From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E33635F8B2 for ; Fri, 6 Mar 2026 22:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772837976; cv=none; b=PC2oQQjcNaNznnfRfFHFW+03UirMzOMHU24v4bOFmbHKYeREM+ZRjaLliEJit5wYfvC301licTzaQabLYJn6kTpBZbhGqQ3MlUKyiX0QzBzkdTL5bIcxW6pKb8RCNB1LBq5YQduiPnEjbizbiQWxSnTquOSlURhzBgwYlpeHfpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772837976; c=relaxed/simple; bh=4gdZG34dcUZ3EuvSE5lG2OYC4lyaxRv55cEcPosU/Iw=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=HHuU5rxs/AHY3N0YTdipOZ3faqt5K8mDGkLgpBMEmKoBqaKSnzrafO7RaGuAeTTFCrJ6oiEWWhZM1h0nisNAV8/F/PdwGyN7I200kFdktIqtuDtMn/3NZOk7hX/ppnPcWGmpSusOCCCdiVTcBRUG4TD121DQMkJrguGKArb2oUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LXXzEdhm; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LXXzEdhm" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-483487335c2so81934975e9.2 for ; Fri, 06 Mar 2026 14:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772837973; x=1773442773; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=4gdZG34dcUZ3EuvSE5lG2OYC4lyaxRv55cEcPosU/Iw=; b=LXXzEdhmQPZu/hdoRMRP94caGcFGAMzFkKmrnB/FlMH09GKOW2kX3fSYDSzBSBo4CV vnZ8mQ48Axt8Az9+5aXmqkTAhA+z2wN7k1dMMJSaYA7sYQBEBoU0ABjzTK6hS/Da4Xr3 arO0b42IaaKGSSBjLNtW2Osm4IhHioflbtMrFKpbJJVkQMQgDVjPFGZcCffXx6b52mWp eLrpvIc+Oyy1r8AZxJA6UQr+OSpNvgYroSZziNvvh39M3NVEo8GyA5uxvalkkJcL4E9e E4TdIe5+astxCE4g3+xmHet4l7OmkuyF/Pv6BOYGD1HJDPXCKiV850cGWzqjdz9Ssi1C Ygww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772837973; x=1773442773; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4gdZG34dcUZ3EuvSE5lG2OYC4lyaxRv55cEcPosU/Iw=; b=PTO87iZY5QdlahP4Pa0MXKw5aqr83k5dVd3z9uC07FBKlImccLR3BxEiGDtKmlqk7Q kYwkd9q1yIAHxWNY5wDyFYb08F4dz9j68LTimfr3wa6gY4DtQOfcTexGFYX0n7xTio4E A8PSy4fldX3XqRNO0JiV5vKMPI1q642pvoPmzwbeAcZxOwWRxRGeTMpfsspenVkLlzMP bTccu6tZo4DV0RnOPsnXgNpGqOie52hUuj1Fb5YVAj9qdCNReX/EkoSmeHx/hZHiKqjV fhKGakKvRp4HdZLzRjSnGpZxzCoe05jVcnmV6d96aUzwXUdBin8yxB4oGnBYWH25tpKf Fj1Q== X-Forwarded-Encrypted: i=1; AJvYcCXK1PRQCOomGskhQ9QE3H0bM69IRYseNi43MpLL3IoXu6hLuRutSLcBYplVRu4g+PGoDSXZAKw/djMsYDI=@vger.kernel.org X-Gm-Message-State: AOJu0YzRHyIoPDqMfN4yTuiJzmTE216dXrts/M+lYZ8qu/UHpwsf98cf 15+Am9njSHFmhV3Uvr4VTWNCLT2CQhR9OwFCi/hKxifzj17xu9uX+RFp X-Gm-Gg: ATEYQzyIHT/AWbxmdafwWHhlc3ooexvmBJqAi0y8l2dXU/7qBC+Y3bixyET/Nqh8nII buf9eCl2lUJ7PQUYreNHkFHk4+ibTWnDXAuqRQQpU0jw1OJWMDTKEmX7mQ05IFA01PB9Ga1Bn3I +AgqTRz621+v09jbuDBgPuRjANA13qrVMguY7NyUuJL56dRTnuN+vOm8TZ27hvEOesr3iYjxirO NPMAPHk9mMJjjkVaONmb0FLiP0WTE14bbtZB9J+jzdzxeJnezTyGdw6eRQTjl3hDFXZvwdQsXRP QikGrQA6s/byGe8vg1dhDbArbOFIButSFmjhI0mQN68Pl1na4CQxnXOB0y6bzC9IvOAPsvHbdWb eM+gNlPNnY8JpfBrvnLwH3APN1z2au716WSbKTwhX16q2sZe/QGCLaGKQsLHo2eexPq4mnKvNJb C7h4NrYCAYpTwZFlzp X-Received: by 2002:a05:600c:821b:b0:477:89d5:fdb2 with SMTP id 5b1f17b1804b1-4852693049fmr61205695e9.14.1772837972744; Fri, 06 Mar 2026 14:59:32 -0800 (PST) Received: from [127.0.0.1] ([86.1.69.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48527681a3esm149218735e9.4.2026.03.06.14.59.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2026 14:59:32 -0800 (PST) Date: Fri, 6 Mar 2026 22:59:33 +0000 From: Josh Law To: Andrew Morton Cc: Liam Howlett , Matthew Wilcox , Alice Ryhl , Andrew Ballance , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Law Message-ID: In-Reply-To: <20260306145720.e8b6afd26aeb9b5caa277026@linux-foundation.org> References: <20260306223219.2824040-1-objecting@objecting.org> <20260306145720.e8b6afd26aeb9b5caa277026@linux-foundation.org> Subject: Re: [PATCH v2] lib/maple_tree: fix swapped arguments in mas_safe_pivot() call 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: 6 Mar 2026 22:57:21 Andrew Morton : > On Fri,=C2=A0 6 Mar 2026 22:32:19 +0000 Josh Law = wrote: > >> From: Josh Law >> >> The call to mas_safe_pivot() in mas_wr_extend_null() has the pivot index >> and maple type arguments swapped. The function signature expects >> (mas, pivots, piv, type) but the call passes (mas, pivots, type, piv). >> >> This causes the pivot index to be interpreted as a maple node type and >> vice versa, leading to incorrect pivot lookups. In practice, this means >> a null-extending store into a maple tree node can read the wrong pivot >> value, potentially corrupting the range tracked by the maple state. For >> a VMA maple tree, this could cause an incorrect vm_area_struct range to >> be returned during operations like mmap or munmap, leading to silent >> memory mapping corruption. >> >> Every other mas_safe_pivot() call site in the file passes the arguments >> in the correct (piv, type) order; this is the only one with them >> reversed. > > This all appears to be identical to v1? > >> Link: https://lkml.kernel.org/r/20260306200820.2819999-1-objecting@objec= ting.org >> Fixes: 54a611b60590 ("Maple Tree: add new data structure") >> Signed-off-by: Josh Law >> Cc: stable@vger.kernel.org >> Cc: Alice Ryhl >> Cc: Andrew Ballance >> Cc: Liam Howlett >> Signed-off-by: Andrew Morton >> --- > > Right here after the --- is where people add their > what-i-changed-since-last time notes. > >> lib/maple_tree.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) Fixed on V3 Only the cc stable was changed so you don't have to do much haha V/R Josh law