Skip to content

Commit 0545702

Browse files
committed
Merge tag 'lsm-pr-20250323' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
Pull lsm updates from Paul Moore: - Various minor updates to the LSM Rust bindings Changes include marking trivial Rust bindings as inlines and comment tweaks to better reflect the LSM hooks. - Add LSM/SELinux access controls to io_uring_allowed() Similar to the io_uring_disabled sysctl, add a LSM hook to io_uring_allowed() to enable LSMs a simple way to enforce security policy on the use of io_uring. This pull request includes SELinux support for this new control using the io_uring/allowed permission. - Remove an unused parameter from the security_perf_event_open() hook The perf_event_attr struct parameter was not used by any currently supported LSMs, remove it from the hook. - Add an explicit MAINTAINERS entry for the credentials code We've seen problems in the past where patches to the credentials code sent by non-maintainers would often languish on the lists for multiple months as there was no one explicitly tasked with the responsibility of reviewing and/or merging credentials related code. Considering that most of the code under security/ has a vested interest in ensuring that the credentials code is well maintained, I'm volunteering to look after the credentials code and Serge Hallyn has also volunteered to step up as an official reviewer. I posted the MAINTAINERS update as a RFC to LKML in hopes that someone else would jump up with an "I'll do it!", but beyond Serge it was all crickets. - Update Stephen Smalley's old email address to prevent confusion This includes a corresponding update to the mailmap file. * tag 'lsm-pr-20250323' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: mailmap: map Stephen Smalley's old email addresses lsm: remove old email address for Stephen Smalley MAINTAINERS: add Serge Hallyn as a credentials reviewer MAINTAINERS: add an explicit credentials entry cred,rust: mark Credential methods inline lsm,rust: reword "destroy" -> "release" in SecurityCtx lsm,rust: mark SecurityCtx methods inline perf: Remove unnecessary parameter of security check lsm: fix a missing security_uring_allowed() prototype io_uring,lsm,selinux: add LSM hooks for io_uring_setup() io_uring: refactor io_uring_allowed()
2 parents b3c623b + 65b796a commit 0545702

File tree

20 files changed

+100
-42
lines changed

20 files changed

+100
-42
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,8 @@ Stephen Hemminger <[email protected]> <[email protected]>
685685
686686
687687
688+
689+
688690
689691
690692
Subash Abhinov Kasiviswanathan <[email protected]> <[email protected]>

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6154,6 +6154,16 @@ L: [email protected]
61546154
S: Maintained
61556155
F: drivers/hid/hid-creative-sb0540.c
61566156

6157+
CREDENTIALS
6158+
M: Paul Moore <[email protected]>
6159+
R: Serge Hallyn <[email protected]>
6160+
6161+
S: Supported
6162+
T: git https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git
6163+
F: include/linux/cred.h
6164+
F: kernel/cred.c
6165+
F: Documentation/security/credentials.rst
6166+
61576167
INTEL CRPS COMMON REDUNDANT PSU DRIVER
61586168
M: Ninad Palsule <[email protected]>
61596169

arch/x86/events/amd/ibs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
13431343
* unprivileged users.
13441344
*/
13451345
if ((event->attr.sample_type & PERF_SAMPLE_RAW) &&
1346-
perf_allow_kernel(&event->attr)) {
1346+
perf_allow_kernel()) {
13471347
perf_ibs_phyaddr_clear(perf_ibs, &ibs_data);
13481348
}
13491349

arch/x86/events/intel/bts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static int bts_event_init(struct perf_event *event)
574574
* to the user in a zero-copy fashion.
575575
*/
576576
if (event->attr.exclude_kernel) {
577-
ret = perf_allow_kernel(&event->attr);
577+
ret = perf_allow_kernel();
578578
if (ret)
579579
return ret;
580580
}

arch/x86/events/intel/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4297,7 +4297,7 @@ static int intel_pmu_hw_config(struct perf_event *event)
42974297
if (x86_pmu.version < 3)
42984298
return -EINVAL;
42994299

4300-
ret = perf_allow_cpu(&event->attr);
4300+
ret = perf_allow_cpu();
43014301
if (ret)
43024302
return ret;
43034303

arch/x86/events/intel/p4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ static int p4_validate_raw_event(struct perf_event *event)
777777
* the user needs special permissions to be able to use it
778778
*/
779779
if (p4_ht_active() && p4_event_bind_map[v].shared) {
780-
v = perf_allow_cpu(&event->attr);
780+
v = perf_allow_cpu();
781781
if (v)
782782
return v;
783783
}

drivers/perf/arm_spe_pmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static_assert((PERF_EVENT_FLAG_ARCH & SPE_PMU_HW_FLAGS_CX) == SPE_PMU_HW_FLAGS_C
5050

5151
static void set_spe_event_has_cx(struct perf_event *event)
5252
{
53-
if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && !perf_allow_kernel(&event->attr))
53+
if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && !perf_allow_kernel())
5454
event->hw.flags |= SPE_PMU_HW_FLAGS_CX;
5555
}
5656

@@ -765,7 +765,7 @@ static int arm_spe_pmu_event_init(struct perf_event *event)
765765
set_spe_event_has_cx(event);
766766
reg = arm_spe_event_to_pmscr(event);
767767
if (reg & (PMSCR_EL1_PA | PMSCR_EL1_PCT))
768-
return perf_allow_kernel(&event->attr);
768+
return perf_allow_kernel();
769769

770770
return 0;
771771
}

include/linux/lsm_audit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Author : Etienne BASSET <[email protected]>
77
*
8-
* All credits to : Stephen Smalley, <[email protected]>
8+
* All credits to : Stephen Smalley
99
* All BUGS to : Etienne BASSET <[email protected]>
1010
*/
1111
#ifndef _LSM_COMMON_LOGGING_

include/linux/lsm_hook_defs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ LSM_HOOK(int, 0, bpf_token_capable, const struct bpf_token *token, int cap)
445445
LSM_HOOK(int, 0, locked_down, enum lockdown_reason what)
446446

447447
#ifdef CONFIG_PERF_EVENTS
448-
LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int type)
448+
LSM_HOOK(int, 0, perf_event_open, int type)
449449
LSM_HOOK(int, 0, perf_event_alloc, struct perf_event *event)
450450
LSM_HOOK(int, 0, perf_event_read, struct perf_event *event)
451451
LSM_HOOK(int, 0, perf_event_write, struct perf_event *event)
@@ -455,6 +455,7 @@ LSM_HOOK(int, 0, perf_event_write, struct perf_event *event)
455455
LSM_HOOK(int, 0, uring_override_creds, const struct cred *new)
456456
LSM_HOOK(int, 0, uring_sqpoll, void)
457457
LSM_HOOK(int, 0, uring_cmd, struct io_uring_cmd *ioucmd)
458+
LSM_HOOK(int, 0, uring_allowed, void)
458459
#endif /* CONFIG_IO_URING */
459460

460461
LSM_HOOK(void, LSM_RET_VOID, initramfs_populated, void)

include/linux/perf_event.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,22 +1698,22 @@ static inline int perf_is_paranoid(void)
16981698
return sysctl_perf_event_paranoid > -1;
16991699
}
17001700

1701-
int perf_allow_kernel(struct perf_event_attr *attr);
1701+
int perf_allow_kernel(void);
17021702

1703-
static inline int perf_allow_cpu(struct perf_event_attr *attr)
1703+
static inline int perf_allow_cpu(void)
17041704
{
17051705
if (sysctl_perf_event_paranoid > 0 && !perfmon_capable())
17061706
return -EACCES;
17071707

1708-
return security_perf_event_open(attr, PERF_SECURITY_CPU);
1708+
return security_perf_event_open(PERF_SECURITY_CPU);
17091709
}
17101710

1711-
static inline int perf_allow_tracepoint(struct perf_event_attr *attr)
1711+
static inline int perf_allow_tracepoint(void)
17121712
{
17131713
if (sysctl_perf_event_paranoid > -1 && !perfmon_capable())
17141714
return -EPERM;
17151715

1716-
return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);
1716+
return security_perf_event_open(PERF_SECURITY_TRACEPOINT);
17171717
}
17181718

17191719
extern int perf_exclude_event(struct perf_event *event, struct pt_regs *regs);

0 commit comments

Comments
 (0)