linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Josh Law <hlcj1234567@gmail.com>
Cc: Liam.Howlett@oracle.com, aliceryhl@google.com,
	andrewjballance@gmail.com, maple-tree@lists.infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Josh Law <objecting@objecting.org>
Subject: Re: [PATCH] lib/maple_tree: fix swapped arguments in mas_safe_pivot() call
Date: Fri, 6 Mar 2026 14:54:34 -0800	[thread overview]
Message-ID: <20260306145434.c069313fe809d94e64a07109@linux-foundation.org> (raw)
In-Reply-To: <b796ccaa-242d-4e4a-a9f5-b3a91f46f838@gmail.com>

On Fri, 6 Mar 2026 22:11:54 +0000 Josh Law <hlcj1234567@gmail.com> wrote:

> >> --- a/lib/maple_tree.c
> >> +++ b/lib/maple_tree.c
> >> @@ -3279,7 +3279,7 @@ static inline void mas_extend_spanning_null(struct ma_wr_state *l_wr_mas,
> >>         (r_mas->last < r_mas->max) &&
> >>         !mas_slot_locked(r_mas, r_wr_mas->slots, r_mas->offset + 1)) {
> >>         r_mas->last = mas_safe_pivot(r_mas, r_wr_mas->pivots,
> >> -                        r_wr_mas->type, r_mas->offset + 1);
> >> +                        r_mas->offset + 1, r_wr_mas->type);
> >>         r_mas->offset++;
> >>     }
> >
> > Whoops.  How come nobody has noticed after 4+ years?
> >
> > I'll add
> >
> >     Fixes: 54a611b60590 ("Maple Tree: add new data structure")
> >
> > and maybe cc:stable if we have a reason to do so.
> 
> Hi Andrew, on thought, I'd like to add Cc: stable@vger.kernel.org to this.
> Even though it's been 4 years, a swapped argument in a core data structure like Maple Tree is a silent bug that could cause rare corruption. Better to defuse it in the LTS kernels.

Seems appropriate.  But not as a hotfix, given the 3+ year thing.

I was hoping to hear some thoughts on why this has proven to be so benign.  


  reply	other threads:[~2026-03-06 22:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 20:08 Josh Law
2026-03-06 21:33 ` Andrew Morton
2026-03-06 22:11   ` Josh Law
2026-03-06 22:54     ` Andrew Morton [this message]
2026-03-06 23:38       ` Josh Law

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=20260306145434.c069313fe809d94e64a07109@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=aliceryhl@google.com \
    --cc=andrewjballance@gmail.com \
    --cc=hlcj1234567@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=objecting@objecting.org \
    /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