linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/util: make memdup_user_nul() similar to memdup_user()
Date: Mon, 23 Dec 2024 17:25:52 -0800	[thread overview]
Message-ID: <20241223172552.133f4e293f1dfbb6aa86b5ef@linux-foundation.org> (raw)
In-Reply-To: <014cd694-cc27-4a07-a34a-2ae95d744515@I-love.SAKURA.ne.jp>


tl;dr: patch does three different things, some of which appear to be
needed in -stable kernels.


On Sat, 21 Dec 2024 16:47:29 +0900 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:

> Since the string data to copy from userspace is likely less than PAGE_SIZE
> bytes, replace GFP_KERNEL with GFP_USER like commit 6c2c97a24f09
> ("memdup_user(): switch to GFP_USER") does

Please provide a reason for this change.  Does it have user-visible
effects?  If so, what are they?

> and add __GFP_NOWARN like commit
> 6c8fcc096be9 ("mm: don't let userspace spam allocations warnings") does.

Ditto.

> Also, use dedicated slab buckets like commit d73778e4b867 ("mm/util: Use
> dedicated slab buckets for memdup_user()") does.

Ditto.

> Reported-by: syzbot+7e12e97b36154c54414b@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=7e12e97b36154c54414b

That's a userspace-triggered WARN, so we'll want to backport the fix
into -stable kernels.  But we won't necessarly want to backport the
other two changes, depending upon what their effects are.


In other words, it would be better to present this as a series of three
(fully changelogged!) patches, with one or more of them cc:stable.

If we really do want to roll all three changes into a single patch and
backport that then please let's justify all three backports within the
changelog.



  reply	other threads:[~2024-12-24  1:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-21  7:47 Tetsuo Handa
2024-12-24  1:25 ` Andrew Morton [this message]
2024-12-30  2:55   ` Tetsuo Handa
2024-12-31  4:13     ` Tetsuo Handa
2025-01-09 17:38 ` Kees Cook

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=20241223172552.133f4e293f1dfbb6aa86b5ef@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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