6.6.163-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 3298/3318 vdpa_sim: disable page faults around vringh_need_notify_iotlb()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 05fb07c40e0013ba5ae373c6ea1bcc622eaea7f0 ]
When vdpa_sim runs with use_va (the default), its rings live in user memory, and vringh reads the ring's flags and event index with __get_user() through the user address. The net and block simulators call vringh_need_notify_iotlb() with bottom halves disabled, so those reads happen in atomic context.
That only works today because __get_user() has no might_fault() check: a fault is not handled in atomic context and simply comes back as -EFAULT. Make that explicit with pagefault_disable() around the call, so vringh can use the normal user accessors without complaint. Only the notification check needs this: the rest of the ring processing runs in the same kthread without bottom halves disabled, and can fault normally.
--- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 9 ++++++++- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c +8 -1
@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/device.h> #include <linux/kernel.h> +#include <linux/uaccess.h> #include <linux/blkdev.h> #include <linux/vringh.h> #include <linux/vdpa.h>
@@ -343,11 +344,17 @@ static void vdpasim_blk_work(struct vdpasim *vdpasim)continue ;while (vdpasim_blk_handle_req (vdpasim, vq)) { +bool notify; +/* Make sure used is visible before rasing the interrupt. */ smp_wmb ();local_bh_disable (); -if (vringh_need_notify_iotlb (&vq->vring) >0 ) +/* The ring may be in user memory, and we can't take faults here */ +pagefault_disable (); + notify =vringh_need_notify_iotlb (&vq->vring) >0 ; +pagefault_enable (); +if (notify)vringh_notify (&vq->vring);local_bh_enable ();
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +8 -1
@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/device.h> #include <linux/kernel.h> +#include <linux/uaccess.h> #include <linux/etherdevice.h> #include <linux/vringh.h> #include <linux/vdpa.h>
@@ -68,6 +69,8 @@ static struct vdpasim_net *sim_to_net(struct vdpasim *vdpasim)static void vdpasim_net_complete (struct vdpasim_virtqueue *vq,size_t len) { +bool notify; +/* Make sure data is wrote before advancing index */ smp_wmb ();
@@ -77,7 +80,11 @@ static void vdpasim_net_complete(struct vdpasim_virtqueue *vq, size_t len)smp_wmb ();local_bh_disable (); -if (vringh_need_notify_iotlb (&vq->vring) >0 ) +/* The ring may be in user memory, and we can't take faults here */ +pagefault_disable (); + notify =vringh_need_notify_iotlb (&vq->vring) >0 ; +pagefault_enable (); +if (notify)vringh_notify (&vq->vring);local_bh_enable (); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 3299/3318 PCI/sysfs: Decouple acpi_index from the optional device name element
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Wilczyński <[email protected]>
[ Upstream commit 337bdf853101a0ee66eadf668f0fef21f8276b52 ]
The "_DSM for Naming a PCI or PCI Express Device Under Operating Systems" (PCI Firmware r3.3, sec 4.6.7) returns a package of two elements:
1) Instance number (mandatory Integer)
2) String name (optional String, null string if not populated)
These are exposed as sysfs 'acpi_index' and 'label'. Previously, if the name was malformed, reads of 'acpi_index' failed unnecessarily.
Validate each element only for the attribute that exports it. So "acpi_index" now depends on the instance number alone, and "label" reads fail with -EIO when the name element is neither a string nor a buffer. The package elements pointer is read only after the object type has been checked.
On platforms with a valid instance number and a malformed name element the "acpi_index" attribute starts returning data. Because udev derives the onboard interface name from "acpi_index", an interface on such a platform may be renamed once, on the first boot after this change. That is the attribute assuming the value the firmware always provided.
--- drivers/pci/pci-label.c | 53 +++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 20 deletions(-)
drivers/pci/pci-label.c +33 -20
@@ -157,7 +157,7 @@ static int dsm_get_label(struct device *dev, char *buf, {acpi_handle handle =ACPI_HANDLE (dev);union acpi_object *obj, *tmp; -int len =0 ; +int len;if (!handle)return -ENODEV ;
@@ -167,30 +167,43 @@ static int dsm_get_label(struct device *dev, char *buf,if (!obj)return -EIO ; +if (obj->type !=ACPI_TYPE_PACKAGE || obj->package.count !=2 ) { + len = -EIO ; + goto out; + } + tmp = obj->package.elements; -if (obj->type ==ACPI_TYPE_PACKAGE && obj->package.count ==2 && - tmp[0 ].type ==ACPI_TYPE_INTEGER && - (tmp[1 ].type ==ACPI_TYPE_STRING || - tmp[1 ].type ==ACPI_TYPE_BUFFER )) { -/* -* The second string element is optional even when -* this _DSM is implemented; when not implemented, -* this entry must return a null string. -*/ -if (attr ==ACPI_ATTR_INDEX_SHOW ) { - len =sysfs_emit (buf,"%llu\n" , tmp->integer.value); - }else if (attr ==ACPI_ATTR_LABEL_SHOW ) { -if (tmp[1 ].type ==ACPI_TYPE_STRING ) - len =sysfs_emit (buf,"%s\n" , - tmp[1 ].string.pointer); -else if (tmp[1 ].type ==ACPI_TYPE_BUFFER ) - len =dsm_label_utf16s_to_utf8s (tmp +1 , buf); - } +if (tmp[0 ].type !=ACPI_TYPE_INTEGER ) { + len = -EIO ; + goto out; } +if (attr ==ACPI_ATTR_INDEX_SHOW ) { + len =sysfs_emit (buf,"%llu\n" , tmp[0 ].integer.value); + goto out; + } + +/* +* Per PCI Firmware r3.3, sec 4.6.7, the device name is optional +* even when this _DSM is implemented. When not implemented, this +* entry must return a NULL string. +*/ +switch (tmp[1 ].type) { +case ACPI_TYPE_STRING : + len =sysfs_emit (buf,"%s\n" , tmp[1 ].string.pointer); +break ; +case ACPI_TYPE_BUFFER : + len =dsm_label_utf16s_to_utf8s (&tmp[1 ], buf); +break ; +default : + len = -EIO ; +break ; + } + +out:ACPI_FREE (obj); -return len >0 ? len : -EIO ; +return len; } static ssize_t label_show(struct device *dev, struct device_attribute *attr,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 3300/3318 kernfs: avoid READ_ONCE() on a kgid_t in kernfs_new_node()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <[email protected]>
commit ef179363b04306dbc645c53207b9ad3516ebc75f upstream.
kernfs_new_node() reads the parent's gid with READ_ONCE(attrs->ia_gid). That gid is a kgid_t, which is a struct.
On SMP alpha, READ_ONCE() ends by casting the value it loaded back to the type of its argument. Here that is a cast from a struct to the same struct. GCC accepts that as an extension, but ISO C does not allow a cast to or from a struct type, so sparse warns:
fs/kernfs/dir.c:751:31: sparse: sparse: cast to non-scalar fs/kernfs/dir.c:751:31: sparse: sparse: cast from non-scalar
Read the gid_t inside the kgid_t instead, and wrap it back up with KGIDT_INIT(). This is still a single marked load of the same four bytes.
There is no functional change. With GCC 12 for alpha (the config from the report) and GCC 14 for x86-64 (with and without KCSAN), fs/kernfs/dir.o has the same object code before and after this change.
--- fs/kernfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/kernfs/dir.c +1 -1
@@ -697,7 +697,7 @@ struct kernfs_node *kernfs_new_node(strustruct kernfs_iattrs *attrs =READ_ONCE (parent->iattr);if (attrs) - gid =READ_ONCE (attrs->ia_gid); + gid =KGIDT_INIT (READ_ONCE (attrs->ia_gid.val));if (flags &KERNFS_DIR ) mode |=S_ISGID ;
Greg Kroah-Hartman
maintainerPATCH 3301/3318 nvmet-auth: reject incomplete DHCHAP messages
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <[email protected]>
commit 29e027774324dbd5321a67bbd16840e8f7bcd189 upstream.
Commit c9359401036e ("nvmet-auth: reject undersized AUTH_SEND payloads") only ensures that AUTH_SEND has auth_type and auth_id before nvmet_execute_auth_send() starts parsing the payload, but the DHCHAP path reads t_id before it verifies message lengths. A two-byte DHCHAP NEGOTIATE payload can therefore still trigger an OOB read that KASAN reports as:
BUG: KASAN: slab-out-of-bounds in nvmet_execute_auth_send Read of size 2 at addr ffff8880030d8364
Require the payload to cover the minimum DHCHAP message length before parsing it.
--- drivers/nvme/target/fabrics-cmd-auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/fabrics-cmd-auth.c +1 -1
@@ -256,7 +256,7 @@ void nvmet_execute_auth_send(struct nvmenvmet_check_transfer_len (req, tl);return ; } -if (tl < offsetof(struct nvmf_auth_dhchap_success2_data , rsvd1)) { +if (tl <sizeof (struct nvmf_auth_dhchap_failure_data )) { status =NVME_SC_INVALID_FIELD |NVME_STATUS_DNR ; req->error_loc = offsetof(struct nvmf_auth_send_command , tl);
Greg Kroah-Hartman
maintainerPATCH 3302/3318 net: lwtunnel: Drop skb metadata before LWT encapsulation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Sitnicki <[email protected]>
commit c00320b0e355c4bf0ae4743a53b4180fea237546 upstream.
skb metadata is meant for passing information between XDP and TC. It lives in the skb headroom, immediately before skb->data. LWT programs cannot access the __sk_buff->data_meta pseudo-pointer to metadata.
However, LWT encapsulation prepends outer headers, moving skb->data back over the headroom where the metadata sits. On an RX-originated (forwarded) packet that still carries XDP metadata this goes wrong in two different ways, depending on the encap type:
1. Non-BPF LWT encaps (mpls, seg6, ioam6 ...) call skb_push()/skb_pull() and silently overwrite the metadata that sits in the headroom.
2) BPF LWT xmit calls bpf_skb_change_head(), which uses skb_data_move(). That helper expects metadata immediately before skb->data. But since the IP output path runs LWT xmit before neighbour output has built the outgoing L2 header, for forwarded packets skb->data points at the L3 header while skb_mac_header() still points at the old L2 header. skb_data_move() sees metadata ending at skb_mac_header(), not before skb->data, warns and clears metadata:
WARNING: CPU: 21 PID: 454557 at include/linux/skbuff.h:4609 skb_data_move+0x47/0x90 CPU: 21 UID: 0 PID: 454557 Comm: napi/iconduit-g Tainted: G O 6.18.21 #1 RIP: 0010:skb_data_move+0x47/0x90 Call Trace: <IRQ> bpf_skb_change_head+0xe6/0x1a0 bpf_prog_...+0x213/0x2e3 run_lwt_bpf.isra.0+0x1d3/0x360 bpf_xmit+0x46/0xe0 lwtunnel_xmit+0xa1/0xf0 ip_finish_output2+0x1e7/0x5e0 ip_output+0x63/0x100 __netif_receive_skb_one_core+0x85/0xa0 process_backlog+0x9c/0x150 __napi_poll+0x2b/0x190 net_rx_action+0x40b/0x7f0 handle_softirqs+0xd2/0x270 do_softirq+0x3f/0x60 </IRQ>
That is what happens, as for how to fix it - a received packet that carries metadata can reach an encap through any of the three LWT redirect modes:
LWTUNNEL_STATE_INPUT_REDIRECT
ip6_rcv_finish
dst_input
lwtunnel_input
LWTUNNEL_STATE_OUTPUT_REDIRECT
ip6_rcv_finish
dst_input
ip6_forward
ip6_forward_finish
dst_output
lwtunnel_output
LWTUNNEL_STATE_XMIT_REDIRECT
ip6_rcv_finish
dst_input
ip6_forward
ip6_forward_finish
dst_output
ip6_output
ip6_finish_output
ip6_finish_output2
lwtunnel_xmit
Every encap funnels through the three LWT dispatch helpers, so drop the metadata there, right before handing the skb to the encap op. This single chokepoint covers all encap types and all three redirect modes:
- lwtunnel_input(): seg6, rpl, ila, seg6_local
- lwtunnel_output(): ioam6
- lwtunnel_xmit(): mpls, LWT BPF xmit
Alternatively, we could clear the metadata right after TC ingress hook. That would require a compromise, however. Metadata would become inaccessible from TC egress (in setups where it actually reaches the hook it tact, that is without any L2 tunnels on path).
--- net/core/lwtunnel.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/core/lwtunnel.c +6 -0
@@ -358,6 +358,8 @@ int lwtunnel_output(struct net *net, strrcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]);if (likely (ops && ops->output)) { +/* Encap pushes outer headers over the metadata; drop it. */ +skb_metadata_clear (skb);dev_xmit_recursion_inc (); ret = ops->output (net, sk, skb);dev_xmit_recursion_dec ();
@@ -412,6 +414,8 @@ int lwtunnel_xmit(struct sk_buff *skb)rcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]);if (likely (ops && ops->xmit)) { +/* Encap pushes outer headers over the metadata; drop it. */ +skb_metadata_clear (skb);dev_xmit_recursion_inc (); ret = ops->xmit (skb);dev_xmit_recursion_dec ();
@@ -463,6 +467,8 @@ int lwtunnel_input(struct sk_buff *skb)rcu_read_lock (); ops =rcu_dereference (lwtun_encaps[lwtstate->type]);if (likely (ops && ops->input)) { +/* Encap pushes outer headers over the metadata; drop it. */ +skb_metadata_clear (skb);dev_xmit_recursion_inc (); ret = ops->input (skb);dev_xmit_recursion_dec ();
Greg Kroah-Hartman
maintainerPATCH 3303/3318 irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Price <[email protected]>
commit bc88d44bd7e45b992cf8c2c2ffbc7bb3e24db4a7 upstream.
itt_alloc_pool() calls its_alloc_pages_node() to allocate an individual page to add to the pool (for allocations <PAGE_SIZE). However the final argument of its_alloc_pages_node() is the page order not the number of pages. Currently it allocates two pages and leaks the second page. Fix it by passing 0 instead (1 << 0 = 1 page).
--- drivers/irqchip/irq-gic-v3-its.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
@@ -262,7 +262,7 @@ static void *itt_alloc_pool(int node, inif (addr)break ; - page =its_alloc_pages_node (node,GFP_KERNEL | __GFP_ZERO,1 ); + page =its_alloc_pages_node (node,GFP_KERNEL | __GFP_ZERO,0 );if (!page)break ;
Greg Kroah-Hartman
maintainerPATCH 3304/3318 smb: align durable reconnect v2 context to 8 byte boundary
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bharath SM <[email protected]>
commit 05f5e355cf783b30bd6eb3dec17ed1a8b3cfa95c upstream.
Add a 4-byte Pad to create_durable_handle_reconnect_v2 so the DH2C create context is 8 byte aligned.
This avoids malformed CREATE contexts on reconnect. Recent change removed this Padding, adding it back.
--- fs/smb/common/smb2pdu.h | 1 + 1 file changed, 1 insertion(+)
fs/smb/common/smb2pdu.h +1 -0
@@ -1318,6 +1318,7 @@ struct create_durable_handle_reconnect_vstruct create_context_hdr ccontext;__u8 Name[8 ];struct durable_reconnect_context_v2 dcontext; +__u8 Pad[4 ]; } __packed;/* See MS-SMB2 2.2.14.2.12 */
Greg Kroah-Hartman
maintainerPATCH 3305/3318 remoteproc: imx_dsp_rproc: Only reset carveout memory at RPROC_OFFLINE state
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <[email protected]>
commit b490ddf27be28e64a39c08ae643d7b22561beaf6 upstream.
Do not reset memory at suspend and resume stage, because some memory is used to save the software state for resume, if it is cleared, the resume operation can fail.
--- drivers/remoteproc/imx_dsp_rproc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/remoteproc/imx_dsp_rproc.c +5 -3
@@ -939,9 +939,11 @@ static int imx_dsp_rproc_load(struct rpr* Clear buffers after pm rumtime for internal ocram is not * accessible if power and clock are not enabled. */ -list_for_each_entry (carveout, &rproc->carveouts, node) { -if (carveout->va) -memset (carveout->va,0 , carveout->len); +if (rproc->state ==RPROC_OFFLINE ) { +list_for_each_entry (carveout, &rproc->carveouts, node) { +if (carveout->va) +memset (carveout->va,0 , carveout->len); + } } ret =imx_dsp_rproc_elf_load_segments (rproc, fw);
Greg Kroah-Hartman
maintainerPATCH 3306/3318 net: bcmgenet: stop Tx NAPI before disabling the queues
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolai Buchwitz <[email protected]>
commit 7e87508b5c4d81210d0a736ed01962e52f5c4c56 upstream.
bcmgenet_netif_stop() and the Wake-on-LAN branch of bcmgenet_suspend() both disable the Tx queues first and stop Tx NAPI several steps later. A completion in flight calls netif_tx_wake_queue() in between, and nothing stops the queue again, so a transmit can reach the rings after they have been freed.
Close is safe because dev_deactivate_many() stops the qdisc first. bcmgenet_suspend() does not, so stop Tx NAPI before the queues on both paths.
KASAN on a Raspberry Pi CM4, driven from an MTU change because suspend freezes user space before the callback runs:
BUG: KASAN: use-after-free in bcmgenet_xmit+0x17f8/0x2258 Write of size 8 at addr ffffff8055844a68 by task ksoftirqd/0/14 bcmgenet_xmit+0x17f8/0x2258 dev_hard_start_xmit+0x13c/0x588 sch_direct_xmit+0x108/0x340 __dev_queue_xmit+0x1190/0x3848
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +4 -2
@@ -3360,6 +3360,8 @@ static void bcmgenet_netif_stop(struct n {struct bcmgenet_priv *priv =netdev_priv (dev); +/* Stop completion polling before it can wake a stopped queue */ +bcmgenet_disable_tx_napi (priv);netif_tx_disable (dev);/* Disable MAC receive */
@@ -3374,7 +3376,6 @@ static void bcmgenet_netif_stop(struct n/* Disable MAC transmit. TX DMA disabled must be done before this */ umac_enable_set (priv,CMD_TX_EN , false); -bcmgenet_disable_tx_napi (priv);bcmgenet_disable_rx_napi (priv);bcmgenet_intr_disable (priv);
@@ -4308,6 +4309,8 @@ static int bcmgenet_suspend(struct devicnetif_device_detach (dev);if (device_may_wakeup (d) && priv->wolopts) { +/* Stop completion polling before it can wake a stopped queue */ +bcmgenet_disable_tx_napi (priv);netif_tx_disable (dev);/* Suspend non-wake Rx data flows */
@@ -4317,7 +4320,6 @@ static int bcmgenet_suspend(struct devicnetdev_warn (priv->dev,"Timed out while disabling TX DMA\n" ); -bcmgenet_disable_tx_napi (priv);bcmgenet_disable_rx_napi (priv);disable_irq (priv->irq1);bcmgenet_tx_reclaim_all (dev);
Greg Kroah-Hartman
maintainerPATCH 3307/3318 net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Chen <[email protected]>
commit 5857e5a196b069766a39ceb754736326a43bc6bc upstream.
When the revised suspend/resume sequence was introduced this led to an edge case where the TX is left disabled in the following sequence.
1. phy link is down, so UMAC is held in reset and then network interface is WoL enabled
2. Enter suspend, bcmgenet_wol_power_down_cfg() enables UMAC_RX since MAC is in SW_RESET
4. Enter resume, UMAC_RX is left enabled. Since we only enable UMAC_TX and UMAC_RX in SW_RESET. The UMAC_TX is never enabled again on link up.
The issue was hit in production and I verified the sequence keeps the TX disabled in my standalone test. I tested on an internal development board with bcm77122, but should be reproducible on any genet HW that supports power management.
--- drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +11 -0
@@ -253,6 +253,17 @@ int bcmgenet_wol_power_up_cfg(struct bcm reg =bcmgenet_umac_readl (priv,UMAC_CMD ); reg &= ~CMD_CRC_FWD ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); + +/* +* Mirror wol_power_down_cfg(). If only UMAC_RX +* is enabled, then we must place the UMAC back +* into SW_RESET. +*/ + reg =bcmgenet_umac_readl (priv,UMAC_CMD ); +if ((reg &CMD_RX_EN ) && !(reg &CMD_TX_EN )) { + reg |=CMD_SW_RESET ; +bcmgenet_umac_writel (priv, reg,UMAC_CMD ); + }spin_unlock_bh (&priv->reg_lock);/* Resume link status tracking */
Greg Kroah-Hartman
maintainerPATCH 3308/3318 apparmor: avoid potential double free when remapping DFA tables
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
commit 7ccd884a5e5386f4c7d98625113f4924f70286b4 upstream.
When unpacking a DFA, aa_dfa_unpack() stores a table in dfa->tables before attempting to remap a 16-bit table to 32-bit.
However, remap_data16_to_data32() frees the original table when allocation of the new table fails. This leaves the corresponding dfa->tables entry pointing to freed memory. If the unpacking then fails, dfa_free() attempts to free the same table again.
Only publish the table to dfa->tables after any required remapping has completed successfully, so that dfa->tables never contains a pointer to a table that has already been freed.
--- security/apparmor/match.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
security/apparmor/match.c +1 -2
@@ -393,7 +393,6 @@ struct aa_dfa *aa_dfa_unpack(void *blob,/* check for duplicate table entry */ if (dfa->tables[table->td_id]) goto fail; - dfa->tables[table->td_id] = table; data +=table_size (table->td_lolen, table->td_flags); size -=table_size (table->td_lolen, table->td_flags);
@@ -410,9 +409,9 @@ struct aa_dfa *aa_dfa_unpack(void *blob,if (!table) goto fail; } - dfa->tables[table->td_id] = table;break ; } + dfa->tables[table->td_id] = table; table =NULL ; } error =verify_table_headers (dfa->tables, flags);
Greg Kroah-Hartman
maintainerPATCH 3309/3318 nvmet: do not return reserved for empty TSAS values
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <[email protected]>
commit f31e85a4d7c6ac4a3e014129c9cdc31592ea29f3 upstream.
The 'TSAS' value is only defined for TCP and RDMA, but returning 'reserved' for undefined values tricked nvmetcli to try to write 'reserved' when restoring from a config file. This caused an error and the configuration would not be applied.
--- drivers/nvme/target/configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/configfs.c +1 -1
@@ -378,7 +378,7 @@ static ssize_t nvmet_addr_tsas_show(strureturn sprintf (page,"%s\n" , nvmet_addr_tsas_rdma[i].name); } } -return sprintf (page,"reserved\n" ); +return sprintf (page,"\n" ); } static ssize_t nvmet_addr_tsas_store(struct config_item *item,
Greg Kroah-Hartman
maintainerPATCH 3310/3318 printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yoann Congal <[email protected]>
commit 320bf43190514be5c00e11f47ec2160dd3993844 upstream.
LOG_CPU_MAX_BUF_SHIFT default value depends on BASE_SMALL:
config LOG_CPU_MAX_BUF_SHIFT
default 12 if !BASE_SMALL
default 0 if BASE_SMALL
But, BASE_SMALL is a config of type int and "!BASE_SMALL" is always evaluated to true whatever is the value of BASE_SMALL.
This patch fixes this by using the correct conditional operator for int type : BASE_SMALL != 0.
Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 for BASE_SMALL defconfigs, but that will not be a big impact due to this code in kernel/printk/printk.c:
/* by default this will only continue through for large > 64 CPUs */ if (cpu_extra <= __LOG_BUF_LEN / 2)
return;
Systems using CONFIG_BASE_SMALL and having 64+ CPUs should be quite rare.
Quoted 4 lines · John Ogness <[email protected]> (printk reviewer) wrote:
For printk this will mean that
BASE_SMALLsystems were probably previously allocating/using the dynamic ringbuffer and now they will just continue to use the static ringbuffer. Which is fine and saves memory (as it should).
Quoted 4 lines · Petr Mladek <[email protected]> (printk maintainer) wrote:
More precisely, it allocated the buffer dynamically when the sum of per-CPU-extra space exceeded half of the default static ring buffer. This happened for systems with more than 64 CPUs with the default config values.
--- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
init/Kconfig +2 -2
@@ -752,8 +752,8 @@ config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP range 0 21 - default 12 if !BASE_SMALL - default 0 if BASE_SMALL + default 0 if BASE_SMALL != 0 + default 12 depends on PRINTK help This option allows to increase the default ring buffer size
Greg Kroah-Hartman
maintainerPATCH 3311/3318 cpufreq/amd-pstate-ut: Dont check for highest perf matching on prefcore
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 9983a9cd4d429dc9ca01770083c4c1f366214b65 upstream.
If a system is using preferred cores the highest perf will be inconsistent as it can change from system events.
Skip the checks for it.
--- drivers/cpufreq/amd-pstate-ut.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/cpufreq/amd-pstate-ut.c +8 -5
@@ -160,14 +160,17 @@ static void amd_pstate_ut_check_perf(u32 lowest_perf =AMD_CPPC_LOWEST_PERF (cap1); } -if ((highest_perf !=READ_ONCE (cpudata->highest_perf)) || - (nominal_perf !=READ_ONCE (cpudata->nominal_perf)) || +if (highest_perf !=READ_ONCE (cpudata->highest_perf) && !cpudata->hw_prefcore) { +pr_err ("%s cpu%d highest=%d %d highest perf doesn't match\n" , + __func__, cpu, highest_perf, cpudata->highest_perf); + goto skip_test; + } +if ((nominal_perf !=READ_ONCE (cpudata->nominal_perf)) || (lowest_nonlinear_perf !=READ_ONCE (cpudata->lowest_nonlinear_perf)) || (lowest_perf !=READ_ONCE (cpudata->lowest_perf))) { amd_pstate_ut_cases[index].result =AMD_PSTATE_UT_RESULT_FAIL ; -pr_err ("%s cpu%d highest=%d %d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n" , - __func__, cpu, highest_perf, cpudata->highest_perf, - nominal_perf, cpudata->nominal_perf, +pr_err ("%s cpu%d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n" , + __func__, cpu, nominal_perf, cpudata->nominal_perf, lowest_nonlinear_perf, cpudata->lowest_nonlinear_perf, lowest_perf, cpudata->lowest_perf); goto skip_test;
Greg Kroah-Hartman
maintainerPATCH 3312/3318 wifi: mt76: mt7996: fix alignment of sta info event
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: StanleyYP Wang <[email protected]>
commit d58a9778f7ca0634622d2fc2e9f76163467bdf5b upstream.
Fix the alignment of struct mt7996_mcu_all_sta_info_event.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +1 -1
@@ -181,7 +181,7 @@ struct mt7996_mcu_all_sta_info_event {u8 more;u8 rsv2;__le16 sta_num; -u8 rsv3[2 ]; +u8 rsv3[4 ];union {struct all_sta_trx_rate rate[0 ];
Greg Kroah-Hartman
maintainerPATCH 3313/3318 wifi: mt76: mt7996: fix mt7996_mcu_all_sta_info_event struct packing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 2ee1c40daeb9a33e25c460bf87feca58e91af879 upstream.
The internal struct and union inside mt7996_mcu_all_sta_info_event is marked as being aligned, which conflicts with it being unaligned within that structure:
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2: error: field within 'struct mt7996_mcu_all_sta_info_event' is less aligned than 'union mt7996_mcu_all_sta_info_event::(anonymous at ../drivers/net/wireless/mediatek/mt76/mt7996/mcu.h:165:2)' and is usually due to 'struct mt7996_mcu_all_sta_info_event' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
Mark all three as being packed as well to ensure byte packing for the entire thing.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +3 -3
@@ -190,15 +190,15 @@ struct mt7996_mcu_all_sta_info_event {u8 rsv[2 ];__le32 tx_bytes[IEEE80211_NUM_ACS ];__le32 rx_bytes[IEEE80211_NUM_ACS ]; - } adm_stat[0 ]; + } adm_stat[0] __packed;struct {__le16 wlan_idx;u8 rsv[2 ];__le32 tx_msdu_cnt;__le32 rx_msdu_cnt; - } msdu_cnt[0 ]; - }; + } msdu_cnt[0] __packed; + } __packed; } __packed;enum mt7996_chan_mib_offs {
Greg Kroah-Hartman
maintainerPATCH 3314/3318 bpftool: Fix wrong free call in do_show_link
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <[email protected]>
commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad upstream.
The error path frees wrong array, it should be ref_ctr_offsets.
--- tools/bpf/bpftool/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/link.c +1 -1
@@ -962,7 +962,7 @@ again: cookies =calloc (count,sizeof (__u64));if (!cookies) {p_err ("mem alloc failed" ); -free (cookies); +free (ref_ctr_offsets);free (offsets);close (fd);return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 3315/3318 kconfig: initialize sym->curr.tri to no for all symbol types again
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
commit bfef491df67022c56aab3b831044f8d259f9441f upstream.
Geert Uytterhoeven reported that commit 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable") changed the default value of CONFIG_LOG_CPU_MAX_BUF_SHIFT from 12 to 0.
As it turned out, this is an undefined behavior because sym_calc_value() stopped setting the sym->curr.tri field for 'int', 'hex', and 'string' symbols.
This commit restores the original behavior, where 'int', 'hex', 'string' symbols are interpreted as false if used in boolean contexts.
CONFIG_LOG_CPU_MAX_BUF_SHIFT will default to 12 again, irrespective of CONFIG_BASE_SMALL. Presumably, this is not the intended behavior, as already reported [1], but this is another issue that should be addressed by a separate patch.
[1]: https://lore.kernel.org/all/[email protected]/
--- scripts/kconfig/symbol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/kconfig/symbol.c +3 -1
@@ -364,6 +364,8 @@ void sym_calc_value(struct symbol *sym) oldval = sym->curr; + newval.tri = no; +switch (sym->type) {case S_INT : newval.val ="0" ;
@@ -376,7 +378,7 @@ void sym_calc_value(struct symbol *sym)break ;case S_BOOLEAN :case S_TRISTATE : - newval = symbol_no.curr; + newval.val ="n" ;break ;default : sym->curr.val = sym->name;
Greg Kroah-Hartman
maintainerPATCH 3316/3318 clk: samsung: Revert "clk: Use device_get_match_data()"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
commit aacb99de1099346244d488bdf7df489a44278574 upstream.
device_get_match_data() function should not be used on the device other than the one matched to the given driver, because it always returns the match_data of the matched driver. In case of exynos-clkout driver, the original code matches the OF IDs on the PARENT device, so replacing it with of_device_get_match_data() broke the driver.
This has been already pointed once in commit 2bc5febd05ab ("clk: samsung:
Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()""). To avoid further confusion, add a comment about this special case, which requires direct of_match_device() call to pass custom IDs array.
This partially reverts commit 409c39ec92a35e3708f5b5798c78eae78512cd71.
--- drivers/clk/samsung/clk-exynos-clkout.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/clk/samsung/clk-exynos-clkout.c +10 -3
@@ -13,9 +13,9 @@#include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm.h> -#include <linux/property.h> #define EXYNOS_CLKOUT_NR_CLKS 1#define EXYNOS_CLKOUT_PARENTS 32
@@ -84,17 +84,24 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_idstatic int exynos_clkout_match_parent_dev (struct device *dev,u32 *mux_mask) {const struct exynos_clkout_variant *variant; +const struct of_device_id *match;if (!dev->parent) {dev_err (dev,"not instantiated from MFD\n" );return -EINVAL ; } - variant =device_get_match_data (dev->parent); -if (!variant) { +/* +* 'exynos_clkout_ids' arrays is not the ids array matched by +* the dev->parent driver, so of_device_get_match_data() or +* device_get_match_data() cannot be used here. +*/ + match =of_match_device (exynos_clkout_ids, dev->parent); +if (!match) {dev_err (dev,"cannot match parent device\n" );return -EINVAL ; } + variant = match->data; *mux_mask = variant->mux_mask;
Greg Kroah-Hartman
maintainerPATCH 3317/3318 RDMA/rxe: Flush delayed SKBs while releasing RXE resources
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhu Yanjun <[email protected]>
commit 3c3e9a9f2972b364e8c2cfbfdeb23c6d6be4f87f upstream.
When skb packets are sent out, these skb packets still depends on the rxe resources, for example, QP, sk, when these packets are destroyed.
If these rxe resources are released when the skb packets are destroyed, the call traces will appear.
To avoid skb packets hang too long time in some network devices, a timestamp is added when these skb packets are created. If these skb packets hang too long time in network devices, these network devices can free these skb packets to release rxe resources.
--- drivers/infiniband/sw/rxe/rxe_net.c | 29 ++++++++--------------------- drivers/infiniband/sw/rxe/rxe_qp.c | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-)
drivers/infiniband/sw/rxe/rxe_net.c +8 -21
@@ -368,33 +368,15 @@ static void rxe_skb_put_held_ndev(structstatic void rxe_skb_tx_dtor (struct sk_buff *skb) { -struct net_device *ndev = skb->dev; -struct rxe_dev *rxe; -unsigned int qp_index; -struct rxe_qp *qp; +struct rxe_qp *qp = skb->sk->sk_user_data;int skb_out; - rxe =rxe_get_dev_from_net (ndev); -if (!rxe &&is_vlan_dev (ndev)) - rxe =rxe_get_dev_from_net (vlan_dev_real_dev (ndev)); -if (WARN_ON (!rxe)) -return ; - - qp_index = (int )(uintptr_t )skb->sk->sk_user_data; -if (!qp_index) -return ; - - qp =rxe_pool_get_index (&rxe->qp_pool, qp_index); -if (!qp) - goto put_dev; - skb_out =atomic_dec_return (&qp->skb_out); -if (qp->need_req_skb && skb_out <RXE_INFLIGHT_SKBS_PER_QP_LOW ) +if (unlikely (qp->need_req_skb && + skb_out <RXE_INFLIGHT_SKBS_PER_QP_LOW ))rxe_sched_task (&qp->send_task);rxe_put (qp); -put_dev: -ib_device_put (&rxe->ib_dev);sock_put (skb->sk);rxe_skb_put_held_ndev (skb); }
@@ -418,6 +400,7 @@ static int rxe_send(struct sk_buff *skb,sock_hold (sk); skb->sk = sk; skb->destructor = rxe_skb_tx_dtor; +rxe_get (pkt->qp);atomic_inc (&pkt->qp->skb_out);if (skb->protocol ==htons (ETH_P_IP ))
@@ -445,6 +428,7 @@ static int rxe_loopback(struct sk_buff *sock_hold (sk); skb->sk = sk; skb->destructor = rxe_skb_tx_dtor; +rxe_get (pkt->qp);atomic_inc (&pkt->qp->skb_out);if (skb->protocol ==htons (ETH_P_IP ))
@@ -543,6 +527,9 @@ struct sk_buff *rxe_init_packet(struct r goto out; } +/* Add time stamp to skb. */ + skb->tstamp =ktime_get (); +skb_reserve (skb, hdr_len +LL_RESERVED_SPACE (ndev));rxe_skb_set_held_ndev (skb, ndev);
drivers/infiniband/sw/rxe/rxe_qp.c +1 -1
@@ -245,7 +245,7 @@ static int rxe_qp_init_req(struct rxe_de err =sock_create_kern (&init_net,AF_INET ,SOCK_DGRAM ,0 , &qp->sk);if (err <0 )return err; - qp->sk->sk->sk_user_data = (void *)(uintptr_t )qp->elem.index; + qp->sk->sk->sk_user_data = qp;/* pick a source UDP port number for this QP based on * the source QPN. this spreads traffic for different QPs
Greg Kroah-Hartman
maintainerPATCH 3318/3318 Input: matrix_keypad - propagate error code from matrix_keypad_build_keymap()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit 4d8221c0d7e72bea5ee1a6bf8ae423a1faca66fa upstream.
When switching to managed resources in matrix_keypad_probe(), the error return path after matrix_keypad_build_keymap() was replaced with a hardcoded -ENOMEM instead of propagating the real error code.
Return the original error so the actual failure reason is preserved.
--- drivers/input/keyboard/matrix_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/matrix_keypad.c +1 -1
@@ -455,7 +455,7 @@ static int matrix_keypad_probe(struct pl NULL, input_dev);if (err) {dev_err (&pdev->dev,"failed to build keymap\n" ); -return -ENOMEM ; +return err; }if (!pdata->no_autorepeat)
Am 18.11.2026 um 15:10 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.6.163 release. There are 3318 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
It's really a bit scary that the "new normal" these days seems to be that these RCs are so massive, 3318 patches, WOW!
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Build tested in our x86,arm64,loongarch,riscv config successfully without error.
Best Regards
Wentao Guan
Log:
Linux version 6.6.163-rc1-arm64-desktop-hwe-gc4e45e560351 (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #2 SMP PREEMPT Thu Nov 19 17:25:15 CST 2026 Linux version 6.6.163-rc1-loong64-desktop-hwe-gc4e45e560351 (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #3 SMP PREEMPT Thu Nov 19 17:41:44 CST 2026 Linux version 6.6.163-rc1-riscv64-desktop-hwe+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #4 SMP Thu Nov 19 17:58:25 CST 2026 Linux version 6.6.163-rc1-amd64-desktop-hwe-gc4e45e560351 (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin18) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #1 SMP PREEMPT_DYNAMIC Thu Nov 19 17:07:17 CST 2026
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.163 release. There are 3318 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:42 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.163 release. There are 3318 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:42 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Tested on an amd64 laptop (Lenovo ThinkPad T14 Gen 1). Working well, no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.163 release. There are 3318 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:42 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.163-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).