]> www.infradead.org Git - users/dwmw2/linux.git/commit
netdev: prevent accessing NAPI instances from another namespace
authorJakub Kicinski <kuba@kernel.org>
Mon, 6 Jan 2025 18:01:36 +0000 (10:01 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jan 2025 18:21:00 +0000 (10:21 -0800)
commitd1cacd74776895f6435941f86a1130e58f6dd226
tree7b46ead7b493a6d93e6c78e3f72a10f546f4ae74
parentdb78475ba0d3c66d430f7ded2388cc041078a542
netdev: prevent accessing NAPI instances from another namespace

The NAPI IDs were not fully exposed to user space prior to the netlink
API, so they were never namespaced. The netlink API must ensure that
at the very least NAPI instance belongs to the same netns as the owner
of the genl sock.

napi_by_id() can become static now, but it needs to move because of
dev_get_by_napi_id().

Cc: stable@vger.kernel.org
Fixes: 1287c1ae0fc2 ("netdev-genl: Support setting per-NAPI config values")
Fixes: 27f91aaf49b3 ("netdev-genl: Add netlink framework functions for napi")
Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250106180137.1861472-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c
net/core/dev.h
net/core/netdev-genl.c