From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 56EDE38399B; Fri, 5 Jun 2026 18:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780682969; cv=none; b=iWU0m5SHNpOMHhwB+AAiRLhNeH4WMcmDG6rAuy+PShNtT4sA9y2yHzRrRjhu2koYSPOO1SdDdjrNNlGb4miB0uKHNn/LexzQ3AW0XjEUty6Vbgt4PavfTr0ifWqnwAB20WrTPOabN1J4jJUu7QuZ8p8iM77nWhYsVJQMjLmGCGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780682969; c=relaxed/simple; bh=fDsw0B4F0OBl4TLpyrNPvCykfVhuQi1Gj+rbHjJVWtQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MEFen0GO8rrTZLlXC202dVZM6Ipxh4vBhPmfaSH5+SK/iY8eivEwIZWM3JXTPynfrGsTvMdL9JBJAi7Dv4O7qdqxlM9F+bgmKRiBT5CzkUKNKPPIJTDO3dRJzDrELmzQ1otJ40ZQHoTsVQHp40AE93ZDNROJrwAzm53Uvvoc0ak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MwmqoBT+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MwmqoBT+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10EFB1F00893; Fri, 5 Jun 2026 18:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780682968; bh=8okm4VUMmFJ4/uejS+xBY+U1Zy2pD+88GtZ8JFsDLIM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MwmqoBT+H6jm/37A2qDJ0pEvRL2HUAWJWBAOtUi8ZhWYcsigeKif7D+soGUArDr1C cguRomnrcHgH8MS6NkWAdpaw4YL3J0DwUe+7N5eFgkGmrEZ/OYCT0l2tOWSThcJQiq kKwQYZRbaXI0k91YV3ZTa0Dx2V/6Tf5Hu7br6LAK9pmupKtKa2/nLiQjHaCDrtBCMj auFVPz1zVR5Csbvus1K029GUxFmfsvP01zQLtYkAonNOkyfOU+vG04tKBKTAU6cEqV BlKWB2y0+WhmZrVriKbyvcwQtaoGlc/xQMaJ72gzFJzON58dyJ09yaTxRMGlvIOF0f I3rhRblEHkIww== Date: Fri, 5 Jun 2026 11:09:27 -0700 From: Kees Cook To: Pedro Falcato Cc: Vlastimil Babka , Harry Yoo , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-hardening@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Simon Horman , Jason Xing , Kuniyuki Iwashima Subject: Re: [PATCH 2/2] net: skb: isolate skb data area allocations into a separate bucket Message-ID: <202606051109.C96C81E3C@keescook> References: <20260602183122.747759-1-pfalcato@suse.de> <20260602183122.747759-3-pfalcato@suse.de> Precedence: bulk X-Mailing-List: netdev@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: <20260602183122.747759-3-pfalcato@suse.de> On Tue, Jun 02, 2026 at 07:31:22PM +0100, Pedro Falcato wrote: > SKB data area allocations (as done from alloc_skb()) use kmalloc(). > These allocations can be variably sized and their contents can be more > or less controlled from userspace, which makes them useful for attackers > that want to overwrite a use-after-free'd object from the same kmalloc slab > (which often just requires the sizes to roughly match into the same kmalloc > bucket). [0] is an easy example of an exploit that uses netlink skb > allocation to target another similarly-sized accidentally freed object. > > While other mitigations like CONFIG_RANDOM_KMALLOC_CACHES exist, these are > probabilistic. Use the existing kmem buckets API to further isolate these > allocations in a guaranteed fashion, when CONFIG_SLAB_BUCKETS=y. > > Link: https://github.com/google/security-research/blob/master/pocs/linux/kernelctf/CVE-2023-4207_lts_cos_mitigation_2/docs/exploit.md [0] > Signed-off-by: Pedro Falcato Great! This is exactly what the bucket API was made for. :) Reviewed-by: Kees Cook -- Kees Cook