From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (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 2C8853D45CF; Wed, 9 Sep 2026 22:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.190.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788992352; cv=none; b=UDuMeDji3/9HQ7WgU2rAJmRtjMlHMQW9oob/CuHgeibqzvq1oJFyojbDsnqqaOf2eYAOMcHEG/ec063G3QWyjhiSajBwrnl4K5Xr2YbHBkcDabSpZJdNj8fDKghAJvF2ptDcPHV5HwxpbM4fuEcf58KgPWP94Evt4IiKb3wTkhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788992352; c=relaxed/simple; bh=06rB7xxdcCuXMcZ1MLTFW0ssuC4OGhJtSTWgYmk6UsY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tMukBI+C7qjg+5xW/spnmWn0n7F0pWIYQ36tCDEYKVBaInoMO5xHeXilI/ego+0pKoj0FP88C0ZmsRksPRFrXa7bBJ7dOHxbrBwJ77MGSAwZYPkHOci135acjnTimxvA77zYCf8yrR2iBoBF38Cr3xWZ2HcCQbONV5NFzjH2AbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.b=o+YedTR1; arc=none smtp.client-ip=217.70.190.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.b="o+YedTR1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1788992340; bh=scg/9sx6svPslY+Ofr+g3GE/uA0Bqw/4YKZu2kSpDD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+YedTR1RaEp8xVfQ50ZhEbV0bsv893uoZ8G/vizrzTKXZSME/Z5OX7zavkmPAc/l X5Ph+awb2Z5rKYkLNXSW7gVMd+OSI8mRC2cNTzJgRdmZiVNmXFAwrB09YErrQ+1UtL JLTuUmRN/f1oIIt8xAVkTLwDhBZE4qzLk1JYivh1csIpWlxK75I6cEiSxplIEyNS3d OhYYQMQBs3DPFM6vJagvceCPiOzyHdipvfzyRB2Aij4bIaL+/ER9laIEhbQzfN3x5m kJupwMipzpVJQQSoRIZg6BvJEPC4CEGZktzRI8EXVwX/XUJVm3cq5Ju9VVSoV40SPd lq34G6G09E46w== Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id DE9DC607C4; Thu, 10 Sep 2026 00:18:59 +0200 (CEST) From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, horms@kernel.org, fw@strlen.de, ja@ssi.bg Subject: [PATCH net 6/7] netfilter: xt_IDLETIMER: allocate timer with kzalloc() Date: Thu, 10 Sep 2026 00:18:43 +0200 Message-ID: <20260909221844.1650275-7-pablo@netfilter.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260909221844.1650275-1-pablo@netfilter.org> References: <20260909221844.1650275-1-pablo@netfilter.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit According to sashiko: "The embedded struct device_attribute attr has its show and mode fields initialized later in this function, but its store function pointer remains uninitialized heap garbage. When the sysfs file is created, a process with the DAC_OVERRIDE capability can bypass the 0444 mode restriction and write to the file. This causes dev_attr_store() to execute the uninitialized store pointer, leading to arbitrary kernel code execution." Use kzalloc_obj() instead to address this issue. Fixes: 68983a354a65 ("netfilter: xtables: Add snapshot of hardidletimer target") Signed-off-by: Pablo Neira Ayuso --- net/netfilter/xt_IDLETIMER.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index fe7d8d19629b..8a1d95d21991 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -196,7 +196,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info) { int ret; - info->timer = kmalloc_obj(*info->timer); + info->timer = kzalloc_obj(*info->timer); if (!info->timer) { ret = -ENOMEM; goto out; -- 2.47.3