In the Linux kernel, the following vulnerability has been resolved:
mm: call the securitymmapfile() LSM hook in remapfilepages()
The remapfilepages syscall handler calls dommap() directly, which doesn't contain the LSM security check. And if the process has called personality(READIMPLIESEXEC) before and remapfilepages() is called for RW pages, this will actually result in remapping the pages to RWX, bypassing a W^X policy enforced by SELinux.
So we should check prot by securitymmapfile LSM hook in the remapfilepages syscall handler before dommap() is called. Otherwise, it potentially permits an attacker to bypass a W^X policy enforced by SELinux.
The bypass is similar to CVE-2016-10044, which bypass the same thing via AIO and can be found in [1].
The PoC:
$ cat > test.c
int main(void) { sizet pagesz = sysconf(SCPAGESIZE); int mfd = syscall(SYSmemfdcreate, "test", 0); const char buf = mmap(NULL, 4 pagesz, PROTREAD | PROTWRITE, MAPSHARED, mfd, 0); unsigned int old = syscall(SYSpersonality, 0xffffffff); syscall(SYSpersonality, READIMPLIESEXEC | old); syscall(SYSremapfilepages, buf, pagesz, 0, 2, 0); syscall(SYSpersonality, old); // show the RWX page exists even if W^X policy is enforced int fd = open("/proc/self/maps", ORDONLY); unsigned char buf2[1024]; while (1) { int ret = read(fd, buf2, 1024); if (ret <= 0) break; write(1, buf2, ret); } close(fd); }
$ gcc test.c -o test $ ./test | grep rwx 7f1836c34000-7f1836c35000 rwxs 00002000 00:01 2050 /memfd:test (deleted)
[PM: subject line tweaks]
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nfnetlinkqueue: do shared-unconfirmed check before segmentation
Ulrich reports a regression with nfqueue:
If an application did not set the 'FGSO' capability flag and a gso packet with an unconfirmed nfconn entry is received all packets are now dropped instead of queued, because the check happens after skbgsosegment(). In that case, we did have exclusive ownership of the skb and its associated conntrack entry. The elevated use count is due to skbclone happening via skbgsosegment().
Move the check so that its peformed vs. the aggregated packet.
Then, annotate the individual segments except the first one so we can do a 2nd check at reinject time.
For the normal case, where userspace does in-order reinjects, this avoids packet drops: first reinjected segment continues traversal and confirms entry, remaining segments observe the confirmed entry.
While at it, simplify nfctdropunconfirmed(): We only care about unconfirmed entries with a refcnt > 1, there is no need to special-case dying entries.
This only happens with UDP. With TCP, the only unconfirmed packet will be the TCP SYN, those aren't aggregated by GRO.
Next patch adds a udpgro test case to cover this scenario.
In the Linux kernel, the following vulnerability has been resolved:
riscv: trace: fix snapshot deadlock with sbi ecall
If sbiecall.c's functions are traceable,
echo "sbiecall:snapshot" > /sys/kernel/tracing/setftracefilter
may get the kernel into a deadlock.
(Functions in sbiecall.c are excluded from tracing if CONFIGRISCVALTERNATIVEEARLY is set.)
sbiecall triggers a snapshot of the ringbuffer. The snapshot code raises an IPI interrupt, which results in another call to sbiecall and another snapshot...
All it takes to get into this endless loop is one initial sbiecall. On RISC-V systems without SSTC extension, the clock events in timer-riscv.c issue periodic sbi ecalls, making the problem easy to trigger.
Always exclude the sbiecall.c functions from tracing to fix the potential deadlock.
sbi ecalls can easiliy be logged via trace events, excluding ecall functions from function tracing is not a big limitation.
drm/amd/display: Add NULL check for function pointer in dcn20setoutputtransferfunc
drm/amd/display: Pass non-null to dcn20validateapplypipesplitflags
f2fs: fix to check atomicfile in f2fs ioctl interfaces
drm/amd/display: Add null check for headpipe in dcn201acquirefreepipeforlayer
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: Add null check for headpipe in dcn32acquireidlepipeforheadpipeinlayer
This commit addresses a potential null pointer dereference issue in the dcn32acquireidlepipeforheadpipeinlayer function. The issue could occur when headpipe is null.
The fix adds a check to ensure headpipe is not null before asserting it. If headpipe is null, the function returns NULL to prevent a potential null pointer dereference.
Reported by smatch: drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn32/dcn32resource.c:2690 dcn32acquireidlepipeforheadpipeinlayer() error: we previously assumed 'headpipe' could be null (see line 2681)
drm/amd/display: Check null pointers before using them
bpf: Zero former ARGPTRTO{LONGINT} args in case of error
drm/amd/display: Add NULL check for clkmgr in dcn32inithw
drm/amd/display: Add NULL check for clkmgr and clkmgr->funcs in dcn30inithw
drm/amd/display: Fix system hang while resume with TBT monitor
drm/amd/display: Handle null 'streamstatus' in 'planeschangedforexistingstream'
In the Linux kernel, the following vulnerability has been resolved:
wifi: iwlwifi: mvm: avoid NULL pointer dereference
iwlmvmtxskbsta() and iwlmvmtxmpdu() verify that the mvmvsta pointer is not NULL. It retrieves this pointer using iwlmvmstafrommac80211, which is dereferencing the ieee80211sta pointer. If sta is NULL, iwlmvmstafrommac80211 will dereference a NULL pointer. Fix this by checking the sta pointer before retrieving the mvmsta from it. If sta is not NULL, then mvmsta isn't either.
In the Linux kernel, the following vulnerability has been resolved:
net/ncsi: Disable the ncsi work before freeing the associated structure
The work function can run after the ncsi device is freed, resulting in use-after-free bugs or kernel panic.
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/hdcp: Check GSC structure validity
Sometimes xegsc is not initialized when checked at HDCP capability check. Add gsc structure check to avoid null pointer error.
gso: fix udp gso fraglist segmentation after pull from fraglist
drm/amd/display: Check linkres->hpodplinkenc before using it
drm/amd/display: Add null check for 'afb' in amdgpudmplanehandlecursorupdate (v2)
icmp: change the order of rate limits
drm/amd/display: Skip Recompute DSC Params if no Stream on Link
In the Linux kernel, the following vulnerability has been resolved:
wifi: mac80211: don't use rate mask for offchannel TX either
Like the commit ab9177d83c04 ("wifi: mac80211: don't use rate mask for scanning"), ignore incorrect settings to avoid no supported rate warning reported by syzbot.
The syzbot did bisect and found cause is commit 9df66d5b9f45 ("cfg80211: fix default HE tx bitrate mask in 2G band"), which however corrects bitmask of HE MCS and recognizes correctly settings of empty legacy rate plus HE MCS rate instead of returning -EINVAL.
As suggestions [1], follow the change of SCAN TX to consider this case of offchannel TX as well.
[1] https://lore.kernel.org/linux-wireless/6ab2dc9c3afe753ca6fdcdd1421e7a1f47e87b84.camel@sipsolutions.net/T/#m2ac2a6d2be06a37c9c47a3d8a44b4f647ed4f024
drm/msm/adreno: Assign msmgpu->pdev earlier to avoid nullptrs
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths
When the HBA is undergoing a reset or is handling an errata event, NULL ptr dereference crashes may occur in routines such as lpfcsliflushiorings(), lpfcdevlosstmocallbk(), or lpfcaborthandler().
Add NULL ptr checks before dereferencing hdwq pointers that may have been freed due to operations colliding with a reset or errata event handler.
drm/amd/display: Check null-initialized variables
In the Linux kernel, the following vulnerability has been resolved:
bpf, lsm: Add check for BPF LSM return value
A bpf prog returning a positive number attached to fileallocsecurity hook makes kernel panic.
This happens because file system can not filter out the positive number returned by the LSM prog using ISERR, and misinterprets this positive number as a file pointer.
Given that hook fileallocsecurity never returned positive number before the introduction of BPF LSM, and other BPF LSM hooks may encounter similar issues, this patch adds LSM return value check in verifier, to ensure no unexpected value is returned.
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: prevent nfskbduplicated corruption
syzbot found that nfdupipv4() or nfdupipv6() could write per-cpu variable nfskbduplicated in an unsafe way [1].
Disabling preemption as hinted by the splat is not enough, we have to disable soft interrupts as well.
[1] BUG: using thiscpuwrite() in preemptible [00000000] code: syz.4.282/6316 caller is nfdupipv4+0x651/0x8f0 net/ipv4/netfilter/nfdupipv4.c:87 CPU: 0 UID: 0 PID: 6316 Comm: syz.4.282 Not tainted 6.11.0-rc7-syzkaller-00104-g7052622fccb1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: <TASK> dumpstack lib/dumpstack.c:93 [inline] dumpstacklvl+0x241/0x360 lib/dumpstack.c:119 checkpreemptiondisabled+0x10e/0x120 lib/smpprocessorid.c:49 nfdupipv4+0x651/0x8f0 net/ipv4/netfilter/nfdupipv4.c:87 nftdupipv4eval+0x1db/0x300 net/ipv4/netfilter/nftdupipv4.c:30 exprcallopseval net/netfilter/nftablescore.c:240 [inline] nftdochain+0x4ad/0x1da0 net/netfilter/nftablescore.c:288 nftdochainipv4+0x202/0x320 net/netfilter/nftchainfilter.c:23 nfhookentryhookfn include/linux/netfilter.h:154 [inline] nfhookslow+0xc3/0x220 net/netfilter/core.c:626 nfhook+0x2c4/0x450 include/linux/netfilter.h:269 NFHOOKCOND include/linux/netfilter.h:302 [inline] ipoutput+0x185/0x230 net/ipv4/ipoutput.c:433 iplocalout net/ipv4/ipoutput.c:129 [inline] ipsendskb+0x74/0x100 net/ipv4/ipoutput.c:1495 udpsendskb+0xacf/0x1650 net/ipv4/udp.c:981 udpsendmsg+0x1c21/0x2a60 net/ipv4/udp.c:1269 socksendmsgnosec net/socket.c:730 [inline] socksendmsg+0x1a6/0x270 net/socket.c:745 syssendmsg+0x525/0x7d0 net/socket.c:2597 syssendmsg net/socket.c:2651 [inline] syssendmmsg+0x3b2/0x740 net/socket.c:2737 dosyssendmmsg net/socket.c:2766 [inline] sesyssendmmsg net/socket.c:2763 [inline] x64syssendmmsg+0xa0/0xb0 net/socket.c:2763 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xf3/0x230 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f RIP: 0033:0x7f4ce4f7def9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4ce5d4a038 EFLAGS: 00000246 ORIGRAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f4ce5135f80 RCX: 00007f4ce4f7def9 RDX: 0000000000000001 RSI: 0000000020005d40 RDI: 0000000000000006 RBP: 00007f4ce4ff0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4ce5135f80 R15: 00007ffd4cbc6d68 </TASK>
ACPICA: check null return of ACPIALLOCATEZEROED() in acpidbconverttopackage()
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/pm: ensure the fwinfo is not null before using it
This resolves the dereference null return value warning reported by Coverity.