summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorKalpesh Solanki <skalpesh942@gmail.com>2026-11-12 18:40:55 +0530
committerJakub Kicinski <kuba@kernel.org>2026-11-17 18:15:27 -0800
commit0a3778b93be43f80ac529a1305a521ac55207a95 (patch)
tree3e2aa0a68778cd57aa3f7d5fc19da07c6b8a8ae2 /tools/perf/scripts/python/bin
parent76115f0ab948a6aeb66a0b9bd4e074ed52cd6946 (diff)
tun: disallow setting ARPHRD_MCTP link type via TUNSETLINK
When an IFF_TUN device is registered as ARPHRD_NONE, mctp_register() attaches an mctp_dev context to it. For ARPHRD_NONE and ARPHRD_LOOPBACK devices, incoming packets in mctp_pkttype_receive() invoke __mctp_cb(skb), which initializes cb->magic = 0x4d435450 and zeros cb->halen. If a userspace process sets the link type of the TUN device to ARPHRD_MCTP via ioctl(fd, TUNSETLINK, ARPHRD_MCTP) and transmits a frame carrying protocol ETH_P_MCTP, mctp_pkttype_receive() evaluates dev->type == ARPHRD_MCTP and calls mctp_cb(skb). Because frames allocated in tun_get_user() have a cleared skb->cb and were not constructed by an MCTP hardware driver, mctp_cb() trips: WARN_ON(cb->magic != 0x4d435450); On systems configured with panic_on_warn=1, an unprivileged user in a user+net namespace can trigger a denial-of-service kernel panic. MCTP communication over TUN interfaces is designed to use ARPHRD_NONE. Setting ARPHRD_MCTP on TUN is invalid and has never functioned. Disallow ARPHRD_MCTP in TUNSETLINK by returning -EINVAL. Fixes: ff4cc3ac93e1 ("[TUNTAP]: Allow setting the linktype of the tap device from userspace") Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com> Link: https://patch.msgid.link/20261112131056.234801-1-skalpesh942@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions