1. 24 9月, 2014 4 次提交
    • R
      audit: use union for audit_field values since they are mutually exclusive · 219ca394
      Richard Guy Briggs 提交于
      Since only one of val, uid, gid and lsm* are used at any given time, combine
      them to reduce the size of the struct audit_field.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      219ca394
    • R
      audit: x86: drop arch from __audit_syscall_entry() interface · b4f0d375
      Richard Guy Briggs 提交于
      Since the arch is found locally in __audit_syscall_entry(), there is no need to
      pass it in as a parameter.  Delete it from the parameter list.
      
      x86* was the only arch to call __audit_syscall_entry() directly and did so from
      assembly code.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: x86@kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-audit@redhat.com
      Signed-off-by: NEric Paris <eparis@redhat.com>
      
      ---
      
      As this patch relies on changes in the audit tree, I think it
      appropriate to send it through my tree rather than the x86 tree.
      b4f0d375
    • E
      audit: fix build error when asm/syscall.h does not exist · a9ebe0b9
      Eric Paris 提交于
      avr32 does not have an asm/syscall.h file.  We need the
      syscall_get_arch() definition from that file for all arch's which
      support CONFIG_AUDITSYSCALL.  Obviously avr32 is not one of those
      arch's.  Move the include inside the CONFIG_AUDITSYSCALL such that we
      only do the include if we need the results.
      
      When the syscall_get_arch() call is moved inside __audit_syscall_entry()
      this include can be dropped entirely.  But that is going to require some
      assembly changes on x86* in a patch that is not ready for the tree...
      Reported-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      a9ebe0b9
    • E
      ARCH: AUDIT: audit_syscall_entry() should not require the arch · 91397401
      Eric Paris 提交于
      We have a function where the arch can be queried, syscall_get_arch().
      So rather than have every single piece of arch specific code use and/or
      duplicate syscall_get_arch(), just have the audit code use the
      syscall_get_arch() code.
      Based-on-patch-by: NRichard Briggs <rgb@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-ia64@vger.kernel.org
      Cc: microblaze-uclinux@itee.uq.edu.au
      Cc: linux-mips@linux-mips.org
      Cc: linux@lists.openrisc.net
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: linux-xtensa@linux-xtensa.org
      Cc: x86@kernel.org
      91397401
  2. 11 4月, 2014 1 次提交
    • C
      AUDIT: make audit_is_compat depend on CONFIG_AUDIT_COMPAT_GENERIC · 312103d6
      Chris Metcalf 提交于
      On systems with CONFIG_COMPAT we introduced the new requirement that
      audit_classify_compat_syscall() exists.  This wasn't true for everything
      (apparently not for "tilegx", which I know less that nothing about.)
      
      Instead of wrapping the preprocessor optomization with CONFIG_COMPAT we
      should have used the new CONFIG_AUDIT_COMPAT_GENERIC.  This patch uses
      that config option to make sure only arches which intend to implement
      this have the requirement.
      
      This works fine for tilegx according to Chris Metcalf
      Signed-off-by: NEric Paris <eparis@redhat.com>
      312103d6
  3. 25 3月, 2014 1 次提交
  4. 20 3月, 2014 2 次提交
  5. 01 3月, 2014 1 次提交
  6. 15 1月, 2014 1 次提交
    • 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
  7. 14 1月, 2014 5 次提交
  8. 06 11月, 2013 3 次提交
  9. 10 7月, 2013 1 次提交
    • J
      audit: fix mq_open and mq_unlink to add the MQ root as a hidden parent audit_names record · 79f6530c
      Jeff Layton 提交于
      The old audit PATH records for mq_open looked like this:
      
        type=PATH msg=audit(1366282323.982:869): item=1 name=(null) inode=6777
        dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
        obj=system_u:object_r:tmpfs_t:s15:c0.c1023
        type=PATH msg=audit(1366282323.982:869): item=0 name="test_mq" inode=26732
        dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
        obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023
      
      ...with the audit related changes that went into 3.7, they now look like this:
      
        type=PATH msg=audit(1366282236.776:3606): item=2 name=(null) inode=66655
        dev=00:0c mode=0100700 ouid=0 ogid=0 rdev=00:00
        obj=staff_u:object_r:user_tmpfs_t:s15:c0.c1023
        type=PATH msg=audit(1366282236.776:3606): item=1 name=(null) inode=6926
        dev=00:0c mode=041777 ouid=0 ogid=0 rdev=00:00
        obj=system_u:object_r:tmpfs_t:s15:c0.c1023
        type=PATH msg=audit(1366282236.776:3606): item=0 name="test_mq"
      
      Both of these look wrong to me.  As Steve Grubb pointed out:
      
       "What we need is 1 PATH record that identifies the MQ.  The other PATH
        records probably should not be there."
      
      Fix it to record the mq root as a parent, and flag it such that it
      should be hidden from view when the names are logged, since the root of
      the mq filesystem isn't terribly interesting.  With this change, we get
      a single PATH record that looks more like this:
      
        type=PATH msg=audit(1368021604.836:484): item=0 name="test_mq" inode=16914
        dev=00:0c mode=0100644 ouid=0 ogid=0 rdev=00:00
        obj=unconfined_u:object_r:user_tmpfs_t:s0
      
      In order to do this, a new audit_inode_parent_hidden() function is
      added.  If we do it this way, then we avoid having the existing callers
      of audit_inode needing to do any sort of flag conversion if auditing is
      inactive.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reported-by: NJiri Jaburek <jjaburek@redhat.com>
      Cc: Steve Grubb <sgrubb@redhat.com>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      79f6530c
  10. 08 5月, 2013 1 次提交
  11. 01 5月, 2013 4 次提交
  12. 17 4月, 2013 1 次提交
    • E
      audit: allow checking the type of audit message in the user filter · 62062cf8
      Eric Paris 提交于
      When userspace sends messages to the audit system it includes a type.
      We want to be able to filter messages based on that type without have to
      do the all or nothing option currently available on the
      AUDIT_FILTER_TYPE filter list.  Instead we should be able to use the
      AUDIT_FILTER_USER filter list and just use the message type as one part
      of the matching decision.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      62062cf8
  13. 11 4月, 2013 2 次提交
  14. 12 1月, 2013 2 次提交
  15. 13 10月, 2012 4 次提交
  16. 12 10月, 2012 4 次提交
  17. 06 10月, 2012 1 次提交
  18. 21 9月, 2012 1 次提交
  19. 18 9月, 2012 1 次提交
    • E
      userns: Convert the audit loginuid to be a kuid · e1760bd5
      Eric W. Biederman 提交于
      Always store audit loginuids in type kuid_t.
      
      Print loginuids by converting them into uids in the appropriate user
      namespace, and then printing the resulting uid.
      
      Modify audit_get_loginuid to return a kuid_t.
      
      Modify audit_set_loginuid to take a kuid_t.
      
      Modify /proc/<pid>/loginuid on read to convert the loginuid into the
      user namespace of the opener of the file.
      
      Modify /proc/<pid>/loginud on write to convert the loginuid
      rom the user namespace of the opener of the file.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Paul Moore <paul@paul-moore.com> ?
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      e1760bd5