1. 15 Apr, 2019 2 commits
    • Ondrej Mosnacek's avatar
      ntp: Audit NTP parameters adjustment · 7e8eda73
      Ondrej Mosnacek authored
      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: default avatarOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: default avatarRichard Guy Briggs <rgb@redhat.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      7e8eda73
    • Ondrej Mosnacek's avatar
      timekeeping: Audit clock adjustments · 2d87a067
      Ondrej Mosnacek authored
      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: default avatarOndrej Mosnacek <omosnace@redhat.com>
      Reviewed-by: default avatarRichard Guy Briggs <rgb@redhat.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      [PM: fixed a line width problem in __audit_tk_injoffset()]
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      2d87a067
  2. 08 Apr, 2019 1 commit
  3. 27 Mar, 2019 1 commit
  4. 21 Mar, 2019 15 commits
    • Dmitry V. Levin's avatar
      syscall_get_arch: add "struct task_struct *" argument · 16add411
      Dmitry V. Levin authored
      This argument is required to extend the generic ptrace API with
      PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going
      to be called from ptrace_request() along with syscall_get_nr(),
      syscall_get_arguments(), syscall_get_error(), and
      syscall_get_return_value() functions with a tracee as their argument.
      
      The primary intent is that the triple (audit_arch, syscall_nr, arg1..arg6)
      should describe what system call is being called and what its arguments
      are.
      
      Reverts: 5e937a9a ("syscall_get_arch: remove useless function arguments")
      Reverts: 1002d94d ("syscall.h: fix doc text for syscall_get_arch()")
      Reviewed-by: Andy Lutomirski <luto@kernel.org> # for x86
      Reviewed-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Acked-by: Paul Burton <paul.burton@mips.com> # MIPS parts
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Acked-by: Kees Cook <keescook@chromium.org> # seccomp parts
      Acked-by: Mark Salter <msalter@redhat.com> # for the c6x bit
      Cc: Elvira Khabirova <lineprinter@altlinux.org>
      Cc: Eugene Syromyatnikov <esyr@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: x86@kernel.org
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-snps-arc@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Cc: linux-hexagon@vger.kernel.org
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: linux-mips@vger.kernel.org
      Cc: nios2-dev@lists.rocketboards.org
      Cc: openrisc@lists.librecores.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-riscv@lists.infradead.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Cc: linux-um@lists.infradead.org
      Cc: linux-xtensa@linux-xtensa.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-audit@redhat.com
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      16add411
    • Dmitry V. Levin's avatar
      unicore32: define syscall_get_arch() · b15fe94a
      Dmitry V. Levin authored
      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: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      b15fe94a
    • Dmitry V. Levin's avatar
      Move EM_UNICORE to uapi/linux/elf-em.h · 03f7e6ad
      Dmitry V. Levin authored
      This should never have been defined in the arch tree to begin with,
      and now uapi/linux/audit.h header is going to use EM_UNICORE
      in order to define AUDIT_ARCH_UNICORE which is needed to implement
      syscall_get_arch() which in turn is required to extend
      the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      03f7e6ad
    • Dmitry V. Levin's avatar
      nios2: define syscall_get_arch() · 1660aac4
      Dmitry V. Levin authored
      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: default avatarPaul Moore <paul@paul-moore.com>
      Acked-by: default avatarLey 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      1660aac4
    • Dmitry V. Levin's avatar
      nds32: define syscall_get_arch() · fa562447
      Dmitry V. Levin authored
      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: default avatarPaul Moore <paul@paul-moore.com>
      Acked-by: default avatarVincent Chen <vincentc@andestech.com>
      Acked-by: default avatarGreentime 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      fa562447
    • Dmitry V. Levin's avatar
      Move EM_NDS32 to uapi/linux/elf-em.h · 530ff23a
      Dmitry V. Levin authored
      This should never have been defined in the arch tree to begin with,
      and now uapi/linux/audit.h header is going to use EM_NDS32
      in order to define AUDIT_ARCH_NDS32 which is needed to implement
      syscall_get_arch() which in turn is required to extend
      the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Acked-by: default avatarVincent Chen <vincentc@andestech.com>
      Acked-by: default avatarGreentime 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      530ff23a
    • Dmitry V. Levin's avatar
      m68k: define syscall_get_arch() · 92f922f3
      Dmitry V. Levin authored
      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.
      Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarPaul Moore <paul@paul-moore.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-m68k@lists.linux-m68k.org
      Cc: linux-audit@redhat.com
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      92f922f3
    • Dmitry V. Levin's avatar
      hexagon: define syscall_get_arch() · d0931534
      Dmitry V. Levin authored
      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: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      d0931534
    • Dmitry V. Levin's avatar
      Move EM_HEXAGON to uapi/linux/elf-em.h · f4780e2d
      Dmitry V. Levin authored
      This should never have been defined in the arch tree to begin with,
      and now uapi/linux/audit.h header is going to use EM_HEXAGON
      in order to define AUDIT_ARCH_HEXAGON which is needed to implement
      syscall_get_arch() which in turn is required to extend
      the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: default avatarPaul Moore <paul@paul-moore.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: Richard Kuo <rkuo@codeaurora.org>
      Cc: linux-hexagon@vger.kernel.org
      Cc: linux-audit@redhat.com
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      f4780e2d
    • Dmitry V. Levin's avatar
      h8300: define syscall_get_arch() · 122a43b1
      Dmitry V. Levin authored
      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: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      122a43b1
    • Dmitry V. Levin's avatar
      c6x: define syscall_get_arch() · a43e6647
      Dmitry V. Levin authored
      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: default avatarMark Salter <msalter@redhat.com>
      Acked-by: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      a43e6647
    • Dmitry V. Levin's avatar
      arc: define syscall_get_arch() · 67f2a8a2
      Dmitry V. Levin authored
      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: default avatarVineet Gupta <vgupta@synopsys.com>
      Acked-by: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      67f2a8a2
    • Dmitry V. Levin's avatar
      Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h · 162f33dd
      Dmitry V. Levin authored
      These should never have been defined in the arch tree to begin with, and
      now uapi/linux/audit.h header is going to use EM_ARCOMPACT and EM_ARCV2
      in order to define AUDIT_ARCH_ARCOMPACT and AUDIT_ARCH_ARCV2 which are
      needed to implement syscall_get_arch() which in turn is required to
      extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.
      Acked-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Acked-by: default avatarPaul 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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      162f33dd
    • YueHaibing's avatar
      audit: Make audit_log_cap and audit_copy_inode static · 2efa48fe
      YueHaibing authored
      Fix sparse warning:
      
      kernel/auditsc.c:1150:6: warning: symbol 'audit_log_cap' was not declared. Should it be static?
      kernel/auditsc.c:1908:6: warning: symbol 'audit_copy_inode' was not declared. Should it be static?
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarRichard Guy Briggs <rgb@redhat.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      2efa48fe
    • Richard Guy Briggs's avatar
      audit: connect LOGIN record to its syscall record · 73e65b88
      Richard Guy Briggs authored
      Currently the AUDIT_LOGIN event is a standalone record that isn't
      connected to any other records that may be part of its syscall event. To
      avoid the confusion of generating two events, connect the records by
      using its syscall context.
      
      Please see the github issue
      https://github.com/linux-audit/audit-kernel/issues/110Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      73e65b88
  5. 18 Mar, 2019 1 commit
    • Li RongQing's avatar
      audit: fix a memleak caused by auditing load module · 95e0b46f
      Li RongQing authored
      module.name will be allocated unconditionally when auditing load
      module, and audit_log_start() can fail with other reasons, or
      audit_log_exit maybe not called, caused module.name is not freed
      
      so free module.name in audit_free_context and __audit_syscall_exit
      
      unreferenced object 0xffff88af90837d20 (size 8):
        comm "modprobe", pid 1036, jiffies 4294704867 (age 3069.138s)
        hex dump (first 8 bytes):
          69 78 67 62 65 00 ff ff                          ixgbe...
        backtrace:
          [<0000000008da28fe>] __audit_log_kern_module+0x33/0x80
          [<00000000c1491e61>] load_module+0x64f/0x3850
          [<000000007fc9ae3f>] __do_sys_init_module+0x218/0x250
          [<0000000000d4a478>] do_syscall_64+0x117/0x400
          [<000000004924ded8>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
          [<000000007dc331dd>] 0xffffffffffffffff
      
      Fixes: ca86cad7 ("audit: log module name on init_module")
      Signed-off-by: default avatarZhang Yu <zhangyu31@baidu.com>
      Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
      [PM: manual merge fixup in __audit_syscall_exit()]
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      95e0b46f
  6. 17 Mar, 2019 14 commits
  7. 16 Mar, 2019 6 commits
    • Linus Torvalds's avatar
      Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · a9dce667
      Linus Torvalds authored
      Pull pidfd system call from Christian Brauner:
       "This introduces the ability to use file descriptors from /proc/<pid>/
        as stable handles on struct pid. Even if a pid is recycled the handle
        will not change. For a start these fds can be used to send signals to
        the processes they refer to.
      
        With the ability to use /proc/<pid> fds as stable handles on struct
        pid we can fix a long-standing issue where after a process has exited
        its pid can be reused by another process. If a caller sends a signal
        to a reused pid it will end up signaling the wrong process.
      
        With this patchset we enable a variety of use cases. One obvious
        example is that we can now safely delegate an important part of
        process management - sending signals - to processes other than the
        parent of a given process by sending file descriptors around via scm
        rights and not fearing that the given process will have been recycled
        in the meantime. It also allows for easy testing whether a given
        process is still alive or not by sending signal 0 to a pidfd which is
        quite handy.
      
        There has been some interest in this feature e.g. from systems
        management (systemd, glibc) and container managers. I have requested
        and gotten comments from glibc to make sure that this syscall is
        suitable for their needs as well. In the future I expect it to take on
        most other pid-based signal syscalls. But such features are left for
        the future once they are needed.
      
        This has been sitting in linux-next for quite a while and has not
        caused any issues. It comes with selftests which verify basic
        functionality and also test that a recycled pid cannot be signaled via
        a pidfd.
      
        Jon has written about a prior version of this patchset. It should
        cover the basic functionality since not a lot has changed since then:
      
            https://lwn.net/Articles/773459/
      
        The commit message for the syscall itself is extensively documenting
        the syscall, including it's functionality and extensibility"
      
      * tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        selftests: add tests for pidfd_send_signal()
        signal: add pidfd_send_signal() syscall
      a9dce667
    • Linus Torvalds's avatar
      Merge tag 'devdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · f67e3fb4
      Linus Torvalds authored
      Pull device-dax updates from Dan Williams:
       "New device-dax infrastructure to allow persistent memory and other
        "reserved" / performance differentiated memories, to be assigned to
        the core-mm as "System RAM".
      
        Some users want to use persistent memory as additional volatile
        memory. They are willing to cope with potential performance
        differences, for example between DRAM and 3D Xpoint, and want to use
        typical Linux memory management apis rather than a userspace memory
        allocator layered over an mmap() of a dax file. The administration
        model is to decide how much Persistent Memory (pmem) to use as System
        RAM, create a device-dax-mode namespace of that size, and then assign
        it to the core-mm. The rationale for device-dax is that it is a
        generic memory-mapping driver that can be layered over any "special
        purpose" memory, not just pmem. On subsequent boots udev rules can be
        used to restore the memory assignment.
      
        One implication of using pmem as RAM is that mlock() no longer keeps
        data off persistent media. For this reason it is recommended to enable
        NVDIMM Security (previously merged for 5.0) to encrypt pmem contents
        at rest. We considered making this recommendation an actively enforced
        requirement, but in the end decided to leave it as a distribution /
        administrator policy to allow for emulation and test environments that
        lack security capable NVDIMMs.
      
        Summary:
      
         - Replace the /sys/class/dax device model with /sys/bus/dax, and
           include a compat driver so distributions can opt-in to the new ABI.
      
         - Allow for an alternative driver for the device-dax address-range
      
         - Introduce the 'kmem' driver to hotplug / assign a device-dax
           address-range to the core-mm.
      
         - Arrange for the device-dax target-node to be onlined so that the
           newly added memory range can be uniquely referenced by numa apis"
      
      NOTE! I'm not entirely happy with the whole "PMEM as RAM" model because
      we currently have special - and very annoying rules in the kernel about
      accessing PMEM only with the "MC safe" accessors, because machine checks
      inside the regular repeat string copy functions can be fatal in some
      (not described) circumstances.
      
      And apparently the PMEM modules can cause that a lot more than regular
      RAM.  The argument is that this happens because PMEM doesn't necessarily
      get scrubbed at boot like RAM does, but that is planned to be added for
      the user space tooling.
      
      Quoting Dan from another email:
       "The exposure can be reduced in the volatile-RAM case by scanning for
        and clearing errors before it is onlined as RAM. The userspace tooling
        for that can be in place before v5.1-final. There's also runtime
        notifications of errors via acpi_nfit_uc_error_notify() from
        background scrubbers on the DIMM devices. With that mechanism the
        kernel could proactively clear newly discovered poison in the volatile
        case, but that would be additional development more suitable for v5.2.
      
        I understand the concern, and the need to highlight this issue by
        tapping the brakes on feature development, but I don't see PMEM as RAM
        making the situation worse when the exposure is also there via DAX in
        the PMEM case. Volatile-RAM is arguably a safer use case since it's
        possible to repair pages where the persistent case needs active
        application coordination"
      
      * tag 'devdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: "Hotplug" persistent memory for use like normal RAM
        mm/resource: Let walk_system_ram_range() search child resources
        mm/memory-hotplug: Allow memory resources to be children
        mm/resource: Move HMM pr_debug() deeper into resource code
        mm/resource: Return real error codes from walk failures
        device-dax: Add a 'modalias' attribute to DAX 'bus' devices
        device-dax: Add a 'target_node' attribute
        device-dax: Auto-bind device after successful new_id
        acpi/nfit, device-dax: Identify differentiated memory with a unique numa-node
        device-dax: Add /sys/class/dax backwards compatibility
        device-dax: Add support for a dax override driver
        device-dax: Move resource pinning+mapping into the common driver
        device-dax: Introduce bus + driver model
        device-dax: Start defining a dax bus model
        device-dax: Remove multi-resource infrastructure
        device-dax: Kill dax_region base
        device-dax: Kill dax_region ida
      f67e3fb4
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 477558d7
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This is the final round of mostly small fixes and performance
        improvements to our initial submit.
      
        The main regression fix is the ia64 simscsi build failure which was
        missed in the serial number elimination conversion"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
        scsi: ia64: simscsi: use request tag instead of serial_number
        scsi: aacraid: Fix performance issue on logical drives
        scsi: lpfc: Fix error codes in lpfc_sli4_pci_mem_setup()
        scsi: libiscsi: Hold back_lock when calling iscsi_complete_task
        scsi: hisi_sas: Change SERDES_CFG init value to increase reliability of HiLink
        scsi: hisi_sas: Send HARD RESET to clear the previous affiliation of STP target port
        scsi: hisi_sas: Set PHY linkrate when disconnected
        scsi: hisi_sas: print PHY RX errors count for later revision of v3 hw
        scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO
        scsi: hisi_sas: Change return variable type in phy_up_v3_hw()
        scsi: qla2xxx: check for kstrtol() failure
        scsi: lpfc: fix 32-bit format string warning
        scsi: lpfc: fix unused variable warning
        scsi: target: tcmu: Switch to bitmap_zalloc()
        scsi: libiscsi: fall back to sendmsg for slab pages
        scsi: qla2xxx: avoid printf format warning
        scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset
        scsi: lpfc: Correct __lpfc_sli_issue_iocb_s4 lockdep check
        scsi: ufs: hisi: fix ufs_hba_variant_ops passing
        scsi: qla2xxx: Fix panic in qla_dfs_tgt_counters_show
        ...
      477558d7
    • Linus Torvalds's avatar
      Merge tag 'for-5.1/block-post-20190315' of git://git.kernel.dk/linux-block · 11efae35
      Linus Torvalds authored
      Pull more block layer changes from Jens Axboe:
       "This is a collection of both stragglers, and fixes that came in after
        I finalized the initial pull. This contains:
      
         - An MD pull request from Song, with a few minor fixes
      
         - Set of NVMe patches via Christoph
      
         - Pull request from Konrad, with a few fixes for xen/blkback
      
         - pblk fix IO calculation fix (Javier)
      
         - Segment calculation fix for pass-through (Ming)
      
         - Fallthrough annotation for blkcg (Mathieu)"
      
      * tag 'for-5.1/block-post-20190315' of git://git.kernel.dk/linux-block: (25 commits)
        blkcg: annotate implicit fall through
        nvme-tcp: support C2HData with SUCCESS flag
        nvmet: ignore EOPNOTSUPP for discard
        nvme: add proper write zeroes setup for the multipath device
        nvme: add proper discard setup for the multipath device
        nvme: remove nvme_ns_config_oncs
        nvme: disable Write Zeroes for qemu controllers
        nvmet-fc: bring Disconnect into compliance with FC-NVME spec
        nvmet-fc: fix issues with targetport assoc_list list walking
        nvme-fc: reject reconnect if io queue count is reduced to zero
        nvme-fc: fix numa_node when dev is null
        nvme-fc: use nr_phys_segments to determine existence of sgl
        nvme-loop: init nvmet_ctrl fatal_err_work when allocate
        nvme: update comment to make the code easier to read
        nvme: put ns_head ref if namespace fails allocation
        nvme-trace: fix cdw10 buffer overrun
        nvme: don't warn on block content change effects
        nvme: add get-feature to admin cmds tracer
        md: Fix failed allocation of md_register_thread
        It's wrong to add len to sector_nr in raid10 reshape twice
        ...
      11efae35
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 465c209d
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
        Bugfixes:
         - Fix an Oops in SUNRPC back channel tracepoints
         - Fix a SUNRPC client regression when handling oversized replies
         - Fix the minimal size for SUNRPC reply buffer allocation
         - rpc_decode_header() must always return a non-zero value on error
         - Fix a typo in pnfs_update_layout()
      
        Cleanup:
         - Remove redundant check for the reply length in call_decode()"
      
      * tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        SUNRPC: Remove redundant check for the reply length in call_decode()
        SUNRPC: Handle the SYSTEM_ERR rpc error
        SUNRPC: rpc_decode_header() must always return a non-zero value on error
        SUNRPC: Use the ENOTCONN error on socket disconnect
        SUNRPC: Fix the minimal size for reply buffer allocation
        SUNRPC: Fix a client regression when handling oversized replies
        pNFS: Fix a typo in pnfs_update_layout
        fix null pointer deref in tracepoints in back channel
      465c209d
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a9c55d58
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "One fix to prevent runtime allocation of 16GB pages when running in a
        VM (as opposed to bare metal), because it doesn't work.
      
        A small fix to our recently added KCOV support to exempt some more
        code from being instrumented.
      
        Plus a few minor build fixes, a small dead code removal and a
        defconfig update.
      
        Thanks to: Alexey Kardashevskiy, Aneesh Kumar K.V, Christophe Leroy,
        Jason Yan, Joel Stanley, Mahesh Salgaonkar, Mathieu Malaterre"
      
      * tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: Include <asm/nmi.h> header file to fix a warning
        powerpc/powernv: Fix compile without CONFIG_TRACEPOINTS
        powerpc/mm: Disable kcov for SLB routines
        powerpc: remove dead code in head_fsl_booke.S
        powerpc/configs: Sync skiroot defconfig
        powerpc/hugetlb: Don't do runtime allocation of 16G pages in LPAR configuration
      a9c55d58