🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #1474

Bug#1145111: [PATCH] apparmor: fix NULL ctx->peer derefs in unix socket ctx updates

#1474
From: Aurelien Jarno
Date: Tue, 20 Oct 2026 21:20
52 lines
4128 bytes
control: affects -1 netcat-openbsd

Hi,

On 2026-10-20 23:39, Adrian Bunk wrote:
> On Sun, Oct 18, 2026 at 09:34:39AM +0200, Paul Gevers wrote:
> > Hi,
> 
> Hi Paul,
> 
> > I find it a bit difficult to track if either of the patches landed already
> > in the kernel used by the buildds.
> 
> the issue is still seen on the buildds, I think netcat-openbsd today 
> killed buildds on loong64 and in ports on pppc64 and sparc64.

The issue is still present upstream, and thus in the testing, unstable, 
experimental and backports kernels. Two similar patches fixing the issue 
have been posted so far. If the fix is not pushed through the next merge 
window, I think the kernel team should either:
- bypass the policy that the patches need to be merged upstream first
- or disable apparmor in the debian kernel

Please also find below a simpler reproducer, it just needs python to 
crash a default forky installation. What is nice is that it works for 
all architectures without having to special case them.

Regards
Aurelien


#!/usr/bin/env python3
import os, socket, sys

if '--payload' in sys.argv:
  server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
  server.setsockopt(socket.SOL_SOCKET, socket.SO_PASSCRED, 1)
  server.bind('\0aa-crash-server')

  client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
  client.connect('\0aa-crash-server')
  os.writev(client.fileno(), [b'\0' * 16])
  sys.exit()

# Run the payload using the unprivileged_userns AA profile
os.execvp('aa-exec', ['aa-exec', '-p', 'unprivileged_userns', '--',
                      sys.executable, os.path.abspath(__file__), '--payload'])


-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                     http://aurel32.net
Technical Details
Message-ID: <NQppv-6Qpz-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <NPtER-6ilc-7@gated-at.bofh.it> <NPtER-6ilc-7@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NPtER-6ilc-5@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NQoWt-6Q47-29@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NQoWt-6Q47-29@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Aurelien Jarno <aurel32@debian.org>
Newsgroups: linux.debian.bugs.dist,linux.debian.kernel
Subject: Bug#1145111: [PATCH] apparmor: fix NULL ctx->peer derefs in unix socket ctx updates
Date: Tue, 20 Oct 2026 23:20:01 +0200
Message-ID: <NQppv-6Qpz-1@gated-at.bofh.it>
References: <NPtER-6ilc-7@gated-at.bofh.it> <NPtER-6ilc-7@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NPtER-6ilc-5@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NQoWt-6Q47-29@gated-at.bofh.it> <NuYNj-cyQR-9@gated-at.bofh.it> <NQoWt-6Q47-29@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Oct 20 21:11:13 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.699
Reply-To: Aurelien Jarno <aurel32@debian.org>, 1145111@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: debian-kernel@lists.debian.org
X-Debian-Pr-Message: followup 1145111
X-Debian-Pr-Package: src:linux
X-Debian-Pr-Keywords: upstream patch
X-Debian-Pr-Source: linux
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/2.4.1 (2026-07-04)
X-Debian-User: aurel32
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1997816
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 52
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Paul Gevers <elbrus@debian.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
X-Original-Date: Tue, 20 Oct 2026 23:08:44 +0200
X-Original-Message-ID: <atfYXNIfWHNY5FB5@aurel32.net>
X-Original-References: <f1d869e3-b7e5-4ade-8521-c1d26815fa4f@app.fastmail.com> <f1d869e3-b7e5-4ade-8521-c1d26815fa4f@app.fastmail.com> <178742368663.657335.8342834243506901075.reportbug@ohm.local> <73c0b33d-7225-4531-aea1-c5fce9a8101f@debian.org> <178742368663.657335.8342834243506901075.reportbug@ohm.local> <atfRZJ7jdTzsP9-D@localhost> <178742368663.657335.8342834243506901075.reportbug@ohm.local> <atfRZJ7jdTzsP9-D@localhost>