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 EC57A3939C2 for ; Wed, 4 Feb 2026 13:12:44 +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=1770210765; cv=none; b=QVxaTuWPdebzbEgRhzot7kctCUTiCQwFflHiVv1KpsLms+J08EIoCoPF7h/rqwdSjAysGb2fIDwsQgKNmy1q/dt4JejrJ8GiKtiaAADrUrGzC1+Rz+4DBTxeFm0Su2aouxqbVpJdLSgwHSLSEuXsG5dwhmoahmePMtOaDD9VZmI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770210765; c=relaxed/simple; bh=TLRFIotEPox30sIyZi2p+PHia6hsMyzCCFBGsmeuTuk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oBMHp7KysE3POWW4yGmWYZNwAq5O71DBnNceHtFcS2UPRuUxeCl1Uc7gt9Z+rgFRQeabvuR1r2pddgIWyROfIiMt1N6TMg92N7X+/1ScoZ0QkugOCqpklfkUYK1Y/GHbXQnckSODxGgg8Yr4nuf7lSOiYhD2Iryq/EciOVXxjwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ekVFIDrW; 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="ekVFIDrW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0829BC4CEF7; Wed, 4 Feb 2026 13:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770210764; bh=TLRFIotEPox30sIyZi2p+PHia6hsMyzCCFBGsmeuTuk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ekVFIDrWIFZ+kXo1jfh16uKi07ehpmowwPi1uLIBY4pH4/AOa3teqcqiF57Kb+1hR dhmjmz4Zu1EhnPNbCKvziog5le3Zljyc+f9TiyzXP9SqmsdILubBzi6UJDPqLNzza+ 8gc8VxzNvfVgvkuufNe5OG3rF+Hd3V0/S2wre/k4= Date: Wed, 4 Feb 2026 14:12:41 +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] mm/kfence: randomize the freelist on initialization Message-ID: <2026020417-pessimism-unharmed-b5cf@gregkh> References: <2026020339-trickery-vegan-e9c3@gregkh> <20260204125653.1415809-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: <20260204125653.1415809-1-pimyn@google.com> On Wed, Feb 04, 2026 at 01:56:53PM +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 > > # Conflicts: > # mm/kfence/core.c > --- What are these # lines for? Please don't do that in the future as I have to manually edit them out :( thanks, greg k-h