Skip to content
Snippets Groups Projects
  1. Sep 14, 2022
    • Nathan Lynch's avatar
      lockdown: ratelimit denial messages · 1e7d8bcb
      Nathan Lynch authored
      
      User space can flood the log with lockdown denial messages:
      
      [  662.555584] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      [  662.563237] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      [  662.571134] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      [  662.578668] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      [  662.586021] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      [  662.593398] Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7
      
      Ratelimiting these shouldn't meaningfully degrade the quality of the
      information logged.
      
      Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      1e7d8bcb
  2. May 14, 2020
  3. Dec 09, 2019
    • Stephen Smalley's avatar
      security,lockdown,selinux: implement SELinux lockdown · 59438b46
      Stephen Smalley authored
      
      Implement a SELinux hook for lockdown.  If the lockdown module is also
      enabled, then a denial by the lockdown module will take precedence over
      SELinux, so SELinux can only further restrict lockdown decisions.
      The SELinux hook only distinguishes at the granularity of integrity
      versus confidentiality similar to the lockdown module, but includes the
      full lockdown reason as part of the audit record as a hint in diagnosing
      what triggered the denial.  To support this auditing, move the
      lockdown_reasons[] string array from being private to the lockdown
      module to the security framework so that it can be used by the lsm audit
      code and so that it is always available even when the lockdown module
      is disabled.
      
      Note that the SELinux implementation allows the integrity and
      confidentiality reasons to be controlled independently from one another.
      Thus, in an SELinux policy, one could allow operations that specify
      an integrity reason while blocking operations that specify a
      confidentiality reason. The SELinux hook implementation is
      stricter than the lockdown module in validating the provided reason value.
      
      Sample AVC audit output from denials:
      avc:  denied  { integrity } for pid=3402 comm="fwupd"
       lockdown_reason="/dev/mem,kmem,port" scontext=system_u:system_r:fwupd_t:s0
       tcontext=system_u:system_r:fwupd_t:s0 tclass=lockdown permissive=0
      
      avc:  denied  { confidentiality } for pid=4628 comm="cp"
       lockdown_reason="/proc/kcore access"
       scontext=unconfined_u:unconfined_r:test_lockdown_integrity_t:s0-s0:c0.c1023
       tcontext=unconfined_u:unconfined_r:test_lockdown_integrity_t:s0-s0:c0.c1023
       tclass=lockdown permissive=0
      
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      Reviewed-by: default avatarJames Morris <jamorris@linux.microsoft.com>
      [PM: some merge fuzz do the the perf hooks]
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      59438b46
  4. Oct 31, 2019
  5. Oct 28, 2019
  6. Sep 10, 2019
  7. Aug 20, 2019
Loading