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 CFEE342EEB0; Tue, 20 Jan 2026 17:46:18 +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=1768931178; cv=none; b=M//uCWJ8TDmZajm9oUP3NXtebtyqZq206AYI9Qbc5O/VcIrLVXmhkUxaqNdMrMBTbQLygA2DtVV0S0BS7SnTPfqKUSHaIjwU/zKLFBMvCRMSNialuFw9DCm3/T6zZ+tplc/g/g85JHuu7rWLxpHEE22kpMt0FkLmq07Z59AIrWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768931178; c=relaxed/simple; bh=d913gHiC7qyAQGtH50oI3jMK1kbHhTOj4kG7zU0QOmA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=DlDiPT1916gFwxjK/bZQmS/0QrOmFRLszguFO41QSQHm7zyGhGj43CbzIRORQvG9WOSD9DR8iliibfJLO+IsqQ1jFy/HOcY5oF9G8a3k5Yr/XNxX1oPcouRggsEnNNDvkM+q06mhES1JNS0y1o4Jc/Nb1bN4KNOiXwxcWlDsIRU= 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=uB7J5VIU; 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="uB7J5VIU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 532CDC16AAE; Tue, 20 Jan 2026 17:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1768931178; bh=d913gHiC7qyAQGtH50oI3jMK1kbHhTOj4kG7zU0QOmA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uB7J5VIUyJlYBEPPsxzVcA4alTvhY6C6nzyO6qsW2rXfF7KeTSdxAvdULVMLimp58 e0wofVjX7CNvQNv0DM7awPKca4ol6l2pbrvVd9thyhwUrtMZz8w80mOxqX0gvitatf ODg5ErvdlaNQ3fygK7JRr98fQWgTwsd8rl8rrzXo= Date: Tue, 20 Jan 2026 09:46:17 -0800 From: Andrew Morton To: Pimyn Girgis Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, elver@google.com, dvyukov@google.com, glider@google.com, kasan-dev@googlegroups.com, stable@vger.kernel.org Subject: Re: [PATCH] mm/kfence: randomize the freelist on initialization Message-Id: <20260120094617.ed5a53e9ec40e8f0a91f8cb6@linux-foundation.org> In-Reply-To: <20260120161510.3289089-1-pimyn@google.com> References: <20260120161510.3289089-1-pimyn@google.com> X-Mailer: Sylpheed 3.8.0beta1 (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=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 20 Jan 2026 17:15:10 +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. > > Cc: stable@vger.kernel.org > Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure") It isn't clear (to me) what was wrong with 0ce20dd84089, nor why a -stable backport is proposed. Can we please have a full description of the current misbehavior? What are the worst-case userspace-visible effects of this flaw?