In the Linux kernel, the following vulnerability has been resolved:
KVM: x86/mmu: Check write tracking in all address spaces
kvmgfniswritetracked() checks only the supplied memslot, but page tracking is per-address-space and shadow pages are shared across all address spaces. With SMM, a GFN can therefore be write-tracked in one address space and appear untracked through the other.
Check the supplied slot first, then the slot for the other address space. This ensures all callers honor write tracking regardless of the active address space. In particular, it prevents mmutrytounsyncpages() from marking an upper-level shadow page unsync and eventually triggering the BUG in ptelistremove().
[invert direction of the conditional. - Paolo]
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu/vce: Prevent partial address patches
In the case that only one of lo/hi is valid, the patching could result in a bad address written to in FW.
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: zero-initialize GART table on allocation
GART TLB is flushed after unmapping but not after mapping. Since amdgpubocreatekernel() does not zero-initialize the buffer, when a single PTE is written the TLB may speculatively load other uninitialized entries from the same cacheline. Those garbage entries can appear valid, and a subsequent write to another PTE in the same cacheline may cause the GPU to use a stale garbage PTE from the TLB.
Fix this by calling memsetio() to zero-initialize the GART table with gartpteflags immediately after allocation.
Using AMDGPUGEMCREATEVRAMCLEARED, SDMA-based clear will not work since SDMA needs GART to be initialized to work.
(cherry picked from commit d9af8263b82b6eaa60c5718e0c6631c5037e4b24)
In the Linux kernel, the following vulnerability has been resolved:
ipvs: clear the svc scheduler ptr early on edit
ipvseditservice() while unbinding the old scheduler clears the svc->scheduler ptr after the scheduler module initiates RCU callbacks. This can cause packets to use the old scheduler at the time when svc->scheddata is already freed after RCU grace period.
Fix it by clearing the ptr early in ipvsunbindscheduler(), before the doneservice method schedules any RCU callbacks.
Also, if the new scheduler fails to initialize when replacing the old scheduler, try to restore the old scheduler while still returning the error code.
In the Linux kernel, the following vulnerability has been resolved:
ibmveth: Disable GSO for packets with small MSS
In the Linux kernel, the following vulnerability has been resolved:
power: supply: rt9455: Fix use-after-free in powersupplychanged()
Using the devm variant for requesting IRQ before the devm variant for allocating/registering the powersupply handle, means that the powersupply handle will be deallocated/unregistered before the interrupt handler (since devm naturally deallocates in reverse allocation order). This means that during removal, there is a race condition where an interrupt can fire just after the powersupply handle has been freed, but just before the corresponding unregistration of the IRQ handler has run.
This will lead to the IRQ handler calling powersupplychanged() with a freed powersupply handle. Which usually crashes the system or otherwise silently corrupts the memory...
Note that there is a similar situation which can also happen during probe(); the possibility of an interrupt firing before registering the powersupply handle. This would then lead to the nasty situation of using the powersupply handle uninitialized in powersupplychanged().
Fix this racy use-after-free by making sure the IRQ is requested after the registration of the powersupply handle.
drm/amdgpu: Add bounds checking to ib{get,set}value
In the Linux kernel, the following vulnerability has been resolved:
lib/crypto: chacha: Zeroize permutedstate before it leaves scope
Since the ChaCha permutation is invertible, the local variable 'permutedstate' is sufficient to compute the original 'state', and thus the key, even after the permutation has been done.
While the kernel is quite inconsistent about zeroizing secrets on the stack (and some prominent userspace crypto libraries don't bother at all since it's not guaranteed to work anyway), the kernel does try to do it as a best practice, especially in cases involving the RNG.
Thus, explicitly zeroize 'permutedstate' before it goes out of scope.
In the Linux kernel, the following vulnerability has been resolved:
wifi: wilc1000: fix u8 overflow in SSID scan buffer size calculation
The variable valuesize is declared as u8 but accumulates the total length of all SSIDs to scan. Each SSID contributes up to 33 bytes (IEEE80211MAXSSIDLEN + 1), and with WILCMAXNUMPROBEDSSID (10) SSIDs the total can reach 330, which wraps around to 74 when stored in a u8.
This causes kmalloc to allocate only 75 bytes while the subsequent memcpy writes up to 331 bytes into the buffer, resulting in a 256-byte heap buffer overflow.
Widen valuesize from u8 to u32 to accommodate the full range.
In the Linux kernel, the following vulnerability has been resolved:
usb: ulpi: fix double free in ulpiregisterinterface() error path
When deviceregister() fails, ulpiregister() calls putdevice() on ulpi->dev.
The device release callback ulpidevrelease() drops the OF node reference and frees ulpi, but the current error path in ulpiregisterinterface() then calls kfree(ulpi) again, causing a double free.
Let putdevice() handle the cleanup through ulpidevrelease() and avoid freeing ulpi again in ulpiregisterinterface().
In the Linux kernel, the following vulnerability has been resolved:
mtd: rawnand: brcmnand: Fix potential out-of-bounds access in oob write
When the oob buffer length is not in multiple of words, the oob write function does out-of-bounds read on the oob source buffer at the last iteration. Fix that by always checking length limit on the oob buffer read and fill with 0xff when reaching the end of the buffer to the oob registers.
In the Linux kernel, the following vulnerability has been resolved:
wifi: wilc1000: avoid buffer overflow in WID string configuration
Fix the following copy overflow warning identified by Smatch checker.
drivers/net/wireless/microchip/wilc1000/wlancfg.c:184 wilcwlanparseresponseframe() error: 'memcpy()' 'cfg->s[i]->str' copy overflow (512 vs 65537)
This patch introduces size check before accessing the memory buffer. The checks are base on the WID type of received data from the firmware. For WID string configuration, the size limit is determined by individual element size in 'struct wilccfgstrvals' that is maintained in 'len' field of 'struct wilccfgstr'.
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu/gfx: disable gfx9 cpeccerrorirq only when enabling legacy gfx ras
gfx9 cpeccerrorirq is only enabled when legacy gfx ras is assert. So in gfxv90hwfini, interrupt disablement for cpeccerrorirq should be executed under such condition, otherwise, an amdgpuirqput calltrace will occur.
[ 7283.170322] RIP: 0010:amdgpuirqput+0x45/0x70 [amdgpu] [ 7283.170964] RSP: 0018:ffff9a5fc3967d00 EFLAGS: 00010246 [ 7283.170967] RAX: ffff98d88afd3040 RBX: ffff98d89da20000 RCX: 0000000000000000 [ 7283.170969] RDX: 0000000000000000 RSI: ffff98d89da2bef8 RDI: ffff98d89da20000 [ 7283.170971] RBP: ffff98d89da20000 R08: ffff98d89da2ca18 R09: 0000000000000006 [ 7283.170973] R10: ffffd5764243c008 R11: 0000000000000000 R12: 0000000000001050 [ 7283.170975] R13: ffff98d89da38978 R14: ffffffff999ae15a R15: ffff98d880130105 [ 7283.170978] FS: 0000000000000000(0000) GS:ffff98d996f00000(0000) knlGS:0000000000000000 [ 7283.170981] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7283.170983] CR2: 00000000f7a9d178 CR3: 00000001c42ea000 CR4: 00000000003506e0 [ 7283.170986] Call Trace: [ 7283.170988] <TASK> [ 7283.170989] gfxv90hwfini+0x1c/0x6d0 [amdgpu] [ 7283.171655] amdgpudeviceipsuspendphase2+0x101/0x1a0 [amdgpu] [ 7283.172245] amdgpudevicesuspend+0x103/0x180 [amdgpu] [ 7283.172823] amdgpupmopsfreeze+0x21/0x60 [amdgpu] [ 7283.173412] pcipmfreeze+0x54/0xc0 [ 7283.173419] ? pfxpcipmfreeze+0x10/0x10 [ 7283.173425] dpmruncallback+0x98/0x200 [ 7283.173430] devicesuspend+0x164/0x5f0
v2: drop gfx11 as it's fixed in a different solution by retiring cpeccirq funcs(Hawking)
fs: writeback: fix use-after-free in markinodedirty()
drm/amdgpu: SDMA update use unlocked iterator
In the Linux kernel, the following vulnerability has been resolved:
staging: vmeuser: Fix possible UAF in tsi148dmalistadd
Smatch report warning as follows:
drivers/staging/vmeuser/vmetsi148.c:1757 tsi148dmalistadd() warn: '&entry->list' not removed from list
In tsi148dmalistadd(), the error path "goto errdma" will not remove entry->list from list->entries, but entry will be freed, then list traversal may cause UAF.
Fix by removeing it from list->entries before free().
In the Linux kernel, the following vulnerability has been resolved:
NFC: nci: uart: Set tty->discdata only in success path
Setting tty->discdata before opening the NCI device means we need to clean it up on error paths. This also opens some short window if device starts sending data, even before NCIUARTSETDRIVER IOCTL succeeded (broken hardware?). Close the window by exposing tty->discdata only on the success path, when opening of the NCI device and trymoduleget() succeeds.
The code differs in error path in one aspect: tty->discdata won't be ever assigned thus NULL-ified. This however should not be relevant difference, because of "tty->discdata=NULL" in nciuartttyopen().
In the Linux kernel, the following vulnerability has been resolved:
mtk-sd: Prevent memory corruption from DMA map failure
If msdcpreparedata() fails to map the DMA region, the request is not prepared for data receiving, but msdcstartdata() proceeds the DMA with previous setting. Since this will lead a memory corruption, we have to stop the request operation soon after the msdcpreparedata() fails to prepare it.
In the Linux kernel, the following vulnerability has been resolved:
tcp: cdg: allow tcpcdgrelease() to be called multiple times
Apparently, mptcp is able to call tcpdisconnect() on an already disconnected flow. This is generally fine, unless current congestion control is CDG, because it might trigger a double-free [1]
Instead of fixing MPTCP, and future bugs, we can make tcpdisconnect() more resilient.
[1] BUG: KASAN: double-free in slabfree mm/slub.c:3539 [inline] BUG: KASAN: double-free in kfree+0xe2/0x580 mm/slub.c:4567
CPU: 0 PID: 3645 Comm: kworker/0:7 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: events mptcpworker Call Trace: <TASK> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0xcd/0x134 lib/dumpstack.c:106 printaddressdescription mm/kasan/report.c:317 [inline] printreport.cold+0x2ba/0x719 mm/kasan/report.c:433 kasanreportinvalidfree+0x81/0x190 mm/kasan/report.c:462 kasanslabfree+0x18b/0x1c0 mm/kasan/common.c:356 kasanslabfree include/linux/kasan.h:200 [inline] slabfreehook mm/slub.c:1759 [inline] slabfreefreelisthook+0x8b/0x1c0 mm/slub.c:1785 slabfree mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 tcpdisconnect+0x980/0x1e20 net/ipv4/tcp.c:3145 mptcpclosessk+0x5ca/0x7e0 net/mptcp/protocol.c:2327 mptcpdofastclose net/mptcp/protocol.c:2592 [inline] mptcpworker+0x78c/0xff0 net/mptcp/protocol.c:2627 processonework+0x991/0x1610 kernel/workqueue.c:2289 workerthread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 retfromfork+0x1f/0x30 arch/x86/entry/entry64.S:306 </TASK>
Allocated by task 3671: kasansavestack+0x1e/0x40 mm/kasan/common.c:38 kasansettrack mm/kasan/common.c:45 [inline] setallocinfo mm/kasan/common.c:437 [inline] kasankmalloc mm/kasan/common.c:516 [inline] kasankmalloc mm/kasan/common.c:475 [inline] kasankmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmallocarray include/linux/slab.h:640 [inline] kcalloc include/linux/slab.h:671 [inline] tcpcdginit+0x10d/0x170 net/ipv4/tcpcdg.c:380 tcpinitcongestioncontrol+0xab/0x550 net/ipv4/tcpcong.c:193 tcpreinitcongestioncontrol net/ipv4/tcpcong.c:217 [inline] tcpsetcongestioncontrol+0x96c/0xaa0 net/ipv4/tcpcong.c:391 dotcpsetsockopt+0x505/0x2320 net/ipv4/tcp.c:3513 tcpsetsockopt+0xd4/0x100 net/ipv4/tcp.c:3801 mptcpsetsockopt+0x35f/0x2570 net/mptcp/sockopt.c:844 syssetsockopt+0x2d6/0x690 net/socket.c:2252 dosyssetsockopt net/socket.c:2263 [inline] sesyssetsockopt net/socket.c:2260 [inline] x64syssetsockopt+0xba/0x150 net/socket.c:2260 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x63/0xcd
Freed by task 16: kasansavestack+0x1e/0x40 mm/kasan/common.c:38 kasansettrack+0x21/0x30 mm/kasan/common.c:45 kasansetfreeinfo+0x20/0x30 mm/kasan/generic.c:370 kasanslabfree mm/kasan/common.c:367 [inline] kasanslabfree+0x166/0x1c0 mm/kasan/common.c:329 kasanslabfree include/linux/kasan.h:200 [inline] slabfreehook mm/slub.c:1759 [inline] slabfreefreelisthook+0x8b/0x1c0 mm/slub.c:1785 slabfree mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 tcpcleanupcongestioncontrol+0x70/0x120 net/ipv4/tcpcong.c:226 tcpv4destroysock+0xdd/0x750 net/ipv4/tcpipv4.c:2254 tcpv6destroysock+0x11/0x20 net/ipv6/tcpipv6.c:1969 inetcskdestroysock+0x196/0x440 net/ipv4/inetconnectionsock.c:1157 tcpdone+0x23b/0x340 net/ipv4/tcp.c:4649 tcprcvstateprocess+0x40e7/0x4990 net/ipv4/tcpinput.c:6624 tcpv6dorcv+0x3fc/0x13c0 net/ipv6/tcpipv6.c:1525 tcpv6rcv+0x2e8e/0x3830 net/ipv6/tcpipv6.c:1759 ip6protocoldeliverrcu+0x2db/0x1950 net/ipv6/ip6input.c:439 ip6inputfinish+0x14c/0x2c0 net/ipv6/ip6input.c:484 NFHOOK include/linux/netfilter.h:302 [inline] NFHOOK include/linux/netfilter.h:296 [inline] ip6input+0x9c/0xd ---truncated---
geneve: Fix use-after-free in genevefinddev().
In the Linux kernel, the following vulnerability has been resolved:
i40e: Fix call trace in setuptxdescriptors
After PF reset and ethtool -t there was call trace in dmesg sometimes leading to panic. When there was some time, around 5 seconds, between reset and test there were no errors.
Problem was that pf reset calls i40evsiclose in prepforreset and ethtool -t calls i40evsiclose in diagtest. If there was not enough time between those commands the second i40evsiclose starts before previous i40evsiclose was done which leads to crash.
Add check to diagtest if pf is in reset and don't start offline tests if it is true. Add netifinfo("testing failed") into unhappy path of i40ediagtest()
In the Linux kernel, the following vulnerability has been resolved:
sfc: fix use after free when disabling sriov
Use after free is detected by kfence when disabling sriov. What was read after being freed was vf->pcidev: it was freed from pcidisablesriov and later read in efxef10sriovfreevfvports, called from efxef10sriovfreevfvswitching.
Set the pointer to NULL at release time to not trying to read it later.
Reproducer and dmesg log (note that kfence doesn't detect it every time): $ echo 1 > /sys/class/net/enp65s0f0np0/device/sriovnumvfs $ echo 0 > /sys/class/net/enp65s0f0np0/device/sriovnumvfs
BUG: KFENCE: use-after-free read in efxef10sriovfreevfvswitching+0x82/0x170 [sfc]
Use-after-free read at 0x00000000ff3c1ba5 (in kfence-#224): efxef10sriovfreevfvswitching+0x82/0x170 [sfc] efxef10pcisriovdisable+0x38/0x70 [sfc] efxpcisriovconfigure+0x24/0x40 [sfc] sriovnumvfsstore+0xfe/0x140 kernfsfopwriteiter+0x11c/0x1b0 newsyncwrite+0x11f/0x1b0 vfswrite+0x1eb/0x280 ksyswrite+0x5f/0xe0 dosyscall64+0x5c/0x80 entrySYSCALL64afterhwframe+0x44/0xae
kfence-#224: 0x00000000edb8ef95-0x00000000671f5ce1, size=2792, cache=kmalloc-4k
allocated by task 6771 on cpu 10 at 3137.860196s: pciallocdev+0x21/0x60 pciiovaddvirtfn+0x2a2/0x320 sriovenable+0x212/0x3e0 efxef10sriovconfigure+0x67/0x80 [sfc] efxpcisriovconfigure+0x24/0x40 [sfc] sriovnumvfsstore+0xba/0x140 kernfsfopwriteiter+0x11c/0x1b0 newsyncwrite+0x11f/0x1b0 vfswrite+0x1eb/0x280 ksyswrite+0x5f/0xe0 dosyscall64+0x5c/0x80 entrySYSCALL64afterhwframe+0x44/0xae
freed by task 6771 on cpu 12 at 3170.991309s: devicerelease+0x34/0x90 kobjectcleanup+0x3a/0x130 pciiovremovevirtfn+0xd9/0x120 sriovdisable+0x30/0xe0 efxef10pcisriovdisable+0x57/0x70 [sfc] efxpcisriovconfigure+0x24/0x40 [sfc] sriovnumvfsstore+0xfe/0x140 kernfsfopwriteiter+0x11c/0x1b0 newsyncwrite+0x11f/0x1b0 vfswrite+0x1eb/0x280 ksyswrite+0x5f/0xe0 dosyscall64+0x5c/0x80 entrySYSCALL64afterhwframe+0x44/0xae
In the Linux kernel, the following vulnerability has been resolved:
tipc: Fix use-after-free of kernel socket in cleanupbearer().
syzkaller reported a use-after-free of UDP kernel socket in cleanupbearer() without repro. [0][1]
When bearerdisable() calls tipcudpdisable(), cleanup of the UDP kernel socket is deferred by work calling cleanupbearer().
tipcexitnet() waits for such works to finish by checking tipcnet(net)->wqcount. However, the work decrements the count too early before releasing the kernel socket, unblocking cleanupnet() and resulting in use-after-free.
Let's move the decrement after releasing the socket in cleanupbearer().
[0]: reftracker: net notrefcnt@000000009b3d1faf has 1/1 users at skalloc+0x438/0x608 inetcreate+0x4c8/0xcb0 sockcreate+0x350/0x6b8 sockcreatekern+0x58/0x78 udpsockcreate4+0x68/0x398 udpsockcreate+0x88/0xc8 tipcudpenable+0x5e8/0x848 tipcnlbearerenable+0x84c/0xed8 tipcnlbearerenable+0x38/0x60 genlfamilyrcvmsgdoit+0x170/0x248 genlrcvmsg+0x400/0x5b0 netlinkrcvskb+0x1dc/0x398 genlrcv+0x44/0x68 netlinkunicast+0x678/0x8b0 netlinksendmsg+0x5e4/0x898 syssendmsg+0x500/0x830
[1]: BUG: KMSAN: use-after-free in udphashslot include/net/udp.h:85 [inline] BUG: KMSAN: use-after-free in udplibunhash+0x3b8/0x930 net/ipv4/udp.c:1979 udphashslot include/net/udp.h:85 [inline] udplibunhash+0x3b8/0x930 net/ipv4/udp.c:1979 skcommonrelease+0xaf/0x3f0 net/core/sock.c:3820 inetrelease+0x1e0/0x260 net/ipv4/afinet.c:437 inet6release+0x6f/0xd0 net/ipv6/afinet6.c:489 sockrelease net/socket.c:658 [inline] sockrelease+0xa0/0x210 net/socket.c:686 cleanupbearer+0x42d/0x4c0 net/tipc/udpmedia.c:819 processonework kernel/workqueue.c:3229 [inline] processscheduledworks+0xcaf/0x1c90 kernel/workqueue.c:3310 workerthread+0xf6c/0x1510 kernel/workqueue.c:3391 kthread+0x531/0x6b0 kernel/kthread.c:389 retfromfork+0x60/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x11/0x20 arch/x86/entry/entry64.S:244
Uninit was created at: slabfreehook mm/slub.c:2269 [inline] slabfree mm/slub.c:4580 [inline] kmemcachefree+0x207/0xc40 mm/slub.c:4682 netfree net/core/netnamespace.c:454 [inline] cleanupnet+0x16f2/0x19d0 net/core/netnamespace.c:647 processonework kernel/workqueue.c:3229 [inline] processscheduledworks+0xcaf/0x1c90 kernel/workqueue.c:3310 workerthread+0xf6c/0x1510 kernel/workqueue.c:3391 kthread+0x531/0x6b0 kernel/kthread.c:389 retfromfork+0x60/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x11/0x20 arch/x86/entry/entry64.S:244
CPU: 0 UID: 0 PID: 54 Comm: kworker/0:2 Not tainted 6.12.0-rc1-00131-gf66ebf37d69c #7 91723d6f74857f70725e1583cba3cf4adc716cfa Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 Workqueue: events cleanupbearer
In the Linux kernel, the following vulnerability has been resolved:
sunrpc: fix one UAF issue caused by sunrpc kernel tcp socket
BUG: KASAN: slab-use-after-free in tcpwritetimerhandler+0x156/0x3e0 Read of size 1 at addr ffff888111f322cd by task swapper/0/0
CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.0-rc4-dirty #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 Call Trace: <IRQ> dumpstacklvl+0x68/0xa0 printaddressdescription.constprop.0+0x2c/0x3d0 printreport+0xb4/0x270 kasanreport+0xbd/0xf0 tcpwritetimerhandler+0x156/0x3e0 tcpwritetimer+0x66/0x170 calltimerfn+0xfb/0x1d0 runtimers+0x3f8/0x480 runtimersoftirq+0x9b/0x100 handlesoftirqs+0x153/0x390 irqexitrcu+0x103/0x120 irqexitrcu+0xe/0x20 sysvecapictimerinterrupt+0x76/0x90 </IRQ> <TASK> asmsysvecapictimerinterrupt+0x1a/0x20 RIP: 0010:defaultidle+0xf/0x20 Code: 4c 01 c7 4c 29 c2 e9 72 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d 33 f8 25 00 fb f4 <fa> c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 RSP: 0018:ffffffffa2007e28 EFLAGS: 00000242 RAX: 00000000000f3b31 RBX: 1ffffffff4400fc7 RCX: ffffffffa09c3196 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff9f00590f RBP: 0000000000000000 R08: 0000000000000001 R09: ffffed102360835d R10: ffff88811b041aeb R11: 0000000000000001 R12: 0000000000000000 R13: ffffffffa202d7c0 R14: 0000000000000000 R15: 00000000000147d0 defaultidlecall+0x6b/0xa0 cpuidleidlecall+0x1af/0x1f0 doidle+0xbc/0x130 cpustartupentry+0x33/0x40 restinit+0x11f/0x210 startkernel+0x39a/0x420 x8664startreservations+0x18/0x30 x8664startkernel+0x97/0xa0 commonstartup64+0x13e/0x141 </TASK>
Allocated by task 595: kasansavestack+0x24/0x50 kasansavetrack+0x14/0x30 kasanslaballoc+0x87/0x90 kmemcacheallocnoprof+0x12b/0x3f0 copynetns+0x94/0x380 createnewnamespaces+0x24c/0x500 unsharensproxynamespaces+0x75/0xf0 ksysunshare+0x24e/0x4f0 x64sysunshare+0x1f/0x30 dosyscall64+0x70/0x180 entrySYSCALL64afterhwframe+0x76/0x7e
Freed by task 100: kasansavestack+0x24/0x50 kasansavetrack+0x14/0x30 kasansavefreeinfo+0x3b/0x60 kasanslabfree+0x54/0x70 kmemcachefree+0x156/0x5d0 cleanupnet+0x5d3/0x670 processonework+0x776/0xa90 workerthread+0x2e2/0x560 kthread+0x1a8/0x1f0 retfromfork+0x34/0x60 retfromforkasm+0x1a/0x30
Reproduction script:
mkdir -p /mnt/nfsshare mkdir -p /mnt/nfs/netns1 mkfs.ext4 /dev/sdb mount /dev/sdb /mnt/nfsshare systemctl restart nfs-server chmod 777 /mnt/nfsshare exportfs -i -o rw,norootsquash :/mnt/nfsshare
ip netns add netns1 ip link add name veth1peer type veth peer veth1 ifconfig veth1peer 11.11.0.254 up ip link set veth1 netns netns1 ip netns exec netns1 ifconfig veth1 11.11.0.1
ip netns exec netns1 /root/iptables -A OUTPUT -d 11.11.0.254 -p tcp \ --tcp-flags FIN FIN -j DROP
(note: In my environment, a DESTROYCLIENTID operation is always sent immediately, breaking the nfs tcp connection.) ip netns exec netns1 timeout -s 9 300 mount -t nfs -o proto=tcp,vers=4.1 \ 11.11.0.254:/mnt/nfsshare /mnt/nfs/netns1
ip netns del netns1
The reason here is that the tcp socket in netns1 (nfs side) has been shutdown and closed (done in xsdestroy), but the FIN message (with ack) is discarded, and the nfsd side keeps sending retransmission messages. As a result, when the tcp sock in netns1 processes the received message, it sends the message (FIN message) in the sending queue, and the tcp timer is re-established. When the network namespace is deleted, the net structure accessed by tcp's timer handler function causes problems.
To fix this problem, let's hold netns refcnt for the tcp kernel socket as done in other modules. This is an ugly hack which can easily be backported to earlier kernels. A proper fix which cleans up the interfaces will follow, but may not be so easy to backport.
In the Linux kernel, the following vulnerability has been resolved:
drm/amd: Guard against bad data for ATIF ACPI method
If a BIOS provides bad data in response to an ATIF method call this causes a NULL pointer dereference in the caller.
? showregs (arch/x86/kernel/dumpstack.c:478 (discriminator 1)) ? die (arch/x86/kernel/dumpstack.c:423 arch/x86/kernel/dumpstack.c:434) ? pagefaultoops (arch/x86/mm/fault.c:544 (discriminator 2) arch/x86/mm/fault.c:705 (discriminator 2)) ? douseraddrfault (arch/x86/mm/fault.c:440 (discriminator 1) arch/x86/mm/fault.c:1232 (discriminator 1)) ? acpiutupdateobjectreference (drivers/acpi/acpica/utdelete.c:642) ? excpagefault (arch/x86/mm/fault.c:1542) ? asmexcpagefault (./arch/x86/include/asm/idtentry.h:623) ? amdgpuatifquerybacklightcaps.constprop.0 (drivers/gpu/drm/amd/amdgpu/amdgpuacpi.c:387 (discriminator 2)) amdgpu ? amdgpuatifquerybacklightcaps.constprop.0 (drivers/gpu/drm/amd/amdgpu/amdgpuacpi.c:386 (discriminator 1)) amdgpu
It has been encountered on at least one system, so guard for it.
(cherry picked from commit c9b7c809b89f24e9372a4e7f02d64c950b07fdee)
In the Linux kernel, the following vulnerability has been resolved:
ipv6: fix possible race in fib6droppcpufrom()
syzbot found a race in fib6droppcpufrom() [1]
If compiler reads more than once (ppcpurt), second read could read NULL, if another cpu clears the value in rt6getpcpuroute().
Add a READONCE() to prevent this race.
Also add rcureadlock()/rcureadunlock() because we rely on RCU protection while dereferencing pcpurt.
[1]
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000012: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097] CPU: 0 PID: 7543 Comm: kworker/u8:17 Not tainted 6.10.0-rc1-syzkaller-00013-g2bfcfd584ff5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: netns cleanupnet RIP: 0010:fib6droppcpufrom.part.0+0x10a/0x370 net/ipv6/ip6fib.c:984 Code: f8 48 c1 e8 03 80 3c 28 00 0f 85 16 02 00 00 4d 8b 3f 4d 85 ff 74 31 e8 74 a7 fa f7 49 8d bf 90 00 00 00 48 89 f8 48 c1 e8 03 <80> 3c 28 00 0f 85 1e 02 00 00 49 8b 87 90 00 00 00 48 8b 0c 24 48 RSP: 0018:ffffc900040df070 EFLAGS: 00010206 RAX: 0000000000000012 RBX: 0000000000000001 RCX: ffffffff89932e16 RDX: ffff888049dd1e00 RSI: ffffffff89932d7c RDI: 0000000000000091 RBP: dffffc0000000000 R08: 0000000000000005 R09: 0000000000000007 R10: 0000000000000001 R11: 0000000000000006 R12: ffff88807fa080b8 R13: fffffbfff1a9a07d R14: ffffed100ff41022 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b32c26000 CR3: 000000005d56e000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> fib6droppcpufrom net/ipv6/ip6fib.c:966 [inline] fib6droppcpufrom net/ipv6/ip6fib.c:1027 [inline] fib6purgert+0x7f2/0x9f0 net/ipv6/ip6fib.c:1038 fib6delroute net/ipv6/ip6fib.c:1998 [inline] fib6del+0xa70/0x17b0 net/ipv6/ip6fib.c:2043 fib6cleannode+0x426/0x5b0 net/ipv6/ip6fib.c:2205 fib6walkcontinue+0x44f/0x8d0 net/ipv6/ip6fib.c:2127 fib6walk+0x182/0x370 net/ipv6/ip6fib.c:2175 fib6cleantree+0xd7/0x120 net/ipv6/ip6fib.c:2255 fib6cleanall+0x100/0x2d0 net/ipv6/ip6fib.c:2271 rt6syncdowndev net/ipv6/route.c:4906 [inline] rt6disableip+0x7ed/0xa00 net/ipv6/route.c:4911 addrconfifdown.isra.0+0x117/0x1b40 net/ipv6/addrconf.c:3855 addrconfnotify+0x223/0x19e0 net/ipv6/addrconf.c:3778 notifiercallchain+0xb9/0x410 kernel/notifier.c:93 callnetdevicenotifiersinfo+0xbe/0x140 net/core/dev.c:1992 callnetdevicenotifiersextack net/core/dev.c:2030 [inline] callnetdevicenotifiers net/core/dev.c:2044 [inline] devclosemany+0x333/0x6a0 net/core/dev.c:1585 unregisternetdevicemanynotify+0x46d/0x19f0 net/core/dev.c:11193 unregisternetdevicemany net/core/dev.c:11276 [inline] defaultdeviceexitbatch+0x85b/0xae0 net/core/dev.c:11759 opsexitlist+0x128/0x180 net/core/netnamespace.c:178 cleanupnet+0x5b7/0xbf0 net/core/netnamespace.c:640 processonework+0x9fb/0x1b60 kernel/workqueue.c:3231 processscheduledworks kernel/workqueue.c:3312 [inline] workerthread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 retfromfork+0x45/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:244
In the Linux kernel, the following vulnerability has been resolved:
iio: mma8452: Fix trigger reference couting
The mma8452 driver directly assigns a trigger to the struct iiodev. The IIO core when done using this trigger will call iiotriggerput() to drop the reference count by 1.
Without the matching iiotriggerget() in the driver the reference count can reach 0 too early, the trigger gets freed while still in use and a use-after-free occurs.
Fix this by getting a reference to the trigger before assigning it to the IIO device.
In the Linux kernel, the following vulnerability has been resolved:
tcp: properly terminate timers for kernel sockets
The Linux kernel CVE team has assigned CVE-2024-35910 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024051955-CVE-2024-35910-5f95@gregkh/T
drm/amdgpu: Skip do PCI error slot reset during RAS recovery