stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	syzbot+3553517af6020c4f2813f1003fe76ef3cbffe98d@syzkaller.appspotmail.com,
	Alexander Potapenko <glider@google.com>,
	David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 28/95] ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network
Date: Mon, 14 Nov 2022 13:45:22 +0100	[thread overview]
Message-ID: <20221114124443.692795238@linuxfoundation.org> (raw)
In-Reply-To: <20221114124442.530286937@linuxfoundation.org>

From: Alexander Potapenko <glider@google.com>

[ 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>
---
 net/ipv6/addrlabel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index 8a22486cf270..17ac45aa7194 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -437,6 +437,7 @@ static void ip6addrlbl_putmsg(struct nlmsghdr *nlh,
 {
 	struct ifaddrlblmsg *ifal = nlmsg_data(nlh);
 	ifal->ifal_family = AF_INET6;
+	ifal->__ifal_reserved = 0;
 	ifal->ifal_prefixlen = prefixlen;
 	ifal->ifal_flags = 0;
 	ifal->ifal_index = ifindex;
-- 
2.35.1




  parent reply	other threads:[~2022-11-14 12:48 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 12:44 [PATCH 5.10 00/95] 5.10.155-rc1 review Greg Kroah-Hartman
2022-11-14 12:44 ` [PATCH 5.10 01/95] fuse: fix readdir cache race Greg Kroah-Hartman
2022-11-14 12:44 ` [PATCH 5.10 02/95] hwspinlock: qcom: correct MMIO max register for newer SoCs Greg Kroah-Hartman
2022-11-14 12:44 ` [PATCH 5.10 03/95] phy: stm32: fix an error code in probe Greg Kroah-Hartman
2022-11-14 12:44 ` [PATCH 5.10 04/95] wifi: cfg80211: silence a sparse RCU warning Greg Kroah-Hartman
2022-11-14 12:44 ` [PATCH 5.10 05/95] wifi: cfg80211: fix memory leak in query_regdb_file() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 06/95] bpf, sockmap: Fix the sk->sk_forward_alloc warning of sk_stream_kill_queues Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 07/95] bpftool: Fix NULL pointer dereference when pin {PROG, MAP, LINK} without FILE Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 08/95] HID: hyperv: fix possible memory leak in mousevsc_probe() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 09/95] bpf: Support for pointers beyond pkt_end Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 10/95] bpf: Add helper macro bpf_for_each_reg_in_vstate Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 11/95] bpf: Fix wrong reg type conversion in release_reference() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 12/95] net: gso: fix panic on frag_list with mixed head alloc types Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 13/95] macsec: delete new rxsc when offload fails Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 14/95] macsec: fix secy->n_rx_sc accounting Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 15/95] macsec: fix detection of RXSCs when toggling offloading Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 16/95] macsec: clear encryption keys from the stack after setting up offload Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 17/95] net: tun: Fix memory leaks of napi_get_frags Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 18/95] bnxt_en: Fix possible crash in bnxt_hwrm_set_coal() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 19/95] bnxt_en: fix potentially incorrect return value for ndo_rx_flow_steer Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 20/95] net: fman: Unregister ethernet device on removal Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 21/95] capabilities: fix undefined behavior in bit shift for CAP_TO_MASK Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 22/95] KVM: s390x: fix SCK locking Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 23/95] KVM: s390: pv: dont allow userspace to set the clock under PV Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 24/95] net: lapbether: fix issue of dev reference count leakage in lapbeth_device_event() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 25/95] hamradio: fix issue of dev reference count leakage in bpq_device_event() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 26/95] drm/vc4: Fix missing platform_unregister_drivers() call in vc4_drm_register() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 27/95] tcp: prohibit TCP_REPAIR_OPTIONS if data was already sent Greg Kroah-Hartman
2022-11-14 12:45 ` Greg Kroah-Hartman [this message]
2022-11-14 12:48   ` [PATCH 5.10 28/95] ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network syzbot
2022-11-14 12:45 ` [PATCH 5.10 29/95] can: af_can: fix NULL pointer dereference in can_rx_register() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 30/95] net: stmmac: dwmac-meson8b: fix meson8b_devm_clk_prepare_enable() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 31/95] net: broadcom: Fix BCMGENET Kconfig Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 32/95] tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 33/95] dmaengine: pxa_dma: use platform_get_irq_optional Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 34/95] dmaengine: mv_xor_v2: Fix a resource leak in mv_xor_v2_remove() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 35/95] drivers: net: xgene: disable napi when register irq failed in xgene_enet_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 36/95] perf stat: Fix printing os->prefix in CSV metrics output Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 37/95] net: marvell: prestera: fix memory leak in prestera_rxtx_switch_init() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 38/95] net: nixge: disable napi when enable interrupts failed in nixge_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 39/95] net/mlx5: Allow async trigger completion execution on single CPU systems Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 40/95] net/mlx5e: E-Switch, Fix comparing termination table instance Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 41/95] net: cpsw: disable napi in cpsw_ndo_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 42/95] net: cxgb3_main: disable napi when bind qsets failed in cxgb_up() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 43/95] cxgb4vf: shut down the adapter when t4vf_update_port_info() failed in cxgb4vf_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 44/95] net: phy: mscc: macsec: clear encryption keys when freeing a flow Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 45/95] net: atlantic: macsec: clear encryption keys from the stack Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 46/95] ethernet: s2io: disable napi when start nic failed in s2io_card_up() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 47/95] net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 48/95] ethernet: tundra: free irq when alloc ring failed in tsi108_open() Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 49/95] net: macvlan: fix memory leaks of macvlan_common_newlink Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 50/95] riscv: process: fix kernel info leakage Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 51/95] riscv: vdso: fix build with llvm Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 52/95] riscv: Enable CMA support Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 53/95] riscv: Separate memory init from paging init Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 54/95] riscv: fix reserved memory setup Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 55/95] arm64: efi: Fix handling of misaligned runtime regions and drop warning Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 56/95] MIPS: jump_label: Fix compat branch range check Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 57/95] mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 58/95] mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 59/95] mmc: sdhci_am654: " Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 60/95] mmc: sdhci-tegra: " Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 61/95] ALSA: hda/hdmi - enable runtime pm for more AMD display audio Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 62/95] ALSA: hda/ca0132: add quirk for EVGA Z390 DARK Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 63/95] ALSA: hda: fix potential memleak in add_widget_node Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 64/95] ALSA: hda/realtek: Add Positivo C6300 model quirk Greg Kroah-Hartman
2022-11-14 12:45 ` [PATCH 5.10 65/95] ALSA: usb-audio: Add quirk entry for M-Audio Micro Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 66/95] ALSA: usb-audio: Add DSD support for Accuphase DAC-60 Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 67/95] vmlinux.lds.h: Fix placement of .data..decrypted section Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 68/95] ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 69/95] nilfs2: fix deadlock in nilfs_count_free_blocks() Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 70/95] nilfs2: fix use-after-free bug of ns_writer on remount Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 71/95] drm/i915/dmabuf: fix sg_table handling in map_dma_buf Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 72/95] platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 73/95] btrfs: selftests: fix wrong error check in btrfs_free_dummy_root() Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 74/95] mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 75/95] udf: Fix a slab-out-of-bounds write bug in udf_find_entry() Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 76/95] mm/memremap.c: map FS_DAX device memory as decrypted Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 77/95] can: j1939: j1939_send_one(): fix missing CAN header initialization Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 78/95] cert host tools: Stop complaining about deprecated OpenSSL functions Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 79/95] dmaengine: at_hdmac: Fix at_lli struct definition Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 80/95] dmaengine: at_hdmac: Dont start transactions at tx_submit level Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 81/95] dmaengine: at_hdmac: Start transfer for cyclic channels in issue_pending Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 82/95] dmaengine: at_hdmac: Fix premature completion of desc " Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 83/95] dmaengine: at_hdmac: Do not call the complete callback on device_terminate_all Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 84/95] dmaengine: at_hdmac: Protect atchan->status with the channel lock Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 85/95] dmaengine: at_hdmac: Fix concurrency problems by removing atc_complete_all() Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 86/95] dmaengine: at_hdmac: Fix concurrency over descriptor Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 87/95] dmaengine: at_hdmac: Free the memset buf without holding the chan lock Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 88/95] dmaengine: at_hdmac: Fix concurrency over the active list Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 89/95] dmaengine: at_hdmac: Fix descriptor handling when issuing it to hardware Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 90/95] dmaengine: at_hdmac: Fix completion of unissued descriptor in case of errors Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 91/95] dmaengine: at_hdmac: Dont allow CPU to reorder channel enable Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 92/95] dmaengine: at_hdmac: Fix impossible condition Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 93/95] dmaengine: at_hdmac: Check return code of dma_async_device_register Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 94/95] net: tun: call napi_schedule_prep() to ensure we own a napi Greg Kroah-Hartman
2022-11-14 12:46 ` [PATCH 5.10 95/95] mmc: sdhci-esdhc-imx: Convert the driver to DT-only Greg Kroah-Hartman
2022-11-14 18:35 ` [PATCH 5.10 00/95] 5.10.155-rc1 review Pavel Machek
2022-11-14 20:20 ` Shuah Khan
2022-11-14 21:06 ` Slade Watkins
2022-11-14 21:44 ` Florian Fainelli
2022-11-15  0:12 ` Guenter Roeck
2022-11-15 10:50 ` Sudip Mukherjee
2022-11-15 10:58 ` Naresh Kamboju
2022-11-15 11:49 ` Rudi Heitbaum
2022-11-16  1:44 ` zhouzhixiu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114124443.692795238@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=glider@google.com \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+3553517af6020c4f2813f1003fe76ef3cbffe98d@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).