Skip to content

Commit 83fa6bb

Browse files
committed
audit: remove CONFIG_AUDIT_LOGINUID_IMMUTABLE
After trying to use this feature in Fedora we found the hard coding policy like this into the kernel was a bad idea. Surprise surprise. We ran into these problems because it was impossible to launch a container as a logged in user and run a login daemon inside that container. This reverts back to the old behavior before this option was added. The option will be re-added in a userspace selectable manor such that userspace can choose when it is and when it is not appropriate. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
1 parent da0a610 commit 83fa6bb

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

‎init/Kconfig‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -301,20 +301,6 @@ config AUDIT_TREE
301301
depends on AUDITSYSCALL
302302
select FSNOTIFY
303303

304-
config AUDIT_LOGINUID_IMMUTABLE
305-
bool "Make audit loginuid immutable"
306-
depends on AUDIT
307-
help
308-
The config option toggles if a task setting its loginuid requires
309-
CAP_SYS_AUDITCONTROL or if that task should require no special permissions
310-
but should instead only allow setting its loginuid if it was never
311-
previously set. On systems which use systemd or a similar central
312-
process to restart login services this should be set to true. On older
313-
systems in which an admin would typically have to directly stop and
314-
start processes this should be set to false. Setting this to true allows
315-
one to drop potentially dangerous capabilites from the login tasks,
316-
but may not be backwards compatible with older init systems.
317-
318304
source "kernel/irq/Kconfig"
319305
source "kernel/time/Kconfig"
320306

‎kernel/auditsc.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,15 +1968,13 @@ static atomic_t session_id = ATOMIC_INIT(0);
19681968

19691969
static int audit_set_loginuid_perm(kuid_t loginuid)
19701970
{
1971-
#ifdef CONFIG_AUDIT_LOGINUID_IMMUTABLE
19721971
/* if we are unset, we don't need privs */
19731972
if (!audit_loginuid_set(current))
19741973
return 0;
1975-
#else /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */
1976-
if (capable(CAP_AUDIT_CONTROL))
1977-
return 0;
1978-
#endif /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */
1979-
return -EPERM;
1974+
/* it is set, you need permission */
1975+
if (!capable(CAP_AUDIT_CONTROL))
1976+
return -EPERM;
1977+
return 0;
19801978
}
19811979

19821980
static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid,

0 commit comments

Comments
 (0)