#19149·zfs

Backport 'kernel BUG at mm/usercopy.c' fix to 2.2.x?

Author: wdoekesCreated Sep 20, 2026Updated Sep 24, 2026
LabelsType: Defect
### System information Type | Version/Name --- | --- Distribution Name | Ubuntu/Noble Distribution Version | 24.04.4 Kernel Version | 6.8.0-138-generic Architecture | amd64 OpenZFS Version | 2.2.2-0ubuntu9.5 ### Describe the problem you're observing We ran into bug #15918 when the kernel was handling an OOM task. I see the fix https://github.com/openzfs/zfs/pull/18408.patch -- which landed in 2.4.2 -- applies cleanly to 2.2.x. *Is it an option to backport that?* What do we need to get any such ball rolling? ### Describe how to reproduce the problem _Don't know how to reproduce._ ### Include any warning/errors/backtraces from the system logs

php invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=999
CPU: 9 PID: 2784589 Comm: php Tainted: P           O       6.8.0-138-generic #138-Ubuntu
Hardware name: Supermicro AS -3015MR-H8TNR/H13SRD-F, BIOS 1.9 05/12/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x76/0xa0
 dump_stack+0x10/0x20
 dump_header+0x49/0x210
 oom_kill_process+0x118/0x280
 out_of_memory+0x103/0x350
 mem_cgroup_out_of_memory+0x145/0x170
 try_charge_memcg+0x6d6/0x7d0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? vma_alloc_folio+0x7a/0xd0
 __mem_cgroup_charge+0x45/0xc0
 do_anonymous_page+0xb2/0x430
 handle_pte_fault+0x1cb/0x1d0
 __handle_mm_fault+0x654/0x790
 handle_mm_fault+0x18a/0x380
 do_user_addr_fault+0x1f5/0x670
 exc_page_fault+0x83/0x1b0
 asm_exc_page_fault+0x27/0x30
RIP: 0010:_copy_to_iter+0x98/0x590
Code: 48 89 d9 31 f6 48 01 d7 48 01 f9 40 0f 92 c6 48 85 c9 0f 88 0a 01 00 00 48 85 f6 0f 85 01 01 00 00 0f 01 cb 48 89 d9 4c 89 ee <f3> a4 0f 1f 00 0f 01 ca 49 8b 54 24 08 49 89 de 49 8b 44 24 18 49
RSP: 0018:ffffccbbee7db8e8 EFLAGS: 00050246
RAX: 0000000000025242 RBX: 0000000000020000 RCX: 0000000000006000
RDX: 0000000000000000 RSI: ffffccbc0b12c000 RDI: 000070057fbcc000
RBP: ffffccbbee7db960 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffccbbee7dbb48
R13: ffffccbc0b112000 R14: 0000000000000000 R15: ffffccbbee7dbb48
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? check_heap_object+0x118/0x1e0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? __check_object_size.part.0+0x72/0x150
 zfs_uiomove_iter+0x6e/0x100 [zfs]
 zfs_uiomove+0x34/0x60 [zfs]
 dmu_read_uio_dnode+0xbb/0x110 [zfs]
 dmu_read_uio_dbuf+0x48/0x70 [zfs]
 zfs_read+0x125/0x300 [zfs]
 zpl_iter_read+0xbc/0x130 [zfs]
 vfs_read+0x205/0x3a0
 ksys_read+0x73/0x100
 __x64_sys_read+0x19/0x30
 x64_sys_call+0x1bf0/0x25a0
 do_syscall_64+0x87/0x180
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? filemap_map_pages+0x43d/0x520
 ? arch_exit_to_user_mode_prepare.isra.0+0x1a/0xe0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? do_read_fault+0x112/0x200
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? do_fault+0xf0/0x260
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? handle_pte_fault+0x114/0x1d0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? __handle_mm_fault+0x654/0x790
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? __count_memcg_events+0x6b/0x120
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? count_memcg_events.constprop.0+0x2a/0x50
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? handle_mm_fault+0xad/0x380
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? arch_exit_to_user_mode_prepare.isra.0+0x1a/0xe0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? irqentry_exit_to_user_mode+0x38/0x1e0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? irqentry_exit+0x43/0x50
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? exc_page_fault+0x94/0x1b0
 entry_SYSCALL_64_after_hwframe+0x78/0x80
RIP: 0033:0x70059424a8f3
Code: Unable to access opcode bytes at 0x70059424a8c9.
RSP: 002b:00007ffff0f58b68 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000700594287b28 RCX: 000070059424a8f3
RDX: 0000000000025242 RSI: 000070057fbb2000 RDI: 0000000000000048
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007005825aaee0 R14: 0000000000025242 R15: 0000000000025242
 </TASK>
memory: usage 262144kB, limit 262144kB, failcnt 15096780
swap: usage 0kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod3015e4bc_2688_43c1_bcbe_a918dd63b8b9.slice:
anon 266657792
file 0
kernel 1777664
kernel_stack 32768
pagetables 729088
sec_pagetables 0
percpu 140624
sock 0
vmalloc 24576
shmem 0
zswap 0
zswapped 0
file_mapped 0
file_dirty 0
file_writeback 0
swapcached 0
anon_thp 0
file_thp 0
shmem_thp 0
inactive_anon 18235392
active_anon 248422400
inactive_file 0
active_file 0
unevictable 0
slab_reclaimable 318224
slab_unreclaimable 505096
slab 823320
workingset_refault_anon 0
workingset_refault_file 17972473
workingset_activate_anon 0
workingset_activate_file 8898586
workingset_restore_anon 0
workingset_restore_file 8898586
workingset_nodereclaim 0
pgscan 28882779
pgsteal 18084778
pgscan_kswapd 0
pgscan_direct 28882779
pgscan_khugepaged 0
pgsteal_kswapd 0
pgsteal_direct 18084778
pgsteal_khugepaged 0
pgfault 19880594
pgmajfault 18086834
pgrefill 8400651
pgactivate 10918552
pgdeactivate 0
pglazyfree 0
pglazyfreed 0
zswpin 0
zswpout 0
zswpwb 0
thp_fault_alloc 0
thp_collapse_alloc 0
thp_swpout 0
thp_swpout_fallback 0
Tasks state (memory values in pages):
[  pid  ]   uid  tgid total_vm      rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name
[1802327]  1000 1802327      255        0        0        0         0    28672        0          -998 pause
[2784589]  1000 2784589    83481    64518    64518        0         0   700416        0           999 php
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=cri-containerd-2d4d65c14da0bd924a573a50a977071aa74c3b6e48de13b8e0c7fe7781dbc493.scope,mems_allowed=0,oom_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod3015e4bc_2688_43c1_bcbe_a918dd63b8b9.slice,task_memcg=/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod3015e4bc_2688_43c1_bcbe_a918dd63b8b9.slice/cri-containerd-2d4d65c14da0bd924a573a50a977071aa74c3b6e48de13b8e0c7fe7781dbc493.scope,task=php,pid=2784589,uid=1000
Memory cgroup out of memory: Killed process 2784589 (php) total-vm:333924kB, anon-rss:258072kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:684kB oom_score_adj:999
Tasks in /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod3015e4bc_2688_43c1_bcbe_a918dd63b8b9.slice/cri-containerd-2d4d65c14da0bd924a573a50a977071aa74c3b6e48de13b8e0c7fe7781dbc493.scope are going to be killed due to memory.oom.group set
Memory cgroup out of memory: Killed process 2784589 (php) total-vm:333924kB, anon-rss:258072kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:684kB oom_score_adj:999
usercopy: Kernel memory exposure attempt detected from vmalloc 'no area' (offset 0, size 21058)!
Cheers, Walter Doekes OSSO B.V. `Ubuntu-Bug:` [`lp#2168414`](https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/2168414)