linux/drivers/mtd
Linus Torvalds e0d5fa9ae4 ubi: use put_user() when filling the erase counter array
ubi_get_ec_info() checks the user's erase_counters array with
access_ok() and then fills it one entry at a time with __put_user(),
taking the wear-leveling lock for each entry in between.  Each of those
accesses enables and disables user access on its own, so the up-front
check saves nothing.

Use put_user().  The access_ok() stays, so a bad array still fails
before anything is written.

This is part of getting rid of __get_user() and __put_user() entirely.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-10-19 19:24:03 -10:00
..
chips mtd: cfi_cmdset_0001: shrink do_write_buffer() stack frame 2026-09-04 19:13:21 +02:00
devices mtd: mtd_intel_dg: reset poll counter for each erase 2026-09-04 20:32:21 +02:00
hyperbus mtd: hyperbus: hbmc-am654: drop unused module alias 2025-09-29 18:02:30 +02:00
lpddr Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
maps * Raw NAND changes 2026-08-23 09:11:21 -07:00
nand mtd: spinand: Do not update the QE bit on devices without one 2026-09-25 16:53:51 +02:00
parsers * Raw NAND changes 2026-08-23 14:30:31 +02:00
spi-nor mtd: spi-nor: core: Fix mutex leak in spi_nor_rww_start_exclusive() 2026-09-14 15:37:24 +02:00
tests Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ubi ubi: use put_user() when filling the erase counter array 2026-10-19 19:24:03 -10:00
ftl.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
inftlcore.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
inftlmount.c mtd: inftlmount: convert printk(KERN_WARNING) to pr_warn 2026-05-27 11:11:10 +02:00
Kconfig mtd: Add driver for concatenating devices 2026-02-25 17:34:20 +01:00
Makefile mtd: Add driver for concatenating devices 2026-02-25 17:34:20 +01:00
mtd_blkdevs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtd_virt_concat.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mtdblock_ro.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtdblock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtdchar.c mtdchar: replace deprecated mmap hook with mmap_prepare, clean up 2026-04-05 13:53:44 -07:00
mtdconcat.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mtdcore.c mtd: core: call _get_device() with the master MTD 2026-09-04 19:11:26 +02:00
mtdcore.h Revert "mtd: core: always create master device" 2025-06-18 11:18:23 +02:00
mtdoops.c mtd: mtdoops: free page bitmap when the backing MTD is removed 2026-07-17 17:49:27 +02:00
mtdpart.c * Raw NAND changes 2026-08-23 09:11:21 -07:00
mtdpstore.c mtd: Add check for devm_kcalloc() 2025-03-04 12:07:08 +01:00
mtdsuper.c mtd: mtdsuper: replace simple_strtoul with kstrtouint 2026-04-27 15:12:59 +02:00
mtdswap.c * Raw NAND changes 2026-08-23 09:11:21 -07:00
nftlcore.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nftlmount.c
rfd_ftl.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
sm_ftl.c mtd: sm_ftl: allocate cis_buffer with main struct 2026-05-04 15:50:47 +02:00
sm_ftl.h mtd: sm_ftl: allocate cis_buffer with main struct 2026-05-04 15:50:47 +02:00
ssfdc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00