btrfs: zoned: finish active block group cleanup if callzonefinish() fails
In the Linux kernel, the following vulnerability has been resolved:
ASoC: Intel: avs: Clean up the bus when fetching ML caps fails
sndhdacextbusgetmlcapabilities() may fail and its return code shall be checked and accounted for. Address the issue by updating the error-path for avspciprobe().
At the same time, if the function in question succeeds but the next part of avspciprobe() fails, the hlink list shall be cleaned up before leaving the scope.
In the Linux kernel, the following vulnerability has been resolved:
vfio/pci: Latch disableidled3 per device
When disableidled3 was introduced in vfio-pci, it directly manipulated the device power state with pcisetpowerstate(). There were no refcounts to maintain or balanced operations, we could unconditionally bring the device to D0 and conditionally move it to D3hot. Therefore the module parameter was made writable.
Later, in commit c61302aa48f7 ("vfio/pci: Move module parameters to vfiopci.c"), as part of the vfio-pci-core split, the writable aspect of the module parameter was nullified. The parameter value could still be changed through sysfs, but the vfio-pci driver latched the values into vfio-pci-core globals at module init. Loading the vfio-pci module, or unloading and reloading, with non-default or different values could change the globals relative to existing devices bound to vfio-pci variant drivers.
Runtime PM was introduced in commit 7ab5e10eda02 ("vfio/pci: Move the unused device into low power state with runtime PM"), which marks the point where power states became refcounted. PM get and put operations need to be balanced, but the same module operations noted above can change the global variables relative to those devices already bound to vfio-pci variant drivers. This introduces a window where PM operations can now become unbalanced.
To resolve this with a narrow footprint for stable backports, the disableidled3 flag is latched into the vfiopcicoredevice at the time of initialization, such that the device always operates with a consistent value.
NB. vfiopcidevsettryreset() now unconditionally raises the runtime PM usage count around bus reset to account for disableidled3 becoming a per-device rather than global flag. When this flag is set, the additional get/put pair is harmless and allows continued use of the shared vfiopcidevsetpmruntimeget() helper.
In the Linux kernel, the following vulnerability has been resolved:
vfio/mlx5: Fix racy bitfields and tighten struct layout
Bitfield operations are not atomic, they use a read-modify-write pattern, therefore we should be careful not to pack bitfields that can be concurrently updated into the same storage unit.
This split takes a binary approach: flags that are only modified pre/post open/close remain bitfields, flags modified from user action, including actions that reach across to another device (ex. reset) use dedicated storage units.
Note mlx5vhcapagetracker.status is relocated to fill the alignment hole this split exposes.
Bitfield justifications:
migratecap: written only in mlx5vfcmdsetmigratable() at probe chunkmode: written only in mlx5vfcmdsetmigratable() at probe migstatecap: written only in mlx5vfcmdsetmigratable() at probe
Dedicated storage units:
mdevdetach: written in the VF attach/detach event notifier mlx5fvvfevent() at runtime logactive: written in mlx5vfstartpagetracker()/ mlx5vfstoppagetracker() during runtime dirty tracking deferredreset: written in mlx5vfstatemutexunlock()/ mlx5vfpciaerresetdone() during runtime reset handling iserr: set by tracker error handling and dirty-log polling at runtime objectchanged: set by tracker event handling and cleared by dirty-log polling at runtime
In the Linux kernel, the following vulnerability has been resolved:
firmwareloader: fix device reference leak in firmwareuploadregister()
firmwareuploadregister() -> fwcreateinstance() -> deviceinitialize()
After fwcreateinstance() succeeds, the lifetime of the embedded struct device is expected to be managed through the device core reference counting, since fwcreateinstance() has already called deviceinitialize().
In firmwareuploadregister(), if alloclookupfwpriv() fails after fwcreateinstance() succeeds, the code reaches freefwsysfs and frees fwsysfs directly instead of releasing the device reference with putdevice(). This may leave the reference count of the embedded struct device unbalanced, resulting in a refcount leak.
The issue was identified by a static analysis tool I developed and confirmed by manual review. Fix this by using putdevice(fwdev) in the failure path and letting fwdevrelease() handle the final cleanup, instead of freeing the instance directly from the error path.
In the Linux kernel, the following vulnerability has been resolved:
riscv: Fix register corruption from uninitialized cregs on error
compatriscvgprset() calls cregstoregs() unconditionally, even when userregsetcopyin() fails. Since cregs is an uninitialized stack variable, a copyin failure causes uninitialized stack data to be written into the target task's ptregs, corrupting its register state and potentially leaking kernel stack contents.
compatrestoresigcontext() has the same issue: it calls cregstoregs() even when copyfromuser() fails, leading to the same corruption of the signal-returning task's register state on error.
Only call cregstoregs() when the user copy succeeds.
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: add hook transactions for device deletions
Restore the flag that indicates that the hook is going away, ie. NFTHOOKREMOVE, but add a new transaction object to track deletion of hooks without altering the basechain/flowtable hooklist during the preparation phase.
The existing approach that moves the hook from the basechain/flowtable hooklist to transaction hooklist breaks netlink dump path readers of this RCU-protected list.
It should be possible use an array for nfttranshook to store the deleted hooks to compact the representation but I am not expecting many hook object, specially now that wildcard support for devices is in place.
Note that the nfttranschainhooks() list contains a list of struct nfttranshook objects for DELCHAIN and DELFLOWTABLE commands, while this list stores struct nfthook objects for NEWCHAIN and NEWFLOWTABLE. Note that new commands can be updated to use nfttranshook for consistency.
This patch also adapts the event notification path to deal with the list of hook transactions.
drm/amdgpu/vcn: set nouserfence for VCN v4.0 enc ring
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu/jpeg: set nouserfence for JPEG v4.0 ring
JPEG rings do not support 64-bit user fence writes, reject CS submissions with user fences.
(cherry picked from commit 8d0cac9478a3f046279c657d6a2545de49ae675a)
drm/amdkfd: Fix buffer overflow in SDMA queue checkpoint/restore on GFX11
In the Linux kernel, the following vulnerability has been resolved:
fsnotify: fix inode reference leak in fsnotifyrecalcmask()
fsnotifyrecalcmask() fails to handle the return value of fsnotifyrecalcmask(), which may return an inode pointer that needs to be released via fsnotifydropobject() when the connector's HASIREF flag transitions from set to cleared.
This manifests as a hung task with the following call trace:
INFO: task umount:1234 blocked for more than 120 seconds. Call Trace: schedule schedule fsnotifysbdelete genericshutdownsuper killanonsuper cleanupmnt taskworkrun doexit dogroupexit
The race window that triggers the iref leak:
Thread A (adding mark) Thread B (removing mark) ────────────────────── ──────────────────────── fsnotifyaddmarklocked(): fsnotifyaddmarklist(): spinlock(conn->lock) add markB(evictable) to list spinunlock(conn->lock) return
/ ---- gap: no lock held ---- /
fsnotifydetachmark(markA): spinlock(markA->lock) clear ATTACHED flag on markA spinunlock(markA->lock) fsnotifyputmark(markA)
fsnotifyrecalcmask(): spinlock(conn->lock) fsnotifyrecalcmask(): / markA skipped: ATTACHED cleared / / only markB(evictable) remains / wantiref = false hasiref = true / not yet cleared / -> HASIREF transitions true -> false -> returns inode pointer spinunlock(conn->lock) / BUG: return value discarded! iput() and fsnotifyputsbwatchedobjects() are never called /
Fix this by deferring the transition true -> false of HASIREF flag from fsnotifyrecalcmask() (Thread A) to fsnotifyputmark() (thread B).
In the Linux kernel, the following vulnerability has been resolved:
KVM: nSVM: Avoid clearing VMCBLBR in vmcb12
svmcopylbrs() always marks VMCBLBR dirty in the destination VMCB. However, nestedsvmvmexit() uses it to copy LBRs to vmcb12, and clearing clean bits in vmcb12 is not architecturally defined.
Move vmcbmarkdirty() to callers and drop it for vmcb12.
This also facilitates incoming refactoring that does not pass the entire VMCB to svmcopylbrs().
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nfconncount: increase the connection clean up limit to 64
After the optimization to only perform one GC per jiffy, a new problem was introduced. If more than 8 new connections are tracked per jiffy the list won't be cleaned up fast enough possibly reaching the limit wrongly.
In order to prevent this issue, only skip the GC if it was already triggered during the same jiffy and the increment is lower than the clean up limit. In addition, increase the clean up limit to 64 connections to avoid triggering GC too often and do more effective GCs.
This has been tested using a HTTP server and several performance tools while having nftconnlimit/xtconnlimit or OVS limit configured.
Output of slowhttptest + OVS limit at 52000 connections:
slow HTTP test status on 340th second: initializing: 0 pending: 432 connected: 51998 error: 0 closed: 0 service available: YES
In the Linux kernel, the following vulnerability has been resolved:
net: wwan: t7xx: validate portcount against message length in t7xxportenummsghandler
t7xxportenummsghandler() uses the modem-supplied portcount field as a loop bound over portmsg->data[] without checking that the message buffer contains sufficient data. A modem sending portcount=65535 in a 12-byte buffer triggers a slab-out-of-bounds read of up to 262140 bytes.
Add a sizeof(portmsg) check before accessing the port message header fields to guard against undersized messages.
Add a structsize() check after extracting portcount and before the loop.
In t7xxparsehostrtdata(), guard the rtfeature header read with a remaining-buffer check before accessing datalen, validate featdatalen against the actual remaining buffer to prevent OOB reads and signed integer overflow on offset.
Pass msglen from both call sites: skb->len at the DPMAIF path after skbpull(), and the validated featdatalen at the handshake path.
In the Linux kernel, the following vulnerability has been resolved:
iouring/kbuf: check if target buffer list is still legacy on recycle
There's a gap between when the buffer was grabbed and when it potentially gets recycled, where if the list is empty, someone could've upgraded it to a ring provided type. This can happen if the request is forced via io-wq. The legacy recycling is missing checking if the bufferlist still exists, and if it's of the correct type. Add those checks.
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix transaction abort on file creation due to name hash collision
If we attempt to create several files with names that result in the same hash, we have to pack them in same dir item and that has a limit inherent to the leaf size. However if we reach that limit, we trigger a transaction abort and turns the filesystem into RO mode. This allows for a malicious user to disrupt a system, without the need to have administration privileges/capabilities.
Reproducer:
$ cat exploit-hash-collisions.sh #!/bin/bash
DEV=/dev/sdi MNT=/mnt/sdi
# Use smallest node size to make the test faster and require fewer file # names that result in hash collision. mkfs.btrfs -f --nodesize 4K $DEV mount $DEV $MNT
# List of names that result in the same crc32c hash for btrfs. declare -a names=( 'foobar' '%a8tYkxfGMLWRGr55QSeQc4PBNH9PCLIvR6jZnkDtUUru1t@RouaUeL:@xGkbO3nCwvLNYeK9vhE628gss:T$yZjZ5l-Nbd6CbC$M=hqE-ujhJICXyIxBvYrIU9-TDC' 'AQci3EUB%shMsg-N%frgU:02ByLs=IPJU0OpgiWit5nexSyxZDncY6WB:=zKZuk5Zy0DD$Ua78%MelgBuMqaHGyKsJUFf9s=UW80PcJmKctb46KveLSiUtNmqrMiL9-Y0Il5Fnam04CGIg=8@U:Z' 'CvVqJpJzueKcuA$wqwePfyu7VxuWNN3ho$p0zi2H8QFYK$7YlEqOhhb%:hHgjhIjW5vnqWHKNP4' 'ET:vk@rFU4tsvMB0$Cp=xQHaYZjvoF%-BTc%wkFW8yaDAPcCYoR%x$FH5O:' 'HwTon%v7SGSP4FE08jBwwiu5aot2CFKXHTeEAa@38fUcNGOWvE@Mz6WBeDHVooaZ6AgsXPkVGwy9l@@ZbNXabUU9csiWrrOp0MWUdfi$EZ3w9GkIqtz7IeOsByOkBOO' 'Ij%2VlFGXSuPvxJGf5UWy6O@1svxGha%b@=%wjkq:CIgE6u7eJOjmQY5qTtxE2Rjbis9@us' 'KBkjG5%9R8K9sOG8UTnAYjxLNAvBmvV5vz3IiZa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hBXpBk:pE-$P7ts58U0J@iR9YZntMPl7j$s62yAJO@9eanFPS54b=UTw$94C-t=HLxT8n6o9P=QnIxq-f1=Ne2dvhe6WbjEQtc' 'YPPh:IFt2mtR6XWSmjHptXLhbSYu8bMw-JP8@PNyaFkdNFsk$M=xfL6LDKCDM-mSyGA2MBwZ8Dr4=R1D%7-mC ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
misc: bcmvk: Fix possible null-pointer dereferences in bcmvkread()
In the function bcmvkread(), the pointer entry is checked, indicating that it can be NULL. If entry is NULL and rc is set to -EMSGSIZE, the following code may cause null-pointer dereferences:
struct vkmsgblk tmpmsg = entry->tohmsg[0]; setmsgid(&tmpmsg, entry->usrmsgid); tmpmsg.size = entry->tohblks - 1;
To prevent these possible null-pointer dereferences, copy tohmsg, usrmsgid, and tohblks from iter into temporary variables, and return these temporary variables to the application instead of accessing them through a potentially NULL entry.
In the Linux kernel, the following vulnerability has been resolved:
net/sched: actskbedit: fix divide-by-zero in tcfskbedithash()
Commit 38a6f0865796 ("net: sched: support hash selecting tx queue") added SKBEDITFTXQSKBHASH support. The inclusive range size is computed as:
mappingmod = queuemappingmax - queuemapping + 1;
The range size can be 65536 when the requested range covers all possible u16 queue IDs (e.g. queuemapping=0 and queuemappingmax=U16MAX). That value cannot be represented in a u16 and previously wrapped to 0, so tcfskbedithash() could trigger a divide-by-zero:
queuemapping += skbgethash(skb) % params->mappingmod;
Compute mappingmod in a wider type and reject ranges larger than U16MAX to prevent params->mappingmod from becoming 0 and avoid the crash.
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: Make cpumaskofnode() robust against NUMANONODE
The arch definition of cpumaskofnode() cannot handle NUMANONODE - which is a valid index - so add a check for this.
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: lag: Check for LAG device before creating debugfs
mlx5lagdevaddmdev() may return 0 (success) even when an error occurs that is handled gracefully. Consequently, the initialization flow proceeds to call mlx5ldevadddebugfs() even when there is no valid LAG context.
mlx5ldevadddebugfs() blindly created the debugfs directory and attributes. This exposed interfaces (like the members file) that rely on a valid ldev pointer, leading to potential NULL pointer dereferences if accessed when ldev is NULL.
Add a check to verify that mlx5lagdev(dev) returns a valid pointer before attempting to create the debugfs entries.
EDAC/mc: Fix error path ordering in edacmcalloc()
In the Linux kernel, the following vulnerability has been resolved:
arm64/fpsimd: signal: Allocate SSVE storage when restoring ZA
The code to restore a ZA context doesn't attempt to allocate the task's svestate before setting TIFSME. Consequently, restoring a ZA context can place a task into an invalid state where TIFSME is set but the task's svestate is NULL.
In legitimate but uncommon cases where the ZA signal context was NOT created by the kernel in the context of the same task (e.g. if the task is saved/restored with something like CRIU), we have no guarantee that svestate had been allocated previously. In these cases, userspace can enter streaming mode without trapping while svestate is NULL, causing a later NULL pointer dereference when the kernel attempts to store the register state:
| # ./sigreturn-za | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 | Mem abort info: | ESR = 0x0000000096000046 | EC = 0x25: DABT (current EL), IL = 32 bits | SET = 0, FnV = 0 | EA = 0, S1PTW = 0 | FSC = 0x06: level 2 translation fault | Data abort info: | ISV = 0, ISS = 0x00000046, ISS2 = 0x00000000 | CM = 0, WnR = 1, TnD = 0, TagAccess = 0 | GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 | user pgtable: 4k pages, 52-bit VAs, pgdp=0000000101f47c00 | [0000000000000000] pgd=08000001021d8403, p4d=0800000102274403, pud=0800000102275403, pmd=0000000000000000 | Internal error: Oops: 0000000096000046 [#1] SMP | Modules linked in: | CPU: 0 UID: 0 PID: 153 Comm: sigreturn-za Not tainted 6.19.0-rc1 #1 PREEMPT | Hardware name: linux,dummy-virt (DT) | pstate: 214000c9 (nzCv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--) | pc : svesavestate+0x4/0xf0 | lr : fpsimdsaveuserstate+0xb0/0x1c0 | sp : ffff80008070bcc0 | x29: ffff80008070bcc0 x28: fff00000c1ca4c40 x27: 63cfa172fb5cf658 | x26: fff00000c1ca5228 x25: 0000000000000000 x24: 0000000000000000 | x23: 0000000000000000 x22: fff00000c1ca4c40 x21: fff00000c1ca4c40 | x20: 0000000000000020 x19: fff00000ff6900f0 x18: 0000000000000000 | x17: fff05e8e0311f000 x16: 0000000000000000 x15: 028fca8f3bdaf21c | x14: 0000000000000212 x13: fff00000c0209f10 x12: 0000000000000020 | x11: 0000000000200b20 x10: 0000000000000000 x9 : fff00000ff69dcc0 | x8 : 00000000000003f2 x7 : 0000000000000001 x6 : fff00000c1ca5b48 | x5 : fff05e8e0311f000 x4 : 0000000008000000 x3 : 0000000000000000 | x2 : 0000000000000001 x1 : fff00000c1ca5970 x0 : 0000000000000440 | Call trace: | svesavestate+0x4/0xf0 (P) | fpsimdthreadswitch+0x48/0x198 | switchto+0x20/0x1c0 | schedule+0x36c/0xce0 | schedule+0x34/0x11c | exittousermodeloop+0x124/0x188 | el0interrupt+0xc8/0xd8 | el0irqhandlercommon+0x18/0x24 | el0t64irqhandler+0x10/0x1c | el0t64irq+0x198/0x19c | Code: 54000040 d51b4408 d65f03c0 d503245f (e5bb5800) | ---[ end trace 0000000000000000 ]---
Fix this by having restorezacontext() ensure that the task's svestate is allocated, matching what we do when taking an SME trap. Any live SVE/SSVE state (which is restored earlier from a separate signal context) must be preserved, and hence this is not zeroed.
In the Linux kernel, the following vulnerability has been resolved:
arm64/fpsimd: signal: Fix restoration of SVE context
When SME is supported, Restoring SVE signal context can go wrong in a few ways, including placing the task into an invalid state where the kernel may read from out-of-bounds memory (and may potentially take a fatal fault) and/or may kill the task with a SIGKILL.
(1) Restoring a context with SVESIGFLAGSM set can place the task into an invalid state where SVCR.SM is set (and svestate is non-NULL) but TIFSME is clear, consequently resuting in out-of-bounds memory reads and/or killing the task with SIGKILL.
This can only occur in unusual (but legitimate) cases where the SVE signal context has either been modified by userspace or was saved in the context of another task (e.g. as with CRIU), as otherwise the presence of an SVE signal context with SVESIGFLAGSM implies that TIFSME is already set.
While in this state, taskfpsimdload() will NOT configure SMCRELx (leaving some arbitrary value configured in hardware) before restoring SVCR and attempting to restore the streaming mode SVE registers from memory via sveloadstate(). As the value of SMCRELx.LEN may be larger than the task's streaming SVE vector length, this may read memory outside of the task's allocated svestate, reading unrelated data and/or triggering a fault.
While this can result in secrets being loaded into streaming SVE registers, these values are never exposed. As TIFSME is clear, fpsimdbindtasktocpu() will configure CPACRELx.SMEN to trap EL0 accesses to streaming mode SVE registers, so these cannot be accessed directly at EL0. As fpsimdsaveuserstate() verifies the live vector length before saving (S)SVE state to memory, no secret values can be saved back to memory (and hence cannot be observed via ptrace, signals, etc).
When the live vector length doesn't match the expected vector length for the task, fpsimdsaveuserstate() will send a fatal SIGKILL signal to the task. Hence the task may be killed after executing userspace for some period of time.
(2) Restoring a context with SVESIGFLAGSM clear does not clear the task's SVCR.SM. If SVCR.SM was set prior to restoring the context, then the task will be left in streaming mode unexpectedly, and some register state will be combined inconsistently, though the task will be left in legitimate state from the kernel's PoV.
This can only occur in unusual (but legitimate) cases where ptrace has been used to set SVCR.SM after entry to the sigreturn syscall, as syscall entry clears SVCR.SM.
In these cases, the the provided SVE register data will be loaded into the task's svestate using the non-streaming SVE vector length and the FPSIMD registers will be merged into this using the streaming SVE vector length.
Fix (1) by setting TIFSME when setting SVCR.SM. This also requires ensuring that the task's smestate has been allocated, but as this could contain live ZA state, it should not be zeroed. Fix (2) by clearing SVCR.SM when restoring a SVE signal context with SVESIGFLAGSM clear.
For consistency, I've pulled the manipulation of SVCR, TIFSVE, TIFSME, and fptype earlier, immediately after the allocation of svestate/smestate, before the restore of the actual register state. This makes it easier to ensure that these are always modified consistently, even if a fault is taken while reading the register data from the signal context. I do not expect any software to depend on the exact state restored when a fault is taken while reading the context.
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: dw: dmamux: fix OF node leak on route allocation failure
Make sure to drop the reference taken to the DMA master OF node also on late route allocation failures.
In the Linux kernel, the following vulnerability has been resolved:
drm/msm/dpu: Add missing NULL pointer check for pingpong interface
It is checked almost always in dpuencoderphyswbsetupctl(), but in a single place the check is missing. Also use convenient locals instead of physenc-> where available.
Patchwork: https://patchwork.freedesktop.org/patch/693860/
In the Linux kernel, the following vulnerability has been resolved:
srcu: Delegate work to the boot cpu if using SRCUSIZESMALL
Commit 994f706872e6 ("srcu: Make Tree SRCU able to operate without snpnode array") assumes that cpu 0 is always online. However, there really are situations when some other CPU is the boot CPU, for example, when booting a kdump kernel with the maxcpus=1 boot parameter.
On PowerPC, the kdump kernel can hang as follows: ... [ 1.740036] systemd[1]: Hostname set to <xyz.com> [ 243.686240] INFO: task systemd:1 blocked for more than 122 seconds. [ 243.686264] Not tainted 6.1.0-rc1 #1 [ 243.686272] "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. [ 243.686281] task:systemd state:D stack:0 pid:1 ppid:0 flags:0x00042000 [ 243.686296] Call Trace: [ 243.686301] [c000000016657640] [c000000016657670] 0xc000000016657670 (unreliable) [ 243.686317] [c000000016657830] [c00000001001dec0] switchto+0x130/0x220 [ 243.686333] [c000000016657890] [c000000010f607b8] schedule+0x1f8/0x580 [ 243.686347] [c000000016657940] [c000000010f60bb4] schedule+0x74/0x140 [ 243.686361] [c0000000166579b0] [c000000010f699b8] scheduletimeout+0x168/0x1c0 [ 243.686374] [c000000016657a80] [c000000010f61de8] waitforcommon+0x148/0x360 [ 243.686387] [c000000016657b20] [c000000010176bb0] flushwork.isra.0+0x1c0/0x3d0 [ 243.686401] [c000000016657bb0] [c0000000105f2768] fsnotifywaitmarksdestroyed+0x28/0x40 [ 243.686415] [c000000016657bd0] [c0000000105f21b8] fsnotifydestroygroup+0x68/0x160 [ 243.686428] [c000000016657c40] [c0000000105f6500] inotifyrelease+0x30/0xa0 [ 243.686440] [c000000016657cb0] [c0000000105751a8] fput+0xc8/0x350 [ 243.686452] [c000000016657d00] [c00000001017d524] taskworkrun+0xe4/0x170 [ 243.686464] [c000000016657d50] [c000000010020e94] donotifyresume+0x134/0x140 [ 243.686478] [c000000016657d80] [c00000001002eb18] interruptexituserpreparemain+0x198/0x270 [ 243.686493] [c000000016657de0] [c00000001002ec60] syscallexitprepare+0x70/0x180 [ 243.686505] [c000000016657e10] [c00000001000bf7c] systemcallvectoredcommon+0xfc/0x280 [ 243.686520] --- interrupt: 3000 at 0x7fffa47d5ba4 [ 243.686528] NIP: 00007fffa47d5ba4 LR: 0000000000000000 CTR: 0000000000000000 [ 243.686538] REGS: c000000016657e80 TRAP: 3000 Not tainted (6.1.0-rc1) [ 243.686548] MSR: 800000000000d033 <SF,EE,PR,ME,IR,DR,RI,LE> CR: 42044440 XER: 00000000 [ 243.686572] IRQMASK: 0 [ 243.686572] GPR00: 0000000000000006 00007ffffa606710 00007fffa48e7200 0000000000000000 [ 243.686572] GPR04: 0000000000000002 000000000000000a 0000000000000000 0000000000000001 [ 243.686572] GPR08: 000001000c172dd0 0000000000000000 0000000000000000 0000000000000000 [ 243.686572] GPR12: 0000000000000000 00007fffa4ff4bc0 0000000000000000 0000000000000000 [ 243.686572] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 243.686572] GPR20: 0000000132dfdc50 000000000000000e 0000000000189375 0000000000000000 [ 243.686572] GPR24: 00007ffffa606ae0 0000000000000005 000001000c185490 000001000c172570 [ 243.686572] GPR28: 000001000c172990 000001000c184850 000001000c172e00 00007fffa4fedd98 [ 243.686683] NIP [00007fffa47d5ba4] 0x7fffa47d5ba4 [ 243.686691] LR [0000000000000000] 0x0 [ 243.686698] --- interrupt: 3000 [ 243.686708] INFO: task kworker/u16:1:24 blocked for more than 122 seconds. [ 243.686717] Not tainted 6.1.0-rc1 #1 [ 243.686724] "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. [ 243.686733] task:kworker/u16:1 state:D stack:0 pid:24 ppid:2 flags:0x00000800 [ 243.686747] Workqueue: eventsunbound fsnotifymarkdestroyworkfn [ 243.686758] Call Trace: [ 243.686762] [c0000000166736e0] [c00000004fd91000] 0xc00000004fd91000 (unreliable) [ 243.686775] [c0000000166738d0] [c00000001001dec0] switchto+0x130/0x220 [ 243.686788] [c000000016673930] [c000000010f607b8] schedule+0x1f8/0x ---truncated---
In the Linux kernel, the following vulnerability has been resolved:
iommu/mediatek: Check return value after calling platformgetresource()
platformgetresource() may return NULL pointer, we need check its return value to avoid null-ptr-deref in resourcesize().
In the Linux kernel, the following vulnerability has been resolved:
wifi: ath11k: fix deinitialization of firmware resources
Currently, in ath11kahbfwresourcesinit(), iommu domain mapping is done only for the chipsets having fixed firmware memory. Also, for such chipsets, mapping is done only if it does not have TrustZone support.
During deinitialization, only if TrustZone support is not there, iommu is unmapped back. However, for non fixed firmware memory chipsets, TrustZone support is not there and this makes the condition check to true and it tries to unmap the memory which was not mapped during initialization.
This leads to the following trace -
[ 83.198790] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [ 83.259537] Modules linked in: ath11kahb ath11k qmihelpers .. snip .. [ 83.280286] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 83.287228] pc : iommuunmap+0x30/0x140 [ 83.293907] lr : iommuunmap+0x5c/0xa4 [ 83.298072] sp : ffff80000b3abad0 .. snip .. [ 83.369175] Call trace: [ 83.376282] iommuunmap+0x30/0x140 [ 83.378541] iommuunmap+0x5c/0xa4 [ 83.382360] ath11kahbfwresourcedeinit.part.12+0x2c/0xac [ath11kahb] [ 83.385666] ath11kahbfreeresources+0x140/0x17c [ath11kahb] [ 83.392521] ath11kahbshutdown+0x34/0x40 [ath11kahb] [ 83.398248] platformshutdown+0x20/0x2c [ 83.403455] deviceshutdown+0x16c/0x1c4 [ 83.407621] kernelrestartprepare+0x34/0x3c [ 83.411529] kernelrestart+0x14/0x74 [ 83.415781] dosysreboot+0x1c4/0x22c [ 83.419427] arm64sysreboot+0x1c/0x24 [ 83.423420] invokesyscall+0x44/0xfc [ 83.427326] el0svccommon.constprop.3+0xac/0xe8 [ 83.430974] doel0svc+0xa0/0xa8 [ 83.435659] el0svc+0x1c/0x44 [ 83.438957] el0t64synchandler+0x60/0x144 [ 83.441910] el0t64sync+0x15c/0x160 [ 83.446343] Code: aa0103f4 f9400001 f90027a1 d2800001 (f94006a0) [ 83.449903] ---[ end trace 0000000000000000 ]---
This can be reproduced by probing an AHB chipset which is not having a fixed memory region. During reboot (or rmmod) trace can be seen.
Fix this issue by adding a condition check on firmware fixed memory hwparam as done in the counter initialization function.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPLSILICONZ-1
In the Linux kernel, the following vulnerability has been resolved:
mm/uffd: fix warning without PTEMARKERUFFDWP compiled in
When PTEMARKERUFFDWP not configured, it's still possible to reach pte marker code and trigger an warning. Add a few CONFIGPTEMARKERUFFDWP ifdefs to make sure the code won't be reached when not compiled in.
In the Linux kernel, the following vulnerability has been resolved:
mm: slub: avoid wake up kswapd in settrackprepare
settrackprepare() can incur lock recursion. The issue is that it is called from hrtimerstartrangens holding the percpu(hrtimerbases)[n].lock, but when enabled CONFIGDEBUGOBJECTSTIMERS, may wake up kswapd in settrackprepare, and try to hold the percpu(hrtimerbases)[n].lock.
Avoid deadlock caused by implicitly waking up kswapd by passing in allocation flags, which do not contain GFPKSWAPDRECLAIM in the debugobjectsfillpool() case. Inside stack depot they are processed by gfpnestedmask(). Since slaballoc() has preemption disabled, we mask out GFPDIRECTRECLAIM from the flags there.
The oops looks something like:
BUG: spinlock recursion on CPU#3, swapper/3/0 lock: 0xffffff8a4bf29c80, .magic: dead4ead, .owner: swapper/3/0, .ownercpu: 3 Hardware name: Qualcomm Technologies, Inc. Popsicle based on SM8850 (DT) Call trace: spinbug+0x0 rawspinlockirqsave+0x80 hrtimertrytocancel+0x94 taskcontending+0x10c enqueuedlentity+0x2a4 dlserverstart+0x74 enqueuetaskfair+0x568 enqueuetask+0xac doactivatetask+0x14c ttwudoactivate+0xcc trytowakeup+0x6c8 defaultwakefunction+0x20 autoremovewakefunction+0x1c wakeup+0xac wakeupkswapd+0x19c wakeallkswapds+0x78 allocpagesslowpath+0x1ac allocpagesnoprof+0x298 stackdepotsaveflags+0x6b0 stackdepotsave+0x14 settrackprepare+0x5c slaballoc+0xccc kmalloccachenoprof+0x470 setpageowner+0x2bc postallochook[jt]+0x1b8 prepnewpage+0x28 getpagefromfreelist+0x1edc allocpagesnoprof+0x13c allocslabpage+0x244 allocateslab+0x7c slaballoc+0x8e8 kmemcacheallocnoprof+0x450 debugobjectsfillpool+0x22c debugobjectactivate+0x40 enqueuehrtimer[jt]+0xdc hrtimerstartrangens+0x5f8 ...