The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>,
	David Laight <david.laight.linux@gmail.com>,
	Ondrej Mosnacek <omosnace@redhat.com>,
	Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
	selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] selinux: hooks: use kmalloc() to allocate path buffer
Date: Tue, 2 Jun 2026 13:20:13 +0300	[thread overview]
Message-ID: <ah6uXccHdngEUKr8@kernel.org> (raw)
In-Reply-To: <CAHC9VhQ9mMhswzmy3745HbXbe_xm0aeJOmTG1PiDHtv1=zTG6A@mail.gmail.com>

On Mon, Jun 01, 2026 at 02:11:11PM -0400, Paul Moore wrote:
> On Sun, May 31, 2026 at 12:58 PM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> >
> > selinux_genfs_get_sid() allocates memory for a path with __get_free_page().
> >
> > Such usage does not require a "page" and the size of the buffer should
> > actually be PATH_MAX which may be less than PAGE_SIZE on some
> > architectures.
> >
> > Replace __get_free_page() for allocation of a path buffer with kmalloc()
> > and make it explicit that the buffer size is PATH_MAX.
> >
> > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> > ---
> > v3:
> > get the args in the right order
> >
> > v2:
> > * explicitly use kmalloc() with PATH_MAX
> >
> >  security/selinux/hooks.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Considering the problems with the first two versions of this patch I
> have to ask what sort of testing you've done on this?  I know it's a
> trivial patch, but we're on v3 ...

Boot of fedora on an arm64 VM with 64K page size kernel.
 
> -- 
> paul-moore.com

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2026-06-02 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 16:58 [PATCH v3] selinux: hooks: use kmalloc() to allocate path buffer Mike Rapoport
2026-06-01 18:11 ` Paul Moore
2026-06-02 10:20   ` Mike Rapoport [this message]
2026-06-03 16:08     ` Paul Moore
2026-06-04  5:29       ` Mike Rapoport
2026-06-02 13:51 ` Stephen Smalley

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=ah6uXccHdngEUKr8@kernel.org \
    --to=rppt@kernel.org \
    --cc=david.laight.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    --cc=venkat88@linux.ibm.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