]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jul 2024 07:58:53 +0000 (09:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jul 2024 07:58:53 +0000 (09:58 +0200)
added patches:
af_packet-handle-outgoing-vlan-packets-without-hardware-offloading.patch
char-tpm-fix-possible-memory-leak-in-tpm_bios_measurements_open.patch
drm-gma500-fix-null-pointer-dereference-in-cdv_intel_lvds_get_modes.patch
drm-gma500-fix-null-pointer-dereference-in-psb_intel_lvds_get_modes.patch
hfs-fix-to-initialize-fields-of-hfs_inode_info-after-hfs_alloc_inode.patch
ipv6-take-care-of-scope-when-choosing-the-src-addr.patch
media-venus-fix-use-after-free-in-vdec_close.patch
net-netconsole-disable-target-before-netpoll-cleanup.patch
tick-broadcast-make-takeover-of-broadcast-hrtimer-reliable.patch

queue-4.19/af_packet-handle-outgoing-vlan-packets-without-hardware-offloading.patch [new file with mode: 0644]
queue-4.19/char-tpm-fix-possible-memory-leak-in-tpm_bios_measurements_open.patch [new file with mode: 0644]
queue-4.19/drm-gma500-fix-null-pointer-dereference-in-cdv_intel_lvds_get_modes.patch [new file with mode: 0644]
queue-4.19/drm-gma500-fix-null-pointer-dereference-in-psb_intel_lvds_get_modes.patch [new file with mode: 0644]
queue-4.19/hfs-fix-to-initialize-fields-of-hfs_inode_info-after-hfs_alloc_inode.patch [new file with mode: 0644]
queue-4.19/ipv6-take-care-of-scope-when-choosing-the-src-addr.patch [new file with mode: 0644]
queue-4.19/media-venus-fix-use-after-free-in-vdec_close.patch [new file with mode: 0644]
queue-4.19/net-netconsole-disable-target-before-netpoll-cleanup.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/tick-broadcast-make-takeover-of-broadcast-hrtimer-reliable.patch [new file with mode: 0644]

diff --git a/queue-4.19/af_packet-handle-outgoing-vlan-packets-without-hardware-offloading.patch b/queue-4.19/af_packet-handle-outgoing-vlan-packets-without-hardware-offloading.patch
new file mode 100644 (file)
index 0000000..ef447e1
--- /dev/null
@@ -0,0 +1,173 @@
+From 79eecf631c14e7f4057186570ac20e2cfac3802e Mon Sep 17 00:00:00 2001
+From: Chengen Du <chengen.du@canonical.com>
+Date: Sat, 13 Jul 2024 19:47:35 +0800
+Subject: af_packet: Handle outgoing VLAN packets without hardware offloading
+
+From: Chengen Du <chengen.du@canonical.com>
+
+commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream.
+
+The issue initially stems from libpcap. The ethertype will be overwritten
+as the VLAN TPID if the network interface lacks hardware VLAN offloading.
+In the outbound packet path, if hardware VLAN offloading is unavailable,
+the VLAN tag is inserted into the payload but then cleared from the sk_buff
+struct. Consequently, this can lead to a false negative when checking for
+the presence of a VLAN tag, causing the packet sniffing outcome to lack
+VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing
+tool may be unable to parse packets as expected.
+
+The TCI-TPID is missing because the prb_fill_vlan_info() function does not
+modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the
+payload and not in the sk_buff struct. The skb_vlan_tag_present() function
+only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header
+is stripped, preventing the packet capturing tool from determining the
+correct TCI-TPID value. Additionally, the protocol in SLL is incorrect,
+which means the packet capturing tool cannot parse the L3 header correctly.
+
+Link: https://github.com/the-tcpdump-group/libpcap/issues/1105
+Link: https://lore.kernel.org/netdev/20240520070348.26725-1-chengen.du@canonical.com/T/#u
+Fixes: 393e52e33c6c ("packet: deliver VLAN TCI to userspace")
+Cc: stable@vger.kernel.org
+Signed-off-by: Chengen Du <chengen.du@canonical.com>
+Reviewed-by: Willem de Bruijn <willemb@google.com>
+Link: https://patch.msgid.link/20240713114735.62360-1-chengen.du@canonical.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/packet/af_packet.c |   86 +++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 84 insertions(+), 2 deletions(-)
+
+--- a/net/packet/af_packet.c
++++ b/net/packet/af_packet.c
+@@ -499,6 +499,61 @@ static void *packet_current_frame(struct
+       return packet_lookup_frame(po, rb, rb->head, status);
+ }
++static u16 vlan_get_tci(struct sk_buff *skb, struct net_device *dev)
++{
++      u8 *skb_orig_data = skb->data;
++      int skb_orig_len = skb->len;
++      struct vlan_hdr vhdr, *vh;
++      unsigned int header_len;
++
++      if (!dev)
++              return 0;
++
++      /* In the SOCK_DGRAM scenario, skb data starts at the network
++       * protocol, which is after the VLAN headers. The outer VLAN
++       * header is at the hard_header_len offset in non-variable
++       * length link layer headers. If it's a VLAN device, the
++       * min_header_len should be used to exclude the VLAN header
++       * size.
++       */
++      if (dev->min_header_len == dev->hard_header_len)
++              header_len = dev->hard_header_len;
++      else if (is_vlan_dev(dev))
++              header_len = dev->min_header_len;
++      else
++              return 0;
++
++      skb_push(skb, skb->data - skb_mac_header(skb));
++      vh = skb_header_pointer(skb, header_len, sizeof(vhdr), &vhdr);
++      if (skb_orig_data != skb->data) {
++              skb->data = skb_orig_data;
++              skb->len = skb_orig_len;
++      }
++      if (unlikely(!vh))
++              return 0;
++
++      return ntohs(vh->h_vlan_TCI);
++}
++
++static __be16 vlan_get_protocol_dgram(struct sk_buff *skb)
++{
++      __be16 proto = skb->protocol;
++
++      if (unlikely(eth_type_vlan(proto))) {
++              u8 *skb_orig_data = skb->data;
++              int skb_orig_len = skb->len;
++
++              skb_push(skb, skb->data - skb_mac_header(skb));
++              proto = __vlan_get_protocol(skb, proto, NULL);
++              if (skb_orig_data != skb->data) {
++                      skb->data = skb_orig_data;
++                      skb->len = skb_orig_len;
++              }
++      }
++
++      return proto;
++}
++
+ static void prb_del_retire_blk_timer(struct tpacket_kbdq_core *pkc)
+ {
+       del_timer_sync(&pkc->retire_blk_timer);
+@@ -974,10 +1029,16 @@ static void prb_clear_rxhash(struct tpac
+ static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
+                       struct tpacket3_hdr *ppd)
+ {
++      struct packet_sock *po = container_of(pkc, struct packet_sock, rx_ring.prb_bdqc);
++
+       if (skb_vlan_tag_present(pkc->skb)) {
+               ppd->hv1.tp_vlan_tci = skb_vlan_tag_get(pkc->skb);
+               ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->vlan_proto);
+               ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
++      } else if (unlikely(po->sk.sk_type == SOCK_DGRAM && eth_type_vlan(pkc->skb->protocol))) {
++              ppd->hv1.tp_vlan_tci = vlan_get_tci(pkc->skb, pkc->skb->dev);
++              ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->protocol);
++              ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
+       } else {
+               ppd->hv1.tp_vlan_tci = 0;
+               ppd->hv1.tp_vlan_tpid = 0;
+@@ -2344,6 +2405,10 @@ static int tpacket_rcv(struct sk_buff *s
+                       h.h2->tp_vlan_tci = skb_vlan_tag_get(skb);
+                       h.h2->tp_vlan_tpid = ntohs(skb->vlan_proto);
+                       status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
++              } else if (unlikely(sk->sk_type == SOCK_DGRAM && eth_type_vlan(skb->protocol))) {
++                      h.h2->tp_vlan_tci = vlan_get_tci(skb, skb->dev);
++                      h.h2->tp_vlan_tpid = ntohs(skb->protocol);
++                      status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
+               } else {
+                       h.h2->tp_vlan_tci = 0;
+                       h.h2->tp_vlan_tpid = 0;
+@@ -2373,7 +2438,8 @@ static int tpacket_rcv(struct sk_buff *s
+       sll->sll_halen = dev_parse_header(skb, sll->sll_addr);
+       sll->sll_family = AF_PACKET;
+       sll->sll_hatype = dev->type;
+-      sll->sll_protocol = skb->protocol;
++      sll->sll_protocol = (sk->sk_type == SOCK_DGRAM) ?
++              vlan_get_protocol_dgram(skb) : skb->protocol;
+       sll->sll_pkttype = skb->pkt_type;
+       if (unlikely(packet_sock_flag(po, PACKET_SOCK_ORIGDEV)))
+               sll->sll_ifindex = orig_dev->ifindex;
+@@ -3412,7 +3478,8 @@ static int packet_recvmsg(struct socket
+               /* Original length was stored in sockaddr_ll fields */
+               origlen = PACKET_SKB_CB(skb)->sa.origlen;
+               sll->sll_family = AF_PACKET;
+-              sll->sll_protocol = skb->protocol;
++              sll->sll_protocol = (sock->type == SOCK_DGRAM) ?
++                      vlan_get_protocol_dgram(skb) : skb->protocol;
+       }
+       sock_recv_ts_and_drops(msg, sk, skb);
+@@ -3467,6 +3534,21 @@ static int packet_recvmsg(struct socket
+                       aux.tp_vlan_tci = skb_vlan_tag_get(skb);
+                       aux.tp_vlan_tpid = ntohs(skb->vlan_proto);
+                       aux.tp_status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
++              } else if (unlikely(sock->type == SOCK_DGRAM && eth_type_vlan(skb->protocol))) {
++                      struct sockaddr_ll *sll = &PACKET_SKB_CB(skb)->sa.ll;
++                      struct net_device *dev;
++
++                      rcu_read_lock();
++                      dev = dev_get_by_index_rcu(sock_net(sk), sll->sll_ifindex);
++                      if (dev) {
++                              aux.tp_vlan_tci = vlan_get_tci(skb, dev);
++                              aux.tp_vlan_tpid = ntohs(skb->protocol);
++                              aux.tp_status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID;
++                      } else {
++                              aux.tp_vlan_tci = 0;
++                              aux.tp_vlan_tpid = 0;
++                      }
++                      rcu_read_unlock();
+               } else {
+                       aux.tp_vlan_tci = 0;
+                       aux.tp_vlan_tpid = 0;
diff --git a/queue-4.19/char-tpm-fix-possible-memory-leak-in-tpm_bios_measurements_open.patch b/queue-4.19/char-tpm-fix-possible-memory-leak-in-tpm_bios_measurements_open.patch
new file mode 100644 (file)
index 0000000..9f30bfa
--- /dev/null
@@ -0,0 +1,35 @@
+From 5d8e2971e817bb64225fc0b6327a78752f58a9aa Mon Sep 17 00:00:00 2001
+From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+Date: Thu, 27 Jun 2024 15:31:09 +0900
+Subject: char: tpm: Fix possible memory leak in tpm_bios_measurements_open()
+
+From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+
+commit 5d8e2971e817bb64225fc0b6327a78752f58a9aa upstream.
+
+In tpm_bios_measurements_open(), get_device() is called on the device
+embedded in struct tpm_chip. In the error path, however, put_device() is
+not called. This results in a reference count leak, which prevents the
+device from being properly released. This commit makes sure to call
+put_device() when the seq_open() call fails.
+
+Cc: stable@vger.kernel.org # +v4.18
+Fixes: 9b01b5356629 ("tpm: Move shared eventlog functions to common.c")
+Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/tpm/eventlog/common.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/char/tpm/eventlog/common.c
++++ b/drivers/char/tpm/eventlog/common.c
+@@ -52,6 +52,8 @@ static int tpm_bios_measurements_open(st
+       if (!err) {
+               seq = file->private_data;
+               seq->private = chip;
++      } else {
++              put_device(&chip->dev);
+       }
+       return err;
diff --git a/queue-4.19/drm-gma500-fix-null-pointer-dereference-in-cdv_intel_lvds_get_modes.patch b/queue-4.19/drm-gma500-fix-null-pointer-dereference-in-cdv_intel_lvds_get_modes.patch
new file mode 100644 (file)
index 0000000..d3af079
--- /dev/null
@@ -0,0 +1,35 @@
+From cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 Mon Sep 17 00:00:00 2001
+From: Ma Ke <make24@iscas.ac.cn>
+Date: Tue, 9 Jul 2024 19:33:11 +0800
+Subject: drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes
+
+From: Ma Ke <make24@iscas.ac.cn>
+
+commit cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 upstream.
+
+In cdv_intel_lvds_get_modes(), the return value of drm_mode_duplicate()
+is assigned to mode, which will lead to a NULL pointer dereference on
+failure of drm_mode_duplicate(). Add a check to avoid npd.
+
+Cc: stable@vger.kernel.org
+Fixes: 6a227d5fd6c4 ("gma500: Add support for Cedarview")
+Signed-off-by: Ma Ke <make24@iscas.ac.cn>
+Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240709113311.37168-1-make24@iscas.ac.cn
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/gma500/cdv_intel_lvds.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
++++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+@@ -404,6 +404,9 @@ static int cdv_intel_lvds_get_modes(stru
+       if (mode_dev->panel_fixed_mode != NULL) {
+               struct drm_display_mode *mode =
+                   drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
++              if (!mode)
++                      return 0;
++
+               drm_mode_probed_add(connector, mode);
+               return 1;
+       }
diff --git a/queue-4.19/drm-gma500-fix-null-pointer-dereference-in-psb_intel_lvds_get_modes.patch b/queue-4.19/drm-gma500-fix-null-pointer-dereference-in-psb_intel_lvds_get_modes.patch
new file mode 100644 (file)
index 0000000..48236e2
--- /dev/null
@@ -0,0 +1,35 @@
+From 2df7aac81070987b0f052985856aa325a38debf6 Mon Sep 17 00:00:00 2001
+From: Ma Ke <make24@iscas.ac.cn>
+Date: Tue, 9 Jul 2024 17:20:11 +0800
+Subject: drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes
+
+From: Ma Ke <make24@iscas.ac.cn>
+
+commit 2df7aac81070987b0f052985856aa325a38debf6 upstream.
+
+In psb_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is
+assigned to mode, which will lead to a possible NULL pointer dereference
+on failure of drm_mode_duplicate(). Add a check to avoid npd.
+
+Cc: stable@vger.kernel.org
+Fixes: 89c78134cc54 ("gma500: Add Poulsbo support")
+Signed-off-by: Ma Ke <make24@iscas.ac.cn>
+Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240709092011.3204970-1-make24@iscas.ac.cn
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/gma500/psb_intel_lvds.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
++++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
+@@ -519,6 +519,9 @@ static int psb_intel_lvds_get_modes(stru
+       if (mode_dev->panel_fixed_mode != NULL) {
+               struct drm_display_mode *mode =
+                   drm_mode_duplicate(dev, mode_dev->panel_fixed_mode);
++              if (!mode)
++                      return 0;
++
+               drm_mode_probed_add(connector, mode);
+               return 1;
+       }
diff --git a/queue-4.19/hfs-fix-to-initialize-fields-of-hfs_inode_info-after-hfs_alloc_inode.patch b/queue-4.19/hfs-fix-to-initialize-fields-of-hfs_inode_info-after-hfs_alloc_inode.patch
new file mode 100644 (file)
index 0000000..99ddda5
--- /dev/null
@@ -0,0 +1,122 @@
+From 26a2ed107929a855155429b11e1293b83e6b2a8b Mon Sep 17 00:00:00 2001
+From: Chao Yu <chao@kernel.org>
+Date: Sun, 16 Jun 2024 09:38:41 +0800
+Subject: hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode()
+
+From: Chao Yu <chao@kernel.org>
+
+commit 26a2ed107929a855155429b11e1293b83e6b2a8b upstream.
+
+Syzbot reports uninitialized value access issue as below:
+
+loop0: detected capacity change from 0 to 64
+=====================================================
+BUG: KMSAN: uninit-value in hfs_revalidate_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
+ hfs_revalidate_dentry+0x307/0x3f0 fs/hfs/sysdep.c:30
+ d_revalidate fs/namei.c:862 [inline]
+ lookup_fast+0x89e/0x8e0 fs/namei.c:1649
+ walk_component fs/namei.c:2001 [inline]
+ link_path_walk+0x817/0x1480 fs/namei.c:2332
+ path_lookupat+0xd9/0x6f0 fs/namei.c:2485
+ filename_lookup+0x22e/0x740 fs/namei.c:2515
+ user_path_at_empty+0x8b/0x390 fs/namei.c:2924
+ user_path_at include/linux/namei.h:57 [inline]
+ do_mount fs/namespace.c:3689 [inline]
+ __do_sys_mount fs/namespace.c:3898 [inline]
+ __se_sys_mount+0x66b/0x810 fs/namespace.c:3875
+ __x64_sys_mount+0xe4/0x140 fs/namespace.c:3875
+ do_syscall_x64 arch/x86/entry/common.c:52 [inline]
+ do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
+ entry_SYSCALL_64_after_hwframe+0x63/0x6b
+
+BUG: KMSAN: uninit-value in hfs_ext_read_extent fs/hfs/extent.c:196 [inline]
+BUG: KMSAN: uninit-value in hfs_get_block+0x92d/0x1620 fs/hfs/extent.c:366
+ hfs_ext_read_extent fs/hfs/extent.c:196 [inline]
+ hfs_get_block+0x92d/0x1620 fs/hfs/extent.c:366
+ block_read_full_folio+0x4ff/0x11b0 fs/buffer.c:2271
+ hfs_read_folio+0x55/0x60 fs/hfs/inode.c:39
+ filemap_read_folio+0x148/0x4f0 mm/filemap.c:2426
+ do_read_cache_folio+0x7c8/0xd90 mm/filemap.c:3553
+ do_read_cache_page mm/filemap.c:3595 [inline]
+ read_cache_page+0xfb/0x2f0 mm/filemap.c:3604
+ read_mapping_page include/linux/pagemap.h:755 [inline]
+ hfs_btree_open+0x928/0x1ae0 fs/hfs/btree.c:78
+ hfs_mdb_get+0x260c/0x3000 fs/hfs/mdb.c:204
+ hfs_fill_super+0x1fb1/0x2790 fs/hfs/super.c:406
+ mount_bdev+0x628/0x920 fs/super.c:1359
+ hfs_mount+0xcd/0xe0 fs/hfs/super.c:456
+ legacy_get_tree+0x167/0x2e0 fs/fs_context.c:610
+ vfs_get_tree+0xdc/0x5d0 fs/super.c:1489
+ do_new_mount+0x7a9/0x16f0 fs/namespace.c:3145
+ path_mount+0xf98/0x26a0 fs/namespace.c:3475
+ do_mount fs/namespace.c:3488 [inline]
+ __do_sys_mount fs/namespace.c:3697 [inline]
+ __se_sys_mount+0x919/0x9e0 fs/namespace.c:3674
+ __ia32_sys_mount+0x15b/0x1b0 fs/namespace.c:3674
+ do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
+ __do_fast_syscall_32+0xa2/0x100 arch/x86/entry/common.c:178
+ do_fast_syscall_32+0x37/0x80 arch/x86/entry/common.c:203
+ do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:246
+ entry_SYSENTER_compat_after_hwframe+0x70/0x82
+
+Uninit was created at:
+ __alloc_pages+0x9a6/0xe00 mm/page_alloc.c:4590
+ __alloc_pages_node include/linux/gfp.h:238 [inline]
+ alloc_pages_node include/linux/gfp.h:261 [inline]
+ alloc_slab_page mm/slub.c:2190 [inline]
+ allocate_slab mm/slub.c:2354 [inline]
+ new_slab+0x2d7/0x1400 mm/slub.c:2407
+ ___slab_alloc+0x16b5/0x3970 mm/slub.c:3540
+ __slab_alloc mm/slub.c:3625 [inline]
+ __slab_alloc_node mm/slub.c:3678 [inline]
+ slab_alloc_node mm/slub.c:3850 [inline]
+ kmem_cache_alloc_lru+0x64d/0xb30 mm/slub.c:3879
+ alloc_inode_sb include/linux/fs.h:3018 [inline]
+ hfs_alloc_inode+0x5a/0xc0 fs/hfs/super.c:165
+ alloc_inode+0x83/0x440 fs/inode.c:260
+ new_inode_pseudo fs/inode.c:1005 [inline]
+ new_inode+0x38/0x4f0 fs/inode.c:1031
+ hfs_new_inode+0x61/0x1010 fs/hfs/inode.c:186
+ hfs_mkdir+0x54/0x250 fs/hfs/dir.c:228
+ vfs_mkdir+0x49a/0x700 fs/namei.c:4126
+ do_mkdirat+0x529/0x810 fs/namei.c:4149
+ __do_sys_mkdirat fs/namei.c:4164 [inline]
+ __se_sys_mkdirat fs/namei.c:4162 [inline]
+ __x64_sys_mkdirat+0xc8/0x120 fs/namei.c:4162
+ do_syscall_x64 arch/x86/entry/common.c:52 [inline]
+ do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
+ entry_SYSCALL_64_after_hwframe+0x63/0x6b
+
+It missed to initialize .tz_secondswest, .cached_start and .cached_blocks
+fields in struct hfs_inode_info after hfs_alloc_inode(), fix it.
+
+Cc: stable@vger.kernel.org
+Reported-by: syzbot+3ae6be33a50b5aae4dab@syzkaller.appspotmail.com
+Closes: https://lore.kernel.org/linux-fsdevel/0000000000005ad04005ee48897f@google.com
+Signed-off-by: Chao Yu <chao@kernel.org>
+Link: https://lore.kernel.org/r/20240616013841.2217-1-chao@kernel.org
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/hfs/inode.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/hfs/inode.c
++++ b/fs/hfs/inode.c
+@@ -199,6 +199,7 @@ struct inode *hfs_new_inode(struct inode
+       HFS_I(inode)->flags = 0;
+       HFS_I(inode)->rsrc_inode = NULL;
+       HFS_I(inode)->fs_blocks = 0;
++      HFS_I(inode)->tz_secondswest = sys_tz.tz_minuteswest * 60;
+       if (S_ISDIR(mode)) {
+               inode->i_size = 2;
+               HFS_SB(sb)->folder_count++;
+@@ -274,6 +275,8 @@ void hfs_inode_read_fork(struct inode *i
+       for (count = 0, i = 0; i < 3; i++)
+               count += be16_to_cpu(ext[i].count);
+       HFS_I(inode)->first_blocks = count;
++      HFS_I(inode)->cached_start = 0;
++      HFS_I(inode)->cached_blocks = 0;
+       inode->i_size = HFS_I(inode)->phys_size = log_size;
+       HFS_I(inode)->fs_blocks = (log_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
diff --git a/queue-4.19/ipv6-take-care-of-scope-when-choosing-the-src-addr.patch b/queue-4.19/ipv6-take-care-of-scope-when-choosing-the-src-addr.patch
new file mode 100644 (file)
index 0000000..8e1b989
--- /dev/null
@@ -0,0 +1,36 @@
+From abb9a68d2c64dd9b128ae1f2e635e4d805e7ce64 Mon Sep 17 00:00:00 2001
+From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Date: Wed, 10 Jul 2024 10:14:29 +0200
+Subject: ipv6: take care of scope when choosing the src addr
+
+From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+
+commit abb9a68d2c64dd9b128ae1f2e635e4d805e7ce64 upstream.
+
+When the source address is selected, the scope must be checked. For
+example, if a loopback address is assigned to the vrf device, it must not
+be chosen for packets sent outside.
+
+CC: stable@vger.kernel.org
+Fixes: afbac6010aec ("net: ipv6: Address selection needs to consider L3 domains")
+Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Link: https://patch.msgid.link/20240710081521.3809742-4-nicolas.dichtel@6wind.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/addrconf.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/ipv6/addrconf.c
++++ b/net/ipv6/addrconf.c
+@@ -1768,7 +1768,8 @@ int ipv6_dev_get_saddr(struct net *net,
+                                                           master, &dst,
+                                                           scores, hiscore_idx);
+-                      if (scores[hiscore_idx].ifa)
++                      if (scores[hiscore_idx].ifa &&
++                          scores[hiscore_idx].scopedist >= 0)
+                               goto out;
+               }
diff --git a/queue-4.19/media-venus-fix-use-after-free-in-vdec_close.patch b/queue-4.19/media-venus-fix-use-after-free-in-vdec_close.patch
new file mode 100644 (file)
index 0000000..6fffea9
--- /dev/null
@@ -0,0 +1,38 @@
+From a0157b5aa34eb43ec4c5510f9c260bbb03be937e Mon Sep 17 00:00:00 2001
+From: Dikshita Agarwal <quic_dikshita@quicinc.com>
+Date: Thu, 9 May 2024 10:44:29 +0530
+Subject: media: venus: fix use after free in vdec_close
+
+From: Dikshita Agarwal <quic_dikshita@quicinc.com>
+
+commit a0157b5aa34eb43ec4c5510f9c260bbb03be937e upstream.
+
+There appears to be a possible use after free with vdec_close().
+The firmware will add buffer release work to the work queue through
+HFI callbacks as a normal part of decoding. Randomly closing the
+decoder device from userspace during normal decoding can incur
+a read after free for inst.
+
+Fix it by cancelling the work in vdec_close.
+
+Cc: stable@vger.kernel.org
+Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
+Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
+Acked-by: Vikash Garodia <quic_vgarodia@quicinc.com>
+Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/media/platform/qcom/venus/vdec.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/media/platform/qcom/venus/vdec.c
++++ b/drivers/media/platform/qcom/venus/vdec.c
+@@ -1096,6 +1096,7 @@ static int vdec_close(struct file *file)
+ {
+       struct venus_inst *inst = to_inst(file);
++      cancel_work_sync(&inst->delayed_process_work);
+       v4l2_m2m_ctx_release(inst->m2m_ctx);
+       v4l2_m2m_release(inst->m2m_dev);
+       vdec_ctrl_deinit(inst);
diff --git a/queue-4.19/net-netconsole-disable-target-before-netpoll-cleanup.patch b/queue-4.19/net-netconsole-disable-target-before-netpoll-cleanup.patch
new file mode 100644 (file)
index 0000000..6a668af
--- /dev/null
@@ -0,0 +1,52 @@
+From 97d9fba9a812cada5484667a46e14a4c976ca330 Mon Sep 17 00:00:00 2001
+From: Breno Leitao <leitao@debian.org>
+Date: Fri, 12 Jul 2024 07:34:15 -0700
+Subject: net: netconsole: Disable target before netpoll cleanup
+
+From: Breno Leitao <leitao@debian.org>
+
+commit 97d9fba9a812cada5484667a46e14a4c976ca330 upstream.
+
+Currently, netconsole cleans up the netpoll structure before disabling
+the target. This approach can lead to race conditions, as message
+senders (write_ext_msg() and write_msg()) check if the target is
+enabled before using netpoll. The sender can validate that the target is
+enabled, but, the netpoll might be de-allocated already, causing
+undesired behaviours.
+
+This patch reverses the order of operations:
+1. Disable the target
+2. Clean up the netpoll structure
+
+This change eliminates the potential race condition, ensuring that
+no messages are sent through a partially cleaned-up netpoll structure.
+
+Fixes: 2382b15bcc39 ("netconsole: take care of NETDEV_UNREGISTER event")
+Cc: stable@vger.kernel.org
+Signed-off-by: Breno Leitao <leitao@debian.org>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Link: https://patch.msgid.link/20240712143415.1141039-1-leitao@debian.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/netconsole.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/netconsole.c
++++ b/drivers/net/netconsole.c
+@@ -727,6 +727,7 @@ restart:
+                               /* rtnl_lock already held
+                                * we might sleep in __netpoll_cleanup()
+                                */
++                              nt->enabled = false;
+                               spin_unlock_irqrestore(&target_list_lock, flags);
+                               __netpoll_cleanup(&nt->np);
+@@ -734,7 +735,6 @@ restart:
+                               spin_lock_irqsave(&target_list_lock, flags);
+                               dev_put(nt->np.dev);
+                               nt->np.dev = NULL;
+-                              nt->enabled = false;
+                               stopped = true;
+                               netconsole_target_put(nt);
+                               goto restart;
index dfe51f19b9028bae623a0202d8dceb5def156c59..0a413f3a6c8811d835eee3512cdd7e58a93f1a5c 100644 (file)
@@ -59,3 +59,12 @@ pinctrl-ti-ti-iodelay-fix-possible-memory-leak-when-.patch
 pinctrl-freescale-mxs-fix-refcount-of-child.patch
 fs-nilfs2-remove-some-unused-macros-to-tame-gcc.patch
 nilfs2-avoid-undefined-behavior-in-nilfs_cnt32_ge-ma.patch
+tick-broadcast-make-takeover-of-broadcast-hrtimer-reliable.patch
+net-netconsole-disable-target-before-netpoll-cleanup.patch
+af_packet-handle-outgoing-vlan-packets-without-hardware-offloading.patch
+ipv6-take-care-of-scope-when-choosing-the-src-addr.patch
+char-tpm-fix-possible-memory-leak-in-tpm_bios_measurements_open.patch
+media-venus-fix-use-after-free-in-vdec_close.patch
+hfs-fix-to-initialize-fields-of-hfs_inode_info-after-hfs_alloc_inode.patch
+drm-gma500-fix-null-pointer-dereference-in-cdv_intel_lvds_get_modes.patch
+drm-gma500-fix-null-pointer-dereference-in-psb_intel_lvds_get_modes.patch
diff --git a/queue-4.19/tick-broadcast-make-takeover-of-broadcast-hrtimer-reliable.patch b/queue-4.19/tick-broadcast-make-takeover-of-broadcast-hrtimer-reliable.patch
new file mode 100644 (file)
index 0000000..4974eaa
--- /dev/null
@@ -0,0 +1,109 @@
+From f7d43dd206e7e18c182f200e67a8db8c209907fa Mon Sep 17 00:00:00 2001
+From: Yu Liao <liaoyu15@huawei.com>
+Date: Thu, 11 Jul 2024 20:48:43 +0800
+Subject: tick/broadcast: Make takeover of broadcast hrtimer reliable
+
+From: Yu Liao <liaoyu15@huawei.com>
+
+commit f7d43dd206e7e18c182f200e67a8db8c209907fa upstream.
+
+Running the LTP hotplug stress test on a aarch64 machine results in
+rcu_sched stall warnings when the broadcast hrtimer was owned by the
+un-plugged CPU. The issue is the following:
+
+CPU1 (owns the broadcast hrtimer)      CPU2
+
+                               tick_broadcast_enter()
+                                 // shutdown local timer device
+                                 broadcast_shutdown_local()
+                               ...
+                               tick_broadcast_exit()
+                                 clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT)
+                                 // timer device is not programmed
+                                 cpumask_set_cpu(cpu, tick_broadcast_force_mask)
+
+                               initiates offlining of CPU1
+take_cpu_down()
+/*
+ * CPU1 shuts down and does not
+ * send broadcast IPI anymore
+ */
+                               takedown_cpu()
+                                 hotplug_cpu__broadcast_tick_pull()
+                                   // move broadcast hrtimer to this CPU
+                                   clockevents_program_event()
+                                     bc_set_next()
+                                       hrtimer_start()
+                                       /*
+                                        * timer device is not programmed
+                                        * because only the first expiring
+                                        * timer will trigger clockevent
+                                        * device reprogramming
+                                        */
+
+What happens is that CPU2 exits broadcast mode with force bit set, then the
+local timer device is not reprogrammed and CPU2 expects to receive the
+expired event by the broadcast IPI. But this does not happen because CPU1
+is offlined by CPU2. CPU switches the clockevent device to ONESHOT state,
+but does not reprogram the device.
+
+The subsequent reprogramming of the hrtimer broadcast device does not
+program the clockevent device of CPU2 either because the pending expiry
+time is already in the past and the CPU expects the event to be delivered.
+As a consequence all CPUs which wait for a broadcast event to be delivered
+are stuck forever.
+
+Fix this issue by reprogramming the local timer device if the broadcast
+force bit of the CPU is set so that the broadcast hrtimer is delivered.
+
+[ tglx: Massage comment and change log. Add Fixes tag ]
+
+Fixes: 989dcb645ca7 ("tick: Handle broadcast wakeup of multiple cpus")
+Signed-off-by: Yu Liao <liaoyu15@huawei.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20240711124843.64167-1-liaoyu15@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/time/tick-broadcast.c |   23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+--- a/kernel/time/tick-broadcast.c
++++ b/kernel/time/tick-broadcast.c
+@@ -941,6 +941,7 @@ void tick_broadcast_switch_to_oneshot(vo
+ #ifdef CONFIG_HOTPLUG_CPU
+ void hotplug_cpu__broadcast_tick_pull(int deadcpu)
+ {
++      struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
+       struct clock_event_device *bc;
+       unsigned long flags;
+@@ -948,6 +949,28 @@ void hotplug_cpu__broadcast_tick_pull(in
+       bc = tick_broadcast_device.evtdev;
+       if (bc && broadcast_needs_cpu(bc, deadcpu)) {
++              /*
++               * If the broadcast force bit of the current CPU is set,
++               * then the current CPU has not yet reprogrammed the local
++               * timer device to avoid a ping-pong race. See
++               * ___tick_broadcast_oneshot_control().
++               *
++               * If the broadcast device is hrtimer based then
++               * programming the broadcast event below does not have any
++               * effect because the local clockevent device is not
++               * running and not programmed because the broadcast event
++               * is not earlier than the pending event of the local clock
++               * event device. As a consequence all CPUs waiting for a
++               * broadcast event are stuck forever.
++               *
++               * Detect this condition and reprogram the cpu local timer
++               * device to avoid the starvation.
++               */
++              if (tick_check_broadcast_expired()) {
++                      cpumask_clear_cpu(smp_processor_id(), tick_broadcast_force_mask);
++                      tick_program_event(td->evtdev->next_event, 1);
++              }
++
+               /* This moves the broadcast assignment to this CPU: */
+               clockevents_program_event(bc, bc->next_event, 1);
+       }