From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC8DF35DA77 for ; Fri, 6 Mar 2026 22:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772837676; cv=none; b=m8cf1RmxaUKwCa60s5y25KmrLVWBg/Ux1L/tCDBZd8qHkwKBlzYZ2if07siuIeo4pJIXgPNer/axZbpmh/dWcjw61Fu5nbsxbeNSesGDf5xYpsm42GcUQ7MmmkA6ucu2RLn/wHi6wK1s00e4fQbkiKfkCoBgz4L48yqKGDbnifs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772837676; c=relaxed/simple; bh=Crwot/d7WDbdCGkIKt73y4giJNElc+vyWtGZgHDnlsk=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=OyqesjXn5bx8E6J7Xo/edoeY5Jyw2Xu+TUelEzwEePjBqqVh1CoJR1PquEjmtDn1ltrGKU4iJnSPqrkicN8lfCnMmDRwAOtWCZvEhqHKnukk8v3fq2QGOPyl8eIAdQbbzcvnqKzqhy32yprSoq27VwWNCKGppCYNOXQXIrzIl4E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=THmqX8z0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="THmqX8z0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DC2AC4CEF7; Fri, 6 Mar 2026 22:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1772837675; bh=Crwot/d7WDbdCGkIKt73y4giJNElc+vyWtGZgHDnlsk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=THmqX8z0XY2vShT+oN+k58cZPc8qtCX0GKKF7CItaFCMczcEQnmyhAEyR63WWJa3Y 0ccps40WBnBLmgZej9zfz4VT5bbR4DP9fVPegZKaSP/9JBi2m+gbkm86fDMiZXrnF3 4J6/hsW8ztkD9j1w2rFlVglS8QyfK0ma6okLNDVQ= Date: Fri, 6 Mar 2026 14:54:34 -0800 From: Andrew Morton To: Josh Law 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 Subject: Re: [PATCH] lib/maple_tree: fix swapped arguments in mas_safe_pivot() call Message-Id: <20260306145434.c069313fe809d94e64a07109@linux-foundation.org> In-Reply-To: References: <20260306200820.2819999-1-objecting@objecting.org> <20260306133321.4fa6c5a73067bd179a5e888e@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, 6 Mar 2026 22:11:54 +0000 Josh Law wrote: > >> --- a/lib/maple_tree.c > >> +++ b/lib/maple_tree.c > >> @@ -3279,7 +3279,7 @@ static inline void mas_extend_spanning_null(stru= ct ma_wr_state *l_wr_mas, > >> =A0=A0=A0=A0=A0=A0=A0 (r_mas->last < r_mas->max) && > >> =A0=A0=A0=A0=A0=A0=A0 !mas_slot_locked(r_mas, r_wr_mas->slots, r_mas->= offset + 1)) { > >> =A0=A0=A0=A0=A0=A0=A0 r_mas->last =3D mas_safe_pivot(r_mas, r_wr_mas->= pivots, > >> -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= r_wr_mas->type, r_mas->offset + 1); > >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= r_mas->offset + 1, r_wr_mas->type); > >> =A0=A0=A0=A0=A0=A0=A0 r_mas->offset++; > >> =A0=A0=A0 } > > > > Whoops.=A0 How come nobody has noticed after 4+ years? > > > > I'll add > > > > =A0=A0=A0 Fixes: 54a611b60590 ("Maple Tree: add new data structure") > > > > and maybe cc:stable if we have a reason to do so. >=20 > 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 structur= e 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. = =20