CVE-2026-99848: apparmor: fix NULL ctx->peer derefs in unix socket ctx updates

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

apparmor: fix NULL ctx->peer derefs in unix socket ctx updates

aaunixfileperm lazily refreshes the AppArmor context cached on a unix socket. Two of the helpers it uses assume ctx->peer has already been set:

updatepeerctx -> l = aalabelmerge(old, label, GFPATOMIC); updateskctx -> } else if (aalabelissubset(plabel, old)) {

where @old is ctx->peer. Neither aalabelmerge nor aalabelissubset allows NULL. So both fault on the aalabel->size load.

BUG: kernel NULL pointer dereference, address: 000000000000004c RIP: 0010:aalabelnextnotinset+0xb/0xd0 Call Trace: aalabelissubset+0x3f/0x70 aaunixfileperm+0x5e8/0x9d0 aafileperm+0x45a/0x550 apparmorfilepermission+0x44/0xb0 securityfilepermission+0x40/0x100 rwverifyarea+0x56/0x180 vfswrite+0x7c/0x480 ksyswrite+0xbf/0xf0

ctx->peer is only recorded for stream connections and socket pairs. unixdgramconnect sets unixpeer(sk) without going through that path, so a connected AFUNIX datagram socket has unixpeer(sk) set while ctx->peer is still NULL, and the first write that needs revalidation reaches the helpers above.

Both derefs date back to the Fixes: commit, but the updateskctx() one was dormant until commit 4483efe4f215 ("apparmor: fix shadowing of plabel that prevents cache from being updated") stopped @plabel being shadowed, which is why bisecting the oops lands there.

A NULL @old just means no peer label has been recorded yet, so install the label directly instead of merging or comparing against it.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:17 PM
Data Sourced
via MITRE·01:17 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203