A flaw was found in the Linux kernels wifi implementation. An attacker within wireless broadcast range can inject custom data into the wireless communication circumventing checks on the data. This can cause the frame to pass checks and be considered a valid frame of a different type.
In the Linux kernel, the following vulnerability has been resolved:
i2c: designware: Fix handling of real but unexpected device interrupts
Commit c7b79a752871 ("mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs") caused a regression on certain Gigabyte motherboards for Intel Alder Lake-S where system crashes to NULL pointer dereference in i2cdwxfermsg() when system resumes from S3 sleep state ("deep").
I was able to debug the issue on Gigabyte Z690 AORUS ELITE and made following notes:
- Issue happens when resuming from S3 but not when resuming from "s2idle" - PCI device 00:15.0 == i2cdesignware.0 is already in D0 state when system enters into pcipmresumenoirq() while all other i2cdesignware PCI devices are in D3. Devices were runtime suspended and in D3 prior entering into suspend - Interrupt comes after pcipmresumenoirq() when device interrupts are re-enabled - According to register dump the interrupt really comes from the i2cdesignware.0. Controller is enabled, I2C target address register points to a one detectable I2C device address 0x60 and the DWICRAWINTRSTAT register STARTDET, STOPDET, ACTIVITY and TXEMPTY bits are set indicating completed I2C transaction.
My guess is that the firmware uses this controller to communicate with an on-board I2C device during resume but does not disable the controller before giving control to an operating system.
I was told the UEFI update fixes this but never the less it revealed the driver is not ready to handle TXEMPTY (or RXFULL) interrupt when device is supposed to be idle and state variables are not set (especially the dev->msgs pointer which may point to NULL or stale old data).
Introduce a new software status flag STATUSACTIVE indicating when the controller is active in driver point of view. Now treat all interrupts that occur when is not set as unexpected and mask all interrupts from the controller.
In the Linux kernel, the following vulnerability has been resolved:
net: fix potential refcount leak in ndiscrouterdiscovery()
The issue happens on specific paths in the function. After both the object rt and neigh are grabbed successfully, when lifetime is nonzero but the metric needs change, the function just deletes the route and set rt to NULL. Then, it may try grabbing rt and neigh again if above conditions hold. The function simply overwrite neigh if succeeds or returns if fails, without decreasing the reference count of previous neigh. This may result in memory leaks.
Fix it by decrementing the reference count of neigh in place.
In the Linux kernel, the following vulnerability has been resolved:
In the Linux kernel, the following vulnerability has been resolved:
PCI: microchip: Fix refcount leak in mcpcieinitirqdomains()
ofgetnextchild() returns a node pointer with refcount incremented, so we should use ofnodeput() on it when we don't need it anymore.
mcpcieinitirqdomains() only calls ofnodeput() in the normal path, missing it in some error paths. Add missing ofnodeput() to avoid refcount leak.
In the Linux kernel, the following vulnerability has been resolved:
riscv:uprobe fix SRSPIE set/clear handling
In riscv the process of uprobe going to clear spie before exec the origin insn,and set spie after that.But When access the page which origin insn has been placed a page fault may happen and irq was disabled in archuprobeprexol function,It cause a WARN as follows. There is no need to clear/set spie in archuprobepre/post/abortxol. We can just remove it.
[ 31.684157] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1488 [ 31.684677] inatomic(): 0, irqsdisabled(): 1, nonblock: 0, pid: 76, name: work [ 31.684929] preemptcount: 0, expected: 0 [ 31.685969] CPU: 2 PID: 76 Comm: work Tainted: G [ 31.686542] Hardware name: riscv-virtio,qemu (DT) [ 31.686797] Call Trace: [ 31.687053] [<ffffffff80006442>] dumpbacktrace+0x30/0x38 [ 31.687699] [<ffffffff80812118>] showstack+0x40/0x4c [ 31.688141] [<ffffffff8081817a>] dumpstacklvl+0x44/0x5c [ 31.688396] [<ffffffff808181aa>] dumpstack+0x18/0x20 [ 31.688653] [<ffffffff8003e454>] mightresched+0x114/0x122 [ 31.688948] [<ffffffff8003e4b2>] mightsleep+0x50/0x7a [ 31.689435] [<ffffffff80822676>] downread+0x30/0x130 [ 31.689728] [<ffffffff8000b650>] dopagefault+0x166/x446 [ 31.689997] [<ffffffff80003c0c>] retfromexception+0x0/0xc
In the Linux kernel, the following vulnerability has been resolved:
selinux: fix memleak in securityreadstatekernel()
In this function, it directly returns the result of securityreadpolicy without freeing the allocated memory in data, cause memory leak issue, so free the memory if securityreadpolicy failed.
[PM: subject line tweak]
In the Linux kernel, the following vulnerability has been resolved:
perf/x86/intel/uncore: Fix reference count leak in hswephaslimitsbox()
pcigetdevice() will increase the reference count for the returned 'dev'. We need to call pcidevput() to decrease the reference count. Since 'dev' is only used in pcireadconfigdword(), let's add pcidevput() right after it.
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix space cache corruption and potential double allocations
When testing spacecache v2 on a large set of machines, we encountered a few symptoms:
1. "unable to add free space :-17" (EEXIST) errors. 2. Missing free space info items, sometimes caught with a "missing free space info for X" error. 3. Double-accounted space: ranges that were allocated in the extent tree and also marked as free in the free space tree, ranges that were marked as allocated twice in the extent tree, or ranges that were marked as free twice in the free space tree. If the latter made it onto disk, the next reboot would hit the BUGON() in addnewfreespace(). 4. On some hosts with no on-disk corruption or error messages, the in-memory space cache (dumped with drgn) disagreed with the free space tree.
All of these symptoms have the same underlying cause: a race between caching the free space for a block group and returning free space to the in-memory space cache for pinned extents causes us to double-add a free range to the space cache. This race exists when free space is cached from the free space tree (spacecache=v2) or the extent tree (nospacecache, or spacecache=v1 if the cache needs to be regenerated). struct btrfsblockgroup::lastbytetounpin and struct btrfsblockgroup::progress are supposed to protect against this race, but commit d0c2f4fa555e ("btrfs: make concurrent fsyncs wait less when waiting for a transaction commit") subtly broke this by allowing multiple transactions to be unpinning extents at the same time.
Specifically, the race is as follows:
1. An extent is deleted from an uncached block group in transaction A. 2. btrfscommittransaction() is called for transaction A. 3. btrfsrundelayedrefs() -> btrfsfreeextent() runs the delayed ref for the deleted extent. 4. btrfsfreeextent() -> dofreeextentaccounting() -> addtofreespacetree() adds the deleted extent back to the free space tree. 5. dofreeextentaccounting() -> btrfsupdateblockgroup() -> btrfscacheblockgroup() queues up the block group to get cached. blockgroup->progress is set to blockgroup->start. 6. btrfscommittransaction() for transaction A calls switchcommitroots(). It sets blockgroup->lastbytetounpin to blockgroup->progress, which is blockgroup->start because the block group hasn't been cached yet. 7. The caching thread gets to our block group. Since the commit roots were already switched, loadfreespacetree() sees the deleted extent as free and adds it to the space cache. It finishes caching and sets blockgroup->progress to U64MAX. 8. btrfscommittransaction() advances transaction A to TRANSSTATESUPERCOMMITTED. 9. fsync calls btrfscommittransaction() for transaction B. Since transaction A is already in TRANSSTATESUPERCOMMITTED and the commit is for fsync, it advances. 10. btrfscommittransaction() for transaction B calls switchcommitroots(). This time, the block group has already been cached, so it sets blockgroup->lastbytetounpin to U64MAX. 11. btrfscommittransaction() for transaction A calls btrfsfinishextentcommit(), which calls unpinextentrange() for the deleted extent. It sees lastbytetounpin set to U64MAX (by transaction B!), so it adds the deleted extent to the space cache again!
This explains all of our symptoms above:
If the sequence of events is exactly as described above, when the free space is re-added in step 11, it will fail with EEXIST. If another thread reallocates the deleted extent in between steps 7 and 11, then step 11 will silently re-add that space to the space cache as free even though it is actually allocated. Then, if that space is allocated again, the free space tree will be corrupted (namely, the wrong item will be deleted). If we don't catch this free space tree corr ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix memory leak in tracingreadpipe()
kmemleak reports this issue:
unreferenced object 0xffff888105a18900 (size 128): comm "testprogs", pid 18933, jiffies 4336275356 (age 22801.766s) hex dump (first 32 bytes): 25 73 00 90 81 88 ff ff 26 05 00 00 42 01 58 04 %s......&...B.X. 03 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000560143a1>] kmallocnodetrackcaller+0x4a/0x140 [<000000006af00822>] krealloc+0x8d/0xf0 [<00000000c309be6a>] traceiterexpandformat+0x99/0x150 [<000000005a53bdb6>] tracecheckvprintf+0x1e0/0x11d0 [<0000000065629d9d>] traceeventprintf+0xb6/0xf0 [<000000009a690dc7>] tracerawoutputbpftraceprintk+0x89/0xc0 [<00000000d22db172>] printtraceline+0x73c/0x1480 [<00000000cdba76ba>] tracingreadpipe+0x45c/0x9f0 [<0000000015b58459>] vfsread+0x17b/0x7c0 [<000000004aeee8ed>] ksysread+0xed/0x1c0 [<0000000063d3d898>] dosyscall64+0x3b/0x90 [<00000000a06dda7f>] entrySYSCALL64afterhwframe+0x63/0xcd
iter->fmt alloced in tracingreadpipe() -> .. ->traceiterexpandformat(), but not freed, to fix, add free in tracingreleasepipe()
In the Linux kernel, the following vulnerability has been resolved:
btrfs: ensure pages are unlocked on cowfilerange() failure
There is a hungtask report on zoned btrfs like below.
https://github.com/naota/linux/issues/59
[726.328648] INFO: task rocksdb:high0:11085 blocked for more than 241 seconds. [726.329839] Not tainted 5.16.0-rc1+ #1 [726.330484] "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. [726.331603] task:rocksdb:high0 state:D stack: 0 pid:11085 ppid: 11082 flags:0x00000000 [726.331608] Call Trace: [726.331611] <TASK> [726.331614] schedule+0x2e5/0x9d0 [726.331622] schedule+0x58/0xd0 [726.331626] ioschedule+0x3f/0x70 [726.331629] foliolock+0x125/0x200 [726.331634] ? findgetentries+0x1bc/0x240 [726.331638] ? filemapinvalidateunlocktwo+0x40/0x40 [726.331642] truncateinodepagesrange+0x5b2/0x770 [726.331649] truncateinodepagesfinal+0x44/0x50 [726.331653] btrfsevictinode+0x67/0x480 [726.331658] evict+0xd0/0x180 [726.331661] iput+0x13f/0x200 [726.331664] dounlinkat+0x1c0/0x2b0 [726.331668] x64sysunlink+0x23/0x30 [726.331670] dosyscall64+0x3b/0xc0 [726.331674] entrySYSCALL64afterhwframe+0x44/0xae [726.331677] RIP: 0033:0x7fb9490a171b [726.331681] RSP: 002b:00007fb943ffac68 EFLAGS: 00000246 ORIGRAX: 0000000000000057 [726.331684] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9490a171b [726.331686] RDX: 00007fb943ffb040 RSI: 000055a6bbe6ec20 RDI: 00007fb94400d300 [726.331687] RBP: 00007fb943ffad00 R08: 0000000000000000 R09: 0000000000000000 [726.331688] R10: 0000000000000031 R11: 0000000000000246 R12: 00007fb943ffb000 [726.331690] R13: 00007fb943ffb040 R14: 0000000000000000 R15: 00007fb943ffd260 [726.331693] </TASK>
While we debug the issue, we found running fstests generic/551 on 5GB non-zoned nullblk device in the emulated zoned mode also had a similar hung issue.
Also, we can reproduce the same symptom with an error injected cowfilerange() setup.
The hang occurs when cowfilerange() fails in the middle of allocation. cowfilerange() called from doallocationzoned() can split the give region ([start, end]) for allocation depending on current block group usages. When btrfs can allocate bytes for one part of the split regions but fails for the other region (e.g. because of -ENOSPC), we return the error leaving the pages in the succeeded regions locked. Technically, this occurs only when @unlock == 0. Otherwise, we unlock the pages in an allocated region after creating an ordered extent.
Considering the callers of cowfilerange(unlock=0) won't write out the pages, we can unlock the pages on error exit from cowfilerange(). So, we can ensure all the pages except @lockedpage are unlocked on error case.
In summary, cowfilerange now behaves like this:
- pagestarted == 1 (return value) - All the pages are unlocked. IO is started. - unlock == 1 - All the pages except @lockedpage are unlocked in any case - unlock == 0 - On success, all the pages are locked for writing out them - On failure, all the pages except @lockedpage are unlocked
In the Linux kernel, the following vulnerability has been resolved:
drm/vkms: Fix memory leak in vkmsinit()
A memory leak was reported after the vkms module install failed.
unreferenced object 0xffff88810bc28520 (size 16): comm "modprobe", pid 9662, jiffies 4298009455 (age 42.590s) hex dump (first 16 bytes): 01 01 00 64 81 88 ff ff 00 00 dc 0a 81 88 ff ff ...d............ backtrace: [<00000000e7561ff8>] kmalloctrace+0x27/0x60 [<000000000b1954a0>] 0xffffffffc45200a9 [<00000000abbf1da0>] dooneinitcall+0xd0/0x4f0 [<000000001505ee87>] doinitmodule+0x1a4/0x680 [<00000000958079ad>] loadmodule+0x6249/0x7110 [<00000000117e4696>] dosysfinitmodule+0x140/0x200 [<00000000f74b12d2>] dosyscall64+0x35/0x80 [<000000008fc6fcde>] entrySYSCALL64afterhwframe+0x46/0xb0
The reason is that the vkmsinit() returns without checking the return value of vkmscreate(), and if the vkmscreate() failed, the config allocated at the beginning of vkmsinit() is leaked.
vkmsinit() config = kmalloc(...) # config allocated ... return vkmscreate() # vkmscreate failed and config is leaked
Fix this problem by checking return value of vkmscreate() and free the config if error happened.
In the Linux kernel, the following vulnerability has been resolved:
mt76: mt7915: Fix PCI device refcount leak in mt7915pciinithif2()
As comment of pcigetdevice() says, it returns a pcidevice with its refcount increased. We need to call pcidevput() to decrease the refcount. Save the return value of pcigetdevice() and call pcidevput() to decrease the refcount.
In the Linux kernel, the following vulnerability has been resolved:
irqchip/realtek-rtl: Fix refcount leak in mapinterrupts
offindnodebyphandle() returns a node pointer with refcount incremented, we should use ofnodeput() on it when not need anymore. This function doesn't call ofnodeput() in error path. Call ofnodeput() directly after ofpropertyreadu32() to cover both normal path and error path.
In the Linux kernel, the following vulnerability has been resolved:
scsi: ibmvfc: Store vhost pointer during subcrq allocation
Currently the back pointer from a queue to the vhost adapter isn't set until after subcrq interrupt registration. The value is available when a queue is first allocated and can/should be also set for primary and async queues as well as subcrqs.
This fixes a crash observed during kexec/kdump on Power 9 with legacy XICS interrupt controller where a pending subcrq interrupt from the previous kernel can be replayed immediately upon IRQ registration resulting in dereference of a garbage backpointer in ibmvfcinterruptscsi().
Kernel attempted to read user page (58) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000058 Faulting instruction address: 0xc008000003216a08 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c008000003216a08] ibmvfcinterruptscsi+0x40/0xb0 [ibmvfc] LR [c0000000082079e8] handleirqeventpercpu+0x98/0x270 Call Trace: [c000000047fa3d80] [c0000000123e6180] 0xc0000000123e6180 (unreliable) [c000000047fa3df0] [c0000000082079e8] handleirqeventpercpu+0x98/0x270 [c000000047fa3ea0] [c000000008207d18] handleirqevent+0x98/0x188 [c000000047fa3ef0] [c00000000820f564] handlefasteoiirq+0xc4/0x310 [c000000047fa3f40] [c000000008205c60] generichandleirq+0x50/0x80 [c000000047fa3f60] [c000000008015c40] doirq+0x70/0x1a0 [c000000047fa3f90] [c000000008016d7c] doIRQ+0x9c/0x130 [c000000014622f60] [0000000020000000] 0x20000000 [c000000014622ff0] [c000000008016e50] doIRQ+0x40/0xa0 [c000000014623020] [c000000008017044] replaysoftinterrupts+0x194/0x2f0 [c000000014623210] [c0000000080172a8] archlocalirqrestore+0x108/0x170 [c000000014623240] [c000000008eb1008] rawspinunlockirqrestore+0x58/0xb0 [c000000014623270] [c00000000820b12c] setupirq+0x49c/0x9f0 [c000000014623310] [c00000000820b7c0] requestthreadedirq+0x140/0x230 [c000000014623380] [c008000003212a50] ibmvfcregisterscsichannel+0x1e8/0x2f0 [ibmvfc] [c000000014623450] [c008000003213d1c] ibmvfcinitsubcrqs+0xc4/0x1f0 [ibmvfc] [c0000000146234d0] [c0080000032145a8] ibmvfcresetcrq+0x150/0x210 [ibmvfc] [c000000014623550] [c0080000032147c8] ibmvfcinitcrq+0x160/0x280 [ibmvfc] [c0000000146235f0] [c00800000321a9cc] ibmvfcprobe+0x2a4/0x530 [ibmvfc]
filemap: Handle sibling entries in filemapgetreadbatch()
In the Linux kernel, the following vulnerability has been resolved:
soc: bcm: Check for NULL return of devmkzalloc()
As the potential failure of allocation, devmkzalloc() may return NULL. Then the 'pd->pmb' and the follow lines of code may bring null pointer dereference.
Therefore, it is better to check the return value of devmkzalloc() to avoid this confusion.
In the Linux kernel, the following vulnerability has been resolved:
drm/mediatek: Add vblank register/unregister callback functions
We encountered a kernel panic issue that callback data will be NULL when it's using in ovl irq handler. There is a timing issue between mtkdispovlirqhandler() and mtkovldisablevblank().
To resolve this issue, we use the flow to register/unregister vblank cb: - Register callback function and callback data when crtc creates. - Unregister callback function and callback data when crtc destroies.
With this solution, we can assure callback data will not be NULL when vblank is disable.
In the Linux kernel, the following vulnerability has been resolved:
mt76: mt7915: fix possible NULL pointer dereference in mt7915macfillrxvector
Fix possible NULL pointer dereference in mt7915macfillrxvector routine if the chip does not support dbdc and the hw reports bandidx set to 1.
In the Linux kernel, the following vulnerability has been resolved:
mt76: mt7921: fix kernel crash at mt7921pciremove
The crash log shown it is possible that mt7921irqhandler is called while devmfreeirq is being handled so mt76freedevice need to be postponed until devmfreeirq is completed to solve the crash we free the mt76 device too early.
[ 9299.339655] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 9299.339705] #PF: supervisor read access in kernel mode [ 9299.339735] #PF: errorcode(0x0000) - not-present page [ 9299.339768] PGD 0 P4D 0 [ 9299.339786] Oops: 0000 [#1] SMP PTI [ 9299.339812] CPU: 1 PID: 1624 Comm: prepare-suspend Not tainted 5.15.14-1.fc32.qubes.x8664 #1 [ 9299.339863] Hardware name: Xen HVM domU, BIOS 4.14.3 01/20/2022 [ 9299.339901] RIP: 0010:mt7921irqhandler+0x1e/0x70 [mt7921e] [ 9299.340048] RSP: 0018:ffffa81b80c27cb0 EFLAGS: 00010082 [ 9299.340081] RAX: 0000000000000000 RBX: ffff98a4cb752020 RCX: ffffffffa96211c5 [ 9299.340123] RDX: 0000000000000000 RSI: 00000000000d4204 RDI: ffff98a4cb752020 [ 9299.340165] RBP: ffff98a4c28a62a4 R08: ffff98a4c37a96c0 R09: 0000000080150011 [ 9299.340207] R10: 0000000040000000 R11: 0000000000000000 R12: ffff98a4c4eaa080 [ 9299.340249] R13: ffff98a4c28a6360 R14: ffff98a4cb752020 R15: ffff98a4c28a6228 [ 9299.340297] FS: 00007260840d3740(0000) GS:ffff98a4ef700000(0000) knlGS:0000000000000000 [ 9299.340345] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9299.340383] CR2: 0000000000000008 CR3: 0000000004c56001 CR4: 0000000000770ee0 [ 9299.340432] PKRU: 55555554 [ 9299.340449] Call Trace: [ 9299.340467] <TASK> [ 9299.340485] freeirq+0x221/0x350 [ 9299.340527] freeirq+0x30/0x70 [ 9299.340553] devmfreeirq+0x55/0x80 [ 9299.340579] mt7921pciremove+0x2f/0x40 [mt7921e] [ 9299.340616] pcideviceremove+0x3b/0xa0 [ 9299.340651] devicereleasedriver+0x17a/0x240 [ 9299.340686] devicedriverdetach+0x3c/0xa0 [ 9299.340714] unbindstore+0x113/0x130 [ 9299.340740] kernfsfopwriteiter+0x124/0x1b0 [ 9299.340775] newsyncwrite+0x15c/0x1f0 [ 9299.340806] vfswrite+0x1d2/0x270 [ 9299.340831] ksyswrite+0x67/0xe0 [ 9299.340857] dosyscall64+0x3b/0x90 [ 9299.340887] entrySYSCALL64afterhwframe+0x44/0xae
In the Linux kernel, the following vulnerability has been resolved:
rtc: pl031: fix rtc features null pointer dereference
When there is no interrupt line, rtc alarm feature is disabled.
The clearing of the alarm feature bit was being done prior to allocations of ldata->rtc device, resulting in a null pointer dereference.
Clear RTCFEATUREALARM after the rtc device is allocated.
In the Linux kernel, the following vulnerability has been resolved:
mtd: parsers: qcom: Fix kernel panic on skipped partition
In the event of a skipped partition (case when the entry name is empty) the kernel panics in the cleanup function as the name entry is NULL. Rework the parser logic by first checking the real partition number and then allocate the space and set the data for the valid partitions.
The logic was also fundamentally wrong as with a skipped partition, the parts number returned was incorrect by not decreasing it for the skipped partitions.
In the Linux kernel, the following vulnerability has been resolved:
platform/surface: aggregator: Add missing call to ssamrequestsyncfree()
Although rare, ssamrequestsyncinit() can fail. In that case, the request should be freed via ssamrequestsyncfree(). Currently it is leaked instead. Fix this.
In the Linux kernel, the following vulnerability has been resolved:
iwlwifi: mvm: check debugfsdir ptr before use
When "debugfs=off" is used on the kernel command line, iwiwifi's mvm module uses an invalid/unchecked debugfsdir pointer and causes a BUG:
BUG: kernel NULL pointer dereference, address: 000000000000004f #PF: supervisor read access in kernel mode #PF: errorcode(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP CPU: 1 PID: 503 Comm: modprobe Tainted: G W 5.17.0-rc5 #7 Hardware name: Dell Inc. Inspiron 15 5510/076F7Y, BIOS 2.4.1 11/05/2021 RIP: 0010:iwlmvmdbgfsregister+0x692/0x700 [iwlmvm] Code: 69 a0 be 80 01 00 00 48 c7 c7 50 73 6a a0 e8 95 cf ee e0 48 8b 83 b0 1e 00 00 48 c7 c2 54 73 6a a0 be 64 00 00 00 48 8d 7d 8c <48> 8b 48 50 e8 15 22 07 e1 48 8b 43 28 48 8d 55 8c 48 c7 c7 5f 73 RSP: 0018:ffffc90000a0ba68 EFLAGS: 00010246 RAX: ffffffffffffffff RBX: ffff88817d6e3328 RCX: ffff88817d6e3328 RDX: ffffffffa06a7354 RSI: 0000000000000064 RDI: ffffc90000a0ba6c RBP: ffffc90000a0bae0 R08: ffffffff824e4880 R09: ffffffffa069d620 R10: ffffc90000a0ba00 R11: ffffffffffffffff R12: 0000000000000000 R13: ffffc90000a0bb28 R14: ffff88817d6e3328 R15: ffff88817d6e3320 FS: 00007f64dd92d740(0000) GS:ffff88847f640000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000004f CR3: 000000016fc79001 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: <TASK> ? iwlmvmmacsetupregister+0xbdc/0xda0 [iwlmvm] iwlmvmstartpostnvm+0x71/0x100 [iwlmvm] iwlopmodemvmstart+0xab8/0xb30 [iwlmvm] iwlopmodestart+0x6f/0xd0 [iwlwifi] iwlopmoderegister+0x6a/0xe0 [iwlwifi] ? 0xffffffffa0231000 iwlmvminit+0x35/0x1000 [iwlmvm] ? 0xffffffffa0231000 dooneinitcall+0x5a/0x1b0 ? kmemcachealloc+0x1e5/0x2f0 ? doinitmodule+0x1e/0x220 doinitmodule+0x48/0x220 loadmodule+0x2602/0x2bc0 ? kernelread+0x145/0x2e0 ? kernelreadfile+0x229/0x290 dosysfinitmodule+0xc5/0x130 ? dosysfinitmodule+0xc5/0x130 x64sysfinitmodule+0x13/0x20 dosyscall64+0x38/0x90 entrySYSCALL64afterhwframe+0x44/0xae RIP: 0033:0x7f64dda564dd Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1b 29 0f 00 f7 d8 64 89 01 48 RSP: 002b:00007ffdba393f88 EFLAGS: 00000246 ORIGRAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f64dda564dd RDX: 0000000000000000 RSI: 00005575399e2ab2 RDI: 0000000000000001 RBP: 000055753a91c5e0 R08: 0000000000000000 R09: 0000000000000002 R10: 0000000000000001 R11: 0000000000000246 R12: 00005575399e2ab2 R13: 000055753a91ceb0 R14: 0000000000000000 R15: 000055753a923018 </TASK> Modules linked in: btintel(+) btmtk bluetooth vfat sndhdacodechdmi fat sndhdacodecrealtek sndhdacodecgeneric iwlmvm(+) sndsofpciinteltgl mac80211 sndsofintelhdacommon soundwireintel soundwiregenericallocation soundwirecadence soundwirebus sndsofintelhda sndsofpci sndsof sndsofxtensadsp sndsochdachda sndhdaextcore sndsocacpiintelmatch sndsocacpi sndsoccore btrfs sndcompress sndhdaintel sndinteldspcfg sndintelsdwacpi sndhdacodec raid6pq iwlwifi sndhdacore sndpcm sndtimer snd soundcore cfg80211 intelishipc(+) thunderbolt rfkill intelishtp ucsiacpi wmi i2chidacpi i2chid evdev CR2: 000000000000004f ---[ end trace 0000000000000000 ]---
Check the debugfsdir pointer for an error before using it.
[change to make both conditional]
In the Linux kernel, the following vulnerability has been resolved:
crypto: octeontx2 - remove CONFIGDMCRYPT check
No issues were found while using the driver with dm-crypt enabled. So CONFIGDMCRYPT check in the driver can be removed.
This also fixes the NULL pointer dereference in driver release if CONFIGDMCRYPT is enabled.
... Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 ... Call trace: cryptounregisteralg+0x68/0xfc cryptounregisterskciphers+0x44/0x60 otx2cptcryptoexit+0x100/0x1a0 otx2cptvfremove+0xf8/0x200 pcideviceremove+0x3c/0xd4 devicereleasedriver+0x188/0x234 devicereleasedriver+0x2c/0x4c ...
In the Linux kernel, the following vulnerability has been resolved:
media: ti-vpe: cal: Fix a NULL pointer dereference in calctxv4l2initformats()
In calctxv4l2initformats(), devmkzalloc() is assigned to ctx->activefmt and there is a dereference of it after that, which could lead to NULL pointer dereference on failure of devmkzalloc().
Fix this bug by adding a NULL check of ctx->activefmt.
This bug was found by a static analyzer.
Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code.
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix relocation crash due to premature return from btrfscommittransaction()
We are seeing crashes similar to the following trace:
[38.969182] WARNING: CPU: 20 PID: 2105 at fs/btrfs/relocation.c:4070 btrfsrelocateblockgroup+0x2dc/0x340 [btrfs] [38.973556] CPU: 20 PID: 2105 Comm: btrfs Not tainted 5.17.0-rc4 #54 [38.974580] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [38.976539] RIP: 0010:btrfsrelocateblockgroup+0x2dc/0x340 [btrfs] [38.980336] RSP: 0000:ffffb0dd42e03c20 EFLAGS: 00010206 [38.981218] RAX: ffff96cfc4ede800 RBX: ffff96cfc3ce0000 RCX: 000000000002ca14 [38.982560] RDX: 0000000000000000 RSI: 4cfd109a0bcb5d7f RDI: ffff96cfc3ce0360 [38.983619] RBP: ffff96cfc309c000 R08: 0000000000000000 R09: 0000000000000000 [38.984678] R10: ffff96cec0000001 R11: ffffe84c80000000 R12: ffff96cfc4ede800 [38.985735] R13: 0000000000000000 R14: 0000000000000000 R15: ffff96cfc3ce0360 [38.987146] FS: 00007f11c15218c0(0000) GS:ffff96d6dfb00000(0000) knlGS:0000000000000000 [38.988662] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [38.989398] CR2: 00007ffc922c8e60 CR3: 00000001147a6001 CR4: 0000000000370ee0 [38.990279] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [38.991219] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [38.992528] Call Trace: [38.992854] <TASK> [38.993148] btrfsrelocatechunk+0x27/0xe0 [btrfs] [38.993941] btrfsbalance+0x78e/0xea0 [btrfs] [38.994801] ? vsnprintf+0x33c/0x520 [38.995368] ? kmalloctrackcaller+0x351/0x440 [38.996198] btrfsioctlbalance+0x2b9/0x3a0 [btrfs] [38.997084] btrfsioctl+0x11b0/0x2da0 [btrfs] [38.997867] ? modobjcgstate+0xee/0x340 [38.998552] ? seqrelease+0x24/0x30 [38.999184] ? procnrfiles+0x30/0x30 [38.999654] ? callrcu+0xc8/0x2f0 [39.000228] ? x64sysioctl+0x84/0xc0 [39.000872] ? btrfsioctlgetsupportedfeatures+0x30/0x30 [btrfs] [39.001973] x64sysioctl+0x84/0xc0 [39.002566] dosyscall64+0x3a/0x80 [39.003011] entrySYSCALL64afterhwframe+0x44/0xae [39.003735] RIP: 0033:0x7f11c166959b [39.007324] RSP: 002b:00007fff2543e998 EFLAGS: 00000246 ORIGRAX: 0000000000000010 [39.008521] RAX: ffffffffffffffda RBX: 00007f11c1521698 RCX: 00007f11c166959b [39.009833] RDX: 00007fff2543ea40 RSI: 00000000c4009420 RDI: 0000000000000003 [39.011270] RBP: 0000000000000003 R08: 0000000000000013 R09: 00007f11c16f94e0 [39.012581] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff25440df3 [39.014046] R13: 0000000000000000 R14: 00007fff2543ea40 R15: 0000000000000001 [39.015040] </TASK> [39.015418] ---[ end trace 0000000000000000 ]--- [43.131559] ------------[ cut here ]------------ [43.132234] kernel BUG at fs/btrfs/extent-tree.c:2717! [43.133031] invalid opcode: 0000 [#1] PREEMPT SMP PTI [43.133702] CPU: 1 PID: 1839 Comm: btrfs Tainted: G W 5.17.0-rc4 #54 [43.134863] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [43.136426] RIP: 0010:unpinextentrange+0x37a/0x4f0 [btrfs] [43.139913] RSP: 0000:ffffb0dd4216bc70 EFLAGS: 00010246 [43.140629] RAX: 0000000000000000 RBX: ffff96cfc34490f8 RCX: 0000000000000001 [43.141604] RDX: 0000000080000001 RSI: 0000000051d00000 RDI: 00000000ffffffff [43.142645] RBP: 0000000000000000 R08: 0000000000000000 R09: ffff96cfd07dca50 [43.143669] R10: ffff96cfc46e8a00 R11: fffffffffffec000 R12: 0000000041d00000 [43.144657] R13: ffff96cfc3ce0000 R14: ffffb0dd4216bd08 R15: 0000000000000000 [43.145686] FS: 00007f7657dd68c0(0000) GS:ffff96d6df640000(0000) knlGS:0000000000000000 [43.146808] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [43.147584] CR2: 00007f7fe81bf5b0 CR3: 00000001093ee004 CR4: 0000000000370ee0 [43.148589] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [43.149581] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 00000000000 ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
iouring: Fix a null-ptr-deref in iotctxexitcb()
Syzkaller reports a NULL deref bug as follows:
BUG: KASAN: null-ptr-deref in iotctxexitcb+0x53/0xd3 Read of size 4 at addr 0000000000000138 by task file1/1955
CPU: 1 PID: 1955 Comm: file1 Not tainted 6.1.0-rc7-00103-gef4d3ea40565 #75 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 Call Trace: <TASK> dumpstacklvl+0xcd/0x134 ? iotctxexitcb+0x53/0xd3 kasanreport+0xbb/0x1f0 ? iotctxexitcb+0x53/0xd3 kasancheckrange+0x140/0x190 iotctxexitcb+0x53/0xd3 taskworkrun+0x164/0x250 ? taskworkcancel+0x30/0x30 getsignal+0x1c3/0x2440 ? lockdowngrade+0x6e0/0x6e0 ? lockdowngrade+0x6e0/0x6e0 ? exitsignals+0x8b0/0x8b0 ? dorawreadunlock+0x3b/0x70 ? dorawspinunlock+0x50/0x230 archdosignalorrestart+0x82/0x2470 ? kmemcachefree+0x260/0x4b0 ? putname+0xfe/0x140 ? getsigframesize+0x10/0x10 ? doexecveatcommon.isra.0+0x226/0x710 ? lockdephardirqson+0x79/0x100 ? putname+0xfe/0x140 ? doexecveatcommon.isra.0+0x238/0x710 exittousermodeprepare+0x15f/0x250 syscallexittousermode+0x19/0x50 dosyscall64+0x42/0xb0 entrySYSCALL64afterhwframe+0x63/0xcd RIP: 0023:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 002b:00000000fffb7790 EFLAGS: 00000200 ORIGRAX: 000000000000000b RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 </TASK> Kernel panic - not syncing: paniconwarn set ...
This happens because the adding of taskwork from ioringexitwork() isn't synchronized with canceling all work items from eg exec. The execution of the two are ordered in that they are both run by the task itself, but if iotctxexitcb() is queued while we're canceling all work items off exec AND gets executed when the task exits to userspace rather than in the main loop in iouringcancelgeneric(), then we can find current->iouring == NULL and hit the above crash.
It's safe to add this NULL check here, because the execution of the two paths are done by the task itself.
[axboe: add code comment and also put an explanation in the commit msg]
In the Linux kernel, the following vulnerability has been resolved:
tty: fix possible null-ptr-defer in spkttyiorelease
Run the following tests on the qemu platform:
syzkaller:~# modprobe speakupaudptr input: Speakup as /devices/virtual/input/input4 initialized device: /dev/synth, node (MAJOR 10, MINOR 125) speakup 3.1.6: initialized synth name on entry is: (null) synth probe
spkttyioinitialiseldisc failed because ttykopenexclusive returned failed (errno -16), then remove the module, we will get a null-ptr-defer problem, as follow:
syzkaller:~# modprobe -r speakupaudptr releasing synth audptr BUG: kernel NULL pointer dereference, address: 0000000000000080 #PF: supervisor write access in kernel mode #PF: errorcode(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 2 PID: 204 Comm: modprobe Not tainted 6.1.0-rc6-dirty #1 RIP: 0010:mutexlock+0x14/0x30 Call Trace: <TASK> spkttyiorelease+0x19/0x70 [speakup] synthrelease.part.6+0xac/0xc0 [speakup] synthremove+0x56/0x60 [speakup] x64sysdeletemodule+0x156/0x250 ? fpregsassertstateconsistent+0x1d/0x50 dosyscall64+0x37/0x90 entrySYSCALL64afterhwframe+0x63/0xcd </TASK> Modules linked in: speakupaudptr(-) speakup Dumping ftrace buffer:
insynth->dev was not initialized during modprobe, so we add check for insynth->dev to fix this bug.
In the Linux kernel, the following vulnerability has been resolved:
iommu/amd: Fix I/O page table memory leak
The current logic updates the I/O page table mode for the domain before calling the logic to free memory used for the page table. This results in IOMMU page table memory leak, and can be observed when launching VM w/ pass-through devices.
Fix by freeing the memory used for page table before updating the mode.