From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (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 3341539E18E for ; Sat, 4 Jul 2026 08:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783154906; cv=none; b=CoCYm/oqFjKCReFL6Jl+zfcU6rtKDpAtGTfFRnp0k7lzimkK7Xcw776VLKi2hXdmkdotw/Y/80jL76/YoGqVM9YjcxNbvts9N1VNQ9VdO/g+fE8L340RsjhKh6YCGyvb2E1ASS3zkZbpkESWFZjA0pDhuv57nHCo4ngx7qbMH1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783154906; c=relaxed/simple; bh=RRUqtf+ggWbcYEHBYm8nSw22XwO/ZQRiYuSK+IroWgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nZeJEAliNcWlUCidDFfmyUe+480WBPJPVoXTKSePUi4hw7hUdLwvYL3UK6etwWdGriHOCXwdjEqlHDTYzkdGggG1Wz6iLFSvI9BQGd8+Y3f7ylybt5jrgESOutt4GB3WsLfv8e5KB+zn3L/6UkzwPW8vI0wYFlf4HdcSEpGQm6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id 7D7E260491; Sat, 04 Jul 2026 10:48:23 +0200 (CEST) From: Florian Westphal To: Cc: Florian Westphal Subject: [PATCH nf-next 1/3] netfilter: ebtables: zero chainstack array Date: Sat, 4 Jul 2026 10:48:09 +0200 Message-ID: <20260704084811.27355-2-fw@strlen.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260704084811.27355-1-fw@strlen.de> References: <20260704084811.27355-1-fw@strlen.de> Precedence: bulk X-Mailing-List: netfilter-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit shashiko reports: looking at ebtables table translation, could a sparse cpu_possible_mask lead to an uninitialized pointer free? If cpu_possible_mask is sparse (for example, CPU 0 and CPU 2 are possible, but CPU 1 is not), the allocation loop skips CPU 1. If vmalloc_node() fails at CPU 2, the cleanup loop will blindly decrement and call vfree() on newinfo->chainstack[1]. Not a real-world bug, such allocation isn't expected to fail in the first place. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Florian Westphal --- net/bridge/netfilter/ebtables.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 042d31278713..66c407cffa16 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -923,8 +923,7 @@ static int translate_table(struct net *net, const char *name, * if an error occurs */ newinfo->chainstack = - vmalloc_array(nr_cpu_ids, - sizeof(*(newinfo->chainstack))); + vcalloc(nr_cpu_ids, sizeof(*(newinfo->chainstack))); if (!newinfo->chainstack) return -ENOMEM; for_each_possible_cpu(i) { -- 2.55.0