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 70A6C275AE8 for ; Thu, 5 Feb 2026 14:11:07 +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=1770300667; cv=none; b=koKdjXSUzKOPQdir3eBvHvwrkQsLOSFkvK6jCwGfnzeiRfvY3sqRuiqc97yEkZQTHGPaW9VEevCE3OWUn+eoy08itTSCkBP4mJSJWV19RPI9JdCjCChrVRU0ByaiOgmpYntGozZMUuMN1fKehgWZl+mcB7nOSmB+vxDnXAye0hw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770300667; c=relaxed/simple; bh=GUa0E4UqVuY7CM9Ey97twGZD2MJQFqkeX74MMiFvY1w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bVXUt4vL++96aIOwsSkGSz9x+ju0pk4pyiU8QxWbwmbE/1fJ3AXMOw8++iZkxzoRZ1B8xGtFqX76XPLAyRo9t9s0IRkKuZaEWbCKkrGyeaKQ3VbmKzGvpv7+BXkmQsy8rvzLs6EWc7qd4Wo21/qEHGWWHznBCOPfNe33eDeLPno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sgVRzhnf; 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="sgVRzhnf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84F70C4CEF7; Thu, 5 Feb 2026 14:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770300667; bh=GUa0E4UqVuY7CM9Ey97twGZD2MJQFqkeX74MMiFvY1w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sgVRzhnfU9RevwCnld5iGaDRdC2wjAf3FJnT5epGbUzxVly6dFxPhchepOR7wPE5V ufTOBlLzZFKcJWnJdrV+661oPlVxW++pjXsUDzz5Sh7oUS5OHopz394wIp3gBIJ/+7 7Lw1FCrxunJb71M2dG3iSl3aZHlJ+SuLr1i81ZSk= Date: Thu, 5 Feb 2026 15:11:03 +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 v2] mm/kfence: randomize the freelist on initialization Message-ID: <2026020546-nimble-mower-1202@gregkh> References: <2026020339-trickery-vegan-e9c3@gregkh> <20260205095323.3149138-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: <20260205095323.3149138-1-pimyn@google.com> On Thu, Feb 05, 2026 at 10:53:23AM +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 > --- > mm/kfence/core.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) What changed from v1? Always put that below the --- line, like any other kernel patch. thanks, greg k-h