]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: psample: fix info leak in PSAMPLE_ATTR_DATA
authorJakub Kicinski <kuba@kernel.org>
Tue, 16 Jun 2026 00:30:46 +0000 (17:30 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Jun 2026 23:35:50 +0000 (16:35 -0700)
commitaedd02af1f8b0bceb7f42f5a21c41634ca9ed390
tree57e0e879d7bf8c599d85ff4d340ed8d11e435fe5
parentb50fa1e07cf875609b9d34c5c8b32dcf11b8b603
net: psample: fix info leak in PSAMPLE_ATTR_DATA

psample open codes nla_put() presumably to avoid wiping
the data with 0s just to override it with packet data.
This open coding is missing clearing the pad, however,
each netlink attr is padded to 4B and data_len may
not be divisible by 4B.

Fixes: 6ae0a6286171 ("net: Introduce psample, a new genetlink channel for packet sampling")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20260616003046.1099490-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/psample/psample.c