Alexander Potapenko
c23fb2c822
ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network
...
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>
2022-11-07 12:26:15 +00:00
..
2022-08-29 12:47:15 +01:00
2022-10-19 08:46:48 +02:00
2022-06-09 21:52:55 -07:00
2022-10-20 17:24:59 -07:00
2022-11-07 12:26:15 +00:00
2022-10-12 17:50:37 -07:00
2022-09-29 07:17:59 +02:00
2020-07-30 16:30:55 -07:00
2021-03-04 15:26:57 -08:00
2022-10-18 10:17:18 +02:00
2022-08-29 10:20:58 +02:00
2022-10-03 07:52:13 +01:00
2022-04-13 13:09:57 +01:00
2022-02-08 20:41:34 -08:00
2020-06-20 21:33:57 -07:00
2022-07-13 12:56:49 +01:00
2020-11-23 18:36:21 -05:00
2022-09-20 10:21:49 -07:00
2022-02-04 20:24:45 -08:00
2022-08-29 12:47:15 +01:00
2022-01-20 20:18:37 -08:00
2022-10-11 17:42:58 -06:00
2022-10-25 16:04:22 -07:00
2021-02-23 11:29:52 -08:00
2022-07-15 18:50:35 -07:00
2022-09-30 12:31:46 +01:00
2022-09-28 18:51:25 -07:00
2022-10-25 16:04:22 -07:00
2020-06-01 14:57:14 -07:00
2022-09-30 13:10:44 +01:00
2022-09-22 13:02:10 -07:00
2022-09-29 07:18:00 +02:00
2022-10-12 17:50:37 -07:00
2022-07-15 16:43:59 +08:00
2021-09-28 13:13:40 +01:00
2021-04-27 14:02:06 -07:00
2022-10-11 17:42:55 -06:00
2022-09-29 07:18:01 +02:00
2022-08-15 11:40:28 +01:00
2022-05-16 13:03:29 +02:00
2022-10-11 17:42:58 -06:00
2022-10-12 09:10:02 +01:00
2020-11-09 15:34:44 -08:00
2022-06-22 18:48:08 -07:00
2022-03-03 14:38:48 +00:00
2022-11-02 20:47:14 -07:00
2020-12-08 16:22:54 -08:00
2020-10-30 12:12:52 -07:00
2022-06-28 21:23:30 -07:00
2022-07-29 12:14:03 +01:00
2022-09-20 12:33:22 +02:00
2022-09-08 18:38:30 +02:00
2022-10-25 16:04:22 -07:00
2022-07-18 12:21:54 +01:00
2022-05-03 10:15:06 +02:00
2022-10-12 17:50:37 -07:00
2021-11-16 13:16:54 +00:00
2020-07-09 12:52:37 +02:00
2022-10-12 17:50:37 -07:00
2021-11-24 17:21:42 -08:00
2022-10-28 20:21:25 -07:00
2022-10-12 17:50:37 -07:00
2022-03-01 12:08:40 +01:00
2022-06-09 21:52:55 -07:00
2022-09-29 07:18:00 +02:00