Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #85327

Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Salvatore Bonaccorso <carnil@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled
Date Fri, 31 Jan 2025 07:00:01 +0100
Message-ID <KaSel-dexM-17@gated-at.bofh.it> (permalink)
References <K30sp-6TAG-3@gated-at.bofh.it> <K30sp-6TAG-3@gated-at.bofh.it> <K30sp-6TAG-3@gated-at.bofh.it> <K5y6B-9mFR-1@gated-at.bofh.it> <K5Zgt-9HwT-3@gated-at.bofh.it> <K30sp-6TAG-3@gated-at.bofh.it> <K6YLn-aroU-7@gated-at.bofh.it> <K30sp-6TAG-3@gated-at.bofh.it> <K6YLn-aroU-7@gated-at.bofh.it>
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Fri Jan 31 05:51:08 2025
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -3.999
Reply-To Salvatore Bonaccorso <carnil@debian.org>, 1092591@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc Debian Kernel Team <debian-kernel@lists.debian.org>
X-Debian-Pr-Message followup 1092591
X-Debian-Pr-Package src:linux
X-Debian-Pr-Keywords upstream
X-Debian-Pr-Source linux
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Debian-User carnil
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1884009
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 39
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc Bastian Blank <waldi@debian.org>
X-Original-Date Fri, 31 Jan 2025 06:48:08 +0100
X-Original-Message-ID <Z5xkGPEBVy-v7EzU@eldamar.lan>
X-Original-References <173642770338.6275.10194148740238481779.reportbug@lomiri-content-hub-trixie> <173642770338.6275.10194148740238481779.reportbug@lomiri-content-hub-trixie> <173642770338.6275.10194148740238481779.reportbug@lomiri-content-hub-trixie> <2b14bced-076b-4259-935c-b0356d94d028@berhoerster.name> <20250117181620.al3aqzdpr6gnjtcf@shell.thinkmo.de> <173642770338.6275.10194148740238481779.reportbug@lomiri-content-hub-trixie> <cb3b240c-3704-4c96-a35d-f08ad9aeab44@berhoerster.name> <173642770338.6275.10194148740238481779.reportbug@lomiri-content-hub-trixie> <cb3b240c-3704-4c96-a35d-f08ad9aeab44@berhoerster.name>
Xref csiph.com linux.debian.bugs.dist:1231089 linux.debian.kernel:85327

Cross-posted to 2 groups.

Show key headers only | View raw


Hi

On Mon, Jan 20, 2025 at 01:06:00PM +0100, Guido Berhoerster wrote:
> Am 17.01.25 um 19:16 schrieb Bastian Blank:
> > Control: tags -1 upstream
> > Controm: forwarded -1 https://gitlab.com/apparmor/apparmor/-/blob/692e6850ba90582105713a683bed753bad696aab/kernel-patches/v4.17/0002-apparmor-af_unix-mediation.patch
> > 
> > On Thu, Jan 16, 2025 at 02:16:18PM +0100, Guido Berhoerster wrote:
> >> From my superficial reading of the code the error seems to come from here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/security/apparmor/lsm.c?h=v6.12.6#n1313
> > 
> > Yes, it does.
> > 
> >> It appears that AppArmor SO_PEERSEC support for unix domain sockets bound to a filesystem path name is missing from the upstream kernel and is only enabled as a side effect of a patch distributed with AppArmor: https://gitlab.com/apparmor/apparmor/-/blob/692e6850ba90582105713a683bed753bad696aab/kernel-patches/v4.17/0002-apparmor-af_unix-mediation.patch
> >> Ubuntu kernels contain a rebased variant of the patch which is likely why SO_PEERSEC works on Ubuntu.
> > 
> > This comes from the addition of apparmor_unix_stream_connect.  Without
> > it the peer context is never set.
> > 
> >> The reason I stumbled on this issue is that we (ubports-team) are currently packaging lomiri-content-hub which implicitly relies on SO_PEERSEC through the DBus daemon to get the AppArmor profile of a process requesting to export a file. Without this it is not possible to confine Lomiri/Ubuntu Touch apps running on Debian.
> > 
> > So someone needs to properly submit this support upstream.
> 
> >From my understanding the AppArmor project has kept this as an out-of-tree
> patch because it will have to be reworked when/if LSM stacking lands
> (see [1]). I don't follow kernel development closely but LSM-stacking has
> been under discussion for more than a decade now with no end in sight.
> Would you consider including this patch into Debian? The patch itself is
> very likely to be maintained by Ubuntu as they also make use of SO_PEERSEC.

WE had a short discussion on that in our team. BAsically, we won't
pick a change which is not going to land in upstream. That means the
support needs to go upstream in one or the other acceptable form from
Apparmor upstream.

I see and understand the problem you mention that in the related work
upstream there is ongoing discussion since years.

Regards,
Salvatore

Back to linux.debian.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled Guido Berhoerster <guido+debian@berhoerster.name> - 2025-01-09 14:10 +0100
  Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled Guido Berhoerster <guido+debian@berhoerster.name> - 2025-01-16 14:30 +0100
    Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled Bastian Blank <waldi@debian.org> - 2025-01-17 19:30 +0100
      Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled Guido Berhoerster <guido+debian@berhoerster.name> - 2025-01-20 13:10 +0100
        Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC fails with ENOPROTOOPT with AppArmor enabled Salvatore Bonaccorso <carnil@debian.org> - 2025-01-31 07:00 +0100
  Processed: Re: Bug#1092591: linux-image-6.12.6-amd64: SO_PEERSEC  fails with ENOPROTOOPT with AppArmor enabled "Debian Bug Tracking System" <owner@bugs.debian.org> - 2025-01-17 19:30 +0100

csiph-web