1. 27 4月, 2022 2 次提交
  2. 22 4月, 2022 1 次提交
    • M
      signal: Deliver SIGTRAP on perf event asynchronously if blocked · 78ed93d7
      Marco Elver 提交于
      With SIGTRAP on perf events, we have encountered termination of
      processes due to user space attempting to block delivery of SIGTRAP.
      Consider this case:
      
          <set up SIGTRAP on a perf event>
          ...
          sigset_t s;
          sigemptyset(&s);
          sigaddset(&s, SIGTRAP | <and others>);
          sigprocmask(SIG_BLOCK, &s, ...);
          ...
          <perf event triggers>
      
      When the perf event triggers, while SIGTRAP is blocked, force_sig_perf()
      will force the signal, but revert back to the default handler, thus
      terminating the task.
      
      This makes sense for error conditions, but not so much for explicitly
      requested monitoring. However, the expectation is still that signals
      generated by perf events are synchronous, which will no longer be the
      case if the signal is blocked and delivered later.
      
      To give user space the ability to clearly distinguish synchronous from
      asynchronous signals, introduce siginfo_t::si_perf_flags and
      TRAP_PERF_FLAG_ASYNC (opted for flags in case more binary information is
      required in future).
      
      The resolution to the problem is then to (a) no longer force the signal
      (avoiding the terminations), but (b) tell user space via si_perf_flags
      if the signal was synchronous or not, so that such signals can be
      handled differently (e.g. let user space decide to ignore or consider
      the data imprecise).
      
      The alternative of making the kernel ignore SIGTRAP on perf events if
      the signal is blocked may work for some usecases, but likely causes
      issues in others that then have to revert back to interception of
      sigprocmask() (which we want to avoid). [ A concrete example: when using
      breakpoint perf events to track data-flow, in a region of code where
      signals are blocked, data-flow can no longer be tracked accurately.
      When a relevant asynchronous signal is received after unblocking the
      signal, the data-flow tracking logic needs to know its state is
      imprecise. ]
      
      Fixes: 97ba62b2 ("perf: Add support for SIGTRAP on perf events")
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NMarco Elver <elver@google.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NDmitry Vyukov <dvyukov@google.com>
      Link: https://lore.kernel.org/r/20220404111204.935357-1-elver@google.com
      78ed93d7
  3. 09 9月, 2021 3 次提交
    • A
      arch: remove compat_alloc_user_space · a7a08b27
      Arnd Bergmann 提交于
      All users of compat_alloc_user_space() and copy_in_user() have been
      removed from the kernel, only a few functions in sparc remain that can be
      changed to calling arch_copy_in_user() instead.
      
      Link: https://lkml.kernel.org/r/20210727144859.4150043-7-arnd@kernel.orgSigned-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a7a08b27
    • A
      compat: remove some compat entry points · 59ab844e
      Arnd Bergmann 提交于
      These are all handled correctly when calling the native system call entry
      point, so remove the special cases.
      
      Link: https://lkml.kernel.org/r/20210727144859.4150043-6-arnd@kernel.orgSigned-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59ab844e
    • A
      mm: simplify compat numa syscalls · e130242d
      Arnd Bergmann 提交于
      The compat implementations for mbind, get_mempolicy, set_mempolicy and
      migrate_pages are just there to handle the subtly different layout of
      bitmaps on 32-bit hosts.
      
      The compat implementation however lacks some of the checks that are
      present in the native one, in particular for checking that the extra bits
      are all zero when user space has a larger mask size than the kernel.
      Worse, those extra bits do not get cleared when copying in or out of the
      kernel, which can lead to incorrect data as well.
      
      Unify the implementation to handle the compat bitmap layout directly in
      the get_nodes() and copy_nodes_to_user() helpers.  Splitting out the
      get_bitmap() helper from get_nodes() also helps readability of the native
      case.
      
      On x86, two additional problems are addressed by this: compat tasks can
      pass a bitmap at the end of a mapping, causing a fault when reading across
      the page boundary for a 64-bit word.  x32 tasks might also run into
      problems with get_mempolicy corrupting data when an odd number of 32-bit
      words gets passed.
      
      On parisc the migrate_pages() system call apparently had the wrong calling
      convention, as big-endian architectures expect the words inside of a
      bitmap to be swapped.  This is not a problem though since parisc has no
      NUMA support.
      
      [arnd@arndb.de: fix mempolicy crash]
        Link: https://lkml.kernel.org/r/20210730143417.3700653-1-arnd@kernel.org
        Link: https://lore.kernel.org/lkml/YQPLG20V3dmOfq3a@osiris/
      
      Link: https://lkml.kernel.org/r/20210727144859.4150043-5-arnd@kernel.orgSigned-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e130242d
  4. 23 7月, 2021 1 次提交
    • A
      compat: make linux/compat.h available everywhere · 1a33b18b
      Arnd Bergmann 提交于
      Parts of linux/compat.h are under an #ifdef, but we end up
      using more of those over time, moving things around bit by
      bit.
      
      To get it over with once and for all, make all of this file
      uncondititonal now so it can be accessed everywhere. There
      are only a few types left that are in asm/compat.h but not
      yet in the asm-generic version, so add those in the process.
      
      This requires providing a few more types in asm-generic/compat.h
      that were not already there. The only tricky one is
      compat_sigset_t, which needs a little help on 32-bit architectures
      and for x86.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a33b18b
  5. 02 7月, 2021 1 次提交
  6. 19 5月, 2021 2 次提交
  7. 07 5月, 2021 1 次提交
  8. 23 4月, 2021 1 次提交
    • M
      signal, perf: Fix siginfo_t by avoiding u64 on 32-bit architectures · 3ddb3fd8
      Marco Elver 提交于
      The alignment of a structure is that of its largest member. On
      architectures like 32-bit Arm (but not e.g. 32-bit x86) 64-bit integers
      will require 64-bit alignment and not its natural word size.
      
      This means that there is no portable way to add 64-bit integers to
      siginfo_t on 32-bit architectures without breaking the ABI, because
      siginfo_t does not yet (and therefore likely never will) contain 64-bit
      fields on 32-bit architectures. Adding a 64-bit integer could change the
      alignment of the union after the 3 initial int si_signo, si_errno,
      si_code, thus introducing 4 bytes of padding shifting the entire union,
      which would break the ABI.
      
      One alternative would be to use the __packed attribute, however, it is
      non-standard C. Given siginfo_t has definitions outside the Linux kernel
      in various standard libraries that can be compiled with any number of
      different compilers (not just those we rely on), using non-standard
      attributes on siginfo_t should be avoided to ensure portability.
      
      In the case of the si_perf field, word size is sufficient since there is
      no exact requirement on size, given the data it contains is user-defined
      via perf_event_attr::sig_data. On 32-bit architectures, any excess bits
      of perf_event_attr::sig_data will therefore be truncated when copying
      into si_perf.
      
      Since si_perf is intended to disambiguate events (e.g. encoding relevant
      information if there are more events of the same type), 32 bits should
      provide enough entropy to do so on 32-bit architectures.
      
      For 64-bit architectures, no change is intended.
      
      Fixes: fb6cc127 ("signal: Introduce TRAP_PERF si_code and si_perf to siginfo")
      Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reported-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMarco Elver <elver@google.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: NJon Hunter <jonathanh@nvidia.com>
      Link: https://lkml.kernel.org/r/20210422191823.79012-1-elver@google.com
      3ddb3fd8
  9. 16 4月, 2021 1 次提交
  10. 03 4月, 2021 1 次提交
  11. 20 12月, 2020 1 次提交
  12. 03 12月, 2020 1 次提交
  13. 03 10月, 2020 5 次提交
  14. 25 9月, 2020 1 次提交
  15. 23 9月, 2020 1 次提交
  16. 18 9月, 2020 1 次提交
  17. 24 8月, 2020 1 次提交
  18. 15 8月, 2020 1 次提交
    • X
      all arch: remove system call sys_sysctl · 88db0aa2
      Xiaoming Ni 提交于
      Since commit 61a47c1a ("sysctl: Remove the sysctl system call"),
      sys_sysctl is actually unavailable: any input can only return an error.
      
      We have been warning about people using the sysctl system call for years
      and believe there are no more users.  Even if there are users of this
      interface if they have not complained or fixed their code by now they
      probably are not going to, so there is no point in warning them any
      longer.
      
      So completely remove sys_sysctl on all architectures.
      
      [nixiaoming@huawei.com: s390: fix build error for sys_call_table_emu]
       Link: http://lkml.kernel.org/r/20200618141426.16884-1-nixiaoming@huawei.comSigned-off-by: NXiaoming Ni <nixiaoming@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: Will Deacon <will@kernel.org>		[arm/arm64]
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Bin Meng <bin.meng@windriver.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: chenzefeng <chenzefeng2@huawei.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christian Brauner <christian@brauner.io>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Diego Elio Pettenò <flameeyes@flameeyes.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kars de Jong <jongk@linux-m68k.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Marco Elver <elver@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Miklos Szeredi <mszeredi@redhat.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Nick Piggin <npiggin@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: "Paul E. McKenney" <paulmck@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: Sargun Dhillon <sargun@sargun.me>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Sven Schnelle <svens@stackframe.org>
      Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Zhou Yanjie <zhouyanjie@wanyeetech.com>
      Link: http://lkml.kernel.org/r/20200616030734.87257-1-nixiaoming@huawei.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      88db0aa2
  19. 20 7月, 2020 1 次提交
    • C
      net: remove compat_sys_{get,set}sockopt · 55db9c0e
      Christoph Hellwig 提交于
      Now that the ->compat_{get,set}sockopt proto_ops methods are gone
      there is no good reason left to keep the compat syscalls separate.
      
      This fixes the odd use of unsigned int for the compat_setsockopt
      optlen and the missing sock_use_custom_sol_socket.
      
      It would also easily allow running the eBPF hooks for the compat
      syscalls, but such a large change in behavior does not belong into
      a consolidation patch like this one.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55db9c0e
  20. 06 5月, 2020 1 次提交
    • C
      signal: refactor copy_siginfo_to_user32 · c3b3f524
      Christoph Hellwig 提交于
      Factor out a copy_siginfo_to_external32 helper from
      copy_siginfo_to_user32 that fills out the compat_siginfo, but does so
      on a kernel space data structure.  With that we can let architectures
      override copy_siginfo_to_user32 with their own implementations using
      copy_siginfo_to_external32.  That allows moving the x32 SIGCHLD purely
      to x86 architecture code.
      
      As a nice side effect copy_siginfo_to_external32 also comes in handy
      for avoiding a set_fs() call in the coredump code later on.
      
      Contains improvements from Eric W. Biederman <ebiederm@xmission.com>
      and Arnd Bergmann <arnd@arndb.de>.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c3b3f524
  21. 19 3月, 2020 1 次提交
  22. 22 2月, 2020 1 次提交
  23. 03 1月, 2020 1 次提交
  24. 20 11月, 2019 1 次提交
  25. 15 11月, 2019 2 次提交
  26. 17 7月, 2019 1 次提交
  27. 07 2月, 2019 2 次提交
    • A
      y2038: syscalls: rename y2038 compat syscalls · 8dabe724
      Arnd Bergmann 提交于
      A lot of system calls that pass a time_t somewhere have an implementation
      using a COMPAT_SYSCALL_DEFINEx() on 64-bit architectures, and have
      been reworked so that this implementation can now be used on 32-bit
      architectures as well.
      
      The missing step is to redefine them using the regular SYSCALL_DEFINEx()
      to get them out of the compat namespace and make it possible to build them
      on 32-bit architectures.
      
      Any system call that ends in 'time' gets a '32' suffix on its name for
      that version, while the others get a '_time32' suffix, to distinguish
      them from the normal version, which takes a 64-bit time argument in the
      future.
      
      In this step, only 64-bit architectures are changed, doing this rename
      first lets us avoid touching the 32-bit architectures twice.
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      8dabe724
    • A
      time: make adjtime compat handling available for 32 bit · 4d5f007e
      Arnd Bergmann 提交于
      We want to reuse the compat_timex handling on 32-bit architectures the
      same way we are using the compat handling for timespec when moving to
      64-bit time_t.
      
      Move all definitions related to compat_timex out of the compat code
      into the normal timekeeping code, along with a rename to old_timex32,
      corresponding to the timespec/timeval structures, and make it controlled
      by CONFIG_COMPAT_32BIT_TIME, which 32-bit architectures will then select.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      4d5f007e
  28. 18 12月, 2018 2 次提交
    • A
      y2038: signal: Add compat_sys_rt_sigtimedwait_time64 · 2367c4b5
      Arnd Bergmann 提交于
      Now that 32-bit architectures have two variants of sys_rt_sigtimedwaid()
      for 32-bit and 64-bit time_t, we also need to have a second compat system
      call entry point on the corresponding 64-bit architectures.
      
      The traditional system call keeps getting handled
      by compat_sys_rt_sigtimedwait(), and this adds a new
      compat_sys_rt_sigtimedwait_time64() that differs only in the timeout
      argument type.
      
      The naming remains a bit asymmetric for the moment. Ideally we would
      want to have compat_sys_rt_sigtimedwait_time32() for the old version
      and compat_sys_rt_sigtimedwait() for the new one to mirror the names
      of the native entry points, but renaming the existing system call
      tables causes unnecessary churn. I would suggest renaming all such
      system calls together at a later point.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      2367c4b5
    • A
      y2038: socket: Add compat_sys_recvmmsg_time64 · e11d4284
      Arnd Bergmann 提交于
      recvmmsg() takes two arguments to pointers of structures that differ
      between 32-bit and 64-bit architectures: mmsghdr and timespec.
      
      For y2038 compatbility, we are changing the native system call from
      timespec to __kernel_timespec with a 64-bit time_t (in another patch),
      and use the existing compat system call on both 32-bit and 64-bit
      architectures for compatibility with traditional 32-bit user space.
      
      As we now have two variants of recvmmsg() for 32-bit tasks that are both
      different from the variant that we use on 64-bit tasks, this means we
      also require two compat system calls!
      
      The solution I picked is to flip things around: The existing
      compat_sys_recvmmsg() call gets moved from net/compat.c into net/socket.c
      and now handles the case for old user space on all architectures that
      have set CONFIG_COMPAT_32BIT_TIME.  A new compat_sys_recvmmsg_time64()
      call gets added in the old place for 64-bit architectures only, this
      one handles the case of a compat mmsghdr structure combined with
      __kernel_timespec.
      
      In the indirect sys_socketcall(), we now need to call either
      do_sys_recvmmsg() or __compat_sys_recvmmsg(), depending on what kind of
      architecture we are on. For compat_sys_socketcall(), no such change is
      needed, we always call __compat_sys_recvmmsg().
      
      I decided to not add a new SYS_RECVMMSG_TIME64 socketcall: Any libc
      implementation for 64-bit time_t will need significant changes including
      an updated asm/unistd.h, and it seems better to consistently use the
      separate syscalls that configuration, leaving the socketcall only for
      backward compatibility with 32-bit time_t based libc.
      
      The naming is asymmetric for the moment, so both existing syscalls
      entry points keep their names, while the new ones are recvmmsg_time32
      and compat_recvmmsg_time64 respectively. I expect that we will rename
      the compat syscalls later as we start using generated syscall tables
      everywhere and add these entry points.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      e11d4284
  29. 07 12月, 2018 1 次提交
    • D
      io_pgetevents: use __kernel_timespec · 7a35397f
      Deepa Dinamani 提交于
      struct timespec is not y2038 safe.
      struct __kernel_timespec is the new y2038 safe structure for all
      syscalls that are using struct timespec.
      Update io_pgetevents interfaces to use struct __kernel_timespec.
      
      sigset_t also has different representations on 32 bit and 64 bit
      architectures. Hence, we need to support the following different
      syscalls:
      
      New y2038 safe syscalls:
      (Controlled by CONFIG_64BIT_TIME for 32 bit ABIs)
      
      Native 64 bit(unchanged) and native 32 bit : sys_io_pgetevents
      Compat : compat_sys_io_pgetevents_time64
      
      Older y2038 unsafe syscalls:
      (Controlled by CONFIG_32BIT_COMPAT_TIME for 32 bit ABIs)
      
      Native 32 bit : sys_io_pgetevents_time32
      Compat : compat_sys_io_pgetevents
      
      Note that io_getevents syscalls do not have a y2038 safe solution.
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      7a35397f