linux/arch/arm/configs
David Hildenbrand bbcd53c960 drivers/char: remove /dev/kmem for good
Patch series "drivers/char: remove /dev/kmem for good".

Exploring /dev/kmem and /dev/mem in the context of memory hot(un)plug and
memory ballooning, I started questioning the existence of /dev/kmem.

Comparing it with the /proc/kcore implementation, it does not seem to be
able to deal with things like

a) Pages unmapped from the direct mapping (e.g., to be used by secretmem)
  -> kern_addr_valid(). virt_addr_valid() is not sufficient.

b) Special cases like gart aperture memory that is not to be touched
  -> mem_pfn_is_ram()

Unless I am missing something, it's at least broken in some cases and might
fault/crash the machine.

Looks like its existence has been questioned before in 2005 and 2010 [1],
after ~11 additional years, it might make sense to revive the discussion.

CONFIG_DEVKMEM is only enabled in a single defconfig (on purpose or by
mistake?).  All distributions disable it: in Ubuntu it has been disabled
for more than 10 years, in Debian since 2.6.31, in Fedora at least
starting with FC3, in RHEL starting with RHEL4, in SUSE starting from
15sp2, and OpenSUSE has it disabled as well.

1) /dev/kmem was popular for rootkits [2] before it got disabled
   basically everywhere. Ubuntu documents [3] "There is no modern user of
   /dev/kmem any more beyond attackers using it to load kernel rootkits.".
   RHEL documents in a BZ [5] "it served no practical purpose other than to
   serve as a potential security problem or to enable binary module drivers
   to access structures/functions they shouldn't be touching"

2) /proc/kcore is a decent interface to have a controlled way to read
   kernel memory for debugging puposes. (will need some extensions to
   deal with memory offlining/unplug, memory ballooning, and poisoned
   pages, though)

3) It might be useful for corner case debugging [1]. KDB/KGDB might be a
   better fit, especially, to write random memory; harder to shoot
   yourself into the foot.

4) "Kernel Memory Editor" [4] hasn't seen any updates since 2000 and seems
   to be incompatible with 64bit [1]. For educational purposes,
   /proc/kcore might be used to monitor value updates -- or older
   kernels can be used.

5) It's broken on arm64, and therefore, completely disabled there.

Looks like it's essentially unused and has been replaced by better
suited interfaces for individual tasks (/proc/kcore, KDB/KGDB). Let's
just remove it.

[1] https://lwn.net/Articles/147901/
[2] https://www.linuxjournal.com/article/10505
[3] https://wiki.ubuntu.com/Security/Features#A.2Fdev.2Fkmem_disabled
[4] https://sourceforge.net/projects/kme/
[5] https://bugzilla.redhat.com/show_bug.cgi?id=154796

Link: https://lkml.kernel.org/r/20210324102351.6932-1-david@redhat.com
Link: https://lkml.kernel.org/r/20210324102351.6932-2-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Chris Zankel <chris@zankel.net>
Cc: Corentin Labbe <clabbe@baylibre.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Gregory Clement <gregory.clement@bootlin.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Hillf Danton <hdanton@sina.com>
Cc: huang ying <huang.ying.caritas@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: James Troup <james.troup@canonical.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kairui Song <kasong@redhat.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Cc: openrisc@lists.librecores.org
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Pavel Machek (CIP)" <pavel@denx.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Pierre Morel <pmorel@linux.ibm.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Rich Felker <dalias@libc.org>
Cc: Robert Richter <rric@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: sparclinux@vger.kernel.org
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Theodore Dubois <tblodt@icloud.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: William Cohen <wcohen@redhat.com>
Cc: Xiaoming Ni <nixiaoming@huawei.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-07 00:26:34 -07:00
..
am200epdkit_defconfig all arch: remove system call sys_sysctl 2020-08-14 19:56:56 -07:00
aspeed_g4_defconfig ARM: config: aspeed: Fix selection of media drivers 2020-09-11 15:25:24 +09:30
aspeed_g5_defconfig ARM: config: aspeed_g5: Enable IBM OP Panel driver 2020-09-11 15:25:24 +09:30
assabet_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
at91_dt_defconfig ARM: configs: at91: Modernize UBI defconfig part 2021-03-29 11:27:14 +02:00
axm55xx_defconfig arm: Remove KVM from config files 2020-03-24 10:55:50 +00:00
badge4_defconfig USB: serial: keyspan_pda: clean up xircom/entrega support 2020-11-04 11:01:49 +01:00
bcm2835_defconfig Modules updates for v5.12 2021-02-23 10:15:33 -08:00
cerfcube_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
clps711x_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
cm_x300_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
cns3420vb_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
colibri_pxa270_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
colibri_pxa300_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
collie_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
corgi_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
davinci_all_defconfig drm/bridge: dumb-vga-dac: Rename driver to simple-bridge 2020-02-26 13:31:31 +02:00
dove_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
dram_0x00000000.config
dram_0xc0000000.config ARM: configs: Add new config fragment to change RAM start point 2016-11-26 00:20:09 +01:00
dram_0xd0000000.config ARM: configs: Add new config fragment to change RAM start point 2017-03-31 14:19:40 +02:00
ep93xx_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
eseries_pxa_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
exynos_defconfig ARM: exynos_defconfig: compile Atmel MXT touchscreeen as module 2020-11-16 17:31:38 +01:00
ezx_defconfig ARM: configs: Remove REGULATOR_USERSPACE_CONSUMER 2021-04-01 22:44:08 +02:00
footbridge_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
gemini_defconfig ARM: defconfig: gemini: Update defconfig 2020-01-06 09:24:32 -08:00
h3600_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
h5000_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
hackkit_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
hisi_defconfig irqdomain: Kill CONFIG_IRQ_DOMAIN_DEBUG 2018-01-24 12:32:58 +01:00
imote2_defconfig ARM: configs: Remove REGULATOR_USERSPACE_CONSUMER 2021-04-01 22:44:08 +02:00
imx_v4_v5_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
imx_v6_v7_defconfig ARM: imx_v6_v7_defconfig: enable power driver of RN5T618 PMIC family 2021-01-05 10:57:25 +08:00
integrator_defconfig ARM: configs: Update Integrator defconfig 2020-08-20 18:12:49 -07:00
iop32x_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
ixp4xx_defconfig net: wan: Delete the DLCI / SDLA drivers 2020-11-17 13:33:29 -08:00
jornada720_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
keystone_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
lart_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
lpc18xx_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
lpc32xx_defconfig sysctl: Remove the sysctl system call 2019-11-26 13:03:56 -06:00
lpd270_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
lubbock_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
magician_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
mainstone_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
milbeaut_m10v_defconfig ARM: configs: Add Milbeaut M10V defconfig 2019-03-01 15:18:54 +01:00
mini2440_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
mmp2_defconfig ARM: config: Remove left-over BACKLIGHT_LCD_SUPPORT 2019-06-19 07:02:07 -07:00
moxart_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
mps2_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
multi_v4t_defconfig ARM: defconfig: re-run savedefconfig on multi_v* configs 2019-12-05 13:20:18 -08:00
multi_v5_defconfig ARM: config: Add WPCM to multi v5 2021-04-09 15:18:40 +09:30
multi_v7_defconfig ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
mv78xx0_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
mvebu_v5_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
mvebu_v7_defconfig ARM: SoC defconfig updates 2019-07-19 17:27:27 -07:00
mxs_defconfig module: remove EXPORT_UNUSED_SYMBOL* 2021-02-08 12:28:07 +01:00
neponset_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
netwinder_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
nhk8815_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
omap1_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
omap2plus_defconfig ARM: omap2plus_defconfig: Add AT25 EEPROM module 2021-03-24 13:46:55 +02:00
orion5x_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
oxnas_v6_defconfig mtd: rawnand: Clarify Kconfig entry MTD_NAND 2019-04-18 08:54:00 +02:00
palmz72_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
pcm027_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
pleb_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
pxa3xx_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
pxa168_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
pxa255-idp_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
pxa910_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
pxa_defconfig ARM: configs: Remove REGULATOR_USERSPACE_CONSUMER 2021-04-01 22:44:08 +02:00
qcom_defconfig ARM: configs: qcom_defconfig: Reduce CMA size to 64MB 2021-04-13 21:21:22 -05:00
realview_defconfig ARM: configs: Update Realview defconfig 2020-09-13 11:15:24 -07:00
rpc_defconfig scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-02-24 14:59:01 -05:00
s3c2410_defconfig scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-02-24 14:59:01 -05:00
s3c6400_defconfig Samsung defconfig changes for v5.3 2019-06-26 19:27:25 -07:00
s5pv210_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
sama5_defconfig ARM: configs: at91: Modernize UBI defconfig part 2021-03-29 11:27:14 +02:00
shannon_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
shmobile_defconfig ARM: shmobile: defconfig: Refresh for v5.12-rc2 2021-03-12 09:34:57 +01:00
simpad_defconfig ARM: defconfig: Cleanup from old Kconfig options 2017-06-10 19:28:57 +02:00
socfpga_defconfig ARM: socfpga: drop ARCH_SOCFPGA 2021-03-23 11:03:36 -05:00
spear3xx_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
spear6xx_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
spear13xx_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
spitz_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
stm32_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
sunxi_defconfig ARM: configs: drop unused BACKLIGHT_GENERIC option 2020-12-08 17:30:24 +01:00
tct_hammer_defconfig ARM: configs: Remove useless UEVENT_HELPER_PATH 2019-06-19 07:09:39 -07:00
tegra_defconfig USB/Thunderbolt patches for 5.12-rc1 2021-02-20 21:32:37 -08:00
trizeps4_defconfig ARM: config: Remove left-over BACKLIGHT_LCD_SUPPORT 2019-06-19 07:02:07 -07:00
u8500_defconfig ARM: configs: ux500: Update for new drivers 2021-04-01 22:36:55 +02:00
versatile_defconfig ARM: configs: Update Versatile defconfig 2020-09-13 11:15:17 -07:00
vexpress_defconfig arch: arm: Remove CONFIG_OPROFILE support 2021-01-22 12:11:54 +05:30
vf610m4_defconfig firmware: Drop FIRMWARE_IN_KERNEL Kconfig option 2018-01-25 12:46:30 +01:00
viper_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00
vt8500_v6_v7_defconfig irqdomain: Kill CONFIG_IRQ_DOMAIN_DEBUG 2018-01-24 12:32:58 +01:00
xcep_defconfig drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
zeus_defconfig ARM: configs: Cleanup old Kconfig options 2020-02-09 03:44:58 -08:00