Bug 219988
Summary: | UBSAN: shift-out-of-bounds in xprt_calc_majortimeo | ||
---|---|---|---|
Product: | File System | Reporter: | wangzhaolong1 |
Component: | NFS | Assignee: | Trond Myklebust (trondmy) |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
wangzhaolong1
2025-04-07 10:10:45 UTC
This problem can be easily reproduced by running the following command: Ensure that UDP support is enabled for NFS server. # grep udp= /etc/nfs.conf udp=y Run the following command: mount -t nfs 127.0.0.1:/s_test /mnt -o vers=3,proto=udp,retrans=101 [ 96.658260] ------------[ cut here ]------------ [ 96.658984] UBSAN: shift-out-of-bounds in net/sunrpc/xprt.c:660:14 [ 96.659902] shift exponent 101 is too large for 64-bit type 'long unsigned int' [ 96.660983] CPU: 2 UID: 0 PID: 791 Comm: mount.nfs Not tainted 6.15.0-rc1+ #225 PREEMPT(undef) [ 96.660988] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014 [ 96.660990] Call Trace: [ 96.661007] <TASK> [ 96.661021] dump_stack_lvl+0x53/0x70 [ 96.661035] __ubsan_handle_shift_out_of_bounds+0x16a/0x320 [ 96.661048] ? d_instantiate+0x41/0x60 [ 96.661054] ? debugfs_create_symlink+0xde/0x150 [ 96.661059] xprt_init_majortimeo.cold+0x11/0x20 [sunrpc] [ 96.661170] xprt_request_init+0xbe/0x110 [sunrpc] [ 96.661232] ? __pfx_call_reserve+0x10/0x10 [sunrpc] [ 96.661271] __rpc_execute+0xa6/0x300 [sunrpc] [ 96.661351] rpc_execute+0x12f/0x150 [sunrpc] [ 96.661410] rpc_run_task+0x103/0x160 [sunrpc] [ 96.661475] rpc_call_null_helper+0x96/0xc0 [sunrpc] [ 96.661523] rpc_ping+0x2d/0x50 [sunrpc] [ 96.661570] rpc_create_xprt+0x12b/0x180 [sunrpc] [ 96.661617] rpc_create+0x152/0x290 [sunrpc] [ 96.661664] ? finish_task_switch.isra.0+0x21c/0x2d0 [ 96.661670] ? kmem_cache_free+0x356/0x400 [ 96.661674] ? finish_task_switch.isra.0+0x21c/0x2d0 [ 96.661676] ? __schedule+0x2fb/0x870 [ 96.661680] ? ttwu_queue_wakelist+0x10c/0x190 [ 96.661683] nfs_mount+0x150/0x2e0 [nfs] [ 96.661757] nfs_request_mount.constprop.0.isra.0+0x16d/0x240 [nfs] [ 96.661794] nfs_try_mount_request+0x73/0x320 [nfs] [ 96.661826] ? find_nfs_version+0x4a/0xe0 [nfs] [ 96.661857] nfs_try_get_tree+0x5e/0x60 [nfs] [ 96.661888] vfs_get_tree+0x29/0xf0 [ 96.661893] do_new_mount+0x180/0x310 [ 96.661897] __x64_sys_mount+0x103/0x140 [ 96.661900] do_syscall_64+0x5f/0x170 [ 96.661904] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 96.661908] RIP: 0033:0x7f01dcead21e [ 96.661912] Code: 48 8b 0d 5d 1c 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2a 1c 0c 00 f7 d8 64 89 01 48 [ 96.661914] RSP: 002b:00007ffd0b70f698 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 [ 96.661917] RAX: ffffffffffffffda RBX: 00007ffd0b70f890 RCX: 00007f01dcead21e [ 96.661918] RDX: 000056090e41fd90 RSI: 000056090e41fde0 RDI: 000056090e41fb70 [ 96.661919] RBP: 000056090e421bf0 R08: 000056090e423180 R09: fefeff37332f2f31 [ 96.661920] R10: 0000000000000000 R11: 0000000000000246 R12: 000056090e423180 [ 96.661921] R13: 00007f01dcaf44c8 R14: 00005608f7bdc940 R15: 00007ffd0b70f890 [ 96.661923] </TASK> [ 96.694790] ---[ end trace ]--- |