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 F2B56423A99 for ; Thu, 5 Feb 2026 15:32:33 +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=1770305554; cv=none; b=JBRfXY/GjOFFaU0+oj9NAQwbBADlzxQ4AYodD/rULKDI+ikhE1uLABVMxU0uekDxOkIjqT7Rj9/IymvmelmisZRGzLyHl7vh68WtE0KF3KnCXC0LzrQT686aRolv/L2BgR0hLwOsltcmmYhM033rK67FAju1VRUpYzVWjzdaxAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770305554; c=relaxed/simple; bh=NkSRuhIkbLPVZrxTQaZV1VAjFjjIRy3T5AMSUuV3gbQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JTtEIAIhBwU40hlFT9Ma4FZBt55qAbnnxCMe0mdnEXvRo93XzT6YZYawnTf1yerHc2m/+pABG/k3X7PgzbgS9cUcrFs06wwjczYim/5+2s9aA6iCCSUQ9c4drrQRQ15k4StWGF8JeBRKfge/n9k3ZrYvlIZf4DJiwD4xOaNZQqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=libPGa7j; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="libPGa7j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF49CC4CEF7; Thu, 5 Feb 2026 15:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770305553; bh=NkSRuhIkbLPVZrxTQaZV1VAjFjjIRy3T5AMSUuV3gbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=libPGa7juMyiJuct+dPnMDaonyPMoOO6L9UDJ+iQF9SzTg1osafQabUOo/bfrtAMb pLksSyPUy+k9LbDAWTE3Q4aUl18T8jjTwjKUDvnNh5yTZIigy3NZW4NXvLobA6OgAx 3rrrMcaJ6OaqVT21RwGo6PynUnKyamic7+hK8fhA= Date: Thu, 5 Feb 2026 16:32:29 +0100 From: Greg KH To: Pimyn Girgis Cc: stable@vger.kernel.org, Alexander Potapenko , Dmitry Vyukov , Marco Elver , Ernesto Martnez Garca , Kees Cook , Andrew Morton Subject: Re: [PATCH 5.15.y v3] mm/kfence: randomize the freelist on initialization Message-ID: <2026020508-rabid-heaviness-d146@gregkh> References: <2026020339-trickery-vegan-e9c3@gregkh> <20260205145055.3333340-1-pimyn@google.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260205145055.3333340-1-pimyn@google.com> On Thu, Feb 05, 2026 at 03:50:55PM +0100, Pimyn Girgis wrote: > Randomize the KFENCE freelist during pool initialization to make > allocation patterns less predictable. This is achieved by shuffling the > order in which metadata objects are added to the freelist using > get_random_u32_below(). > > Additionally, ensure the error path correctly calculates the address range > to be reset if initialization fails, as the address increment logic has > been moved to a separate loop. > > Link: https://lkml.kernel.org/r/20260120161510.3289089-1-pimyn@google.com > Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure") > Signed-off-by: Pimyn Girgis > Reviewed-by: Alexander Potapenko > Cc: Dmitry Vyukov > Cc: Marco Elver > Cc: Ernesto Martnez Garca > Cc: Greg KH > Cc: Kees Cook > Cc: > Signed-off-by: Andrew Morton > (cherry picked from commit 870ff19251bf3910dda7a7245da826924045fedd) > Signed-off-by: Pimyn Girgis > --- > v2: handle addr calculation for error path within appropriate loop What changed in v3? Yes, it's a nit, but please, we have a process :) thanks, greg k-h