Alexander Potapenko
58cd7fdc8c
ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network
...
[ Upstream commit c23fb2c82267638f9d206cb96bb93e1f93ad7828 ]
When copying a `struct ifaddrlblmsg` to the network, __ifal_reserved
remained uninitialized, resulting in a 1-byte infoleak:
BUG: KMSAN: kernel-network-infoleak in __netdev_start_xmit ./include/linux/netdevice.h:4841
__netdev_start_xmit ./include/linux/netdevice.h:4841
netdev_start_xmit ./include/linux/netdevice.h:4857
xmit_one net/core/dev.c:3590
dev_hard_start_xmit+0x1dc/0x800 net/core/dev.c:3606
__dev_queue_xmit+0x17e8/0x4350 net/core/dev.c:4256
dev_queue_xmit ./include/linux/netdevice.h:3009
__netlink_deliver_tap_skb net/netlink/af_netlink.c:307
__netlink_deliver_tap+0x728/0xad0 net/netlink/af_netlink.c:325
netlink_deliver_tap net/netlink/af_netlink.c:338
__netlink_sendskb net/netlink/af_netlink.c:1263
netlink_sendskb+0x1d9/0x200 net/netlink/af_netlink.c:1272
netlink_unicast+0x56d/0xf50 net/netlink/af_netlink.c:1360
nlmsg_unicast ./include/net/netlink.h:1061
rtnl_unicast+0x5a/0x80 net/core/rtnetlink.c:758
ip6addrlbl_get+0xfad/0x10f0 net/ipv6/addrlabel.c:628
rtnetlink_rcv_msg+0xb33/0x1570 net/core/rtnetlink.c:6082
...
Uninit was created at:
slab_post_alloc_hook+0x118/0xb00 mm/slab.h:742
slab_alloc_node mm/slub.c:3398
__kmem_cache_alloc_node+0x4f2/0x930 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954
__kmalloc_node_track_caller+0x117/0x3d0 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437
__alloc_skb+0x27a/0xab0 net/core/skbuff.c:509
alloc_skb ./include/linux/skbuff.h:1267
nlmsg_new ./include/net/netlink.h:964
ip6addrlbl_get+0x490/0x10f0 net/ipv6/addrlabel.c:608
rtnetlink_rcv_msg+0xb33/0x1570 net/core/rtnetlink.c:6082
netlink_rcv_skb+0x299/0x550 net/netlink/af_netlink.c:2540
rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6109
netlink_unicast_kernel net/netlink/af_netlink.c:1319
netlink_unicast+0x9ab/0xf50 net/netlink/af_netlink.c:1345
netlink_sendmsg+0xebc/0x10f0 net/netlink/af_netlink.c:1921
...
This patch ensures that the reserved field is always initialized.
Reported-by: syzbot+3553517af6020c4f2813f1003fe76ef3cbffe98d@syzkaller.appspotmail.com
Fixes: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-25 17:42:05 +01:00
..
2021-09-15 09:47:31 +02:00
2022-08-25 11:18:17 +02:00
2021-07-31 08:19:38 +02:00
2021-12-01 09:23:34 +01:00
2021-04-07 14:47:41 +02:00
2022-10-29 10:20:35 +02:00
2022-04-20 09:19:40 +02:00
2022-05-18 09:47:24 +02:00
2022-11-10 17:57:54 +01:00
2022-09-05 10:27:46 +02:00
2021-07-14 16:53:33 +02:00
2022-09-28 11:04:07 +02:00
2021-09-22 12:26:40 +02:00
2022-11-03 23:56:52 +09:00
2020-11-05 11:43:34 +01:00
2022-11-25 17:42:04 +01:00
2022-03-08 19:07:51 +01:00
2022-08-25 11:17:49 +02:00
2021-07-28 13:30:56 +02:00
2020-04-23 10:36:45 +02:00
2022-03-23 09:12:07 +01:00
2020-01-09 10:20:06 +01:00
2021-05-14 09:44:10 +02:00
2022-11-03 23:56:54 +09:00
2022-11-25 17:42:04 +01:00
2022-11-25 17:42:05 +01:00
2021-03-07 12:20:42 +01:00
2022-11-03 23:56:55 +09:00
2022-09-05 10:27:40 +02:00
2022-06-22 14:11:21 +02:00
2022-04-27 13:50:47 +02:00
2021-02-10 09:25:28 +01:00
2022-03-28 08:46:48 +02:00
2022-10-26 13:22:22 +02:00
2022-11-03 23:56:53 +09:00
2021-12-08 09:01:12 +01:00
2022-01-05 12:37:45 +01:00
2022-11-10 17:57:51 +01:00
2022-04-15 14:18:35 +02:00
2022-05-18 09:47:25 +02:00
2021-07-28 13:30:56 +02:00
2022-06-14 18:11:33 +02:00
2022-11-03 23:56:56 +09:00
2022-09-05 10:27:48 +02:00
2022-01-11 15:23:33 +01:00
2021-09-03 10:08:12 +02:00
2022-10-26 13:22:26 +02:00
2020-11-24 13:29:05 +01:00
2022-11-10 17:57:51 +01:00
2022-09-28 11:03:58 +02:00
2022-11-10 17:57:50 +01:00
2022-10-26 13:22:26 +02:00
2022-09-15 12:04:50 +02:00
2021-11-17 09:48:48 +01:00
2022-09-05 10:27:40 +02:00
2021-10-27 09:54:24 +02:00
2022-11-03 23:56:55 +09:00
2022-07-29 17:14:12 +02:00
2022-10-26 13:22:59 +02:00
2022-10-26 13:22:25 +02:00
2022-11-25 17:42:04 +01:00
2022-04-15 14:18:21 +02:00
2021-12-22 09:29:40 +01:00
2022-10-26 13:22:49 +02:00
2021-06-18 09:59:00 +02:00
2020-04-01 11:02:18 +02:00
2022-09-05 10:27:42 +02:00