linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Hellwig <hch@lst.de>,
	linux-arch@vger.kernel.org, linux-mm@kvack.org,
	linux-api@vger.kernel.org, arnd@arndb.de,
	linux-kernel@vger.kernel.org
Cc: mark.rutland@arm.com, dalias@libc.org,
	linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org,
	peterz@infradead.org, jcmvbkbc@gmail.com, guoren@kernel.org,
	sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org,
	linux-riscv@lists.infradead.org, will@kernel.org,
	ardb@kernel.org, linux-s390@vger.kernel.org,
	bcain@codeaurora.org, deller@gmx.de, x86@kernel.org,
	linux@armlinux.org.uk, linux-csky@vger.kernel.org,
	mingo@redhat.com, geert@linux-m68k.org,
	linux-snps-arc@lists.infradead.org,
	linux-xtensa@linux-xtensa.org, hca@linux.ibm.com,
	linux-alpha@vger.kernel.org, linux-um@lists.infradead.org,
	linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org,
	green.hu@gmail.com, shorne@gmail.com,
	linux-arm-kernel@lists.infradead.org, monstr@monstr.eu,
	tsbogend@alpha.franken.de, linux-parisc@vger.kernel.org,
	nickhu@andestech.com, linux-mips@vger.kernel.org,
	dinguyen@kernel.org, ebiederm@xmission.com, richard@nod.at,
	akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
	davem@davemloft.net
Subject: [PATCH 00/14] clean up asm/uaccess.h, kill set_fs for good
Date: Mon, 14 Feb 2022 17:34:38 +0100	[thread overview]
Message-ID: <20220214163452.1568807-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

Christoph Hellwig and a few others spent a huge effort on removing
set_fs() from most of the important architectures, but about half the
other architectures were never completed even though most of them don't
actually use set_fs() at all.

I did a patch for microblaze at some point, which turned out to be fairly
generic, and now ported it to most other architectures, using new generic
implementations of access_ok() and __{get,put}_kernel_nocheck().

Three architectures (sparc64, ia64, and sh) needed some extra work,
which I also completed.

The final series contains extra cleanup changes that touch all
architectures. Please review and test these, so we can merge them
for v5.18.

The series is available at
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=set_fs
for testing.

       Arnd

Arnd Bergmann (14):
  uaccess: fix integer overflow on access_ok()
  sparc64: add __{get,put}_kernel_nocheck()
  nds32: fix access_ok() checks in get/put_user
  x86: use more conventional access_ok() definition
  uaccess: add generic __{get,put}_kernel_nofault
  mips: use simpler access_ok()
  uaccess: generalize access_ok()
  arm64: simplify access_ok()
  m68k: drop custom __access_ok()
  uaccess: remove most CONFIG_SET_FS users
  sparc64: remove CONFIG_SET_FS support
  sh: remove CONFIG_SET_FS support
  ia64: remove CONFIG_SET_FS support
  uaccess: drop set_fs leftovers

 arch/Kconfig                              |   3 -
 arch/alpha/Kconfig                        |   1 -
 arch/alpha/include/asm/processor.h        |   4 -
 arch/alpha/include/asm/thread_info.h      |   2 -
 arch/alpha/include/asm/uaccess.h          |  53 +--------
 arch/arc/Kconfig                          |   1 -
 arch/arc/include/asm/segment.h            |  20 ----
 arch/arc/include/asm/thread_info.h        |   3 -
 arch/arc/include/asm/uaccess.h            |  30 -----
 arch/arm/include/asm/uaccess.h            |  22 +---
 arch/arm/kernel/swp_emulate.c             |   2 +-
 arch/arm/kernel/traps.c                   |   2 +-
 arch/arm/lib/uaccess_with_memcpy.c        |  10 --
 arch/arm64/include/asm/uaccess.h          |  29 +----
 arch/csky/Kconfig                         |   1 -
 arch/csky/include/asm/processor.h         |   2 -
 arch/csky/include/asm/segment.h           |  10 --
 arch/csky/include/asm/thread_info.h       |   2 -
 arch/csky/include/asm/uaccess.h           |  12 --
 arch/csky/kernel/asm-offsets.c            |   1 -
 arch/csky/kernel/signal.c                 |   2 +-
 arch/h8300/Kconfig                        |   1 -
 arch/h8300/include/asm/processor.h        |   1 -
 arch/h8300/include/asm/segment.h          |  40 -------
 arch/h8300/include/asm/thread_info.h      |   3 -
 arch/h8300/kernel/entry.S                 |   1 -
 arch/h8300/kernel/head_ram.S              |   1 -
 arch/h8300/mm/init.c                      |   6 -
 arch/h8300/mm/memory.c                    |   1 -
 arch/hexagon/Kconfig                      |   1 -
 arch/hexagon/include/asm/thread_info.h    |   6 -
 arch/hexagon/include/asm/uaccess.h        |  25 ----
 arch/hexagon/kernel/process.c             |   1 -
 arch/ia64/Kconfig                         |   1 -
 arch/ia64/include/asm/processor.h         |   4 -
 arch/ia64/include/asm/thread_info.h       |   2 -
 arch/ia64/include/asm/uaccess.h           |  26 ++---
 arch/ia64/kernel/unaligned.c              |  60 ++++++----
 arch/m68k/include/asm/uaccess.h           |  14 +--
 arch/microblaze/Kconfig                   |   1 -
 arch/microblaze/include/asm/thread_info.h |   6 -
 arch/microblaze/include/asm/uaccess.h     |  43 +------
 arch/microblaze/kernel/asm-offsets.c      |   1 -
 arch/microblaze/kernel/process.c          |   1 -
 arch/mips/include/asm/uaccess.h           |  47 +-------
 arch/nds32/Kconfig                        |   1 -
 arch/nds32/include/asm/thread_info.h      |   4 -
 arch/nds32/include/asm/uaccess.h          |  40 +++----
 arch/nds32/kernel/process.c               |   5 +-
 arch/nds32/mm/alignment.c                 |   3 -
 arch/nios2/Kconfig                        |   1 -
 arch/nios2/include/asm/thread_info.h      |   9 --
 arch/nios2/include/asm/uaccess.h          |  23 +---
 arch/nios2/kernel/signal.c                |  20 ++--
 arch/openrisc/Kconfig                     |   1 -
 arch/openrisc/include/asm/thread_info.h   |   7 --
 arch/openrisc/include/asm/uaccess.h       |  42 +------
 arch/parisc/include/asm/futex.h           |   2 +-
 arch/parisc/include/asm/uaccess.h         |  11 +-
 arch/parisc/lib/memcpy.c                  |   2 +-
 arch/powerpc/include/asm/uaccess.h        |  13 +--
 arch/powerpc/lib/sstep.c                  |   4 +-
 arch/riscv/include/asm/uaccess.h          |  33 +-----
 arch/riscv/kernel/perf_callchain.c        |   2 +-
 arch/s390/include/asm/uaccess.h           |  13 +--
 arch/sh/Kconfig                           |   1 -
 arch/sh/include/asm/processor.h           |   1 -
 arch/sh/include/asm/segment.h             |  33 ------
 arch/sh/include/asm/thread_info.h         |   2 -
 arch/sh/include/asm/uaccess.h             |  24 +---
 arch/sh/kernel/io_trapped.c               |   9 +-
 arch/sh/kernel/process_32.c               |   2 -
 arch/sh/kernel/traps_32.c                 |  30 +++--
 arch/sparc/Kconfig                        |   1 -
 arch/sparc/include/asm/processor_32.h     |   6 -
 arch/sparc/include/asm/processor_64.h     |   4 -
 arch/sparc/include/asm/switch_to_64.h     |   4 +-
 arch/sparc/include/asm/thread_info_64.h   |   4 +-
 arch/sparc/include/asm/uaccess.h          |   3 -
 arch/sparc/include/asm/uaccess_32.h       |  31 +----
 arch/sparc/include/asm/uaccess_64.h       | 135 +++++++++++++---------
 arch/sparc/kernel/process_32.c            |   2 -
 arch/sparc/kernel/process_64.c            |  12 --
 arch/sparc/kernel/signal_32.c             |   2 +-
 arch/sparc/kernel/traps_64.c              |   2 -
 arch/sparc/lib/NGmemcpy.S                 |   3 +-
 arch/sparc/mm/init_64.c                   |   3 -
 arch/um/include/asm/uaccess.h             |   7 +-
 arch/x86/include/asm/uaccess.h            |  44 ++-----
 arch/xtensa/Kconfig                       |   1 -
 arch/xtensa/include/asm/asm-uaccess.h     |  71 ------------
 arch/xtensa/include/asm/processor.h       |   7 --
 arch/xtensa/include/asm/thread_info.h     |   3 -
 arch/xtensa/include/asm/uaccess.h         |  26 +----
 arch/xtensa/kernel/asm-offsets.c          |   3 -
 drivers/hid/uhid.c                        |   2 +-
 drivers/scsi/sg.c                         |   5 -
 fs/exec.c                                 |   6 -
 include/asm-generic/access_ok.h           |  51 ++++++++
 include/asm-generic/uaccess.h             |  46 +-------
 include/linux/syscalls.h                  |   4 -
 include/linux/uaccess.h                   |  59 +++-------
 include/rdma/ib.h                         |   2 +-
 kernel/events/callchain.c                 |   4 -
 kernel/events/core.c                      |   3 -
 kernel/exit.c                             |  14 ---
 kernel/kthread.c                          |   5 -
 kernel/stacktrace.c                       |   3 -
 kernel/trace/bpf_trace.c                  |   4 -
 mm/maccess.c                              | 119 -------------------
 mm/memory.c                               |   8 --
 net/bpfilter/bpfilter_kern.c              |   2 +-
 112 files changed, 315 insertions(+), 1239 deletions(-)
 delete mode 100644 arch/arc/include/asm/segment.h
 delete mode 100644 arch/csky/include/asm/segment.h
 delete mode 100644 arch/h8300/include/asm/segment.h
 delete mode 100644 arch/sh/include/asm/segment.h
 create mode 100644 include/asm-generic/access_ok.h

-- 
2.29.2

Cc: linux@armlinux.org.uk
Cc: will@kernel.org
Cc: guoren@kernel.org
Cc: bcain@codeaurora.org
Cc: geert@linux-m68k.org
Cc: monstr@monstr.eu
Cc: tsbogend@alpha.franken.de
Cc: nickhu@andestech.com
Cc: green.hu@gmail.com
Cc: dinguyen@kernel.org
Cc: shorne@gmail.com
Cc: deller@gmx.de
Cc: mpe@ellerman.id.au
Cc: peterz@infradead.org
Cc: mingo@redhat.com
Cc: mark.rutland@arm.com
Cc: hca@linux.ibm.com
Cc: dalias@libc.org
Cc: davem@davemloft.net
Cc: richard@nod.at
Cc: x86@kernel.org
Cc: jcmvbkbc@gmail.com
Cc: ebiederm@xmission.com
Cc: arnd@arndb.de
Cc: akpm@linux-foundation.org
Cc: ardb@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-alpha@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
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: 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-mm@kvack.org

             reply	other threads:[~2022-02-14 16:36 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 16:34 Arnd Bergmann [this message]
2022-02-14 16:34 ` [PATCH 01/14] uaccess: fix integer overflow on access_ok() Arnd Bergmann
2022-02-14 16:58   ` Christoph Hellwig
2022-02-14 16:34 ` [PATCH 02/14] sparc64: add __{get,put}_kernel_nocheck() Arnd Bergmann
2022-02-14 16:34 ` [PATCH 03/14] nds32: fix access_ok() checks in get/put_user Arnd Bergmann
2022-02-14 17:01   ` Christoph Hellwig
2022-02-14 17:10     ` David Laight
2022-02-15  9:18     ` Arnd Bergmann
2022-02-15 10:25       ` Greg KH
2022-02-14 16:34 ` [PATCH 04/14] x86: use more conventional access_ok() definition Arnd Bergmann
2022-02-14 17:02   ` Christoph Hellwig
2022-02-14 19:45     ` Arnd Bergmann
2022-02-14 20:00       ` Christoph Hellwig
2022-02-14 20:01       ` Linus Torvalds
2022-02-14 20:17         ` Al Viro
2022-02-15  2:47           ` Al Viro
2022-02-14 20:24         ` Linus Torvalds
2022-02-14 22:13           ` David Laight
2022-02-14 16:34 ` [PATCH 05/14] uaccess: add generic __{get,put}_kernel_nofault Arnd Bergmann
2022-02-14 17:02   ` Christoph Hellwig
2022-02-15  0:31   ` Al Viro
2022-02-15 13:16     ` Arnd Bergmann
2022-02-14 16:34 ` [PATCH 06/14] mips: use simpler access_ok() Arnd Bergmann
2022-02-14 16:34 ` [PATCH 07/14] uaccess: generalize access_ok() Arnd Bergmann
2022-02-14 17:04   ` Christoph Hellwig
2022-02-14 17:15   ` Al Viro
2022-02-14 19:25     ` Arnd Bergmann
2022-02-15 10:58   ` Mark Rutland
2022-02-14 16:34 ` [PATCH 08/14] arm64: simplify access_ok() Arnd Bergmann
2022-02-14 21:06   ` Robin Murphy
2022-02-15  8:17   ` Ard Biesheuvel
2022-02-15  9:12     ` Arnd Bergmann
2022-02-15  9:21       ` Ard Biesheuvel
2022-02-15  9:39         ` Arnd Bergmann
2022-02-15 10:39           ` Mark Rutland
2022-02-15 10:37         ` Mark Rutland
2022-02-16 19:43       ` Christophe Leroy
2022-02-15  9:30     ` David Laight
2022-02-15 11:24       ` Mark Rutland
2022-02-15 11:07   ` Mark Rutland
2022-02-14 16:34 ` [PATCH 09/14] m68k: drop custom __access_ok() Arnd Bergmann
2022-02-15  0:37   ` Al Viro
2022-02-15  6:29     ` Christoph Hellwig
2022-02-15  7:13       ` Al Viro
2022-02-15 10:02         ` Arnd Bergmann
2022-02-15 13:28           ` David Laight
2022-02-14 16:34 ` [PATCH 10/14] uaccess: remove most CONFIG_SET_FS users Arnd Bergmann
2022-02-14 17:06   ` Christoph Hellwig
2022-02-14 19:40     ` Arnd Bergmann
2022-02-14 16:34 ` [PATCH 11/14] sparc64: remove CONFIG_SET_FS support Arnd Bergmann
2022-02-14 17:06   ` Christoph Hellwig
2022-02-16 13:06     ` Arnd Bergmann
2022-02-15  0:48   ` Al Viro
2022-02-16 13:07     ` Arnd Bergmann
2022-02-14 16:34 ` [PATCH 12/14] sh: " Arnd Bergmann
2022-02-14 16:34 ` [PATCH 13/14] ia64: " Arnd Bergmann
2022-02-14 16:34 ` [PATCH 14/14] uaccess: drop set_fs leftovers Arnd Bergmann
2022-02-15  3:03   ` Al Viro
2022-02-15  7:46     ` Helge Deller
2022-02-15  8:10       ` Arnd Bergmann
2022-02-14 17:35 ` [PATCH 00/14] clean up asm/uaccess.h, kill set_fs for good Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220214163452.1568807-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bcain@codeaurora.org \
    --cc=dalias@libc.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dinguyen@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=geert@linux-m68k.org \
    --cc=green.hu@gmail.com \
    --cc=guoren@kernel.org \
    --cc=hca@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=monstr@monstr.eu \
    --cc=nickhu@andestech.com \
    --cc=openrisc@lists.librecores.org \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=shorne@gmail.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).