1. 12 12月, 2019 1 次提交
    • D
      bpf: Emit audit messages upon successful prog load and unload · bae141f5
      Daniel Borkmann 提交于
      Allow for audit messages to be emitted upon BPF program load and
      unload for having a timeline of events. The load itself is in
      syscall context, so additional info about the process initiating
      the BPF prog creation can be logged and later directly correlated
      to the unload event.
      
      The only info really needed from BPF side is the globally unique
      prog ID where then audit user space tooling can query / dump all
      info needed about the specific BPF program right upon load event
      and enrich the record, thus these changes needed here can be kept
      small and non-intrusive to the core.
      
      Raw example output:
      
        # auditctl -D
        # auditctl -a always,exit -F arch=x86_64 -S bpf
        # ausearch --start recent -m 1334
        ...
        ----
        time->Wed Nov 27 16:04:13 2019
        type=PROCTITLE msg=audit(1574867053.120:84664): proctitle="./bpf"
        type=SYSCALL msg=audit(1574867053.120:84664): arch=c000003e syscall=321   \
          success=yes exit=3 a0=5 a1=7ffea484fbe0 a2=70 a3=0 items=0 ppid=7477    \
          pid=12698 auid=1001 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001    \
          egid=1001 sgid=1001 fsgid=1001 tty=pts2 ses=4 comm="bpf"                \
          exe="/home/jolsa/auditd/audit-testsuite/tests/bpf/bpf"                  \
          subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
        type=UNKNOWN[1334] msg=audit(1574867053.120:84664): prog-id=76 op=LOAD
        ----
        time->Wed Nov 27 16:04:13 2019
        type=UNKNOWN[1334] msg=audit(1574867053.120:84665): prog-id=76 op=UNLOAD
        ...
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Co-developed-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Link: https://lore.kernel.org/bpf/20191206214934.11319-1-jolsa@kernel.org
      bae141f5
  2. 24 11月, 2019 1 次提交
  3. 21 11月, 2019 1 次提交
    • D
      bpf: Emit audit messages upon successful prog load and unload · 91e6015b
      Daniel Borkmann 提交于
      Allow for audit messages to be emitted upon BPF program load and
      unload for having a timeline of events. The load itself is in
      syscall context, so additional info about the process initiating
      the BPF prog creation can be logged and later directly correlated
      to the unload event.
      
      The only info really needed from BPF side is the globally unique
      prog ID where then audit user space tooling can query / dump all
      info needed about the specific BPF program right upon load event
      and enrich the record, thus these changes needed here can be kept
      small and non-intrusive to the core.
      
      Raw example output:
      
        # auditctl -D
        # auditctl -a always,exit -F arch=x86_64 -S bpf
        # ausearch --start recent -m 1334
        [...]
        ----
        time->Wed Nov 20 12:45:51 2019
        type=PROCTITLE msg=audit(1574271951.590:8974): proctitle="./test_verifier"
        type=SYSCALL msg=audit(1574271951.590:8974): arch=c000003e syscall=321 success=yes exit=14 a0=5 a1=7ffe2d923e80 a2=78 a3=0 items=0 ppid=742 pid=949 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="test_verifier" exe="/root/bpf-next/tools/testing/selftests/bpf/test_verifier" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
        type=UNKNOWN[1334] msg=audit(1574271951.590:8974): auid=0 uid=0 gid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=949 comm="test_verifier" exe="/root/bpf-next/tools/testing/selftests/bpf/test_verifier" prog-id=3260 event=LOAD
        ----
        time->Wed Nov 20 12:45:51 2019
      type=UNKNOWN[1334] msg=audit(1574271951.590:8975): prog-id=3260 event=UNLOAD
        ----
        [...]
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20191120213816.8186-1-jolsa@kernel.org
      91e6015b
  4. 04 10月, 2019 1 次提交
  5. 24 5月, 2019 1 次提交
    • R
      audit: add saddr_fam filter field · bf361231
      Richard Guy Briggs 提交于
      Provide a method to filter out sockaddr and bind calls by network
      address family.
      
      Existing SOCKADDR records are listed for any network activity.
      Implement the AUDIT_SADDR_FAM field selector to be able to classify or
      limit records to specific network address families, such as AF_INET or
      AF_INET6.
      
      An example of a network record that is unlikely to be useful and flood
      the logs:
      
      type=SOCKADDR msg=audit(07/27/2017 12:18:27.019:845) : saddr={ fam=local
      path=/var/run/nscd/socket }
      type=SYSCALL msg=audit(07/27/2017 12:18:27.019:845) : arch=x86_64
      syscall=connect success=no exit=ENOENT(No such file or directory) a0=0x3
      a1=0x7fff229c4980 a2=0x6e a3=0x6 items=1 ppid=3301 pid=6145 auid=sgrubb
      uid=sgrubb gid=sgrubb euid=sgrubb suid=sgrubb fsuid=sgrubb egid=sgrubb
      sgid=sgrubb fsgid=sgrubb tty=pts3 ses=4 comm=bash exe=/usr/bin/bash
      subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
      key=network-test
      
      Please see the audit-testsuite PR at
      https://github.com/linux-audit/audit-testsuite/pull/87
      Please see the github issue
      https://github.com/linux-audit/audit-kernel/issues/64
      Please see the github issue for the accompanying userspace support
      https://github.com/linux-audit/audit-userspace/issues/93Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      [PM: merge fuzz in auditfilter.c]
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      bf361231
  6. 16 4月, 2019 2 次提交
    • O
      ntp: Audit NTP parameters adjustment · 7e8eda73
      Ondrej Mosnacek 提交于
      Emit an audit record every time selected NTP parameters are modified
      from userspace (via adjtimex(2) or clock_adjtime(2)). These parameters
      may be used to indirectly change system clock, and thus their
      modifications should be audited.
      
      Such events will now generate records of type AUDIT_TIME_ADJNTPVAL
      containing the following fields:
        - op -- which value was adjusted:
          - offset -- corresponding to the time_offset variable
          - freq   -- corresponding to the time_freq variable
          - status -- corresponding to the time_status variable
          - adjust -- corresponding to the time_adjust variable
          - tick   -- corresponding to the tick_usec variable
          - tai    -- corresponding to the timekeeping's TAI offset
        - old -- the old value
        - new -- the new value
      
      Example records:
      
      type=TIME_ADJNTPVAL msg=audit(1530616044.507:7): op=status old=64 new=8256
      type=TIME_ADJNTPVAL msg=audit(1530616044.511:11): op=freq old=0 new=49180377088000
      
      The records of this type will be associated with the corresponding
      syscall records.
      
      An overview of parameter changes that can be done via do_adjtimex()
      (based on information from Miroslav Lichvar) and whether they are
      audited:
        __timekeeping_set_tai_offset() -- sets the offset from the
                                          International Atomic Time
                                          (AUDITED)
        NTP variables:
          time_offset -- can adjust the clock by up to 0.5 seconds per call
                         and also speed it up or slow down by up to about
                         0.05% (43 seconds per day) (AUDITED)
          time_freq -- can speed up or slow down by up to about 0.05%
                       (AUDITED)
          time_status -- can insert/delete leap seconds and it also enables/
                         disables synchronization of the hardware real-time
                         clock (AUDITED)
          time_maxerror, time_esterror -- change error estimates used to
                                          inform userspace applications
                                          (NOT AUDITED)
          time_constant -- controls the speed of the clock adjustments that
                           are made when time_offset is set (NOT AUDITED)
          time_adjust -- can temporarily speed up or slow down the clock by up
                         to 0.05% (AUDITED)
          tick_usec -- a more extreme version of time_freq; can speed up or
                       slow down the clock by up to 10% (AUDITED)
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: NRichard Guy Briggs <rgb@redhat.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      7e8eda73
    • O
      timekeeping: Audit clock adjustments · 2d87a067
      Ondrej Mosnacek 提交于
      Emit an audit record whenever the system clock is changed (i.e. shifted
      by a non-zero offset) by a syscall from userspace. The syscalls than can
      (at the time of writing) trigger such record are:
        - settimeofday(2), stime(2), clock_settime(2) -- via
          do_settimeofday64()
        - adjtimex(2), clock_adjtime(2) -- via do_adjtimex()
      
      The new records have type AUDIT_TIME_INJOFFSET and contain the following
      fields:
        - sec -- the 'seconds' part of the offset
        - nsec -- the 'nanoseconds' part of the offset
      
      Example record (time was shifted backwards by ~15.875 seconds):
      
      type=TIME_INJOFFSET msg=audit(1530616049.652:13): sec=-16 nsec=124887145
      
      The records of this type will be associated with the corresponding
      syscall records.
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: NRichard Guy Briggs <rgb@redhat.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      [PM: fixed a line width problem in __audit_tk_injoffset()]
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      2d87a067
  7. 21 3月, 2019 7 次提交
    • D
      unicore32: define syscall_get_arch() · b15fe94a
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      b15fe94a
    • D
      nios2: define syscall_get_arch() · 1660aac4
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Acked-by: NLey Foon Tan <ley.foon.tan@intel.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: nios2-dev@lists.rocketboards.org
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      1660aac4
    • D
      nds32: define syscall_get_arch() · fa562447
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Acked-by: NVincent Chen <vincentc@andestech.com>
      Acked-by: NGreentime Hu <greentime@andestech.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      fa562447
    • D
      hexagon: define syscall_get_arch() · d0931534
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: linux-hexagon@vger.kernel.org
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      d0931534
    • D
      h8300: define syscall_get_arch() · 122a43b1
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      122a43b1
    • D
      c6x: define syscall_get_arch() · a43e6647
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NMark Salter <msalter@redhat.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      a43e6647
    • D
      arc: define syscall_get_arch() · 67f2a8a2
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in addition to already implemented syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions in order to extend the generic
      ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: NVineet Gupta <vgupta@synopsys.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: linux-snps-arc@lists.infradead.org
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      67f2a8a2
  8. 08 1月, 2019 1 次提交
  9. 30 12月, 2018 1 次提交
    • D
      csky: define syscall_get_arch() · d770b256
      Dmitry V. Levin 提交于
      syscall_get_arch() is required to be implemented on all architectures
      in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO
      request.
      
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Paul Moore <paul@paul-moore.com>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: linux-audit@redhat.com
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NGuo Ren <guoren@kernel.org>
      
       arch/csky/include/asm/syscall.h | 7 +++++++
       include/uapi/linux/audit.h      | 1 +
       2 files changed, 8 insertions(+)
      d770b256
  10. 18 12月, 2018 1 次提交
  11. 18 7月, 2018 1 次提交
    • S
      ima: Differentiate auditing policy rules from "audit" actions · dba31ee7
      Stefan Berger 提交于
      The AUDIT_INTEGRITY_RULE is used for auditing IMA policy rules and
      the IMA "audit" policy action.  This patch defines
      AUDIT_INTEGRITY_POLICY_RULE to reflect the IMA policy rules.
      
      Since we defined a new message type we can now also pass the
      audit_context and get an associated SYSCALL record. This now produces
      the following records when parsing IMA policy's rules:
      
      type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \
        func=MMAP_CHECK mask=MAY_EXEC res=1
      type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \
        func=FILE_CHECK mask=MAY_READ res=1
      type=SYSCALL msg=audit(1527888965.738:320): arch=c000003e syscall=1 \
        success=yes exit=17 a0=1 a1=55bcfcca9030 a2=11 a3=7fcc1b55fb38 \
        items=0 ppid=1567 pid=1601 auid=0 uid=0 gid=0 euid=0 suid=0 \
        fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty2 ses=2 comm="echo" \
        exe="/usr/bin/echo" \
        subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      dba31ee7
  12. 19 6月, 2018 1 次提交
  13. 19 5月, 2018 1 次提交
    • M
      EVM: Allow runtime modification of the set of verified xattrs · fa516b66
      Matthew Garrett 提交于
      Sites may wish to provide additional metadata alongside files in order
      to make more fine-grained security decisions[1]. The security of this is
      enhanced if this metadata is protected, something that EVM makes
      possible. However, the kernel cannot know about the set of extended
      attributes that local admins may wish to protect, and hardcoding this
      policy in the kernel makes it difficult to change over time and less
      convenient for distributions to enable.
      
      This patch adds a new /sys/kernel/security/integrity/evm/evm_xattrs node,
      which can be read to obtain the current set of EVM-protected extended
      attributes or written to in order to add new entries. Extending this list
      will not change the validity of any existing signatures provided that the
      file in question does not have any of the additional extended attributes -
      missing xattrs are skipped when calculating the EVM hash.
      
      [1] For instance, a package manager could install information about the
      package uploader in an additional extended attribute. Local LSM policy
      could then be associated with that extended attribute in order to
      restrict the privileges available to packages from less trusted
      uploaders.
      Signed-off-by: NMatthew Garrett <mjg59@google.com>
      Reviewed-by: NJames Morris <james.morris@microsoft.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      fa516b66
  14. 15 5月, 2018 1 次提交
  15. 11 11月, 2017 1 次提交
  16. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX license identifier to uapi header files with a license · e2be04c7
      Greg Kroah-Hartman 提交于
      Many user space API headers have licensing information, which is either
      incomplete, badly formatted or just a shorthand for referring to the
      license under which the file is supposed to be.  This makes it hard for
      compliance tools to determine the correct license.
      
      Update these files with an SPDX license identifier.  The identifier was
      chosen based on the license information in the file.
      
      GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
      identifier with the added 'WITH Linux-syscall-note' exception, which is
      the officially assigned exception identifier for the kernel syscall
      exception:
      
         NOTE! This copyright does *not* cover user programs that use kernel
         services by normal system calls - this is merely considered normal use
         of the kernel, and does *not* fall under the heading of "derived work".
      
      This exception makes it possible to include GPL headers into non GPL
      code, without confusing license compliance tools.
      
      Headers which have either explicit dual licensing or are just licensed
      under a non GPL license are updated with the corresponding SPDX
      identifier and the GPLv2 with syscall exception identifier.  The format
      is:
              ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)
      
      SPDX license identifiers are a legally binding shorthand, which can be
      used instead of the full boiler plate text.  The update does not remove
      existing license information as this has to be done on a case by case
      basis and the copyright holders might have to be consulted. This will
      happen in a separate step.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.  See the previous patch in this series for the
      methodology of how this patch was researched.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2be04c7
  17. 10 10月, 2017 1 次提交
    • S
      audit: Record fanotify access control decisions · de8cd83e
      Steve Grubb 提交于
      The fanotify interface allows user space daemons to make access
      control decisions. Under common criteria requirements, we need to
      optionally record decisions based on policy. This patch adds a bit mask,
      FAN_AUDIT, that a user space daemon can 'or' into the response decision
      which will tell the kernel that it made a decision and record it.
      
      It would be used something like this in user space code:
      
        response.response = FAN_DENY | FAN_AUDIT;
        write(fd, &response, sizeof(struct fanotify_response));
      
      When the syscall ends, the audit system will record the decision as a
      AUDIT_FANOTIFY auxiliary record to denote that the reason this event
      occurred is the result of an access control decision from fanotify
      rather than DAC or MAC policy.
      
      A sample event looks like this:
      
      type=PATH msg=audit(1504310584.332:290): item=0 name="./evil-ls"
      inode=1319561 dev=fc:03 mode=0100755 ouid=1000 ogid=1000 rdev=00:00
      obj=unconfined_u:object_r:user_home_t:s0 nametype=NORMAL
      type=CWD msg=audit(1504310584.332:290): cwd="/home/sgrubb"
      type=SYSCALL msg=audit(1504310584.332:290): arch=c000003e syscall=2
      success=no exit=-1 a0=32cb3fca90 a1=0 a2=43 a3=8 items=1 ppid=901
      pid=959 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000
      fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=pts1 ses=3 comm="bash"
      exe="/usr/bin/bash" subj=unconfined_u:unconfined_r:unconfined_t:
      s0-s0:c0.c1023 key=(null)
      type=FANOTIFY msg=audit(1504310584.332:290): resp=2
      
      Prior to using the audit flag, the developer needs to call
      fanotify_init or'ing in FAN_ENABLE_AUDIT to ensure that the kernel
      supports auditing. The calling process must also have the CAP_AUDIT_WRITE
      capability.
      Signed-off-by: Nsgrubb <sgrubb@redhat.com>
      Reviewed-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      de8cd83e
  18. 14 2月, 2017 1 次提交
  19. 19 1月, 2017 1 次提交
  20. 30 11月, 2016 1 次提交
  21. 30 9月, 2016 1 次提交
  22. 28 6月, 2016 1 次提交
    • H
      netlabel: Initial support for the CALIPSO netlink protocol. · cb72d382
      Huw Davies 提交于
      CALIPSO is a packet labelling protocol for IPv6 which is very similar
      to CIPSO.  It is specified in RFC 5570.  Much of the code is based on
      the current CIPSO code.
      
      This adds support for adding passthrough-type CALIPSO DOIs through the
      NLBL_CALIPSO_C_ADD command.  It requires attributes:
      
       NLBL_CALIPSO_A_TYPE which must be CALIPSO_MAP_PASS.
       NLBL_CALIPSO_A_DOI.
      
      In passthrough mode the CALIPSO engine will map MLS secattr levels
      and categories directly to the packet label.
      
      At this stage, the major difference between this and the CIPSO
      code is that IPv6 may be compiled as a module.  To allow for
      this the CALIPSO functions are registered at module init time.
      Signed-off-by: NHuw Davies <huw@codeweavers.com>
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      cb72d382
  23. 26 1月, 2016 1 次提交
    • R
      audit: stop an old auditd being starved out by a new auditd · 133e1e5a
      Richard Guy Briggs 提交于
      Nothing prevents a new auditd starting up and replacing a valid
      audit_pid when an old auditd is still running, effectively starving out
      the old auditd since audit_pid no longer points to the old valid
      auditd.
      
      If no message to auditd has been attempted since auditd died
      unnaturally or got killed, audit_pid will still indicate it is alive.
      There isn't an easy way to detect if an old auditd is still running on
      the existing audit_pid other than attempting to send a message to see
      if it fails.  An -ECONNREFUSED almost certainly means it disappeared
      and can be replaced.  Other errors are not so straightforward and may
      indicate transient problems that will resolve themselves and the old
      auditd will recover.  Yet others will likely need manual intervention
      for which a new auditd will not solve the problem.
      
      Send a new message type (AUDIT_REPLACE) to the old auditd containing a
      u32 with the PID of the new auditd.  If the audit replace message
      succeeds (or doesn't fail with certainty), fail to register the new
      auditd and return an error (-EEXIST).
      
      This is expected to make the patch preventing an old auditd orphaning a
      new auditd redundant.
      
      V3: Switch audit message type from 1000 to 1300 block.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      133e1e5a
  24. 07 8月, 2015 1 次提交
    • R
      audit: implement audit by executable · 34d99af5
      Richard Guy Briggs 提交于
      This adds the ability audit the actions of a not-yet-running process.
      
      This patch implements the ability to filter on the executable path.  Instead of
      just hard coding the ino and dev of the executable we care about at the moment
      the rule is inserted into the kernel, use the new audit_fsnotify
      infrastructure to manage this dynamically.  This means that if the filename
      does not yet exist but the containing directory does, or if the inode in
      question is unlinked and creat'd (aka updated) the rule will just continue to
      work.  If the containing directory is moved or deleted or the filesystem is
      unmounted, the rule is deleted automatically.  A future enhancement would be to
      have the rule survive across directory disruptions.
      
      This is a heavily modified version of a patch originally submitted by Eric
      Paris with some ideas from Peter Moody.
      
      Cc: Peter Moody <peter@hda3.com>
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      [PM: minor whitespace clean to satisfy ./scripts/checkpatch]
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      34d99af5
  25. 31 7月, 2015 1 次提交
  26. 12 12月, 2014 1 次提交
  27. 18 11月, 2014 1 次提交
    • R
      audit: convert status version to a feature bitmap · 0288d718
      Richard Guy Briggs 提交于
      The version field defined in the audit status structure was found to have
      limitations in terms of its expressibility of features supported.  This is
      distict from the get/set features call to be able to command those features
      that are present.
      
      Converting this field from a version number to a feature bitmap will allow
      distributions to selectively backport and support certain features and will
      allow upstream to be able to deprecate features in the future.  It will allow
      userspace clients to first query the kernel for which features are actually
      present and supported.  Currently, EINVAL is returned rather than EOPNOTSUP,
      which isn't helpful in determining if there was an error in the command, or if
      it simply isn't supported yet.  Past features are not represented by this
      bitmap, but their use may be converted to EOPNOTSUP if needed in the future.
      
      Since "version" is too generic to convert with a #define, use a union in the
      struct status, introducing the member "feature_bitmap" unionized with
      "version".
      
      Convert existing AUDIT_VERSION_* macros over to AUDIT_FEATURE_BITMAP*
      counterparts, leaving the former for backwards compatibility.
      Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
      [PM: minor whitespace tweaks]
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      0288d718
  28. 24 9月, 2014 2 次提交
  29. 10 7月, 2014 1 次提交
  30. 23 5月, 2014 1 次提交
  31. 22 5月, 2014 1 次提交
  32. 14 5月, 2014 1 次提交