-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v6.5-rc1-modules-next' of git://git.kernel.org/pub/scm/lin…
…ux/kernel/git/mcgrof/linux Pull module updates from Luis Chamberlain: "The changes queued up for modules are pretty tame, mostly code removal of moving of code. Only two minor functional changes are made, the only one which stands out is Sebastian Andrzej Siewior's simplification of module reference counting by removing preempt_disable() and that has been tested on linux-next for well over a month without no regressions. I'm now, I guess, also a kitchen sink for some kallsyms changes" [ There was a mis-communication about the concurrent module load changes that I had expected to come through Luis despite me authoring the patch. So some of the module updates were left hanging in the email ether, and I just committed them separately. It's my bad - I should have made it more clear that I expected my own patches to come through the module tree too. Now they missed linux-next, but hopefully that won't cause any issues - Linus ] * tag 'v6.5-rc1-modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: kallsyms: make kallsyms_show_value() as generic function kallsyms: move kallsyms_show_value() out of kallsyms.c kallsyms: remove unsed API lookup_symbol_attrs kallsyms: remove unused arch_get_kallsym() helper module: Remove preempt_disable() from module reference counting.
- Loading branch information
Showing
8 changed files
with
49 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* ksyms_common.c: A split of kernel/kallsyms.c | ||
* Contains a few generic function definations independent of config KALLSYMS. | ||
*/ | ||
#include <linux/kallsyms.h> | ||
#include <linux/security.h> | ||
|
||
static inline int kallsyms_for_perf(void) | ||
{ | ||
#ifdef CONFIG_PERF_EVENTS | ||
extern int sysctl_perf_event_paranoid; | ||
|
||
if (sysctl_perf_event_paranoid <= 1) | ||
return 1; | ||
#endif | ||
return 0; | ||
} | ||
|
||
/* | ||
* We show kallsyms information even to normal users if we've enabled | ||
* kernel profiling and are explicitly not paranoid (so kptr_restrict | ||
* is clear, and sysctl_perf_event_paranoid isn't set). | ||
* | ||
* Otherwise, require CAP_SYSLOG (assuming kptr_restrict isn't set to | ||
* block even that). | ||
*/ | ||
bool kallsyms_show_value(const struct cred *cred) | ||
{ | ||
switch (kptr_restrict) { | ||
case 0: | ||
if (kallsyms_for_perf()) | ||
return true; | ||
fallthrough; | ||
case 1: | ||
if (security_capable(cred, &init_user_ns, CAP_SYSLOG, | ||
CAP_OPT_NOAUDIT) == 0) | ||
return true; | ||
fallthrough; | ||
default: | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters