Vlastimil Babka
a79e49e170
mm/mempool: fix poisoning order>0 pages with HIGHMEM
commit ec33b59542 upstream.
The kernel test has reported:
BUG: unable to handle page fault for address: fffba000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
*pde = 03171067 *pte = 00000000
Oops: Oops: 0002 [#1]
CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Tainted: G T 6.18.0-rc2-00031-gec7f31b2a2d3 #1 NONE a1d066dfe789f54bc7645c7989957d2bdee593ca
Tainted: [T]=RANDSTRUCT
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
EIP: memset (arch/x86/include/asm/string_32.h:168 arch/x86/lib/memcpy_32.c:17)
Code: a5 8b 4d f4 83 e1 03 74 02 f3 a4 83 c4 04 5e 5f 5d 2e e9 73 41 01 00 90 90 90 3e 8d 74 26 00 55 89 e5 57 56 89 c6 89 d0 89 f7 <f3> aa 89 f0 5e 5f 5d 2e e9 53 41 01 00 cc cc cc 55 89 e5 53 57 56
EAX: 0000006b EBX: 00000015 ECX: 001fefff EDX: 0000006b
ESI: fffb9000 EDI: fffba000 EBP: c611fbf0 ESP: c611fbe8
DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010287
CR0: 80050033 CR2: fffba000 CR3: 0316e000 CR4: 00040690
Call Trace:
poison_element (mm/mempool.c:83 mm/mempool.c:102)
mempool_init_node (mm/mempool.c:142 mm/mempool.c:226)
mempool_init_noprof (mm/mempool.c:250 (discriminator 1))
? mempool_alloc_pages (mm/mempool.c:640)
bio_integrity_initfn (block/bio-integrity.c:483 (discriminator 8))
? mempool_alloc_pages (mm/mempool.c:640)
do_one_initcall (init/main.c:1283)
Christoph found out this is due to the poisoning code not dealing
properly with CONFIG_HIGHMEM because only the first page is mapped but
then the whole potentially high-order page is accessed.
We could give up on HIGHMEM here, but it's straightforward to fix this
with a loop that's mapping, poisoning or checking and unmapping
individual pages.
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202511111411.9ebfa1ba-lkp@intel.com
Analyzed-by: Christoph Hellwig <hch@lst.de>
Fixes: bdfedb76f4 ("mm, mempool: poison elements backed by slab allocator")
Cc: stable@vger.kernel.org
Tested-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251113-mempool-poison-v1-1-233b3ef984c3@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-12-01 11:45:41 +01:00
..
2025-11-24 10:37:44 +01:00
2025-09-08 23:45:11 -07:00
2025-07-23 11:55:22 +02:00
2025-11-24 10:37:44 +01:00
2025-04-05 10:30:12 +02:00
2025-08-19 16:35:57 -07:00
2025-03-16 22:06:27 -07:00
2025-07-24 19:12:36 -07:00
2025-03-16 22:06:24 -07:00
2025-07-24 19:12:36 -07:00
2025-05-22 14:55:36 -07:00
2025-07-13 16:38:30 -07:00
2025-05-12 23:50:38 -07:00
2025-08-19 16:35:54 -07:00
2025-07-24 19:12:35 -07:00
2024-07-03 19:29:58 -07:00
2025-07-01 13:25:36 -06:00
2025-01-13 22:40:59 -08:00
2025-08-02 12:06:13 -07:00
2024-11-03 01:28:06 -05:00
2024-09-01 20:43:33 -07:00
2024-09-01 20:43:33 -07:00
2025-11-24 10:37:50 +01:00
2025-03-04 17:02:25 +00:00
2025-09-13 13:05:36 -07:00
2024-07-03 19:30:06 -07:00
2025-07-19 18:59:53 -07:00
2025-11-24 10:37:50 +01:00
2025-03-17 00:05:35 -07:00
2025-05-12 23:50:35 -07:00
2025-03-16 22:06:31 -07:00
2025-07-09 22:42:05 -07:00
2025-03-16 22:06:29 -07:00
2025-10-19 16:37:38 +02:00
2024-07-03 19:29:58 -07:00
2025-03-16 22:06:20 -07:00
2025-08-05 16:02:07 +03:00
2025-03-16 22:06:23 -07:00
2025-08-02 12:06:10 -07:00
2025-03-17 00:05:32 -07:00
2025-09-03 17:10:35 -07:00
2025-09-01 17:11:37 -07:00
2025-11-24 10:37:42 +01:00
2025-07-09 22:41:56 -07:00
2025-07-09 22:42:22 -07:00
2025-08-02 12:06:09 -07:00
2025-08-02 12:06:10 -07:00
2025-07-09 22:42:17 -07:00
2025-08-26 10:47:03 +03:00
2025-05-22 14:55:38 -07:00
2025-03-21 22:03:11 -07:00
2025-10-19 16:37:00 +02:00
2025-07-19 18:59:57 -07:00
2025-09-03 17:10:35 -07:00
2025-09-08 23:45:11 -07:00
2025-07-13 16:38:15 -07:00
2025-11-24 10:37:50 +01:00
2025-07-19 18:59:45 -07:00
2025-12-01 11:45:41 +01:00
2025-07-13 16:38:17 -07:00
2024-03-13 12:12:21 -07:00
2025-10-29 14:10:32 +01:00
2025-10-29 14:10:32 +01:00
2025-08-02 12:06:10 -07:00
2025-09-13 13:05:36 -07:00
2025-11-24 10:37:44 +01:00
2025-08-02 12:06:11 -07:00
2025-07-31 14:57:54 -07:00
2025-05-31 22:46:12 -07:00
2025-05-12 23:50:31 -07:00
2024-09-01 20:25:55 -07:00
2025-08-11 23:00:59 -07:00
2025-11-24 10:37:44 +01:00
2025-08-02 12:06:09 -07:00
2025-08-05 16:02:07 +03:00
2025-08-20 16:31:23 +03:00
2025-08-20 16:31:23 +03:00
2025-05-12 23:50:38 -07:00
2025-03-16 22:05:55 -07:00
2025-10-19 16:37:38 +02:00
2025-03-17 00:05:35 -07:00
2025-07-13 16:38:16 -07:00
2025-01-13 22:40:31 -08:00
2025-06-17 10:44:15 +02:00
2025-07-09 22:41:58 -07:00
2025-07-13 16:38:29 -07:00
2025-10-29 14:10:21 +01:00
2024-01-08 15:27:15 -08:00
2025-05-09 13:43:07 +01:00
2025-07-09 22:42:17 -07:00
2025-07-19 18:59:47 -07:00
2025-07-09 22:42:17 -07:00
2024-07-10 12:14:54 -07:00
2025-07-13 16:38:23 -07:00
2024-04-25 20:55:49 -07:00
2025-09-08 23:45:10 -07:00
2025-07-09 22:42:17 -07:00
2024-11-05 16:56:23 -08:00
2025-01-13 22:40:48 -08:00
2025-07-09 22:42:20 -07:00
2025-07-19 18:59:53 -07:00
2025-08-02 12:06:10 -07:00
2025-01-13 22:40:38 -08:00
2025-11-24 10:37:43 +01:00
2024-09-01 20:25:45 -07:00
2025-12-01 11:45:36 +01:00
2025-07-19 18:59:47 -07:00
2025-03-17 00:05:40 -07:00
2024-10-31 20:27:04 -07:00
2024-01-08 15:27:15 -08:00
2025-05-12 23:50:31 -07:00
2025-10-19 16:37:37 +02:00
2025-11-24 10:37:45 +01:00
2025-08-27 22:45:44 -07:00
2025-08-27 22:45:43 -07:00
2025-03-17 22:06:58 -07:00
2025-11-24 10:37:44 +01:00
2025-09-13 13:05:36 -07:00
2025-07-09 22:41:58 -07:00
2025-10-06 11:20:05 +02:00
2025-11-24 10:37:50 +01:00
2025-02-28 11:51:31 -08:00
2025-08-27 22:45:41 -07:00
2025-10-19 16:37:25 +02:00
2025-07-09 22:42:11 -07:00
2025-05-22 14:55:37 -07:00
2025-01-13 22:40:42 -08:00
2025-08-05 16:02:07 +03:00
2025-08-02 12:06:09 -07:00
2025-09-08 23:45:11 -07:00
2025-07-24 19:12:32 -07:00
2025-09-13 13:05:36 -07:00
2025-07-19 18:59:47 -07:00
2025-05-12 23:50:44 -07:00
2025-07-13 16:38:30 -07:00
2025-05-11 17:48:06 -07:00
2025-10-29 14:10:32 +01:00
2025-07-09 22:41:57 -07:00