1. 16 4月, 2021 1 次提交
  2. 20 12月, 2020 1 次提交
  3. 03 12月, 2020 1 次提交
  4. 03 10月, 2020 5 次提交
  5. 25 9月, 2020 1 次提交
  6. 23 9月, 2020 1 次提交
  7. 18 9月, 2020 1 次提交
  8. 24 8月, 2020 1 次提交
  9. 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
  10. 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
  11. 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
  12. 19 3月, 2020 1 次提交
  13. 22 2月, 2020 1 次提交
  14. 03 1月, 2020 1 次提交
  15. 20 11月, 2019 1 次提交
  16. 15 11月, 2019 2 次提交
  17. 17 7月, 2019 1 次提交
  18. 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
  19. 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
  20. 07 12月, 2018 4 次提交
    • 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
    • D
      pselect6: use __kernel_timespec · e024707b
      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 pselect 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_pselect6
      Compat : compat_sys_pselect6_time64
      
      Older y2038 unsafe syscalls:
      (Controlled by CONFIG_32BIT_COMPAT_TIME for 32 bit ABIs)
      
      Native 32 bit : pselect6_time32
      Compat : compat_sys_pselect6
      
      Note that all other versions of select syscalls will not have
      y2038 safe versions.
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      e024707b
    • D
      ppoll: use __kernel_timespec · 8bd27a30
      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 ppoll 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_ppoll
      Compat : compat_sys_ppoll_time64
      
      Older y2038 unsafe syscalls:
      (Controlled by CONFIG_32BIT_COMPAT_TIME for 32 bit ABIs)
      
      Native 32 bit : ppoll_time32
      Compat : compat_sys_ppoll
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      8bd27a30
    • D
      signal: Add set_user_sigmask() · ded653cc
      Deepa Dinamani 提交于
      Refactor reading sigset from userspace and updating sigmask
      into an api.
      
      This is useful for versions of syscalls that pass in the
      sigmask and expect the current->sigmask to be changed during,
      and restored after, the execution of the syscall.
      
      With the advent of new y2038 syscalls in the subsequent patches,
      we add two more new versions of the syscalls (for pselect, ppoll,
      and io_pgetevents) in addition to the existing native and compat
      versions. Adding such an api reduces the logic that would need to
      be replicated otherwise.
      
      Note that the calls to sigprocmask() ignored the return value
      from the api as the function only returns an error on an invalid
      first argument that is hardcoded at these call sites.
      The updated logic uses set_current_blocked() instead.
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      ded653cc
  21. 01 11月, 2018 1 次提交
    • D
      x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT · a846446b
      Dmitry Safonov 提交于
      The result of in_compat_syscall() can be pictured as:
      
      x86 platform:
          ---------------------------------------------------
          |  Arch\syscall  |  64-bit  |   ia32   |   x32    |
          |-------------------------------------------------|
          |     x86_64     |  false   |   true   |   true   |
          |-------------------------------------------------|
          |      i686      |          |  <true>  |          |
          ---------------------------------------------------
      
      Other platforms:
          -------------------------------------------
          |  Arch\syscall  |  64-bit  |   compat    |
          |-----------------------------------------|
          |     64-bit     |  false   |    true     |
          |-----------------------------------------|
          |    32-bit(?)   |          |   <false>   |
          -------------------------------------------
      
      As seen, the result of in_compat_syscall() on generic 32-bit platform
      differs from i686.
      
      There is no reason for in_compat_syscall() == true on native i686.  It also
      easy to misread code if the result on native 32-bit platform differs
      between arches.
      
      Because of that non arch-specific code has many places with:
          if (IS_ENABLED(CONFIG_COMPAT) && in_compat_syscall())
      in different variations.
      
      It looks-like the only non-x86 code which uses in_compat_syscall() not
      under CONFIG_COMPAT guard is in amd/amdkfd. But according to the commit
      a18069c1 ("amdkfd: Disable support for 32-bit user processes"), it
      actually should be disabled on native i686.
      
      Rename in_compat_syscall() to in_32bit_syscall() for x86-specific code
      and make in_compat_syscall() false under !CONFIG_COMPAT.
      
      A follow on patch will clean up generic users which were forced to check
      IS_ENABLED(CONFIG_COMPAT) with in_compat_syscall().
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Dmitry Safonov <0x7f454c46@gmail.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-efi@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Link: https://lkml.kernel.org/r/20181012134253.23266-2-dima@arista.com
      a846446b
  22. 31 10月, 2018 1 次提交
  23. 03 10月, 2018 1 次提交
    • E
      signal: Distinguish between kernel_siginfo and siginfo · ae7795bc
      Eric W. Biederman 提交于
      Linus recently observed that if we did not worry about the padding
      member in struct siginfo it is only about 48 bytes, and 48 bytes is
      much nicer than 128 bytes for allocating on the stack and copying
      around in the kernel.
      
      The obvious thing of only adding the padding when userspace is
      including siginfo.h won't work as there are sigframe definitions in
      the kernel that embed struct siginfo.
      
      So split siginfo in two; kernel_siginfo and siginfo.  Keeping the
      traditional name for the userspace definition.  While the version that
      is used internally to the kernel and ultimately will not be padded to
      128 bytes is called kernel_siginfo.
      
      The definition of struct kernel_siginfo I have put in include/signal_types.h
      
      A set of buildtime checks has been added to verify the two structures have
      the same field offsets.
      
      To make it easy to verify the change kernel_siginfo retains the same
      size as siginfo.  The reduction in size comes in a following change.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ae7795bc
  24. 01 10月, 2018 1 次提交
  25. 29 8月, 2018 2 次提交
    • A
      y2038: utimes: Rework #ifdef guards for compat syscalls · 4faea239
      Arnd Bergmann 提交于
      After changing over to 64-bit time_t syscalls, many architectures will
      want compat_sys_utimensat() but not respective handlers for utime(),
      utimes() and futimesat(). This adds a new __ARCH_WANT_SYS_UTIME32 to
      complement __ARCH_WANT_SYS_UTIME. For now, all 64-bit architectures that
      support CONFIG_COMPAT set it, but future 64-bit architectures will not
      (tile would not have needed it either, but got removed).
      
      As older 32-bit architectures get converted to using CONFIG_64BIT_TIME,
      they will have to use __ARCH_WANT_SYS_UTIME32 instead of
      __ARCH_WANT_SYS_UTIME. Architectures using the generic syscall ABI don't
      need either of them as they never had a utime syscall.
      
      Since the compat_utimbuf structure is now required outside of
      CONFIG_COMPAT, I'm moving it into compat_time.h.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      ---
      changed from last version:
      - renamed __ARCH_WANT_COMPAT_SYS_UTIME to __ARCH_WANT_SYS_UTIME32
      4faea239
    • A
      asm-generic: Move common compat types to asm-generic/compat.h · fb373975
      Arnd Bergmann 提交于
      While converting compat system call handlers to work on 32-bit
      architectures, I found a number of types used in those handlers
      that are identical between all architectures.
      
      Let's move all the identical ones into asm-generic/compat.h to avoid
      having to add even more identical definitions of those types.
      
      For unknown reasons, mips defines __compat_gid32_t, __compat_uid32_t
      and compat_caddr_t as signed, while all others have them unsigned.
      This seems to be a mistake, but I'm leaving it alone here. The other
      types all differ by size or alignment on at least on architecture.
      
      compat_aio_context_t is currently defined in linux/compat.h but
      also needed for compat_sys_io_getevents(), so let's move it into
      the same place.
      
      While we still have not decided whether the 32-bit time handling
      will always use the compat syscalls, or in which form, I think this
      is a useful cleanup that we can merge regardless.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      fb373975
  26. 27 8月, 2018 1 次提交
    • A
      y2038: globally rename compat_time to old_time32 · 9afc5eee
      Arnd Bergmann 提交于
      Christoph Hellwig suggested a slightly different path for handling
      backwards compatibility with the 32-bit time_t based system calls:
      
      Rather than simply reusing the compat_sys_* entry points on 32-bit
      architectures unchanged, we get rid of those entry points and the
      compat_time types by renaming them to something that makes more sense
      on 32-bit architectures (which don't have a compat mode otherwise),
      and then share the entry points under the new name with the 64-bit
      architectures that use them for implementing the compatibility.
      
      The following types and interfaces are renamed here, and moved
      from linux/compat_time.h to linux/time32.h:
      
      old				new
      ---				---
      compat_time_t			old_time32_t
      struct compat_timeval		struct old_timeval32
      struct compat_timespec		struct old_timespec32
      struct compat_itimerspec	struct old_itimerspec32
      ns_to_compat_timeval()		ns_to_old_timeval32()
      get_compat_itimerspec64()	get_old_itimerspec32()
      put_compat_itimerspec64()	put_old_itimerspec32()
      compat_get_timespec64()		get_old_timespec32()
      compat_put_timespec64()		put_old_timespec32()
      
      As we already have aliases in place, this patch addresses only the
      instances that are relevant to the system call interface in particular,
      not those that occur in device drivers and other modules. Those
      will get handled separately, while providing the 64-bit version
      of the respective interfaces.
      
      I'm not renaming the timex, rusage and itimerval structures, as we are
      still debating what the new interface will look like, and whether we
      will need a replacement at all.
      
      This also doesn't change the names of the syscall entry points, which can
      be done more easily when we actually switch over the 32-bit architectures
      to use them, at that point we need to change COMPAT_SYSCALL_DEFINEx to
      SYSCALL_DEFINEx with a new name, e.g. with a _time32 suffix.
      Suggested-by: NChristoph Hellwig <hch@infradead.org>
      Link: https://lore.kernel.org/lkml/20180705222110.GA5698@infradead.org/Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      9afc5eee
  27. 12 7月, 2018 1 次提交
  28. 25 6月, 2018 1 次提交
    • A
      disable -Wattribute-alias warning for SYSCALL_DEFINEx() · bee20031
      Arnd Bergmann 提交于
      gcc-8 warns for every single definition of a system call entry
      point, e.g.:
      
      include/linux/compat.h:56:18: error: 'compat_sys_rt_sigprocmask' alias between functions of incompatible types 'long int(int,  compat_sigset_t *, compat_sigset_t *, compat_size_t)' {aka 'long int(int,  struct <anonymous> *, struct <anonymous> *, unsigned int)'} and 'long int(long int,  long int,  long int,  long int)' [-Werror=attribute-alias]
        asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\
                        ^~~~~~~~~~
      include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
        COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~
      kernel/signal.c:2601:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE4'
       COMPAT_SYSCALL_DEFINE4(rt_sigprocmask, int, how, compat_sigset_t __user *, nset,
       ^~~~~~~~~~~~~~~~~~~~~~
      include/linux/compat.h:60:18: note: aliased declaration here
        asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\
                        ^~~~~~~~~~
      
      The new warning seems reasonable in principle, but it doesn't
      help us here, since we rely on the type mismatch to sanitize the
      system call arguments. After I reported this as GCC PR82435, a new
      -Wno-attribute-alias option was added that could be used to turn the
      warning off globally on the command line, but I'd prefer to do it a
      little more fine-grained.
      
      Interestingly, turning a warning off and on again inside of
      a single macro doesn't always work, in this case I had to add
      an extra statement inbetween and decided to copy the __SC_TEST
      one from the native syscall to the compat syscall macro.  See
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83256 for more details
      about this.
      
      [paul.burton@mips.com:
        - Rebase atop current master.
        - Split GCC & version arguments to __diag_ignore() in order to match
          changes to the preceding patch.
        - Add the comment argument to match the preceding patch.]
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82435Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Tested-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Tested-by: NStafford Horne <shorne@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      bee20031
  29. 24 6月, 2018 1 次提交