1. 24 9月, 2014 6 次提交
  2. 07 6月, 2014 1 次提交
  3. 25 4月, 2014 1 次提交
  4. 23 4月, 2014 3 次提交
  5. 01 4月, 2014 1 次提交
    • E
      AUDIT: Allow login in non-init namespaces · 543bc6a1
      Eric Paris 提交于
      It its possible to configure your PAM stack to refuse login if audit
      messages (about the login) were unable to be sent.  This is common in
      many distros and thus normal configuration of many containers.  The PAM
      modules determine if audit is enabled/disabled in the kernel based on
      the return value from sending an audit message on the netlink socket.
      If userspace gets back ECONNREFUSED it believes audit is disabled in the
      kernel.  If it gets any other error else it refuses to let the login
      proceed.
      
      Just about ever since the introduction of namespaces the kernel audit
      subsystem has returned EPERM if the task sending a message was not in
      the init user or pid namespace.  So many forms of containers have never
      worked if audit was enabled in the kernel.
      
      BUT if the container was not in net_init then the kernel network code
      would send ECONNREFUSED (instead of the audit code sending EPERM).  Thus
      by pure accident/dumb luck/bug if an admin configured the PAM stack to
      reject all logins that didn't talk to audit, but then ran the login
      untility in the non-init_net namespace, it would work!! Clearly this was
      a bug, but it is a bug some people expected.
      
      With the introduction of network namespace support in 3.14-rc1 the two
      bugs stopped cancelling each other out.  Now, containers in the
      non-init_net namespace refused to let users log in (just like PAM was
      configfured!) Obviously some people were not happy that what used to let
      users log in, now didn't!
      
      This fix is kinda hacky.  We return ECONNREFUSED for all non-init
      relevant namespaces.  That means that not only will the old broken
      non-init_net setups continue to work, now the broken non-init_pid or
      non-init_user setups will 'work'.  They don't really work, since audit
      isn't logging things.  But it's what most users want.
      
      In 3.15 we should have patches to support not only the non-init_net
      (3.14) namespace but also the non-init_pid and non-init_user namespace.
      So all will be right in the world.  This just opens the doors wide open
      on 3.14 and hopefully makes users happy, if not the audit system...
      Reported-by: NAndre Tomt <andre@tomt.net>
      Reported-by: NAdam Richter <adam_richter2004@yahoo.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      
      Conflicts:
      	kernel/audit.c
      543bc6a1
  6. 31 3月, 2014 1 次提交
    • E
      AUDIT: Allow login in non-init namespaces · aa4af831
      Eric Paris 提交于
      It its possible to configure your PAM stack to refuse login if audit
      messages (about the login) were unable to be sent.  This is common in
      many distros and thus normal configuration of many containers.  The PAM
      modules determine if audit is enabled/disabled in the kernel based on
      the return value from sending an audit message on the netlink socket.
      If userspace gets back ECONNREFUSED it believes audit is disabled in the
      kernel.  If it gets any other error else it refuses to let the login
      proceed.
      
      Just about ever since the introduction of namespaces the kernel audit
      subsystem has returned EPERM if the task sending a message was not in
      the init user or pid namespace.  So many forms of containers have never
      worked if audit was enabled in the kernel.
      
      BUT if the container was not in net_init then the kernel network code
      would send ECONNREFUSED (instead of the audit code sending EPERM).  Thus
      by pure accident/dumb luck/bug if an admin configured the PAM stack to
      reject all logins that didn't talk to audit, but then ran the login
      untility in the non-init_net namespace, it would work!! Clearly this was
      a bug, but it is a bug some people expected.
      
      With the introduction of network namespace support in 3.14-rc1 the two
      bugs stopped cancelling each other out.  Now, containers in the
      non-init_net namespace refused to let users log in (just like PAM was
      configfured!) Obviously some people were not happy that what used to let
      users log in, now didn't!
      
      This fix is kinda hacky.  We return ECONNREFUSED for all non-init
      relevant namespaces.  That means that not only will the old broken
      non-init_net setups continue to work, now the broken non-init_pid or
      non-init_user setups will 'work'.  They don't really work, since audit
      isn't logging things.  But it's what most users want.
      
      In 3.15 we should have patches to support not only the non-init_net
      (3.14) namespace but also the non-init_pid and non-init_user namespace.
      So all will be right in the world.  This just opens the doors wide open
      on 3.14 and hopefully makes users happy, if not the audit system...
      Reported-by: NAndre Tomt <andre@tomt.net>
      Reported-by: NAdam Richter <adam_richter2004@yahoo.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aa4af831
  7. 25 3月, 2014 1 次提交
  8. 20 3月, 2014 6 次提交
  9. 09 3月, 2014 1 次提交
  10. 01 3月, 2014 1 次提交
  11. 28 2月, 2014 1 次提交
  12. 18 1月, 2014 2 次提交
  13. 15 1月, 2014 3 次提交
    • J
      audit: Convert int limit uses to u32 · 3e1d0bb6
      Joe Perches 提交于
      The equivalent uapi struct uses __u32 so make the kernel
      uses u32 too.
      
      This can prevent some oddities where the limit is
      logged/emitted as a negative value.
      
      Convert kstrtol to kstrtouint to disallow negative values.
      Signed-off-by: NJoe Perches <joe@perches.com>
      [eparis: do not remove static from audit_default declaration]
      3e1d0bb6
    • J
      audit: Use more current logging style · d957f7b7
      Joe Perches 提交于
      Add pr_fmt to prefix "audit: " to output
      Convert printk(KERN_<LEVEL> to pr_<level>
      Coalesce formats
      Use pr_cont
      Move a brace after switch
      Signed-off-by: NJoe Perches <joe@perches.com>
      d957f7b7
    • J
      audit: Use hex_byte_pack_upper · b8dbc324
      Joe Perches 提交于
      Using the generic kernel function causes the
      object size to increase with gcc 4.8.1.
      
      $ size kernel/audit.o*
         text	   data	    bss	    dec	    hex	filename
        18577	   6079	   8436	  33092	   8144	kernel/audit.o.new
        18579	   6015	   8420	  33014	   80f6	kernel/audit.o.old
      
      Unsigned...
      b8dbc324
  14. 14 1月, 2014 12 次提交