From: Stephen Smalley <stephen.smalley.work@gmail.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>,
Ondrej Mosnacek <omosnace@redhat.com>,
selinux@vger.kernel.org, Marc Reisner <reisner.marc@gmail.com>,
david@redhat.com, Vlastimil Babka <vbabka@suse.cz>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
linux-mm@kvack.org
Subject: Re: [PATCH] Revert "selinux: use vma_is_initial_stack() and vma_is_initial_heap()"
Date: Thu, 8 Aug 2024 14:54:23 -0400 [thread overview]
Message-ID: <CAEjxPJ5JsNF=ypOFJxLGB3aBOAXLC7av+_HWS_FObfdGz+d0AQ@mail.gmail.com> (raw)
In-Reply-To: <CAHC9VhRz=drY-=W64VezugemWsBgaQZS_NQ2TZzrS0-fhZgg6A@mail.gmail.com>
On Thu, Aug 8, 2024 at 11:48 AM Paul Moore <paul@paul-moore.com> wrote:
>
> On Thu, Aug 8, 2024 at 9:40 AM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> >
> > On Thu, Aug 8, 2024 at 9:09 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> > >
> > > This reverts commit 68df1baf158fddc07b6f0333e4c81fe1ccecd6ff.
> > >
> > > The selinux only want to check whether the VMA range is within the heap
> > > range or not, but vma_is_initial_heap() helper will check the intersection
> > > between the two ranges, which leads to some issue, let's turn back to the
> > > original validation.
> > >
> > > Reported-by: Marc Reisner <reisner.marc@gmail.com>
> > > Closes: https://lore.kernel.org/all/ZrPmoLKJEf1wiFmM@marcreisner.com/
> > > Fixes: 68df1baf158f ("selinux: use vma_is_initial_stack() and vma_is_initial_heap()")
> > > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> >
> > I was only going to recommend reverting the change to the heap check
> > but in case Paul is fine with a straight revert,
> > Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
>
> I was hoping that the mm folks would put together a quick patch to fix
> what looks like a problem with the helper, but I'm not sure when that
> is going to happen and with other callers I don't want to change the
> helper and break a different part of the kernel. Unfortunately that
> leaves us with needing a revert, but like Stephen said, I think
> reverting just the heap helper is the right thing to do right now; I
> also want to put a comment in there for the next time someone tries to
> re-add the vma_is_initial_heap(). Give me some time, I'll have a
> patch out for this later today.
FWIW, I tossed the reproducer code from Marc Reisner into a branch of
the SELinux testsuite and wrapped it up with an added test to the mmap
tests here:
https://github.com/stephensmalley/selinux-testsuite/tree/execheapregression
Passes with the revert, fails without.
Would need to be modified to be portable to actually be suitable for
inclusion though.
next prev parent reply other threads:[~2024-08-08 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240808130909.1027860-1-wangkefeng.wang@huawei.com>
[not found] ` <CAEjxPJ4b2Xcptmi2cJNyh=N=1ky=yfg_wVB1yDLwr8uuhujxew@mail.gmail.com>
2024-08-08 15:48 ` Paul Moore
2024-08-08 18:54 ` Stephen Smalley [this message]
2024-08-08 20:43 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAEjxPJ5JsNF=ypOFJxLGB3aBOAXLC7av+_HWS_FObfdGz+d0AQ@mail.gmail.com' \
--to=stephen.smalley.work@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=reisner.marc@gmail.com \
--cc=selinux@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox