1. 01 5月, 2013 1 次提交
  2. 12 1月, 2013 2 次提交
  3. 13 10月, 2012 4 次提交
  4. 12 10月, 2012 4 次提交
  5. 06 10月, 2012 1 次提交
  6. 21 9月, 2012 1 次提交
  7. 18 9月, 2012 4 次提交
    • 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
    • E
      audit: Add typespecific uid and gid comparators · ca57ec0f
      Eric W. Biederman 提交于
      The audit filter code guarantees that uid are always compared with
      uids and gids are always compared with gids, as the comparason
      operations are type specific.  Take advantage of this proper to define
      audit_uid_comparator and audit_gid_comparator which use the type safe
      comparasons from uidgid.h.
      
      Build on audit_uid_comparator and audit_gid_comparator and replace
      audit_compare_id with audit_compare_uid and audit_compare_gid.  This
      is one of those odd cases where being type safe and duplicating code
      leads to simpler shorter and more concise code.
      
      Don't allow bitmask operations in uid and gid comparisons in
      audit_data_to_entry.  Bitmask operations are already denined in
      audit_rule_to_entry.
      
      Convert constants in audit_rule_to_entry and audit_data_to_entry into
      kuids and kgids when appropriate.
      
      Convert the uid and gid field in struct audit_names to be of type
      kuid_t and kgid_t respectively, so that the new uid and gid comparators
      can be applied in a type safe manner.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ca57ec0f
    • E
      audit: Remove the unused uid parameter from audit_receive_filter · 017143fe
      Eric W. Biederman 提交于
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      017143fe
    • E
      audit: Use current instead of NETLINK_CREDS() in audit_filter · 02276bda
      Eric W. Biederman 提交于
      Get caller process uid and gid and pid values from the current task
      instead of the NETLINK_CB.  This is simpler than passing NETLINK_CREDS
      from from audit_receive_msg to audit_filter_user_rules and avoid the
      chance of being hit by the occassional bugs in netlink uid/gid
      credential passing.  This is a safe changes because all netlink
      requests are processed in the task of the sending process.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      02276bda
  8. 12 9月, 2012 1 次提交
  9. 30 7月, 2012 1 次提交
  10. 14 4月, 2012 1 次提交
  11. 21 3月, 2012 1 次提交
  12. 18 1月, 2012 14 次提交
    • P
      audit: comparison on interprocess fields · 10d68360
      Peter Moody 提交于
      This allows audit to specify rules in which we compare two fields of a
      process.  Such as is the running process uid != to the running process
      euid?
      Signed-off-by: NPeter Moody <pmoody@google.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      10d68360
    • P
      audit: implement all object interfield comparisons · 4a6633ed
      Peter Moody 提交于
      This completes the matrix of interfield comparisons between uid/gid
      information for the current task and the uid/gid information for inodes.
      aka I can audit based on differences between the euid of the process and
      the uid of fs objects.
      Signed-off-by: NPeter Moody <pmoody@google.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      4a6633ed
    • E
      audit: allow interfield comparison between gid and ogid · c9fe685f
      Eric Paris 提交于
      Allow audit rules to compare the gid of the running task to the gid of the
      inode in question.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      c9fe685f
    • E
      audit: allow interfield comparison in audit rules · 02d86a56
      Eric Paris 提交于
      We wish to be able to audit when a uid=500 task accesses a file which is
      uid=0.  Or vice versa.  This patch introduces a new audit filter type
      AUDIT_FIELD_COMPARE which takes as an 'enum' which indicates which fields
      should be compared.  At this point we only define the task->uid vs
      inode->uid, but other comparisons can be added.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      02d86a56
    • E
      audit: remove task argument to audit_set_loginuid · 0a300be6
      Eric Paris 提交于
      The function always deals with current.  Don't expose an option
      pretending one can use it for something.  You can't.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      0a300be6
    • E
      audit: allow audit matching on inode gid · 54d3218b
      Eric Paris 提交于
      Much like the ability to filter audit on the uid of an inode collected, we
      should be able to filter on the gid of the inode.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      54d3218b
    • E
      audit: allow matching on obj_uid · efaffd6e
      Eric Paris 提交于
      Allow syscall exit filter matching based on the uid of the owner of an
      inode used in a syscall.  aka:
      
      auditctl -a always,exit -S open -F obj_uid=0 -F perm=wa
      Signed-off-by: NEric Paris <eparis@redhat.com>
      efaffd6e
    • E
      audit: remove audit_finish_fork as it can't be called · 6422e78d
      Eric Paris 提交于
      Audit entry,always rules are not allowed and are automatically changed in
      exit,always rules in userspace.  The kernel refuses to load such rules.
      
      Thus a task in the middle of a syscall (and thus in audit_finish_fork())
      can only be in one of two states: AUDIT_BUILD_CONTEXT or AUDIT_DISABLED.
      Since the current task cannot be in AUDIT_RECORD_CONTEXT we aren't every
      going to actually use the code in audit_finish_fork() since it will
      return without doing anything.  Thus drop the code.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      6422e78d
    • E
      audit: inline audit_free to simplify the look of generic code · a4ff8dba
      Eric Paris 提交于
      make the conditional a static inline instead of doing it in generic code.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      a4ff8dba
    • E
      audit: drop audit_set_macxattr as it doesn't do anything · 38cdce53
      Eric Paris 提交于
      unused.  deleted.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      38cdce53
    • E
      audit: inline checks for not needing to collect aux records · 07c49417
      Eric Paris 提交于
      A number of audit hooks make function calls before they determine that
      auxilary records do not need to be collected.  Do those checks as static
      inlines since the most common case is going to be that records are not
      needed and we can skip the function call overhead.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      07c49417
    • E
      audit: inline audit_syscall_entry to reduce burden on archs · b05d8447
      Eric Paris 提交于
      Every arch calls:
      
      if (unlikely(current->audit_context))
      	audit_syscall_entry()
      
      which requires knowledge about audit (the existance of audit_context) in
      the arch code.  Just do it all in static inline in audit.h so that arch's
      can remain blissfully ignorant.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      b05d8447
    • E
      Audit: push audit success and retcode into arch ptrace.h · d7e7528b
      Eric Paris 提交于
      The audit system previously expected arches calling to audit_syscall_exit to
      supply as arguments if the syscall was a success and what the return code was.
      Audit also provides a helper AUDITSC_RESULT which was supposed to simplify things
      by converting from negative retcodes to an audit internal magic value stating
      success or failure.  This helper was wrong and could indicate that a valid
      pointer returned to userspace was a failed syscall.  The fix is to fix the
      layering foolishness.  We now pass audit_syscall_exit a struct pt_reg and it
      in turns calls back into arch code to collect the return value and to
      determine if the syscall was a success or failure.  We also define a generic
      is_syscall_success() macro which determines success/failure based on if the
      value is < -MAX_ERRNO.  This works for arches like x86 which do not use a
      separate mechanism to indicate syscall failure.
      
      We make both the is_syscall_success() and regs_return_value() static inlines
      instead of macros.  The reason is because the audit function must take a void*
      for the regs.  (uml calls theirs struct uml_pt_regs instead of just struct
      pt_regs so audit_syscall_exit can't take a struct pt_regs).  Since the audit
      function takes a void* we need to use static inlines to cast it back to the
      arch correct structure to dereference it.
      
      The other major change is that on some arches, like ia64, MIPS and ppc, we
      change regs_return_value() to give us the negative value on syscall failure.
      THE only other user of this macro, kretprobe_example.c, won't notice and it
      makes the value signed consistently for the audit functions across all archs.
      
      In arch/sh/kernel/ptrace_64.c I see that we were using regs[9] in the old
      audit code as the return value.  But the ptrace_64.h code defined the macro
      regs_return_value() as regs[3].  I have no idea which one is correct, but this
      patch now uses the regs_return_value() function, so it now uses regs[3].
      
      For powerpc we previously used regs->result but now use the
      regs_return_value() function which uses regs->gprs[3].  regs->gprs[3] is
      always positive so the regs_return_value(), much like ia64 makes it negative
      before calling the audit code when appropriate.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: H. Peter Anvin <hpa@zytor.com> [for x86 portion]
      Acked-by: Tony Luck <tony.luck@intel.com> [for ia64]
      Acked-by: Richard Weinberger <richard@nod.at> [for uml]
      Acked-by: David S. Miller <davem@davemloft.net> [for sparc]
      Acked-by: Ralf Baechle <ralf@linux-mips.org> [for mips]
      Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [for ppc]
      d7e7528b
    • E
      seccomp: audit abnormal end to a process due to seccomp · 85e7bac3
      Eric Paris 提交于
      The audit system likes to collect information about processes that end
      abnormally (SIGSEGV) as this may me useful intrusion detection information.
      This patch adds audit support to collect information when seccomp forces a
      task to exit because of misbehavior in a similar way.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      85e7bac3
  13. 04 1月, 2012 2 次提交
  14. 01 11月, 2011 1 次提交
  15. 30 6月, 2011 1 次提交
    • M
      netfilter: add SELinux context support to AUDIT target · 131ad62d
      Mr Dash Four 提交于
      In this revision the conversion of secid to SELinux context and adding it
      to the audit log is moved from xt_AUDIT.c to audit.c with the aid of a
      separate helper function - audit_log_secctx - which does both the conversion
      and logging of SELinux context, thus also preventing internal secid number
      being leaked to userspace. If conversion is not successful an error is raised.
      
      With the introduction of this helper function the work done in xt_AUDIT.c is
      much more simplified. It also opens the possibility of this helper function
      being used by other modules (including auditd itself), if desired. With this
      addition, typical (raw auditd) output after applying the patch would be:
      
      type=NETFILTER_PKT msg=audit(1305852240.082:31012): action=0 hook=1 len=52 inif=? outif=eth0 saddr=10.1.1.7 daddr=10.1.2.1 ipid=16312 proto=6 sport=56150 dport=22 obj=system_u:object_r:ssh_client_packet_t:s0
      type=NETFILTER_PKT msg=audit(1306772064.079:56): action=0 hook=3 len=48 inif=eth0 outif=? smac=00:05:5d:7c:27:0b dmac=00:02:b3:0a:7f:81 macproto=0x0800 saddr=10.1.2.1 daddr=10.1.1.7 ipid=462 proto=6 sport=22 dport=3561 obj=system_u:object_r:ssh_server_packet_t:s0
      Acked-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NMr Dash Four <mr.dash.four@googlemail.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      131ad62d
  16. 17 1月, 2011 1 次提交