6.6.87-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 153/268 LoongArch: Fix help text of CMDLINE_EXTEND in Kconfig
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: 谢致邦 (XIE Zhibang) <[email protected]>
[ Upstream commit be216cbc1ddf99a51915414ce147311c0dfd50a2 ]
It is the built-in command line appended to the bootloader command line, not the bootloader command line appended to the built-in command line.
--- arch/loongarch/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/loongarch/Kconfig +2 -2
@@ -356,8 +356,8 @@ config CMDLINE_BOOTLOADER config CMDLINE_EXTEND bool "Use built-in to extend bootloader kernel arguments" help - The command-line arguments provided during boot will be - appended to the built-in command line. This is useful in + The built-in command line will be appended to the command- + line arguments provided during boot. This is useful in cases where the provided arguments are insufficient and you don't want to or cannot modify them.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 154/268 LoongArch: Rework the arch_kgdb_breakpoint() implementation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuli Wang <[email protected]>
[ Upstream commit 29c92a41c6d2879c1f62220fe4758dce191bb38f ]
The arch_kgdb_breakpoint() function defines the kgdb_breakinst symbol using inline assembly.
1. There's a potential issue where the compiler might inline arch_kgdb_breakpoint(), which would then define the kgdb_breakinst symbol multiple times, leading to a linker error.
To prevent this, declare arch_kgdb_breakpoint() as noinline.
Fix follow error with LLVM-19 *only* when LTO_CLANG_FULL:
LD vmlinux.o
ld.lld-19: error: ld-temp.o <inline asm>:3:1: symbol 'kgdb_breakinst' is already defined
kgdb_breakinst: break 2
^
2. Remove "nop" in the inline assembly because it's meaningless for LoongArch here.
3. Add "STACK_FRAME_NON_STANDARD" for arch_kgdb_breakpoint() to avoid the objtool warning.
--- arch/loongarch/kernel/kgdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/loongarch/kernel/kgdb.c +3 -2
@@ -8,6 +8,7 @@#include <linux/hw_breakpoint.h> #include <linux/kdebug.h> #include <linux/kgdb.h> +#include <linux/objtool.h> #include <linux/processor.h> #include <linux/ptrace.h> #include <linux/sched.h>
@@ -224,13 +225,13 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) regs->csr_era = pc; } -void arch_kgdb_breakpoint (void ) +noinline void arch_kgdb_breakpoint(void) { __asm__ __volatile__ ( \".globl kgdb_breakinst\n\t" \ -"nop\n" \"kgdb_breakinst:\tbreak 2\n\t" );/* BRK_KDB = 2 */ } +STACK_FRAME_NON_STANDARD (arch_kgdb_breakpoint);/* * Calls linux_debug_hook before the kernel dies. If KGDB is enabled,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 155/268 ACPI: processor: idle: Return an error if both P_LVL{2,3} idle states are invalid
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giovanni Gherdovich <[email protected]>
[ Upstream commit 9e9b893404d43894d69a18dd2fc8fcf1c36abb7e ]
Prior to commit 496121c02127 ("ACPI: processor: idle: Allow probing on platforms with one ACPI C-state"), the acpi_idle driver wouldn't load on systems without a valid C-State at least as deep as C2.
The behavior was desirable for guests on hypervisors such as VMWare ESXi, which by default don't have the _CST ACPI method, and set the C2 and C3 latencies to 101 and 1001 microseconds respectively via the FADT, to signify they're unsupported.
Since the above change though, these virtualized deployments end up loading acpi_idle, and thus entering the default C1 C-State set by acpi_processor_get_power_info_default(); this is undesirable for a system that's communicating to the OS it doesn't want C-States (missing _CST, and invalid C2/C3 in FADT).
Make acpi_processor_get_power_info_fadt() return -ENODEV in that case, so that acpi_processor_get_cstate_info() exits early and doesn't set pr->flags.power = 1.
--- drivers/acpi/processor_idle.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/acpi/processor_idle.c +4 -0
@@ -268,6 +268,10 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)ACPI_CX_DESC_LEN ,"ACPI P_LVL3 IOPORT 0x%x" , pr->power.states[ACPI_STATE_C3].address); +if (!pr->power.states[ACPI_STATE_C2 ].address && + !pr->power.states[ACPI_STATE_C3 ].address) +return -ENODEV ; +return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 156/268 octeontx2-af: Fix mbox INTR handler when num VFs > 64
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geetha sowjanya <[email protected]>
[ Upstream commit 0fdba88a211508984eb5df62008c29688692b134 ]
When number of RVU VFs > 64, the vfs value passed to "rvu_queue_work" function is incorrect. Due to which mbox workqueue entries for VFs 0 to 63 never gets added to workqueue.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 -1
@@ -2563,7 +2563,7 @@ static irqreturn_t rvu_mbox_intr_handler(int irq, void *rvu_irq)rvupf_write64 (rvu,RVU_PF_VFPF_MBOX_INTX (1 ), intr);rvu_queue_work (&rvu->afvf_wq_info,64 , vfs, intr); - vfs -=64 ; + vfs =64 ; } intr =rvupf_read64 (rvu,RVU_PF_VFPF_MBOX_INTX (0 ));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 157/268 octeontx2-af: Free NIX_AF_INT_VEC_GEN irq
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geetha sowjanya <[email protected]>
[ Upstream commit 323d6db6dc7decb06f2545efb9496259ddacd4f4 ]
Due to the incorrect initial vector number in rvu_nix_unregister_interrupts(), NIX_AF_INT_VEC_GEN is not geeting free. Fix the vector number to include NIX_AF_INT_VEC_GEN irq.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +1 -1
@@ -217,7 +217,7 @@ static void rvu_nix_unregister_interrupts(struct rvu *rvu) rvu->irq_allocated[offs +NIX_AF_INT_VEC_RVU ] = false; } -for (i =NIX_AF_INT_VEC_AF_ERR ; i <NIX_AF_INT_VEC_CNT ; i++) +for (i =NIX_AF_INT_VEC_GEN ; i <NIX_AF_INT_VEC_CNT ; i++)if (rvu->irq_allocated[offs + i]) {free_irq (pci_irq_vector (rvu->pdev, offs + i), rvu_dl); rvu->irq_allocated[offs + i] = false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 158/268 objtool: Fix verbose disassembly if CROSS_COMPILE isnt set
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Laight <[email protected]>
[ Upstream commit e77956e4e5c11218e60a1fe8cdbccd02476f2e56 ]
In verbose mode, when printing the disassembly of affected functions, if CROSS_COMPILE isn't set, the objdump command string gets prefixed with "(null)".
Somehow this worked before. Maybe some versions of glibc return an empty string instead of NULL. Fix it regardless.
[ jpoimboe: Rewrite commit log. ]
--- tools/objtool/check.c | 2 ++ 1 file changed, 2 insertions(+)
tools/objtool/check.c +2 -0
@@ -4550,6 +4550,8 @@ static int disas_funcs(const char *funcs)char *cmd; cross_compile =getenv ("CROSS_COMPILE" ); +if (!cross_compile) + cross_compile ="" ; objdump_str ="%sobjdump -wdr %s | gawk -M -v _funcs='%s' '" "BEGIN { split(_funcs, funcs); }"
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 159/268 sched/smt: Always inline sched_smt_active()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit 09f37f2d7b21ff35b8b533f9ab8cfad2fe8f72f6 ]
sched_smt_active() can be called from noinstr code, so it should always be inlined. The CONFIG_SCHED_SMT version already has __always_inline. Do the same for its !CONFIG_SCHED_SMT counterpart.
Fixes the following warning:
vmlinux.o: error: objtool: intel_idle_ibrs+0x13: call to sched_smt_active() leaves .noinstr.text section
--- include/linux/sched/smt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/smt.h +1 -1
@@ -12,7 +12,7 @@ static __always_inline bool sched_smt_active(void)return static_branch_likely (&sched_smt_present); }#else -static inline bool sched_smt_active (void ) {return false; } +static __always_inline bool sched_smt_active(void) { return false; }#endif void arch_smt_update (void );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 160/268 context_tracking: Always inline ct_{nmi,irq}_{enter,exit}()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit 9ac50f7311dc8b39e355582f14c1e82da47a8196 ]
Thanks to CONFIG_DEBUG_SECTION_MISMATCH, empty functions can be generated out of line. These can be called from noinstr code, so make sure they're always inlined.
Fixes the following warnings:
vmlinux.o: warning: objtool: irqentry_nmi_enter+0xa2: call to ct_nmi_enter() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_nmi_exit+0x16: call to ct_nmi_exit() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_exit+0x78: call to ct_irq_exit() leaves .noinstr.text section
--- include/linux/context_tracking_irq.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/context_tracking_irq.h +4 -4
@@ -10,12 +10,12 @@ void ct_irq_exit_irqson(void);void ct_nmi_enter (void );void ct_nmi_exit (void );#else -static inline void ct_irq_enter (void ) { } -static inline void ct_irq_exit (void ) { } +static __always_inline void ct_irq_enter(void) { } +static __always_inline void ct_irq_exit(void) { }static inline void ct_irq_enter_irqson (void ) { }static inline void ct_irq_exit_irqson (void ) { } -static inline void ct_nmi_enter (void ) { } -static inline void ct_nmi_exit (void ) { } +static __always_inline void ct_nmi_enter(void) { } +static __always_inline void ct_nmi_exit(void) { }#endif #endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 161/268 rcu-tasks: Always inline rcu_irq_work_resched()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit 6309a5c43b0dc629851f25b2e5ef8beff61d08e5 ]
Thanks to CONFIG_DEBUG_SECTION_MISMATCH, empty functions can be generated out of line. rcu_irq_work_resched() can be called from noinstr code, so make sure it's always inlined.
--- include/linux/rcupdate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/rcupdate.h +1 -1
@@ -142,7 +142,7 @@ static inline void rcu_sysrq_end(void) { }#if defined(CONFIG_NO_HZ_FULL ) && (!defined(CONFIG_GENERIC_ENTRY ) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK ))void rcu_irq_work_resched (void );#else -static inline void rcu_irq_work_resched (void ) { } +static __always_inline void rcu_irq_work_resched(void) { }#endif #ifdef CONFIG_RCU_NOCB_CPU
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 162/268 wifi: iwlwifi: fw: allocate chained SG tables for dump
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 7774e3920029398ad49dc848b23840593f14d515 ]
The firmware dumps can be pretty big, and since we use single pages for each SG table entry, even the table itself may end up being an order-5 allocation. Build chained tables so that we need not allocate a higher-order table here.
This could be improved and cleaned up, e.g. by using the SG pool code or simply kvmalloc(), but all of that would require also updating the devcoredump first since that frees it all, so we need to be more careful. SG pool might also run against the CONFIG_ARCH_NO_SG_CHAIN limitation, which is irrelevant here.
Also use _devcd_free_sgtable() for the error paths now, much simpler especially since it's in two places now.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 86 ++++++++++++++------- 1 file changed, 58 insertions(+), 28 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +58 -28
@@ -559,41 +559,71 @@ static void iwl_dump_prph(struct iwl_fw_runtime *fwrt, }/* -* alloc_sgtable - allocates scallerlist table in the given size, -* fills it with pages and returns it +* alloc_sgtable - allocates (chained) scatterlist in the given size, +* fills it with pages and returns it * @size: the size (in bytes) of the table -*/ -static struct scatterlist *alloc_sgtable (int size) +*/ +static struct scatterlist *alloc_sgtable (ssize_t size) { -int alloc_size, nents, i; -struct page *new_page; -struct scatterlist *iter; -struct scatterlist *table; +struct scatterlist *result =NULL , *prev; +int nents, i, n_prev; nents =DIV_ROUND_UP (size,PAGE_SIZE ); - table =kcalloc (nents,sizeof (*table),GFP_KERNEL ); -if (!table) -return NULL ; -sg_init_table (table, nents); - iter = table; -for_each_sg (table, iter,sg_nents (table), i) { - new_page =alloc_page (GFP_KERNEL ); -if (!new_page) { -/* release all previous allocated pages in the table */ - iter = table; -for_each_sg (table, iter,sg_nents (table), i) { - new_page =sg_page (iter); -if (new_page) -__free_page (new_page); - } -kfree (table); + +#define N_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(*result)) +/* +* We need an additional entry for table chaining, +* this ensures the loop can finish i.e. we can +* fit at least two entries per page (obviously, +* many more really fit.) +*/ +BUILD_BUG_ON (N_ENTRIES_PER_PAGE <2 ); + +while (nents >0 ) { +struct scatterlist *new, *iter; +int n_fill, n_alloc; + +if (nents <=N_ENTRIES_PER_PAGE ) { +/* last needed table */ + n_fill = nents; + n_alloc = nents; + nents =0 ; + }else { +/* fill a page with entries */ + n_alloc =N_ENTRIES_PER_PAGE ; +/* reserve one for chaining */ + n_fill = n_alloc -1 ; + nents -= n_fill; + } + + new =kcalloc (n_alloc,sizeof (*new),GFP_KERNEL ); +if (!new) { +if (result) +_devcd_free_sgtable (result);return NULL ; } - alloc_size =min_t (int, size,PAGE_SIZE ); - size -=PAGE_SIZE ; -sg_set_page (iter, new_page, alloc_size,0 ); +sg_init_table (new, n_alloc); + +if (!result) + result = new; +else +sg_chain (prev, n_prev, new); + prev = new; + n_prev = n_alloc; + +for_each_sg (new, iter, n_fill, i) { +struct page *new_page =alloc_page (GFP_KERNEL ); + +if (!new_page) { +_devcd_free_sgtable (result); +return NULL ; + } + +sg_set_page (iter, new_page,PAGE_SIZE ,0 ); + } } -return table; + +return result; } static void iwl_fw_get_prph_len(struct iwl_fw_runtime *fwrt,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 163/268 wifi: iwlwifi: mvm: use the right version of the rate API
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit a03e2082e678ea10d0d8bdf3ed933eb05a8ddbb0 ]
The firmware uses the newer version of the API in recent devices. For older devices, we translate the rate to the new format. Don't parse the rate with old parsing macros.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +4 -4
@@ -1275,7 +1275,7 @@ iwl_mvm_decode_he_phy_ru_alloc(struct iwl_mvm_rx_phy_data *phy_data,*/ u8 ru =le32_get_bits (phy_data->d1,IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK );u32 rate_n_flags = phy_data->rate_n_flags; -u32 he_type = rate_n_flags &RATE_MCS_HE_TYPE_MSK_V1 ; +u32 he_type = rate_n_flags &RATE_MCS_HE_TYPE_MSK ;u8 offs =0 ; rx_status->bw =RATE_INFO_BW_HE_RU ;
@@ -1330,13 +1330,13 @@ iwl_mvm_decode_he_phy_ru_alloc(struct iwl_mvm_rx_phy_data *phy_data,if (he_mu) he_mu->flags2 |= -le16_encode_bits (FIELD_GET (RATE_MCS_CHAN_WIDTH_MSK_V1 , +le16_encode_bits (FIELD_GET (RATE_MCS_CHAN_WIDTH_MSK , rate_n_flags),IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW ); -else if (he_type ==RATE_MCS_HE_TYPE_TRIG_V1 ) +else if (he_type ==RATE_MCS_HE_TYPE_TRIG ) he->data6 |=cpu_to_le16 (IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_KNOWN ) | -le16_encode_bits (FIELD_GET (RATE_MCS_CHAN_WIDTH_MSK_V1 , +le16_encode_bits (FIELD_GET (RATE_MCS_CHAN_WIDTH_MSK , rate_n_flags),IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 164/268 nvme-tcp: fix possible UAF in nvme_tcp_poll
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sagi Grimberg <[email protected]>
[ Upstream commit 8c1624b63a7d24142a2bbc3a5ee7e95f004ea36e ]
nvme_tcp_poll() may race with the send path error handler because it may complete the request while it is actively being polled for completion, resulting in a UAF panic [1]:
We should make sure to stop polling when we see an error when trying to read from the socket. Hence make sure to propagate the error so that the block layer breaks the polling cycle.
[1]:
--
[35665.692310] nvme nvme2: failed to send request -13 [35665.702265] nvme nvme2: unsupported pdu type (3) [35665.702272] BUG: kernel NULL pointer dereference, address: 0000000000000000 [35665.702542] nvme nvme2: queue 1 receive failed: -22 [35665.703209] #PF: supervisor write access in kernel mode [35665.703213] #PF: error_code(0x0002) - not-present page [35665.703214] PGD 8000003801cce067 P4D 8000003801cce067 PUD 37e6f79067 PMD 0 [35665.703220] Oops: 0002 [#1] SMP PTI [35665.703658] nvme nvme2: starting error recovery [35665.705809] Hardware name: Inspur aaabbb/YZMB-00882-104, BIOS 4.1.26 09/22/2022 [35665.705812] Workqueue: kblockd blk_mq_requeue_work [35665.709172] RIP: 0010:_raw_spin_lock+0xc/0x30 [35665.715788] Call Trace: [35665.716201] <TASK> [35665.716613] ? show_trace_log_lvl+0x1c1/0x2d9 [35665.717049] ? show_trace_log_lvl+0x1c1/0x2d9 [35665.717457] ? blk_mq_request_bypass_insert+0x2c/0xb0 [35665.717950] ? __die_body.cold+0x8/0xd [35665.718361] ? page_fault_oops+0xac/0x140 [35665.718749] ? blk_mq_start_request+0x30/0xf0 [35665.719144] ? nvme_tcp_queue_rq+0xc7/0x170 [nvme_tcp] [35665.719547] ? exc_page_fault+0x62/0x130 [35665.719938] ? asm_exc_page_fault+0x22/0x30 [35665.720333] ? _raw_spin_lock+0xc/0x30 [35665.720723] blk_mq_request_bypass_insert+0x2c/0xb0 [35665.721101] blk_mq_requeue_work+0xa5/0x180 [35665.721451] process_one_work+0x1e8/0x390 [35665.721809] worker_thread+0x53/0x3d0 [35665.722159] ? process_one_work+0x390/0x390 [35665.722501] kthread+0x124/0x150 [35665.722849] ? set_kthread_struct+0x50/0x50 [35665.723182] ret_from_fork+0x1f/0x30
--- drivers/nvme/host/tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +3 -2
@@ -2467,6 +2467,7 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob) {struct nvme_tcp_queue *queue = hctx->driver_data;struct sock *sk = queue->sock->sk; +int ret;if (!test_bit (NVME_TCP_Q_LIVE , &queue->flags))return 0 ;
@@ -2474,9 +2475,9 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx, struct io_comp_batch *iob)set_bit (NVME_TCP_Q_POLLING , &queue->flags);if (sk_can_busy_loop (sk) &&skb_queue_empty_lockless (&sk->sk_receive_queue))sk_busy_loop (sk, true); -nvme_tcp_try_recv (queue); + ret =nvme_tcp_try_recv (queue);clear_bit (NVME_TCP_Q_POLLING , &queue->flags); -return queue->nr_cqe; +return ret <0 ? ret : queue->nr_cqe; }static int nvme_tcp_get_address (struct nvme_ctrl *ctrl,char *buf,int size)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 165/268 nvme-pci: clean up CMBMSC when registering CMB fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Icenowy Zheng <[email protected]>
[ Upstream commit 6a3572e10f740acd48e2713ef37e92186a3ce5e8 ]
CMB decoding should get disabled when the CMB block isn't successfully registered to P2P DMA subsystem.
Clean up the CMBMSC register in this error handling codepath to disable CMB decoding (and CMBLOC/CMBSZ registers).
--- drivers/nvme/host/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
@@ -1871,6 +1871,7 @@ static void nvme_map_cmb(struct nvme_dev *dev)if (pci_p2pdma_add_resource (pdev, bar, size, offset)) {dev_warn (dev->ctrl.device,"failed to register the CMB\n" ); +hi_lo_writeq (0 , dev->bar +NVME_REG_CMBMSC );return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 166/268 nvme-pci: skip CMB blocks incompatible with PCI P2P DMA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Icenowy Zheng <[email protected]>
[ Upstream commit 56cf7ef0d490b28fad8f8629fc135c5ab7c9f54e ]
The PCI P2PDMA code will register the CMB block to the memory hot-plugging subsystem, which have an alignment requirement. Memory blocks that do not satisfy this alignment requirement (usually 2MB) will lead to a WARNING from memory hotplugging.
Verify the CMB block's address and size against the alignment and only try to send CMB blocks compatible with it to prevent this warning.
Tested on Intel DC D4502 SSD, which has a 512K CMB block that is too small for memory hotplugging (thus PCI P2PDMA).
--- drivers/nvme/host/pci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/nvme/host/pci.c +12 -8
@@ -1850,6 +1850,18 @@ static void nvme_map_cmb(struct nvme_dev *dev)if (offset > bar_size)return ; +/* +* Controllers may support a CMB size larger than their BAR, for +* example, due to being behind a bridge. Reduce the CMB to the +* reported size of the BAR +*/ + size =min (size, bar_size - offset); + +if (!IS_ALIGNED (size,memremap_compat_align ()) || + !IS_ALIGNED (pci_resource_start (pdev, bar), +memremap_compat_align ())) +return ; +/* * Tell the controller about the host side address mapping the CMB, * and enable CMB decoding for the NVMe 1.4+ scheme:
@@ -1860,14 +1872,6 @@ static void nvme_map_cmb(struct nvme_dev *dev) dev->bar + NVME_REG_CMBMSC); } -/* -* Controllers may support a CMB size larger than their BAR, -* for example, due to being behind a bridge. Reduce the CMB to -* the reported size of the BAR -*/ -if (size > bar_size - offset) - size = bar_size - offset; -if (pci_p2pdma_add_resource (pdev, bar, size, offset)) {dev_warn (dev->ctrl.device,"failed to register the CMB\n" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 167/268 wifi: brcmfmac: keep power during suspend if board requires it
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Proske <[email protected]>
[ Upstream commit 8c3170628a9ce24a59647bd24f897e666af919b8 ]
After commit 92cadedd9d5f ("brcmfmac: Avoid keeping power to SDIO card unless WOWL is used"), the wifi adapter by default is turned off on suspend and then re-probed on resume.
This conflicts with some embedded boards that require to remain powered. They will fail on resume with:
brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout ieee80211 phy1: brcmf_bus_started: failed: -110 ieee80211 phy1: brcmf_attach: dongle is not responding: err=-110
brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed
This commit checks for the Device Tree property 'cap-power-off-cards'. If this property is not set, it means that we do not have the capability to power off and should therefore remain powered.
--- .../broadcom/brcm80211/brcmfmac/bcmsdh.c | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +13 -7
@@ -1167,6 +1167,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev)struct brcmf_bus *bus_if;struct brcmf_sdio_dev *sdiodev;mmc_pm_flag_t sdio_flags; +bool cap_power_off;int ret =0 ; func = container_of(dev, struct sdio_func, dev);
@@ -1174,19 +1175,23 @@ static int brcmf_ops_sdio_suspend(struct device *dev)if (func->num !=1 )return 0 ; + cap_power_off = !!(func->card->host->caps &MMC_CAP_POWER_OFF_CARD ); bus_if =dev_get_drvdata (dev); sdiodev = bus_if->bus_priv.sdio; -if (sdiodev->wowl_enabled) { +if (sdiodev->wowl_enabled || !cap_power_off) {brcmf_sdiod_freezer_on (sdiodev);brcmf_sdio_wd_timer (sdiodev->bus,0 ); sdio_flags =MMC_PM_KEEP_POWER ; -if (sdiodev->settings->bus.sdio.oob_irq_supported) -enable_irq_wake (sdiodev->settings->bus.sdio.oob_irq_nr); -else - sdio_flags |=MMC_PM_WAKE_SDIO_IRQ ; + +if (sdiodev->wowl_enabled) { +if (sdiodev->settings->bus.sdio.oob_irq_supported) +enable_irq_wake (sdiodev->settings->bus.sdio.oob_irq_nr); +else + sdio_flags |=MMC_PM_WAKE_SDIO_IRQ ; + }if (sdio_set_host_pm_flags (sdiodev->func1, sdio_flags))brcmf_err ("Failed to set pm_flags %x\n" , sdio_flags);
@@ -1208,18 +1213,19 @@ static int brcmf_ops_sdio_resume(struct device *dev)struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct sdio_func *func = container_of(dev, struct sdio_func, dev);int ret =0 ; +bool cap_power_off = !!(func->card->host->caps &MMC_CAP_POWER_OFF_CARD );brcmf_dbg (SDIO ,"Enter: F%d\n" , func->num);if (func->num !=2 )return 0 ; -if (!sdiodev->wowl_enabled) { +if (!sdiodev->wowl_enabled && cap_power_off) {/* bus was powered off and device removed, probe again */ ret =brcmf_sdiod_probe (sdiodev);if (ret)brcmf_err ("Failed to probe device on resume\n" ); }else { -if (sdiodev->settings->bus.sdio.oob_irq_supported) +if (sdiodev->wowl_enabled && sdiodev->settings->bus.sdio.oob_irq_supported)disable_irq_wake (sdiodev->settings->bus.sdio.oob_irq_nr);brcmf_sdiod_freezer_off (sdiodev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 168/268 affs: generate OFS sequence numbers starting at 1
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Tatham <[email protected]>
[ Upstream commit e4cf8ec4de4e13f156c1d61977d282d90c221085 ]
If I write a file to an OFS floppy image, and try to read it back on an emulated Amiga running Workbench 1.3, the Amiga reports a disk error trying to read the file. (That is, it's unable to read it _at all_, even to copy it to the NIL: device. It isn't a matter of getting the wrong data and being unable to parse the file format.)
This is because the 'sequence number' field in the OFS data block header is supposed to be based at 1, but affs writes it based at 0. All three locations changed by this patch were setting the sequence number to a variable 'bidx' which was previously obtained by dividing a file position by bsize, so bidx will naturally use 0 for the first block. Therefore all three should add 1 to that value before writing it into the sequence number field.
With this change, the Amiga successfully reads the file.
For data block reference: https://wiki.osdev.org/FFS_(Amiga)
--- fs/affs/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/affs/file.c +3 -3
@@ -597,7 +597,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize)BUG_ON (tmp > bsize);AFFS_DATA_HEAD (bh)->ptype =cpu_to_be32 (T_DATA );AFFS_DATA_HEAD (bh)->key =cpu_to_be32 (inode->i_ino); -AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx); +AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx +1 );AFFS_DATA_HEAD (bh)->size =cpu_to_be32 (tmp);affs_fix_checksum (sb, bh); bh->b_state &= ~(1UL << BH_New);
@@ -748,7 +748,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,if (buffer_new (bh)) {AFFS_DATA_HEAD (bh)->ptype =cpu_to_be32 (T_DATA );AFFS_DATA_HEAD (bh)->key =cpu_to_be32 (inode->i_ino); -AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx); +AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx +1 );AFFS_DATA_HEAD (bh)->size =cpu_to_be32 (bsize);AFFS_DATA_HEAD (bh)->next =0 ; bh->b_state &= ~(1UL << BH_New);
@@ -782,7 +782,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,if (buffer_new (bh)) {AFFS_DATA_HEAD (bh)->ptype =cpu_to_be32 (T_DATA );AFFS_DATA_HEAD (bh)->key =cpu_to_be32 (inode->i_ino); -AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx); +AFFS_DATA_HEAD (bh)->sequence =cpu_to_be32 (bidx +1 );AFFS_DATA_HEAD (bh)->size =cpu_to_be32 (tmp);AFFS_DATA_HEAD (bh)->next =0 ; bh->b_state &= ~(1UL << BH_New);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 169/268 affs: dont write overlarge OFS data block size fields
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Tatham <[email protected]>
[ Upstream commit 011ea742a25a77bac3d995f457886a67d178c6f0 ]
If a data sector on an OFS floppy contains a value > 0x1e8 (the largest amount of data that fits in the sector after its header), then an Amiga reading the file can return corrupt data, by taking the overlarge size at its word and reading past the end of the buffer it read the disk sector into!
The cause: when affs_write_end_ofs() writes data to an OFS filesystem, the new size field for a data block was computed by adding the amount of data currently being written (into the block) to the existing value of the size field. This is correct if you're extending the file at the end, but if you seek backwards in the file and overwrite _existing_ data, it can lead to the size field being larger than the maximum legal value.
This commit changes the calculation so that it sets the size field to the max of its previous size and the position within the block that we just wrote up to.
--- fs/affs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/affs/file.c +2 -1
@@ -726,7 +726,8 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, tmp =min (bsize - boff, to - from);BUG_ON (boff + tmp > bsize || tmp > bsize);memcpy (AFFS_DATA (bh) + boff, data + from, tmp); -be32_add_cpu (&AFFS_DATA_HEAD (bh)->size, tmp); +AFFS_DATA_HEAD (bh)->size =cpu_to_be32 ( +max (boff + tmp,be32_to_cpu (AFFS_DATA_HEAD (bh)->size)));affs_fix_checksum (sb, bh);mark_buffer_dirty_inode (bh, inode); written += tmp;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 170/268 ALSA: hda/realtek: Fix Asus Z13 2025 audio
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
[ Upstream commit 12784ca33b62fd327631749e6a0cd2a10110a56c ]
Use the basic quirk for this type of amplifier. Sound works in speakers, headphones, and microphone. Whereas none worked before.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10236,6 +10236,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1f12 ,"ASUS UM5302" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1f62 ,"ASUS UX7602ZM" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1f92 ,"ASUS ROG Flow X16" ,ALC289_FIXUP_ASUS_GA401 ), +SND_PCI_QUIRK (0x1043 ,0x1fb3 ,"ASUS ROG Flow Z13 GZ302EA" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x3030 ,"ASUS ZN270IE" ,ALC256_FIXUP_ASUS_AIO_GPIO2 ),SND_PCI_QUIRK (0x1043 ,0x3a20 ,"ASUS G614JZR" ,ALC245_FIXUP_CS35L41_SPI_2 ), SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 171/268 ALSA: hda: Fix speakers on ASUS EXPERTBOOK P5405CSA 1.0
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Bárta <[email protected]>
[ Upstream commit f479ecc5ef15ed8d774968c1a8726a49420f11a0 ]
After some digging around I have found that this laptop has Cirrus's smart aplifiers connected to SPI bus (spi1-CSC3551:00-cs35l41-hda).
To get them correctly detected and working I had to modify patch_realtek.c with ASUS EXPERTBOOK P5405CSA 1.0 SystemID (0x1043, 0x1f63) and add corresponding hda_quirk (ALC245_FIXUP_CS35L41_SPI_2).
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10235,6 +10235,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1f11 ,"ASUS Zephyrus G14" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1f12 ,"ASUS UM5302" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1f62 ,"ASUS UX7602ZM" ,ALC245_FIXUP_CS35L41_SPI_2 ), +SND_PCI_QUIRK (0x1043 ,0x1f63 ,"ASUS P5405CSA" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x1f92 ,"ASUS ROG Flow X16" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1fb3 ,"ASUS ROG Flow Z13 GZ302EA" ,ALC287_FIXUP_CS35L41_I2C_2 ), SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 172/268 perf/core: Fix perf_pmu_register() vs. perf_init_event()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 003659fec9f6d8c04738cb74b5384398ae8a7e88 ]
There is a fairly obvious race between perf_init_event() doing idr_find() and perf_pmu_register() doing idr_alloc() with an incompletely initialized PMU pointer.
Avoid by doing idr_alloc() on a NULL pointer to register the id, and swizzling the real struct pmu pointer at the end using idr_replace().
Also making sure to not set struct pmu members after publishing the struct pmu, duh.
[ introduce idr_cmpxchg() in order to better handle the idr_replace()
error case -- if it were to return an unexpected pointer, it will already have replaced the value and there is no going back. ]
--- kernel/events/core.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
kernel/events/core.c +26 -2
@@ -11556,6 +11556,21 @@ static int pmu_dev_alloc(struct pmu *pmu)static struct lock_class_key cpuctx_mutex;static struct lock_class_key cpuctx_lock; +static bool idr_cmpxchg (struct idr *idr,unsigned long id,void *old,void *new) +{ +void *tmp, *val =idr_find (idr, id); + +if (val != old) +return false; + + tmp =idr_replace (idr, new, id); +if (IS_ERR (tmp)) +return false; + +WARN_ON_ONCE (tmp != val); +return true; +} +int perf_pmu_register (struct pmu *pmu,const char *name,int type) {int cpu, ret, max =PERF_TYPE_MAX ;
@@ -11577,7 +11592,7 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)if (type >=0 ) max = type; - ret =idr_alloc (&pmu_idr, pmu, max,0 ,GFP_KERNEL ); + ret =idr_alloc (&pmu_idr,NULL , max,0 ,GFP_KERNEL );if (ret <0 ) goto free_pdc;
@@ -11585,6 +11600,7 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type) type = ret; pmu->type = type; +atomic_set (&pmu->exclusive_cnt,0 );if (pmu_bus_running && !pmu->dev) { ret =pmu_dev_alloc (pmu);
@@ -11633,14 +11649,22 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)if (!pmu->event_idx) pmu->event_idx = perf_event_idx_default; +/* +* Now that the PMU is complete, make it visible to perf_try_init_event(). +*/ +if (!idr_cmpxchg (&pmu_idr, pmu->type,NULL , pmu)) + goto free_context;list_add_rcu (&pmu->entry, &pmus); -atomic_set (&pmu->exclusive_cnt,0 ); + ret =0 ; unlock:mutex_unlock (&pmus_lock);return ret; +free_context: +free_percpu (pmu->cpu_pmu_context); + free_dev:if (pmu->dev && pmu->dev !=PMU_NULL_DEV ) {device_del (pmu->dev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 173/268 cifs: fix incorrect validation for num_aces field of smb_acl
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
[ Upstream commit aa2a739a75ab6f24ef72fb3fdb9192c081eacf06 ]
parse_dcal() validate num_aces to allocate ace array.
f (num_aces > ULONG_MAX / sizeof(struct smb_ace *))
It is an incorrect validation that we can create an array of size ULONG_MAX. smb_acl has ->size field to calculate actual number of aces in response buffer size. Use this to check invalid num_aces.
--- fs/smb/client/cifsacl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/smb/client/cifsacl.c +6 -2
@@ -778,7 +778,8 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl, }/* validate that we do not go past end of acl */ -if (end_of_acl < (char *)pdacl +le16_to_cpu (pdacl->size)) { +if (end_of_acl < (char *)pdacl +sizeof (struct smb_acl ) || + end_of_acl < (char *)pdacl +le16_to_cpu (pdacl->size)) {cifs_dbg (VFS ,"ACL too small to parse DACL\n" );return ; }
@@ -799,8 +800,11 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,if (num_aces >0 ) {umode_t denied_mode =0 ; -if (num_aces >ULONG_MAX /sizeof (struct smb_ace *)) +if (num_aces > (le16_to_cpu (pdacl->size) -sizeof (struct smb_acl )) / + (offsetof(struct smb_ace , sid) + + offsetof(struct smb_sid , sub_auth) +sizeof (__le16)))return ; + ppace =kmalloc_array (num_aces,sizeof (struct smb_ace *),GFP_KERNEL );if (!ppace)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 174/268 platform/x86: intel-hid: fix volume buttons on Microsoft Surface Go 4 tablet
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Panchenko <[email protected]>
[ Upstream commit 2738d06fb4f01145b24c542fb06de538ffc56430 ]
Volume buttons on Microsoft Surface Go 4 tablet didn't send any events. Add Surface Go 4 DMI match to button_array_table to fix this.
--- drivers/platform/x86/intel/hid.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/platform/x86/intel/hid.c +7 -0
@@ -128,6 +128,13 @@ static const struct dmi_system_id button_array_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"), }, }, + { + .ident = "Microsoft Surface Go 4", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 4"), + }, + }, { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 175/268 platform/x86/intel/vsec: Add Diamond Rapids support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David E. Box <[email protected]>
[ Upstream commit f317f38e7fbb15a0d8329289fef8cf034938fb4f ]
Add PCI ID for the Diamond Rapids Platforms
--- drivers/platform/x86/intel/vsec.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/platform/x86/intel/vsec.c +7 -0
@@ -420,6 +420,11 @@ static const struct intel_vsec_platform_info oobmsm_info = { .caps = VSEC_CAP_TELEMETRY | VSEC_CAP_SDSI | VSEC_CAP_TPMI, }; +/* DMR OOBMSM info */ +static const struct intel_vsec_platform_info dmr_oobmsm_info = { + .caps =VSEC_CAP_TELEMETRY |VSEC_CAP_TPMI , +}; +/* TGL info */ static const struct intel_vsec_platform_info tgl_info = { .caps =VSEC_CAP_TELEMETRY ,
@@ -431,6 +436,7 @@ static const struct intel_vsec_platform_info tgl_info = {#define PCI_DEVICE_ID_INTEL_VSEC_MTL_M 0x7d0d#define PCI_DEVICE_ID_INTEL_VSEC_MTL_S 0xad0d#define PCI_DEVICE_ID_INTEL_VSEC_OOBMSM 0x09a7 +#define PCI_DEVICE_ID_INTEL_VSEC_OOBMSM_DMR 0x09a1#define PCI_DEVICE_ID_INTEL_VSEC_RPL 0xa77d#define PCI_DEVICE_ID_INTEL_VSEC_TGL 0x9a0dstatic const struct pci_device_id intel_vsec_pci_ids[] = {
@@ -439,6 +445,7 @@ static const struct pci_device_id intel_vsec_pci_ids[] = { { PCI_DEVICE_DATA(INTEL, VSEC_MTL_M, &mtl_info) }, { PCI_DEVICE_DATA(INTEL, VSEC_MTL_S, &mtl_info) }, { PCI_DEVICE_DATA(INTEL, VSEC_OOBMSM, &oobmsm_info) }, + { PCI_DEVICE_DATA(INTEL, VSEC_OOBMSM_DMR, &dmr_oobmsm_info) }, { PCI_DEVICE_DATA(INTEL, VSEC_RPL, &tgl_info) }, { PCI_DEVICE_DATA(INTEL, VSEC_TGL, &tgl_info) }, { }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 176/268 HID: i2c-hid: improve i2c_hid_get_report error message
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Guan <[email protected]>
[ Upstream commit 723aa55c08c9d1e0734e39a815fd41272eac8269 ]
We have two places to print "failed to set a report to ...", use "get a report from" instead of "set a report to", it makes people who knows less about the module to know where the error happened.
Before:i2c_hid_acpi i2c-FTSC1000:00: failed to set a report to device: -11
After:i2c_hid_acpi i2c-FTSC1000:00: failed to get a report from device: -11
--- drivers/hid/i2c-hid/i2c-hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid-core.c +1 -1
@@ -258,7 +258,7 @@ static int i2c_hid_get_report(struct i2c_hid *ihid, ihid->rawbuf, recv_len + sizeof(__le16));if (error) {dev_err (&ihid->client->dev, -"failed to set a report to device: %d\n" , error); +"failed to get a report from device: %d\n" , error);return error; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 177/268 ALSA: hda/realtek: Add support for ASUS ROG Strix G614 Laptops using CS35L41 HDA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Binding <[email protected]>
[ Upstream commit 9120b2b4ad0dad2f6bbb6bcacd0456f806fda62d ]
Add support for ASUS G614PH/PM/PP and G614FH/FM/FP.
Laptops use 2 CS35L41 Amps with HDA, using Internal boost, with I2C
--- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -10152,7 +10152,9 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x8e1a ,"HP ZBook Firefly 14 G12A" ,ALC285_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x1043 ,0x103e ,"ASUS X540SA" ,ALC256_FIXUP_ASUS_MIC ),SND_PCI_QUIRK (0x1043 ,0x103f ,"ASUS TX300" ,ALC282_FIXUP_ASUS_TX300 ), +SND_PCI_QUIRK (0x1043 ,0x1054 ,"ASUS G614FH/FM/FP" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x106d ,"Asus K53BE" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ), +SND_PCI_QUIRK (0x1043 ,0x1074 ,"ASUS G614PH/PM/PP" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x10a1 ,"ASUS UX391UA" ,ALC294_FIXUP_ASUS_SPK ),SND_PCI_QUIRK (0x1043 ,0x10c0 ,"ASUS X540SA" ,ALC256_FIXUP_ASUS_MIC ), SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 178/268 ALSA: hda/realtek: Add support for ASUS Zenbook UM3406KA Laptops using CS35L41 HDA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Binding <[email protected]>
[ Upstream commit 8463d2adbe1901247937fcdfe4b525130f6db10b ]
Laptop uses 2 CS35L41 Amps with HDA, using External boost with I2C
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10160,6 +10160,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x10d0 ,"ASUS X540LA/X540LJ" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x10d3 ,"ASUS K6500ZC" ,ALC294_FIXUP_ASUS_SPK ),SND_PCI_QUIRK (0x1043 ,0x115d ,"Asus 1015E" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ), +SND_PCI_QUIRK (0x1043 ,0x1194 ,"ASUS UM3406KA" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x11c0 ,"ASUS X556UR" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x125e ,"ASUS Q524UQK" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 179/268 sched/deadline: Use online cpus for validating runtime
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shrikanth Hegde <[email protected]>
[ Upstream commit 14672f059d83f591afb2ee1fff56858efe055e5a ]
The ftrace selftest reported a failure because writing -1 to sched_rt_runtime_us returns -EBUSY. This happens when the possible CPUs are different from active CPUs.
Active CPUs are part of one root domain, while remaining CPUs are part of def_root_domain. Since active cpumask is being used, this results in cpus=0 when a non active CPUs is used in the loop.
Fix it by looping over the online CPUs instead for validating the bandwidth calculations.
--- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
@@ -2780,7 +2780,7 @@ int sched_dl_global_validate(void)* value smaller than the currently allocated bandwidth in * any of the root_domains. */ -for_each_possible_cpu (cpu) { +for_each_online_cpu (cpu) {rcu_read_lock_sched ();if (dl_bw_visited (cpu, gen))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 180/268 x86/hyperv/vtl: Stop kernel from probing VTL0 low memory
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naman Jain <[email protected]>
[ Upstream commit 59115e2e25f42924181055ed7cc1d123af7598b7 ]
For Linux, running in Hyper-V VTL (Virtual Trust Level), kernel in VTL2 tries to access VTL0 low memory in probe_roms. This memory is not described in the e820 map. Initialize probe_roms call to no-ops during boot for VTL2 kernel to avoid this. The issue got identified in OpenVMM which detects invalid accesses initiated from kernel running in VTL2.
Message-ID: <[email protected]>
--- arch/x86/hyperv/hv_vtl.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/hyperv/hv_vtl.c +1 -0
@@ -30,6 +30,7 @@ void __init hv_vtl_init_platform(void) x86_platform.realmode_init = x86_init_noop; x86_init.irqs.pre_vector_init = x86_init_noop; x86_init.timers.timer_init = x86_init_noop; + x86_init.resources.probe_roms = x86_init_noop;/* Avoid searching for BIOS MP tables */ x86_init.mpparse.find_smp_config = x86_init_noop;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 181/268 wifi: mac80211: flush the station before moving it to UN-AUTHORIZED state
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit 43e04077170799d0e6289f3e928f727e401b3d79 ]
We first want to flush the station to make sure we no longer have any frames being Tx by the station before the station is moved to un-authorized state. Failing to do that will lead to races: a frame may be sent after the station's state has been changed.
Since the API clearly states that the driver can't fail the sta_state() transition down the list of state, we can easily flush the station first, and only then call the driver's sta_state().
--- net/mac80211/sta_info.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
net/mac80211/sta_info.c +17 -3
@@ -4,7 +4,7 @@* Copyright 2006-2007 Jiri Benc <[email protected]> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2015 - 2017 Intel Deutschland GmbH -* Copyright (C) 2018-2023 Intel Corporation +* Copyright (C) 2018-2024 Intel Corporation */ #include <linux/module.h>
@@ -1321,9 +1321,13 @@ static int _sta_info_move_state(struct sta_info *sta, sta->sta.addr, new_state);/* notify the driver before the actual changes so it can -* fail the transition +* fail the transition if the state is increasing. +* The driver is required not to fail when the transition +* is decreasing the state, so first, do all the preparation +* work and only then, notify the driver. */ -if (test_sta_flag (sta,WLAN_STA_INSERTED )) { +if (new_state > sta->sta_state && +test_sta_flag (sta,WLAN_STA_INSERTED )) {int err =drv_sta_state (sta->local, sta->sdata, sta, sta->sta_state, new_state);if (err)
@@ -1399,6 +1403,16 @@ static int _sta_info_move_state(struct sta_info *sta,break ; } +if (new_state < sta->sta_state && +test_sta_flag (sta,WLAN_STA_INSERTED )) { +int err =drv_sta_state (sta->local, sta->sdata, sta, + sta->sta_state, new_state); + +WARN_ONCE (err, +"Driver is not allowed to fail if the sta_state is transitioning down the list: %d\n" , + err); + } + sta->sta_state = new_state;return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 182/268 locking/semaphore: Use wake_q to wake up processes outside lock critical section
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
[ Upstream commit 85b2b9c16d053364e2004883140538e73b333cdb ]
A circular lock dependency splat has been seen involving down_trylock():
======================================================
WARNING: possible circular locking dependency detected 6.12.0-41.el10.s390x+debug
------------------------------------------------------
dd/32479 is trying to acquire lock:
0015a20accd0d4f8 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x26/0x90
but task is already holding lock:
000000017e461698 (&zone->lock){-.-.}-{2:2}, at: rmqueue_bulk+0xac/0x8f0
the existing dependency chain (in reverse order) is:
-> #4 (&zone->lock){-.-.}-{2:2}:
-> #3 (hrtimer_bases.lock){-.-.}-{2:2}:
-> #2 (&rq->__lock){-.-.}-{2:2}:
-> #1 (&p->pi_lock){-.-.}-{2:2}:
-> #0 ((console_sem).lock){-.-.}-{2:2}:
The console_sem -> pi_lock dependency is due to calling try_to_wake_up() while holding the console_sem raw_spinlock. This dependency can be broken by using wake_q to do the wakeup instead of calling try_to_wake_up() under the console_sem lock. This will also make the semaphore's raw_spinlock become a terminal lock without taking any further locks underneath it.
The hrtimer_bases.lock is a raw_spinlock while zone->lock is a spinlock. The hrtimer_bases.lock -> zone->lock dependency happens via the debug_objects_fill_pool() helper function in the debugobjects code.
-> #4 (&zone->lock){-.-.}-{2:2}:
__lock_acquire+0xe86/0x1cc0
lock_acquire.part.0+0x258/0x630
lock_acquire+0xb8/0xe0
_raw_spin_lock_irqsave+0xb4/0x120
rmqueue_bulk+0xac/0x8f0
__rmqueue_pcplist+0x580/0x830
rmqueue_pcplist+0xfc/0x470
rmqueue.isra.0+0xdec/0x11b0
get_page_from_freelist+0x2ee/0xeb0
__alloc_pages_noprof+0x2c2/0x520
alloc_pages_mpol_noprof+0x1fc/0x4d0
alloc_pages_noprof+0x8c/0xe0
allocate_slab+0x320/0x460
___slab_alloc+0xa58/0x12b0
__slab_alloc.isra.0+0x42/0x60
kmem_cache_alloc_noprof+0x304/0x350
fill_pool+0xf6/0x450
debug_object_activate+0xfe/0x360
enqueue_hrtimer+0x34/0x190
__run_hrtimer+0x3c8/0x4c0
__hrtimer_run_queues+0x1b2/0x260
hrtimer_interrupt+0x316/0x760
do_IRQ+0x9a/0xe0
do_irq_async+0xf6/0x160Normally a raw_spinlock to spinlock dependency is not legitimate and will be warned if CONFIG_PROVE_RAW_LOCK_NESTING is enabled, but debug_objects_fill_pool() is an exception as it explicitly allows this dependency for non-PREEMPT_RT kernel without causing PROVE_RAW_LOCK_NESTING lockdep splat. As a result, this dependency is legitimate and not a bug.
Anyway, semaphore is the only locking primitive left that is still using try_to_wake_up() to do wakeup inside critical section, all the other locking primitives had been migrated to use wake_q to do wakeup outside of the critical section. It is also possible that there are other circular locking dependencies involving printk/console_sem or other existing/new semaphores lurking somewhere which may show up in the future. Let just do the migration now to wake_q to avoid headache like this.
--- kernel/locking/semaphore.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
kernel/locking/semaphore.c +9 -4
@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/sched.h> #include <linux/sched/debug.h> +#include <linux/sched/wake_q.h> #include <linux/semaphore.h> #include <linux/spinlock.h> #include <linux/ftrace.h>
@@ -38,7 +39,7 @@ static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); static noinline int __down_killable(struct semaphore *sem); static noinline int __down_timeout(struct semaphore *sem, long timeout); -static noinline void __up(struct semaphore *sem); +static noinline void __up(struct semaphore *sem, struct wake_q_head *wake_q);/** * down - acquire the semaphore
@@ -183,13 +184,16 @@ EXPORT_SYMBOL(down_timeout); void __sched up(struct semaphore *sem) {unsigned long flags; +DEFINE_WAKE_Q (wake_q);raw_spin_lock_irqsave (&sem->lock, flags);if (likely (list_empty (&sem->wait_list))) sem->count++;else -__up (sem); +__up (sem, &wake_q);raw_spin_unlock_irqrestore (&sem->lock, flags); +if (!wake_q_empty (&wake_q)) +wake_up_q (&wake_q); }EXPORT_SYMBOL (up);
@@ -269,11 +273,12 @@ static noinline int __sched __down_timeout(struct semaphore *sem, long timeout)return __down_common (sem,TASK_UNINTERRUPTIBLE , timeout); } -static noinline void __sched __up(struct semaphore *sem) +static noinline void __sched __up(struct semaphore *sem, +struct wake_q_head *wake_q) {struct semaphore_waiter *waiter =list_first_entry (&sem->wait_list, struct semaphore_waiter, list);list_del (&waiter->list); waiter->up = true; -wake_up_process (waiter->task); +wake_q_add (wake_q, waiter->task); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 183/268 x86/hyperv: Fix output argument to hypercall that changes page visibility
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <[email protected]>
[ Upstream commit 09beefefb57bbc3a06d98f319d85db4d719d7bcb ]
The hypercall in hv_mark_gpa_visibility() is invoked with an input argument and an output argument. The output argument ostensibly returns the number of pages that were processed. But in fact, the hypercall does not provide any output, so the output argument is spurious.
The spurious argument is harmless because Hyper-V ignores it, but in the interest of correctness and to avoid the potential for future problems, remove it.
Message-ID: <[email protected]>
--- arch/x86/hyperv/ivm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/hyperv/ivm.c +1 -2
@@ -464,7 +464,6 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[], enum hv_mem_host_visibility visibility) {struct hv_gpa_range_for_visibility *input; -u16 pages_processed;u64 hv_status;unsigned long flags;
@@ -493,7 +492,7 @@ static int hv_mark_gpa_visibility(u16 count, const u64 pfn[],memcpy ((void *)input->gpa_page_list, pfn, count *sizeof (*pfn)); hv_status =hv_do_rep_hypercall (HVCALL_MODIFY_SPARSE_GPA_PAGE_HOST_VISIBILITY , count, -0 , input, &pages_processed); +0 , input,NULL );local_irq_restore (flags);if (hv_result_success (hv_status))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 184/268 x86/sgx: Warn explicitly if X86_FEATURE_SGX_LC is not enabled
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladis Dronov <[email protected]>
[ Upstream commit 65be5c95d08eedda570a6c888a12384c77fe7614 ]
The kernel requires X86_FEATURE_SGX_LC to be able to create SGX enclaves, not just X86_FEATURE_SGX.
There is quite a number of hardware which has X86_FEATURE_SGX but not X86_FEATURE_SGX_LC. A kernel running on such hardware does not create the /dev/sgx_enclave file and does so silently.
Explicitly warn if X86_FEATURE_SGX_LC is not enabled to properly notify users that the kernel disabled the SGX driver.
The X86_FEATURE_SGX_LC, a.k.a. SGX Launch Control, is a CPU feature that enables LE (Launch Enclave) hash MSRs to be writable (with additional opt-in required in the 'feature control' MSR) when running enclaves, i.e. using a custom root key rather than the Intel proprietary key for enclave signing.
I've hit this issue myself and have spent some time researching where my /dev/sgx_enclave file went on SGX-enabled hardware.
Related links:
https://github.com/intel/linux-sgx/issues/837
https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/
[ mingo: Made the error message a bit more verbose, and added other cases
where the kernel fails to create the /dev/sgx_enclave device node. ]
--- arch/x86/kernel/cpu/sgx/driver.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/sgx/driver.c +7 -3
@@ -150,13 +150,15 @@ int __init sgx_drv_init(void)u64 xfrm_mask;int ret; -if (!cpu_feature_enabled (X86_FEATURE_SGX_LC )) +if (!cpu_feature_enabled (X86_FEATURE_SGX_LC )) { +pr_info ("SGX disabled: SGX launch control CPU feature is not available, /dev/sgx_enclave disabled.\n" );return -ENODEV ; + }cpuid_count (SGX_CPUID ,0 , &eax, &ebx, &ecx, &edx);if (!(eax &1 )) { -pr_err ("SGX disabled: SGX1 instruction support not available.\n" ); +pr_info ("SGX disabled: SGX1 instruction support not available, /dev/sgx_enclave disabled.\n" );return -ENODEV ; }
@@ -173,8 +175,10 @@ int __init sgx_drv_init(void) } ret =misc_register (&sgx_dev_enclave); -if (ret) +if (ret) { +pr_info ("SGX disabled: Unable to register the /dev/sgx_enclave driver (%d).\n" , ret);return ret; + }return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 185/268 nvme-pci: fix stuck reset on concurrent DPC and HP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
[ Upstream commit 3f674e7b670b7b7d9261935820e4eba3c059f835 ]
The PCIe error handling has the nvme driver quiesce the device, attempt to restart it, then wait for that restart to complete.
A PCIe DPC event also toggles the PCIe link. If the slot doesn't have out-of-band presence detection, this will trigger a pciehp re-enumeration.
The error handling that calls nvme_error_resume is holding the device lock while this happens. This lock blocks pciehp's request to disconnect the driver from proceeding.
Meanwhile the nvme's reset can't make forward progress because its device isn't there anymore with outstanding IO, and the timeout handler won't do anything to fix it because the device is undergoing error handling.
End result: deadlocked.
Fix this by having the timeout handler short cut the disabling for a disconnected PCIe device. The downside is that we're relying on an IO timeout to clean up this mess, which could be a minute by default.
--- drivers/nvme/host/pci.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +12 -1
@@ -1282,8 +1282,19 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req)struct nvme_dev *dev = nvmeq->dev;struct request *abort_req;struct nvme_command cmd = { }; +struct pci_dev *pdev =to_pci_dev (dev->dev);u32 csts =readl (dev->bar +NVME_REG_CSTS ); +/* +* Shutdown the device immediately if we see it is disconnected. This +* unblocks PCIe error handling if the nvme driver is waiting in +* error_resume for a device that has been removed. We can't unbind the +* driver while the driver's error callback is waiting to complete, so +* we're relying on a timeout to break that deadlock if a removal +* occurs while reset work is running. +*/ +if (pci_dev_is_disconnected (pdev)) +nvme_change_ctrl_state (&dev->ctrl,NVME_CTRL_DELETING );if (nvme_state_terminal (&dev->ctrl)) goto disable;
@@ -1291,7 +1302,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req)* the recovery mechanism will surely fail. */ mb (); -if (pci_channel_offline (to_pci_dev (dev->dev))) +if (pci_channel_offline (pdev))return BLK_EH_RESET_TIMER ;/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 186/268 drm/amd: Keep display off while going into S4
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 4afacc9948e1f8fdbca401d259ae65ad93d298c0 ]
When userspace invokes S4 the flow is:
1) amdgpu_pmops_prepare()
2) amdgpu_pmops_freeze()
3) Create hibernation image
4) amdgpu_pmops_thaw()
5) Write out image to disk
6) Turn off system
Then on resume amdgpu_pmops_restore() is called.
This flow has a problem that because amdgpu_pmops_thaw() is called it will call amdgpu_device_resume() which will resume all of the GPU.
This includes turning the display hardware back on and discovering connectors again.
This is an unexpected experience for the display to turn back on. Adjust the flow so that during the S4 sequence display hardware is not turned back on.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 11 +++++++++-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 -2
@@ -2461,7 +2461,6 @@ static int amdgpu_pmops_freeze(struct device *dev) adev->in_s4 = true; r =amdgpu_device_suspend (drm_dev, true); - adev->in_s4 = false;if (r)return r;
@@ -2473,8 +2472,13 @@ static int amdgpu_pmops_freeze(struct device *dev)static int amdgpu_pmops_thaw (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); +struct amdgpu_device *adev =drm_to_adev (drm_dev); +int r; -return amdgpu_device_resume (drm_dev, true); + r =amdgpu_device_resume (drm_dev, true); + adev->in_s4 = false; + +return r; }static int amdgpu_pmops_poweroff (struct device *dev)
@@ -2487,6 +2491,9 @@ static int amdgpu_pmops_poweroff(struct device *dev)static int amdgpu_pmops_restore (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); +struct amdgpu_device *adev =drm_to_adev (drm_dev); + + adev->in_s4 = false;return amdgpu_device_resume (drm_dev, true); }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -0
@@ -2890,6 +2890,11 @@ static int dm_resume(void *handle)return 0 ; } + +/* leave display off for S4 sequence */ +if (adev->in_s4) +return 0 ; +/* Recreate dc_state - DC invalidates it when setting power state to S3. */ dc_release_state (dm_state->context); dm_state->context =dc_create_state (dm->dc);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 187/268 ALSA: hda/realtek: Add mute LED quirk for HP Pavilion x360 14-dy1xxx
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Navon John Lukose <[email protected]>
[ Upstream commit b11a74ac4f545626d0dc95a8ca8c41df90532bf3 ]
Add a fixup to enable the mute LED on HP Pavilion x360 Convertible 14-dy1xxx with ALC295 codec. The appropriate coefficient index and bits were identified through a brute-force method, as detailed in
https://bbs.archlinux.org/viewtopic.php?pid=2079504#p2079504.
--- sound/pci/hda/patch_realtek.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
sound/pci/hda/patch_realtek.c +21 -0
@@ -4785,6 +4785,21 @@ static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, } } +static void alc295_fixup_hp_mute_led_coefbit11 (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +struct alc_spec *spec = codec->spec; + +if (action ==HDA_FIXUP_ACT_PRE_PROBE ) { + spec->mute_led_polarity =0 ; + spec->mute_led_coef.idx =0xb ; + spec->mute_led_coef.mask =3 <<3 ; + spec->mute_led_coef.on =1 <<3 ; + spec->mute_led_coef.off =1 <<4 ; +snd_hda_gen_add_mute_led_cdev (codec, coef_mute_led_set); + } +} +static void alc285_fixup_hp_mute_led (struct hda_codec *codec,const struct hda_fixup *fix,int action) {
@@ -7333,6 +7348,7 @@ enum {ALC290_FIXUP_MONO_SPEAKERS_HSJACK ,ALC290_FIXUP_SUBWOOFER ,ALC290_FIXUP_SUBWOOFER_HSJACK , +ALC295_FIXUP_HP_MUTE_LED_COEFBIT11 ,ALC269_FIXUP_THINKPAD_ACPI ,ALC269_FIXUP_DMIC_THINKPAD_ACPI , ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13,
@@ -9070,6 +9086,10 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC283_FIXUP_INT_MIC, }, + [ALC295_FIXUP_HP_MUTE_LED_COEFBIT11] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc295_fixup_hp_mute_led_coefbit11, + }, [ALC298_FIXUP_SAMSUNG_AMP] = { .type = HDA_FIXUP_FUNC, .v.func = alc298_fixup_samsung_amp,
@@ -9978,6 +9998,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x84e7 ,"HP Pavilion 15" ,ALC269_FIXUP_HP_MUTE_LED_MIC3 ),SND_PCI_QUIRK (0x103c ,0x8519 ,"HP Spectre x360 15-df0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360 ),SND_PCI_QUIRK (0x103c ,0x8537 ,"HP ProBook 440 G6" ,ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF ), +SND_PCI_QUIRK (0x103c ,0x85c6 ,"HP Pavilion x360 Convertible 14-dy1xxx" ,ALC295_FIXUP_HP_MUTE_LED_COEFBIT11 ),SND_PCI_QUIRK (0x103c ,0x85de ,"HP Envy x360 13-ar0xxx" ,ALC285_FIXUP_HP_ENVY_X360 ),SND_PCI_QUIRK (0x103c ,0x860f ,"HP ZBook 15 G6" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ), SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 188/268 can: statistics: use atomic access in hot path
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Hartkopp <[email protected]>
[ Upstream commit 80b5f90158d1364cbd80ad82852a757fc0692bf2 ]
In can_send() and can_receive() CAN messages and CAN filter matches are counted to be visible in the CAN procfs files.
KCSAN detected a data race within can_send() when two CAN frames have been generated by a timer event writing to the same CAN netdevice at the same time. Use atomic operations to access the statistics in the hot path to fix the KCSAN complaint.
--- net/can/af_can.c | 12 ++++++------ net/can/af_can.h | 12 ++++++------ net/can/proc.c | 46 +++++++++++++++++++++++++++------------------- 3 files changed, 39 insertions(+), 31 deletions(-)
net/can/af_can.c +6 -6
@@ -287,8 +287,8 @@ int can_send(struct sk_buff *skb, int loop)netif_rx (newskb);/* update statistics */ - pkg_stats->tx_frames++; - pkg_stats->tx_frames_delta++; +atomic_long_inc (&pkg_stats->tx_frames); +atomic_long_inc (&pkg_stats->tx_frames_delta);return 0 ;
@@ -647,8 +647,8 @@ static void can_receive(struct sk_buff *skb, struct net_device *dev)int matches;/* update statistics */ - pkg_stats->rx_frames++; - pkg_stats->rx_frames_delta++; +atomic_long_inc (&pkg_stats->rx_frames); +atomic_long_inc (&pkg_stats->rx_frames_delta);/* create non-zero unique skb identifier together with *skb */ while (!(can_skb_prv (skb)->skbcnt))
@@ -669,8 +669,8 @@ static void can_receive(struct sk_buff *skb, struct net_device *dev)consume_skb (skb);if (matches >0 ) { - pkg_stats->matches++; - pkg_stats->matches_delta++; +atomic_long_inc (&pkg_stats->matches); +atomic_long_inc (&pkg_stats->matches_delta); } }
net/can/af_can.h +6 -6
@@ -66,9 +66,9 @@ struct receiver {struct can_pkg_stats {unsigned long jiffies_init; -unsigned long rx_frames; -unsigned long tx_frames; -unsigned long matches; +atomic_long_t rx_frames; +atomic_long_t tx_frames; +atomic_long_t matches;unsigned long total_rx_rate;unsigned long total_tx_rate;
@@ -82,9 +82,9 @@ struct can_pkg_stats {unsigned long max_tx_rate;unsigned long max_rx_match_ratio; -unsigned long rx_frames_delta; -unsigned long tx_frames_delta; -unsigned long matches_delta; +atomic_long_t rx_frames_delta; +atomic_long_t tx_frames_delta; +atomic_long_t matches_delta; };/* persistent statistics */
net/can/proc.c +27 -19
86 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 189/268 memory: omap-gpmc: drop no compatible check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
[ Upstream commit edcccc6892f65eff5fd3027a13976131dc7fd733 ]
We are no longer depending on legacy device trees so drop the no compatible check for NAND and OneNAND nodes.
--- drivers/memory/omap-gpmc.c | 20 -------------------- 1 file changed, 20 deletions(-)
drivers/memory/omap-gpmc.c +0 -20
@@ -2247,26 +2247,6 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, goto err; } -if (of_node_name_eq (child,"nand" )) { -/* Warn about older DT blobs with no compatible property */ -if (!of_property_read_bool (child,"compatible" )) { -dev_warn (&pdev->dev, -"Incompatible NAND node: missing compatible" ); - ret = -EINVAL ; - goto err; - } - } - -if (of_node_name_eq (child,"onenand" )) { -/* Warn about older DT blobs with no compatible property */ -if (!of_property_read_bool (child,"compatible" )) { -dev_warn (&pdev->dev, -"Incompatible OneNAND node: missing compatible" ); - ret = -EINVAL ; - goto err; - } - } -if (of_match_node (omap_nand_ids, child)) {/* NAND specific setup */ val =8 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 190/268 hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tasos Sahanidis <[email protected]>
[ Upstream commit 815f80ad20b63830949a77c816e35395d5d55144 ]
pwm_num is set to 7 for these chips, but NCT6776_REG_PWM_MODE and NCT6776_PWM_MODE_MASK only contain 6 values.
Fix this by adding another 0 to the end of each array.
--- drivers/hwmon/nct6775-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/nct6775-core.c +2 -2
@@ -273,8 +273,8 @@ static const s8 NCT6776_BEEP_BITS[NUM_BEEP_BITS] = {static const u16 NCT6776_REG_TOLERANCE_H [] = {0x10c ,0x20c ,0x30c ,0x80c ,0x90c ,0xa0c ,0xb0c }; -static const u8 NCT6776_REG_PWM_MODE [] = {0x04 ,0 ,0 ,0 ,0 ,0 }; -static const u8 NCT6776_PWM_MODE_MASK [] = {0x01 ,0 ,0 ,0 ,0 ,0 }; +static const u8 NCT6776_REG_PWM_MODE [] = {0x04 ,0 ,0 ,0 ,0 ,0 ,0 }; +static const u8 NCT6776_PWM_MODE_MASK [] = {0x01 ,0 ,0 ,0 ,0 ,0 ,0 };static const u16 NCT6776_REG_FAN_MIN [] = {0x63a ,0x63c ,0x63e ,0x640 ,0x642 ,0x64a ,0x64c };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 191/268 spufs: fix a leak on spufs_new_file() failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit d1ca8698ca1332625d83ea0d753747be66f9906d ]
It's called from spufs_fill_dir(), and caller of that will do spufs_rmdir() in case of failure. That does remove everything we'd managed to create, but... the problem dentry is still negative. IOW, it needs to be explicitly dropped.
--- arch/powerpc/platforms/cell/spufs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/cell/spufs/inode.c +3 -1
@@ -191,8 +191,10 @@ static int spufs_fill_dir(struct dentry *dir,return -ENOMEM ; ret =spufs_new_file (dir->d_sb, dentry, files->ops, files->mode & mode, files->size, ctx); -if (ret) +if (ret) { +dput (dentry);return ret; + } files++; }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 192/268 spufs: fix gang directory lifetimes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit c134deabf4784e155d360744d4a6a835b9de4dd4 ]
prior to "[POWERPC] spufs: Fix gang destroy leaks" we used to have a problem with gang lifetimes - creation of a gang returns opened gang directory, which normally gets removed when that gets closed, but if somebody has created a context belonging to that gang and kept it alive until the gang got closed, removal failed and we ended up with a leak.
Unfortunately, it had been fixed the wrong way. Dentry of gang directory was no longer pinned, and rmdir on close was gone. One problem was that failure of open kept calling simple_rmdir() as cleanup, which meant an unbalanced dput(). Another bug was in the success case - gang creation incremented link count on root directory, but that was no longer undone when gang got destroyed.
Fix consists of
* reverting the commit in question
* adding a counter to gang, protected by ->i_rwsem
of gang directory inode.
* having it set to 1 at creation time, dropped
in both spufs_dir_close() and spufs_gang_close() and bumped in spufs_create_context(), provided that it's not 0.
* using simple_recursive_removal() to take the gang
directory out when counter reaches zero.
--- arch/powerpc/platforms/cell/spufs/gang.c | 1 + arch/powerpc/platforms/cell/spufs/inode.c | 54 +++++++++++++++++++---- arch/powerpc/platforms/cell/spufs/spufs.h | 2 + 3 files changed, 49 insertions(+), 8 deletions(-)
arch/powerpc/platforms/cell/spufs/gang.c +1 -0
@@ -25,6 +25,7 @@ struct spu_gang *alloc_spu_gang(void)mutex_init (&gang->aff_mutex);INIT_LIST_HEAD (&gang->list);INIT_LIST_HEAD (&gang->aff_list_head); + gang->alive =1 ; out:return gang;
arch/powerpc/platforms/cell/spufs/inode.c +46 -8
111 lines not on this page · raw message
arch/powerpc/platforms/cell/spufs/spufs.h +2 -0
@@ -151,6 +151,8 @@ struct spu_gang {int aff_flags;struct spu *aff_ref_spu;atomic_t aff_sched_count; + +int alive; };/* Flag bits for spu_gang aff_flags */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 193/268 spufs: fix a leak in spufs_create_context()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit 0f5cce3fc55b08ee4da3372baccf4bcd36a98396 ]
Leak fixes back in 2008 missed one case - if we are trying to set affinity and spufs_mkdir() fails, we need to drop the reference to neighbor.
--- arch/powerpc/platforms/cell/spufs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/platforms/cell/spufs/inode.c +4 -1
@@ -459,8 +459,11 @@ spufs_create_context(struct inode *inode, struct dentry *dentry, } ret =spufs_mkdir (inode, dentry, flags, mode &0777 ); -if (ret) +if (ret) { +if (neighbor) +put_spu_context (neighbor); goto out_aff_unlock; + }if (affinity) { spufs_set_affinity(flags, SPUFS_I(d_inode(dentry))->i_ctx,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 194/268 riscv: ftrace: Add parentheses in macro definitions of make_call_t0 and make_call_ra
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Juhan Jin <[email protected]>
[ Upstream commit 5f1a58ed91a040d4625d854f9bb3dd4995919202 ]
This patch adds parentheses to parameters caller and callee of macros make_call_t0 and make_call_ra. Every existing invocation of these two macros uses a single variable for each argument, so the absence of the parentheses seems okay. However, future invocations might use more complex expressions as arguments. For example, a future invocation might look like this: make_call_t0(a - b, c, call). Without parentheses in the macro definition, the macro invocation expands to:
...
unsigned int offset = (unsigned long) c - (unsigned long) a - b;
...
which is clearly wrong.
The use of parentheses ensures arguments are correctly evaluated and potentially saves future users of make_call_t0 and make_call_ra debugging trouble.
--- arch/riscv/include/asm/ftrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/include/asm/ftrace.h +2 -2
@@ -103,7 +103,7 @@ struct dyn_arch_ftrace {#define make_call_t0 (caller, callee, call) \ do { \ unsigned int offset = \ - (unsigned long) callee - (unsigned long) caller; \ + (unsigned long) (callee) - (unsigned long) (caller); \ call[0] = to_auipc_t0(offset); \ call[1] = to_jalr_t0(offset); \ } while (0)
@@ -119,7 +119,7 @@ do { \#define make_call_ra (caller, callee, call) \ do { \ unsigned int offset = \ - (unsigned long) callee - (unsigned long) caller; \ + (unsigned long) (callee) - (unsigned long) (caller); \ call[0] = to_auipc_ra(offset); \ call[1] = to_jalr_ra(offset); \ } while (0)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 195/268 ntb_hw_switchtec: Fix shift-out-of-bounds in switchtec_ntb_mw_set_trans
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yajun Deng <[email protected]>
[ Upstream commit de203da734fae00e75be50220ba5391e7beecdf9 ]
There is a kernel API ntb_mw_clear_trans() would pass 0 to both addr and size. This would make xlate_pos negative.
[ 23.734156] switchtec switchtec0: MW 0: part 0 addr 0x0000000000000000 size 0x0000000000000000 [ 23.734158] ================================================================================ [ 23.734172] UBSAN: shift-out-of-bounds in drivers/ntb/hw/mscc/ntb_hw_switchtec.c:293:7 [ 23.734418] shift exponent -1 is negative
Ensuring xlate_pos is a positive or zero before BIT.
--- drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ntb/hw/mscc/ntb_hw_switchtec.c +1 -1
@@ -288,7 +288,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx,if (size !=0 && xlate_pos <12 )return -EINVAL ; -if (!IS_ALIGNED (addr,BIT_ULL (xlate_pos))) { +if (xlate_pos >=0 && !IS_ALIGNED (addr,BIT_ULL (xlate_pos))) {/* * In certain circumstances we can get a buffer that is * not aligned to its size. (Most of the time
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 196/268 ntb: intel: Fix using link status DBs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Shubin <[email protected]>
[ Upstream commit 8144e9c8f30fb23bb736a5d24d5c9d46965563c4 ]
Make sure we are not using DB's which were remapped for link status.
--- drivers/ntb/hw/intel/ntb_hw_gen3.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/ntb/hw/intel/ntb_hw_gen3.c +3 -0
@@ -215,6 +215,9 @@ static int gen3_init_ntb(struct intel_ntb_dev *ndev) } ndev->db_valid_mask =BIT_ULL (ndev->db_count) -1 ; +/* Make sure we are not using DB's used for link status */ +if (ndev->hwerr_flags &NTB_HWERR_MSIX_VECTOR32_BAD ) + ndev->db_valid_mask &= ~ndev->db_link_mask; ndev->reg->db_iowrite(ndev->db_valid_mask, ndev->self_mmio +
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 197/268 firmware: cs_dsp: Ensure cs_dsp_load[_coeff]() returns 0 on success
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <[email protected]>
[ Upstream commit 2593f7e0dc93a898a84220b3fb180d86f1ca8c60 ]
Set ret = 0 on successful completion of the processing loop in cs_dsp_load() and cs_dsp_load_coeff() to ensure that the function returns 0 on success.
All normal firmware files will have at least one data block, and processing this block will set ret == 0, from the result of either regmap_raw_write() or cs_dsp_parse_coeff().
The kunit tests create a dummy firmware file that contains only the header, without any data blocks. This gives cs_dsp a file to "load" that will not cause any side-effects. As there aren't any data blocks, the processing loop will not set ret == 0.
Originally there was a line after the processing loop:
ret = regmap_async_complete(regmap);
which would set ret == 0 before the function returned.
Commit fe08b7d5085a ("firmware: cs_dsp: Remove async regmap writes") changed the regmap write to a normal sync write, so the call to regmap_async_complete() wasn't necessary and was removed. It was overlooked that the ret here wasn't only to check the result of regmap_async_complete(), it also set the final return value of the function.
--- drivers/firmware/cirrus/cs_dsp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/firmware/cirrus/cs_dsp.c +2 -0
@@ -1584,6 +1584,7 @@ static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware,cs_dsp_debugfs_save_wmfwname (dsp, file); + ret =0 ; out_fw:cs_dsp_buf_free (&buf_list);kfree (text);
@@ -2299,6 +2300,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmwarecs_dsp_debugfs_save_binname (dsp, file); + ret =0 ; out_fw:cs_dsp_buf_free (&buf_list);kfree (text);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 198/268 ALSA: hda/realtek: Fix built-in mic breakage on ASUS VivoBook X515JA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 84c3c08f5a6c2e2209428b76156bcaf349c3a62d ]
ASUS VivoBook X515JA with PCI SSID 1043:14f2 also hits the same issue as other VivoBook model about the mic pin assignment, and the same workaround is required to apply ALC256_FIXUP_ASUS_MIC_NO_PRESENCE quirk.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10202,6 +10202,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1493 ,"ASUS GV601VV/VU/VJ/VQ/VI" ,ALC285_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1043 ,0x14d3 ,"ASUS G614JY/JZ/JG" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x14e3 ,"ASUS G513PI/PU/PV" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x1043 ,0x14f2 ,"ASUS VivoBook X515JA" ,ALC256_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x1503 ,"ASUS G733PY/PZ/PZV/PYV" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x1043 ,0x1517 ,"Asus Zenbook UX31A" ,ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A ), SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 199/268 RISC-V: errata: Use medany for relocatable builds
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Palmer Dabbelt <[email protected]>
[ Upstream commit bb58e1579f431d42469b6aed0f03eff383ba6db5 ]
We're trying to mix non-PIC/PIE objects into the otherwise-PIE relocatable kernels, to avoid GOT/PLT references during early boot alternative resolution (which happens before the GOT/PLT are set up).
riscv64-unknown-linux-gnu-ld: arch/riscv/errata/sifive/errata.o: relocation R_RISCV_HI20 against tlb_flush_all_threshold' can not be used when making a shared object; recompile with -fPIC riscv64-unknown-linux-gnu-ld: arch/riscv/errata/thead/errata.o: relocation R_RISCV_HI20 against riscv_cbom_block_size' can not be used when making a shared object; recompile with -fPIC
--- arch/riscv/errata/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/riscv/errata/Makefile +5 -1
@@ -1,5 +1,9 @@ ifdef CONFIG_RELOCATABLE -KBUILD_CFLAGS += -fno-pie +# We can't use PIC/PIE when handling early-boot errata parsing, as the kernel +# doesn't have a GOT setup at that point. So instead just use medany: it's +# usually position-independent, so it should be good enough for the errata +# handling. +KBUILD_CFLAGS += -fno-pie -mcmodel=medany endif obj-$(CONFIG_ERRATA_ANDES) += andes/
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 200/268 x86/uaccess: Improve performance by aligning writes to 8 bytes in copy_user_generic(), on non-FSRM/ERMS CPUs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herton R. Krzesinski <[email protected]>
[ Upstream commit b5322b6ec06a6c58650f52abcd2492000396363b ]
History of the performance regression:
======================================
Since the following series of user copy updates were merged upstream ~2 years ago via:
a5624566431d ("Merge branch 'x86-rep-insns': x86 user copy clarifications")
.. copy_user_generic() on x86_64 stopped doing alignment of the writes to the destination to a 8 byte boundary for the non FSRM case.
Previously, this was done through the ALIGN_DESTINATION macro that was used in the now removed copy_user_generic_unrolled function.
Turns out this change causes some loss of performance/throughput on some use cases and specific CPU/platforms without FSRM and ERMS.
Lately I got two reports of performance/throughput issues after a RHEL 9 kernel pulled the same upstream series with updates to user copy functions. Both reports consisted of running specific networking/TCP related testing using iperf3.
Partial upstream fix
====================
The first report was related to a Linux Bridge testing using VMs on a specific machine with an AMD CPU (EPYC 7402), and after a brief investigation it turned out that the later change via:
ca96b162bfd2 ("x86: bring back rep movsq for user access on CPUs without ERMS")
... helped/fixed the performance issue.
However, after the later commit/fix was applied, then I got another regression reported in a multistream TCP test on a 100Gbit mlx5 nic, also running on an AMD based platform (AMD EPYC 7302 CPU), again that was using iperf3 to run the test. That regression was after applying the later fix/commit, but only this didn't help in telling the whole history.
Testing performed to pinpoint residual regression
=================================================
So I narrowed down the second regression use case, but running it without traffic through a NIC, on localhost, in trying to narrow down CPU usage and not being limited by other factor like network bandwidth. I used another system also with an AMD CPU (AMD EPYC 7742). Basically, I run iperf3 in server and client mode in the same system, for example:
- Start the server binding it to CPU core/thread 19:
$ taskset -c 19 iperf3 -D -s -B 127.0.0.1 -p 12000
- Start the client always binding/running on CPU core/thread 17, using perf to get statistics:
$ perf stat -o stat.txt taskset -c 17 iperf3 -c 127.0.0.1 -b 0/1000 -V \
-n 50G --repeating-payload -l 16384 -p 12000 --cport 12001 2>&1 \
> stat-19.txtFor the client, always running/pinned to CPU 17. But for the iperf3 in server mode, I did test runs using CPUs 19, 21, 23 or not pinned to any specific CPU. So it basically consisted with four runs of the same commands, just changing the CPU which the server is pinned, or without pinning by removing the taskset call before the server command. The CPUs were chosen based on NUMA node they were on, this is the relevant output of lscpu on the system:
$ lscpu
...
Model name: AMD EPYC 7742 64-Core Processor
...
Caches (sum of all):
L1d: 2 MiB (64 instances)
L1i: 2 MiB (64 instances)
L2: 32 MiB (64 instances)
L3: 256 MiB (16 instances)
NUMA:
NUMA node(s): 4
NUMA node0 CPU(s): 0,1,8,9,16,17,24,25,32,33,40,41,48,49,56,57,64,65,72,73,80,81,88,89,96,97,104,105,112,113,120,121
NUMA node1 CPU(s): 2,3,10,11,18,19,26,27,34,35,42,43,50,51,58,59,66,67,74,75,82,83,90,91,98,99,106,107,114,115,122,123
NUMA node2 CPU(s): 4,5,12,13,20,21,28,29,36,37,44,45,52,53,60,61,68,69,76,77,84,85,92,93,100,101,108,109,116,117,124,125
NUMA node3 CPU(s): 6,7,14,15,22,23,30,31,38,39,46,47,54,55,62,63,70,71,78,79,86,87,94,95,102,103,110,111,118,119,126,127
...So for the server run, when picking a CPU, I chose CPUs to be not on the same node. The reason is with that I was able to get/measure relevant performance differences when changing the alignment of the writes to the destination in copy_user_generic.
Testing shows up to +81% performance improvement under iperf3
=============================================================
Here's a summary of the iperf3 runs:
# Vanilla upstream alignment:
CPU RATE SYS TIME sender-receiver Server bind 19: 13.0Gbits/sec 28.371851000 33.233499566 86.9%-70.8% Server bind 21: 12.9Gbits/sec 28.283381000 33.586486621 85.8%-69.9% Server bind 23: 11.1Gbits/sec 33.660190000 39.012243176 87.7%-64.5% Server bind none: 18.9Gbits/sec 19.215339000 22.875117865 86.0%-80.5%
# With the attached patch (aligning writes in non ERMS/FSRM case):
CPU RATE SYS TIME sender-receiver Server bind 19: 20.8Gbits/sec 14.897284000 20.811101382 75.7%-89.0% Server bind 21: 20.4Gbits/sec 15.205055000 21.263165909 75.4%-89.7% Server bind 23: 20.2Gbits/sec 15.433801000 21.456175000 75.5%-89.8% Server bind none: 26.1Gbits/sec 12.534022000 16.632447315 79.8%-89.6%
So I consistently got better results when aligning the write. The results above were run on 6.14.0-rc6/rc7 based kernels. The sys is sys time and then the total time to run/transfer 50G of data. The last field is the CPU usage of sender/receiver iperf3 process. It's also worth to note that each pair of iperf3 runs may get slightly different results on each run, but I always got consistent higher results with the write alignment for this specific test of running the processes on CPUs in different NUMA nodes.
Linus Torvalds helped/provided this version of the patch. Initially I proposed a version which aligned writes for all cases in rep_movs_alternative, however it used two extra registers and thus Linus provided an enhanced version that only aligns the write on the large_movsq case, which is sufficient since the problem happens only on those AMD CPUs like ones mentioned above without ERMS/FSRM, and also doesn't require using extra registers. Also, I validated that aligning only on large_movsq case is really enough for getting the performance back.
I also tested this patch on an old Intel based non-ERMS/FRMS system (with Xeon E5-2667 - Sandy Bridge based) and didn't get any problems:
no performance enhancement but also no regression either, using the same iperf3 based benchmark. Also newer Intel processors after Sandy Bridge usually have ERMS and should not be affected by this change.
[ mingo: Updated the changelog. ]
--- arch/x86/lib/copy_user_64.S | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/x86/lib/copy_user_64.S +18 -0
@@ -74,6 +74,24 @@ SYM_FUNC_START(rep_movs_alternative) _ASM_EXTABLE_UA( 0b, 1b) .Llarge_movsq: + /* Do the first possibly unaligned word */ +0: movq (%rsi),%rax +1: movq %rax,(%rdi) + + _ASM_EXTABLE_UA( 0b, .Lcopy_user_tail) + _ASM_EXTABLE_UA( 1b, .Lcopy_user_tail) + + /* What would be the offset to the aligned destination? */ + leaq 8(%rdi),%rax + andq $-8,%rax + subq %rdi,%rax + + /* .. and update pointers and count to match */ + addq %rax,%rdi + addq %rax,%rsi + subq %rax,%rcx + + /* make %rcx contain the number of words, %rax the remainder */ movq %rcx,%rax shrq $3,%rcx andl $7,%eax
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 201/268 ASoC: codecs: rt5665: Fix some error handling paths in rt5665_probe()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 1ebd4944266e86a7ce274f197847f5a6399651e8 ]
Should an error occur after a successful regulator_bulk_enable() call, regulator_bulk_disable() should be called, as already done in the remove function.
Instead of adding an error handling path in the probe, switch from devm_regulator_bulk_get() to devm_regulator_bulk_get_enable() and simplify the remove function and some other places accordingly.
Finally, add a missing const when defining rt5665_supply_names to please checkpatch and constify a few bytes.
--- sound/soc/codecs/rt5665.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
sound/soc/codecs/rt5665.c +4 -20
@@ -31,9 +31,7 @@#include "rl6231.h" #include "rt5665.h" -#define RT5665_NUM_SUPPLIES 3 - -static const char *rt5665_supply_names[RT5665_NUM_SUPPLIES ] = { +static const char *const rt5665_supply_names[] = {"AVDD" ,"MICVDD" ,"VBAT" ,
@@ -46,7 +44,6 @@ struct rt5665_priv {struct gpio_desc *gpiod_ldo1_en;struct gpio_desc *gpiod_reset;struct snd_soc_jack *hs_jack; -struct regulator_bulk_data supplies[RT5665_NUM_SUPPLIES ];struct delayed_work jack_detect_work;struct delayed_work calibrate_work;struct delayed_work jd_check_work;
@@ -4471,8 +4468,6 @@ static void rt5665_remove(struct snd_soc_component *component)struct rt5665_priv *rt5665 =snd_soc_component_get_drvdata (component);regmap_write (rt5665->regmap,RT5665_RESET ,0 ); - -regulator_bulk_disable (ARRAY_SIZE (rt5665->supplies), rt5665->supplies); }#ifdef CONFIG_PM
@@ -4758,7 +4753,7 @@ static int rt5665_i2c_probe(struct i2c_client *i2c) {struct rt5665_platform_data *pdata =dev_get_platdata (&i2c->dev);struct rt5665_priv *rt5665; -int i, ret; +int ret;unsigned int val; rt5665 = devm_kzalloc(&i2c->dev, sizeof(struct rt5665_priv),
@@ -4774,24 +4769,13 @@ static int rt5665_i2c_probe(struct i2c_client *i2c)else rt5665_parse_dt (rt5665, &i2c->dev); -for (i =0 ; i <ARRAY_SIZE (rt5665->supplies); i++) - rt5665->supplies[i].supply = rt5665_supply_names[i]; - - ret =devm_regulator_bulk_get (&i2c->dev,ARRAY_SIZE (rt5665->supplies), - rt5665->supplies); + ret =devm_regulator_bulk_get_enable (&i2c->dev,ARRAY_SIZE (rt5665_supply_names), + rt5665_supply_names);if (ret !=0 ) {dev_err (&i2c->dev,"Failed to request supplies: %d\n" , ret);return ret; } - ret =regulator_bulk_enable (ARRAY_SIZE (rt5665->supplies), - rt5665->supplies); -if (ret !=0 ) { -dev_err (&i2c->dev,"Failed to enable supplies: %d\n" , ret); -return ret; - } - - rt5665->gpiod_ldo1_en =devm_gpiod_get_optional (&i2c->dev,"realtek,ldo1-en" ,GPIOD_OUT_HIGH );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 202/268 riscv: Fix hugetlb retrieval of number of ptes in case of !present pte
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Ghiti <[email protected]>
[ Upstream commit 83d78ac677b9fdd8ea763507c6fe02d6bf415f3a ]
Ryan sent a fix [1] for arm64 that applies to riscv too: in some hugetlb functions, we must not use the pte value to get the size of a mapping because the pte may not be present.
So use the already present size parameter for huge_pte_clear() and the newly introduced size parameter for huge_ptep_get_and_clear(). And make sure to gather A/D bits only on present ptes.
--- arch/riscv/mm/hugetlbpage.c | 76 ++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 31 deletions(-)
arch/riscv/mm/hugetlbpage.c +45 -31
@@ -148,22 +148,25 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)static pte_t get_clear_contig (struct mm_struct *mm,unsigned long addr,pte_t *ptep, -unsigned long pte_num) +unsigned long ncontig) { -pte_t orig_pte =ptep_get (ptep); -unsigned long i; - -for (i =0 ; i < pte_num; i++, addr +=PAGE_SIZE , ptep++) { -pte_t pte =ptep_get_and_clear (mm, addr, ptep); - -if (pte_dirty (pte)) - orig_pte =pte_mkdirty (orig_pte); - -if (pte_young (pte)) - orig_pte =pte_mkyoung (orig_pte); +pte_t pte, tmp_pte; +bool present; + + pte =ptep_get_and_clear (mm, addr, ptep); + present =pte_present (pte); +while (--ncontig) { + ptep++; + addr +=PAGE_SIZE ; + tmp_pte =ptep_get_and_clear (mm, addr, ptep); +if (present) { +if (pte_dirty (tmp_pte)) + pte =pte_mkdirty (pte); +if (pte_young (tmp_pte)) + pte =pte_mkyoung (pte); + } } - -return orig_pte; +return pte; } static pte_t get_clear_contig_flush(struct mm_struct *mm,
@@ -212,6 +215,26 @@ static void clear_flush(struct mm_struct *mm,flush_tlb_range (&vma, saddr, addr); } +static int num_contig_ptes_from_size (unsigned long sz,size_t *pgsize) +{ +unsigned long hugepage_shift; + +if (sz >=PGDIR_SIZE ) + hugepage_shift =PGDIR_SHIFT ; +else if (sz >=P4D_SIZE ) + hugepage_shift =P4D_SHIFT ; +else if (sz >=PUD_SIZE ) + hugepage_shift =PUD_SHIFT ; +else if (sz >=PMD_SIZE ) + hugepage_shift =PMD_SHIFT ; +else + hugepage_shift =PAGE_SHIFT ; + + *pgsize =1 << hugepage_shift; + +return sz >> hugepage_shift; +} +/* * When dealing with NAPOT mappings, the privileged specification indicates that * "if an update needs to be made, the OS generally should first mark all of the
@@ -226,22 +249,10 @@ void set_huge_pte_at(struct mm_struct *mm,pte_t pte, unsigned long sz) { -unsigned long hugepage_shift, pgsize; + size_t pgsize;int i, pte_num; -if (sz >=PGDIR_SIZE ) - hugepage_shift =PGDIR_SHIFT ; -else if (sz >=P4D_SIZE ) - hugepage_shift =P4D_SHIFT ; -else if (sz >=PUD_SIZE ) - hugepage_shift =PUD_SHIFT ; -else if (sz >=PMD_SIZE ) - hugepage_shift =PMD_SHIFT ; -else - hugepage_shift =PAGE_SHIFT ; - - pte_num = sz >> hugepage_shift; - pgsize =1 << hugepage_shift; + pte_num =num_contig_ptes_from_size (sz, &pgsize);if (!pte_present (pte)) {for (i =0 ; i < pte_num; i++, ptep++, addr += pgsize)
@@ -295,13 +306,14 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,unsigned long addr, pte_t *ptep, unsigned long sz) { + size_t pgsize;pte_t orig_pte =ptep_get (ptep);int pte_num;if (!pte_napot (orig_pte))return ptep_get_and_clear (mm, addr, ptep); - pte_num =napot_pte_num (napot_cont_order (orig_pte)); + pte_num =num_contig_ptes_from_size (sz, &pgsize);return get_clear_contig (mm, addr, ptep, pte_num); }
@@ -351,6 +363,7 @@ void huge_pte_clear(struct mm_struct *mm,pte_t *ptep, unsigned long sz) { + size_t pgsize;pte_t pte =ptep_get (ptep);int i, pte_num;
@@ -359,8 +372,9 @@ void huge_pte_clear(struct mm_struct *mm,return ; } - pte_num =napot_pte_num (napot_cont_order (pte)); -for (i =0 ; i < pte_num; i++, addr +=PAGE_SIZE , ptep++) + pte_num =num_contig_ptes_from_size (sz, &pgsize); + +for (i =0 ; i < pte_num; i++, addr += pgsize, ptep++)pte_clear (mm, addr, ptep); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 203/268 ASoC: imx-card: Add NULL check in imx_card_probe()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Martin <[email protected]>
[ Upstream commit 93d34608fd162f725172e780b1c60cc93a920719 ]
devm_kasprintf() returns NULL when memory allocation fails. Currently, imx_card_probe() does not check for this case, which results in a NULL pointer dereference.
Add NULL check after devm_kasprintf() to prevent this issue.
--- sound/soc/fsl/imx-card.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/fsl/imx-card.c +4 -0
@@ -742,6 +742,8 @@ static int imx_card_probe(struct platform_device *pdev) data->dapm_routes[i].sink =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"%d %s" , i +1 ,"Playback" ); +if (!data->dapm_routes[i].sink) +return -ENOMEM ; data->dapm_routes[i].source ="CPU-Playback" ; } }
@@ -759,6 +761,8 @@ static int imx_card_probe(struct platform_device *pdev) data->dapm_routes[i].source =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"%d %s" , i +1 ,"Capture" ); +if (!data->dapm_routes[i].source) +return -ENOMEM ; data->dapm_routes[i].sink ="CPU-Capture" ; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 204/268 e1000e: change k1 configuration on MTP and later platforms
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Lifshits <[email protected]>
[ Upstream commit efaaf344bc2917cbfa5997633bc18a05d3aed27f ]
Starting from Meteor Lake, the Kumeran interface between the integrated MAC and the I219 PHY works at a different frequency. This causes sporadic MDI errors when accessing the PHY, and in rare circumstances could lead to packet corruption.
To overcome this, introduce minor changes to the Kumeran idle state (K1) parameters during device initialization. Hardware reset reverts this configuration, therefore it needs to be applied in a few places.
--- drivers/net/ethernet/intel/e1000e/defines.h | 3 + drivers/net/ethernet/intel/e1000e/ich8lan.c | 80 +++++++++++++++++++-- drivers/net/ethernet/intel/e1000e/ich8lan.h | 4 ++ 3 files changed, 82 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/e1000e/defines.h +3 -0
@@ -808,4 +808,7 @@/* SerDes Control */ #define E1000_GEN_POLL_TIMEOUT 640 +#define E1000_FEXTNVM12_PHYPD_CTRL_MASK 0x00C00000 +#define E1000_FEXTNVM12_PHYPD_CTRL_P1 0x00800000 +#endif /* _E1000_DEFINES_H_ */
drivers/net/ethernet/intel/e1000e/ich8lan.c +75 -5
110 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/ich8lan.h +4 -0
@@ -219,6 +219,10 @@#define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28)#define I217_PLL_CLOCK_GATE_MASK 0x07FF +/* PHY Timeouts */ +#define I217_PHY_TIMEOUTS_REG PHY_REG(770, 21) +#define I217_PHY_TIMEOUTS_K1_EXIT_TO_MASK 0x0FC0 +#define SW_FLAG_TIMEOUT 1000/* SW Semaphore flag timeout in ms */ /* Inband Control */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 205/268 netfilter: nft_set_hash: GC reaps elements with conncount for dynamic sets only
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 9d74da1177c800eb3d51c13f9821b7b0683845a5 ]
conncount has its own GC handler which determines when to reap stale elements, this is convenient for dynamic sets. However, this also reaps non-dynamic sets with static configurations coming from control plane. Always run connlimit gc handler but honor feedback to reap element if this set is dynamic.
--- net/netfilter/nft_set_hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_set_hash.c +2 -1
@@ -308,7 +308,8 @@ static bool nft_rhash_expr_needs_gc_run(const struct nft_set *set, nft_setelem_expr_foreach(expr, elem_expr, size) {if (expr->ops->gc && - expr->ops->gc (read_pnet (&set->net), expr)) + expr->ops->gc (read_pnet (&set->net), expr) && + set->flags &NFT_SET_EVAL )return true; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 206/268 netfilter: nf_tables: dont unregister hook when table is dormant
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit 688c15017d5cd5aac882400782e7213d40dc3556 ]
When nf_tables_updchain encounters an error, hook registration needs to be rolled back.
This should only be done if the hook has been registered, which won't happen when the table is flagged as dormant (inactive).
Just move the assignment into the registration block.
--- net/netfilter/nf_tables_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +2 -2
@@ -2669,11 +2669,11 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy, err =nft_netdev_register_hooks (ctx->net, &hook.list);if (err <0 ) goto err_hooks; + + unregister = true; } } - unregister = true; -if (nla[NFTA_CHAIN_COUNTERS ]) {if (!nft_is_base_chain (chain)) { err = -EOPNOTSUPP ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 207/268 netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Debin Zhu <[email protected]>
[ Upstream commit 078aabd567de3d63d37d7673f714e309d369e6e2 ]
When calling netlbl_conn_setattr(), addr->sa_family is used to determine the function behavior. If sk is an IPv4 socket, but the connect function is called with an IPv6 address, the function calipso_sock_setattr() is triggered. Inside this function, the following code is executed:
sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL;
Since sk is an IPv4 socket, pinet6 is NULL, leading to a null pointer dereference.
This patch fixes the issue by checking if inet6_sk(sk) returns a NULL pointer before accessing pinet6.
--- net/ipv6/calipso.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
net/ipv6/calipso.c +18 -3
@@ -1075,8 +1075,13 @@ static int calipso_sock_getattr(struct sock *sk,struct ipv6_opt_hdr *hop;int opt_len, len, ret_val = -ENOMSG , offset;unsigned char *opt; -struct ipv6_txoptions *txopts =txopt_get (inet6_sk (sk)); +struct ipv6_pinfo *pinfo =inet6_sk (sk); +struct ipv6_txoptions *txopts; + +if (!pinfo) +return -EAFNOSUPPORT ; + txopts =txopt_get (pinfo);if (!txopts || !txopts->hopopt) goto done;
@@ -1128,8 +1133,13 @@ static int calipso_sock_setattr(struct sock *sk, {int ret_val;struct ipv6_opt_hdr *old, *new; -struct ipv6_txoptions *txopts =txopt_get (inet6_sk (sk)); +struct ipv6_pinfo *pinfo =inet6_sk (sk); +struct ipv6_txoptions *txopts; + +if (!pinfo) +return -EAFNOSUPPORT ; + txopts =txopt_get (pinfo); old =NULL ;if (txopts) old = txopts->hopopt;
@@ -1156,8 +1166,13 @@ static int calipso_sock_setattr(struct sock *sk,static void calipso_sock_delattr (struct sock *sk) {struct ipv6_opt_hdr *new_hop; -struct ipv6_txoptions *txopts =txopt_get (inet6_sk (sk)); +struct ipv6_pinfo *pinfo =inet6_sk (sk); +struct ipv6_txoptions *txopts; + +if (!pinfo) +return ; + txopts =txopt_get (pinfo);if (!txopts || !txopts->hopopt) goto done;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 208/268 net_sched: skbprio: Remove overly strict queue assertions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit ce8fe975fd99b49c29c42e50f2441ba53112b2e8 ]
In the current implementation, skbprio enqueue/dequeue contains an assertion that fails under certain conditions when SKBPRIO is used as a child qdisc under TBF with specific parameters. The failure occurs because TBF sometimes peeks at packets in the child qdisc without actually dequeuing them when tokens are unavailable.
This peek operation creates a discrepancy between the parent and child qdisc queue length counters. When TBF later receives a high-priority packet, SKBPRIO's queue length may show a different value than what's reflected in its internal priority queue tracking, triggering the assertion.
The fix removes this overly strict assertions in SKBPRIO, they are not necessary at all.
--- net/sched/sch_skbprio.c | 3 --- 1 file changed, 3 deletions(-)
net/sched/sch_skbprio.c +0 -3
@@ -121,8 +121,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,/* Check to update highest and lowest priorities. */ if (skb_queue_empty (lp_qdisc)) {if (q->lowest_prio == q->highest_prio) { -/* The incoming packet is the only packet in queue. */ -BUG_ON (sch->q.qlen !=1 ); q->lowest_prio = prio; q->highest_prio = prio; }else {
@@ -154,7 +152,6 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)/* Update highest priority field. */ if (skb_queue_empty (hpq)) {if (q->lowest_prio == q->highest_prio) { -BUG_ON (sch->q.qlen); q->highest_prio =0 ; q->lowest_prio =SKBPRIO_MAX_PRIORITY -1 ; }else {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 209/268 net: mvpp2: Prevent parser TCAM memory corruption
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tobias Waldekranz <[email protected]>
[ Upstream commit 96844075226b49af25a69a1d084b648ec2d9b08d ]
Protect the parser TCAM/SRAM memory, and the cached (shadow) SRAM information, from concurrent modifications.
Both the TCAM and SRAM tables are indirectly accessed by configuring an index register that selects the row to read or write to. This means that operations must be atomic in order to, e.g., avoid spreading writes across multiple rows. Since the shadow SRAM array is used to find free rows in the hardware table, it must also be protected in order to avoid TOCTOU errors where multiple cores allocate the same row.
This issue was detected in a situation where mvpp2_set_rx_mode() ran concurrently on two CPUs. In this particular case the MVPP2_PE_MAC_UC_PROMISCUOUS entry was corrupted, causing the classifier unit to drop all incoming unicast - indicated by the rx_classifier_drops counter.
--- drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 3 + .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 +- .../net/ethernet/marvell/mvpp2/mvpp2_prs.c | 201 ++++++++++++------ 3 files changed, 140 insertions(+), 67 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2.h +3 -0
@@ -1108,6 +1108,9 @@ struct mvpp2 {/* Spinlocks for CM3 shared memory configuration */ spinlock_t mss_spinlock; + +/* Spinlock for shared PRS parser memory and shadow table */ +spinlock_t prs_spinlock; };struct mvpp2_pcpu_stats {
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -1
@@ -7615,8 +7615,9 @@ static int mvpp2_probe(struct platform_device *pdev)if (mvpp2_read (priv,MVPP2_VER_ID_REG ) ==MVPP2_VER_PP23 ) priv->hw_version =MVPP23 ; -/* Init mss lock */ +/* Init locks for shared packet processor resources */ spin_lock_init (&priv->mss_spinlock); +spin_lock_init (&priv->prs_spinlock);/* Initialize network controller */ err =mvpp2_init (pdev, priv);
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +135 -66
536 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 210/268 udp: Fix memory accounting leak.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit df207de9d9e7a4d92f8567e2c539d9c8c12fd99d ]
Matt Dowling reported a weird UDP memory usage issue.
Under normal operation, the UDP memory usage reported in /proc/net/sockstat remains close to zero. However, it occasionally spiked to 524,288 pages and never dropped. Moreover, the value doubled when the application was terminated. Finally, it caused intermittent packet drops.
We can reproduce the issue with the script below [0]:
1. /proc/net/sockstat reports 0 pages
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 1 mem 02. Run the script till the report reaches 524,288
# python3 test.py & sleep 5
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 3 mem 524288 <-- (INT_MAX + 1) >> PAGE_SHIFT3. Kill the socket and confirm the number never drops
# pkill python3 && sleep 5
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 1 mem 524288 4. (necessary since v6.0) Trigger proto_memory_pcpu_drain()
# python3 test.py & sleep 1 && pkill python3
5. The number doubles
# cat /proc/net/sockstat | grep UDP:
UDP: inuse 1 mem 1048577The application set INT_MAX to SO_RCVBUF, which triggered an integer overflow in udp_rmem_release().
When a socket is close()d, udp_destruct_common() purges its receive queue and sums up skb->truesize in the queue. This total is calculated and stored in a local unsigned integer variable.
The total size is then passed to udp_rmem_release() to adjust memory accounting. However, because the function takes a signed integer argument, the total size can wrap around, causing an overflow.
Then, the released amount is calculated as follows:
1) Add size to sk->sk_forward_alloc.
2) Round down sk->sk_forward_alloc to the nearest lower multiple of PAGE_SIZE and assign it to amount.
3) Subtract amount from sk->sk_forward_alloc.
4) Pass amount >> PAGE_SHIFT to __sk_mem_reduce_allocated().
When the issue occurred, the total in udp_destruct_common() was 2147484480 (INT_MAX + 833), which was cast to -2147482816 in udp_rmem_release().
At 1) sk->sk_forward_alloc is changed from 3264 to -2147479552, and
2) sets -2147479552 to amount. 3) reverts the wraparound, so we don't see a warning in inet_sock_destruct(). However, udp_memory_allocated ends up doubling at 4).
Since commit 3cd3399dd7a8 ("net: implement per-cpu reserves for memory_allocated"), memory usage no longer doubles immediately after a socket is close()d because __sk_mem_reduce_allocated() caches the amount in udp_memory_per_cpu_fw_alloc. However, the next time a UDP socket receives a packet, the subtraction takes effect, causing UDP memory usage to double.
This issue makes further memory allocation fail once the socket's sk->sk_rmem_alloc exceeds net.ipv4.udp_rmem_min, resulting in packet drops.
To prevent this issue, let's use unsigned int for the calculation and call sk_forward_alloc_add() only once for the small delta.
Note that first_packet_length() also potentially has the same problem.
[0]:
from socket import *
SO_RCVBUFFORCE = 33INT_MAX = (2 ** 31) - 1
s = socket(AF_INET, SOCK_DGRAM)s.bind(('', 0))s.setsockopt(SOL_SOCKET, SO_RCVBUFFORCE, INT_MAX)
c = socket(AF_INET, SOCK_DGRAM)
c.connect(s.getsockname())
data = b'a' * 100
while True:
c.send(data)
--- net/ipv4/udp.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
net/ipv4/udp.c +7 -9
@@ -1412,12 +1412,12 @@ static bool udp_skb_has_head_state(struct sk_buff *skb) }/* fully reclaim rmem/fwd memory allocated for skb */ -static void udp_rmem_release (struct sock *sk,int size,int partial, -bool rx_queue_lock_held) +static void udp_rmem_release (struct sock *sk,unsigned int size, +int partial,bool rx_queue_lock_held) {struct udp_sock *up =udp_sk (sk);struct sk_buff_head *sk_queue; -int amt; +unsigned int amt;if (likely (partial)) { up->forward_deficit += size;
@@ -1437,10 +1437,8 @@ static void udp_rmem_release(struct sock *sk, int size, int partial,if (!rx_queue_lock_held)spin_lock (&sk_queue->lock); - -sk_forward_alloc_add (sk, size); - amt = (sk->sk_forward_alloc - partial) & ~(PAGE_SIZE -1 ); -sk_forward_alloc_add (sk, -amt); + amt = (size + sk->sk_forward_alloc - partial) & ~(PAGE_SIZE -1 ); +sk_forward_alloc_add (sk, size - amt);if (amt)__sk_mem_reduce_allocated (sk, amt >>PAGE_SHIFT );
@@ -1630,7 +1628,7 @@ EXPORT_SYMBOL_GPL(skb_consume_udp);static struct sk_buff *__first_packet_length (struct sock *sk,struct sk_buff_head *rcvq, -int *total) +unsigned int *total) {struct sk_buff *skb;
@@ -1663,8 +1661,8 @@ static int first_packet_length(struct sock *sk) {struct sk_buff_head *rcvq = &udp_sk (sk)->reader_queue;struct sk_buff_head *sk_queue = &sk->sk_receive_queue; +unsigned int total =0 ;struct sk_buff *skb; -int total =0 ;int res;spin_lock_bh (&rcvq->lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 211/268 vsock: avoid timeout during connect() if the socket is closing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Garzarella <[email protected]>
[ Upstream commit fccd2b711d9628c7ce0111d5e4938652101ee30a ]
When a peer attempts to establish a connection, vsock_connect() contains a loop that waits for the state to be TCP_ESTABLISHED. However, the other peer can be fast enough to accept the connection and close it immediately, thus moving the state to TCP_CLOSING.
When this happens, the peer in the vsock_connect() is properly woken up, but since the state is not TCP_ESTABLISHED, it goes back to sleep until the timeout expires, returning -ETIMEDOUT.
If the socket state is TCP_CLOSING, waiting for the timeout is pointless. vsock_connect() can return immediately without errors or delay since the connection actually happened. The socket will be in a closing state, but this is not an issue, and subsequent calls will fail as expected.
We discovered this issue while developing a test that accepts and immediately closes connections to stress the transport switch between two connect() calls, where the first one was interrupted by a signal (see Closes link).
--- net/vmw_vsock/af_vsock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/vmw_vsock/af_vsock.c +5 -1
@@ -1485,7 +1485,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr, timeout = vsk->connect_timeout;prepare_to_wait (sk_sleep (sk), &wait,TASK_INTERRUPTIBLE ); -while (sk->sk_state !=TCP_ESTABLISHED && sk->sk_err ==0 ) { +/* If the socket is already closing or it is in an error state, there +* is no point in waiting. +*/ +while (sk->sk_state !=TCP_ESTABLISHED && + sk->sk_state !=TCP_CLOSING && sk->sk_err ==0 ) {if (flags &O_NONBLOCK ) {/* If we're not going to block, we schedule a timeout * function to generate a timeout on the connection
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 212/268 tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
[ Upstream commit 8930424777e43257f5bf6f0f0f53defd0d30415c ]
Because skb_tunnel_check_pmtu() doesn't handle PACKET_HOST packets, commit 30a92c9e3d6b ("openvswitch: Set the skbuff pkt_type for proper pmtud support.") forced skb->pkt_type to PACKET_OUTGOING for openvswitch packets that are sent using the OVS_ACTION_ATTR_OUTPUT action. This allowed such packets to invoke the iptunnel_pmtud_check_icmp() or iptunnel_pmtud_check_icmpv6() helpers and thus trigger PMTU update on the input device.
However, this also broke other parts of PMTU discovery. Since these packets don't have the PACKET_HOST type anymore, they won't trigger the sending of ICMP Fragmentation Needed or Packet Too Big messages to remote hosts when oversized (see the skb_in->pkt_type condition in __icmp_send() for example).
These two skb->pkt_type checks are therefore incompatible as one requires skb->pkt_type to be PACKET_HOST, while the other requires it to be anything but PACKET_HOST.
It makes sense to not trigger ICMP messages for non-PACKET_HOST packets as these messages should be generated only for incoming l2-unicast packets. However there doesn't seem to be any reason for skb_tunnel_check_pmtu() to ignore PACKET_HOST packets.
Allow both cases to work by allowing skb_tunnel_check_pmtu() to work on PACKET_HOST packets and not overriding skb->pkt_type in openvswitch anymore.
--- net/ipv4/ip_tunnel_core.c | 2 +- net/openvswitch/actions.c | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)
net/ipv4/ip_tunnel_core.c +1 -1
@@ -415,7 +415,7 @@ int skb_tunnel_check_pmtu(struct sk_buff *skb, struct dst_entry *encap_dst,skb_dst_update_pmtu_no_confirm (skb, mtu); -if (!reply || skb->pkt_type ==PACKET_HOST ) +if (!reply)return 0 ;if (skb->protocol ==htons (ETH_P_IP ))
net/openvswitch/actions.c +0 -6
@@ -931,12 +931,6 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,pskb_trim (skb,ovs_mac_header_len (key)); } -/* Need to set the pkt_type to involve the routing layer. The -* packet movement through the OVS datapath doesn't generally -* use routing, but this is needed for tunnel cases. -*/ - skb->pkt_type =PACKET_OUTGOING ; -if (likely (!mru || (skb->len <= mru + vport->dev->hard_header_len))) {ovs_vport_send (vport, skb,ovs_key_mac_proto (key));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 213/268 net: decrease cached dst counters in dst_release
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antoine Tenart <[email protected]>
[ Upstream commit 3a0a3ff6593d670af2451ec363ccb7b18aec0c0a ]
Upstream fix ac888d58869b ("net: do not delay dst_entries_add() in dst_release()") moved decrementing the dst count from dst_destroy to dst_release to avoid accessing already freed data in case of netns dismantle. However in case CONFIG_DST_CACHE is enabled and OvS+tunnels are used, this fix is incomplete as the same issue will be seen for cached dsts:
Unable to handle kernel paging request at virtual address ffff5aabf6b5c000 Call trace: percpu_counter_add_batch+0x3c/0x160 (P) dst_release+0xec/0x108 dst_cache_destroy+0x68/0xd8 dst_destroy+0x13c/0x168 dst_destroy_rcu+0x1c/0xb0 rcu_do_batch+0x18c/0x7d0 rcu_core+0x174/0x378 rcu_core_si+0x18/0x30
Fix this by invalidating the cache, and thus decrementing cached dst counters, in dst_release too.
--- net/core/dst.c | 8 ++++++++ 1 file changed, 8 insertions(+)
net/core/dst.c +8 -0
@@ -167,6 +167,14 @@ static void dst_count_dec(struct dst_entry *dst)void dst_release (struct dst_entry *dst) {if (dst &&rcuref_put (&dst->__rcuref)) { +#ifdef CONFIG_DST_CACHE +if (dst->flags &DST_METADATA ) { +struct metadata_dst *md_dst = (struct metadata_dst *)dst; + +if (md_dst->type ==METADATA_IP_TUNNEL ) +dst_cache_reset_now (&md_dst->u.tun_info.dst_cache); + } +#endif dst_count_dec (dst);call_rcu_hurry (&dst->rcu_head, dst_destroy_rcu); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 214/268 netfilter: nft_tunnel: fix geneve_opt type confusion addition
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
[ Upstream commit 1b755d8eb1ace3870789d48fbd94f386ad6e30be ]
When handling multiple NFTA_TUNNEL_KEY_OPTS_GENEVE attributes, the parsing logic should place every geneve_opt structure one by one compactly. Hence, when deciding the next geneve_opt position, the pointer addition should be in units of char *.
However, the current implementation erroneously does type conversion before the addition, which will lead to heap out-of-bounds write.
[ 6.989857] ================================================================== [ 6.990293] BUG: KASAN: slab-out-of-bounds in nft_tunnel_obj_init+0x977/0xa70 [ 6.990725] Write of size 124 at addr ffff888005f18974 by task poc/178 [ 6.991162] [ 6.991259] CPU: 0 PID: 178 Comm: poc-oob-write Not tainted 6.1.132 #1 [ 6.991655] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 6.992281] Call Trace: [ 6.992423] <TASK> [ 6.992586] dump_stack_lvl+0x44/0x5c [ 6.992801] print_report+0x184/0x4be [ 6.993790] kasan_report+0xc5/0x100 [ 6.994252] kasan_check_range+0xf3/0x1a0 [ 6.994486] memcpy+0x38/0x60 [ 6.994692] nft_tunnel_obj_init+0x977/0xa70 [ 6.995677] nft_obj_init+0x10c/0x1b0 [ 6.995891] nf_tables_newobj+0x585/0x950 [ 6.996922] nfnetlink_rcv_batch+0xdf9/0x1020 [ 6.998997] nfnetlink_rcv+0x1df/0x220 [ 6.999537] netlink_unicast+0x395/0x530 [ 7.000771] netlink_sendmsg+0x3d0/0x6d0 [ 7.001462] __sock_sendmsg+0x99/0xa0 [ 7.001707] ____sys_sendmsg+0x409/0x450 [ 7.002391] ___sys_sendmsg+0xfd/0x170 [ 7.003145] __sys_sendmsg+0xea/0x170 [ 7.004359] do_syscall_64+0x5e/0x90 [ 7.005817] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 7.006127] RIP: 0033:0x7ec756d4e407 [ 7.006339] Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 faf [ 7.007364] RSP: 002b:00007ffed5d46760 EFLAGS: 00000202 ORIG_RAX: 000000000000002e [ 7.007827] RAX: ffffffffffffffda RBX: 00007ec756cc4740 RCX: 00007ec756d4e407 [ 7.008223] RDX: 0000000000000000 RSI: 00007ffed5d467f0 RDI: 0000000000000003 [ 7.008620] RBP: 00007ffed5d468a0 R08: 0000000000000000 R09: 0000000000000000 [ 7.009039] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 7.009429] R13: 00007ffed5d478b0 R14: 00007ec756ee5000 R15: 00005cbd4e655cb8
Fix this bug with correct pointer addition and conversion in parse and dump code.
--- net/netfilter/nft_tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nft_tunnel.c +2 -2
@@ -339,7 +339,7 @@ static const struct nla_policy nft_tunnel_opts_geneve_policy[NFTA_TUNNEL_KEY_GENstatic int nft_tunnel_obj_geneve_init (const struct nlattr *attr,struct nft_tunnel_opts *opts) { -struct geneve_opt *opt = (struct geneve_opt *)opts->u.data + opts->len; +struct geneve_opt *opt = (struct geneve_opt *)(opts->u.data + opts->len);struct nlattr *tb[NFTA_TUNNEL_KEY_GENEVE_MAX +1 ];int err, data_len;
@@ -621,7 +621,7 @@ static int nft_tunnel_opts_dump(struct sk_buff *skb,if (!inner) goto failure; while (opts->len > offset) { - opt = (struct geneve_opt *)opts->u.data + offset; + opt = (struct geneve_opt *)(opts->u.data + offset); if (nla_put_be16(skb, NFTA_TUNNEL_KEY_GENEVE_CLASS, opt->opt_class) || nla_put_u8(skb, NFTA_TUNNEL_KEY_GENEVE_TYPE,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 215/268 ipv6: fix omitted netlink attributes when using RTEXT_FILTER_SKIP_STATS
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit 7ac6ea4a3e0898db76aecccd68fb2c403eb7d24e ]
Using RTEXT_FILTER_SKIP_STATS is incorrectly skipping non-stats IPv6 netlink attributes on link dump. This causes issues on userspace tools, e.g iproute2 is not rendering address generation mode as it should due to missing netlink attribute.
Move the filling of IFLA_INET6_STATS and IFLA_INET6_ICMP6STATS to a helper function guarded by a flag check to avoid hitting the same situation in the future.
--- net/ipv6/addrconf.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-)
net/ipv6/addrconf.c +25 -12
@@ -5750,6 +5750,27 @@ static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype, } } +static int inet6_fill_ifla6_stats_attrs (struct sk_buff *skb, +struct inet6_dev *idev) +{ +struct nlattr *nla; + + nla =nla_reserve (skb,IFLA_INET6_STATS ,IPSTATS_MIB_MAX *sizeof (u64)); +if (!nla) + goto nla_put_failure; +snmp6_fill_stats (nla_data (nla), idev,IFLA_INET6_STATS ,nla_len (nla)); + + nla =nla_reserve (skb,IFLA_INET6_ICMP6STATS ,ICMP6_MIB_MAX *sizeof (u64)); +if (!nla) + goto nla_put_failure; +snmp6_fill_stats (nla_data (nla), idev,IFLA_INET6_ICMP6STATS ,nla_len (nla)); + +return 0 ; + +nla_put_failure: +return -EMSGSIZE ; +} +static int inet6_fill_ifla6_attrs (struct sk_buff *skb,struct inet6_dev *idev,u32 ext_filter_mask) {
@@ -5771,18 +5792,10 @@ static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev,/* XXX - MC not implemented */ -if (ext_filter_mask &RTEXT_FILTER_SKIP_STATS ) -return 0 ; - - nla =nla_reserve (skb,IFLA_INET6_STATS ,IPSTATS_MIB_MAX *sizeof (u64)); -if (!nla) - goto nla_put_failure; -snmp6_fill_stats (nla_data (nla), idev,IFLA_INET6_STATS ,nla_len (nla)); - - nla =nla_reserve (skb,IFLA_INET6_ICMP6STATS ,ICMP6_MIB_MAX *sizeof (u64)); -if (!nla) - goto nla_put_failure; -snmp6_fill_stats (nla_data (nla), idev,IFLA_INET6_ICMP6STATS ,nla_len (nla)); +if (!(ext_filter_mask &RTEXT_FILTER_SKIP_STATS )) { +if (inet6_fill_ifla6_stats_attrs (skb, idev) <0 ) + goto nla_put_failure; + } nla =nla_reserve (skb,IFLA_INET6_TOKEN ,sizeof (struct in6_addr ));if (!nla)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 216/268 net: dsa: mv88e6xxx: propperly shutdown PPU re-enable timer on destroy
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Oberhollenzer <[email protected]>
[ Upstream commit a58d882841a0750da3c482cd3d82432b1c7edb77 ]
The mv88e6xxx has an internal PPU that polls PHY state. If we want to access the internal PHYs, we need to disable the PPU first. Because that is a slow operation, a 10ms timer is used to re-enable it, canceled with every access, so bulk operations effectively only disable it once and re-enable it some 10ms after the last access.
If a PHY is accessed and then the mv88e6xxx module is removed before the 10ms are up, the PPU re-enable ends up accessing a dangling pointer.
This especially affects probing during bootup. The MDIO bus and PHY registration may succeed, but registration with the DSA framework may fail later on (e.g. because the CPU port depends on another, very slow device that isn't done probing yet, returning -EPROBE_DEFER). In this case, probe() fails, but the MDIO subsystem may already have accessed the MIDO bus or PHYs, arming the timer.
This is fixed as follows:
- If probe fails after mv88e6xxx_phy_init(), make sure we also call mv88e6xxx_phy_destroy() before returning
- In mv88e6xxx_remove(), make sure we do the teardown in the correct order, calling mv88e6xxx_phy_destroy() after unregistering the switch device.
- In mv88e6xxx_phy_destroy(), destroy both the timer and the work item that the timer might schedule, synchronously waiting in case one of the callbacks already fired and destroying the timer first, before waiting for the work item.
- Access to the PPU is guarded by a mutex, the worker acquires it with a mutex_trylock(), not proceeding with the expensive shutdown if that fails. We grab the mutex in mv88e6xxx_phy_destroy() to make sure the slow PPU shutdown is already done or won't even enter, when we wait for the work item.
--- drivers/net/dsa/mv88e6xxx/chip.c | 11 +++++++---- drivers/net/dsa/mv88e6xxx/phy.c | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +7 -4
@@ -7156,13 +7156,13 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) err =mv88e6xxx_switch_reset (chip);mv88e6xxx_reg_unlock (chip);if (err) - goto out; + goto out_phy;if (np) { chip->irq =of_irq_get (np,0 );if (chip->irq == -EPROBE_DEFER ) { err = chip->irq; - goto out; + goto out_phy; } }
@@ -7181,7 +7181,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)mv88e6xxx_reg_unlock (chip);if (err) - goto out; + goto out_phy;if (chip->info->g2_irqs >0 ) { err =mv88e6xxx_g2_irq_setup (chip);
@@ -7215,6 +7215,8 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)mv88e6xxx_g1_irq_free (chip); elsemv88e6xxx_irq_poll_free (chip ); +out_phy: +mv88e6xxx_phy_destroy (chip); out:if (pdata)dev_put (pdata->netdev);
@@ -7237,7 +7239,6 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)mv88e6xxx_ptp_free (chip); } -mv88e6xxx_phy_destroy (chip);mv88e6xxx_unregister_switch (chip);mv88e6xxx_g1_vtu_prob_irq_free (chip);
@@ -7250,6 +7251,8 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)mv88e6xxx_g1_irq_free (chip); elsemv88e6xxx_irq_poll_free (chip ); + +mv88e6xxx_phy_destroy (chip); }static void mv88e6xxx_shutdown (struct mdio_device *mdiodev)
drivers/net/dsa/mv88e6xxx/phy.c +3 -0
@@ -229,7 +229,10 @@ static void mv88e6xxx_phy_ppu_state_init(struct mv88e6xxx_chip *chip)static void mv88e6xxx_phy_ppu_state_destroy (struct mv88e6xxx_chip *chip) { +mutex_lock (&chip->ppu_mutex);del_timer_sync (&chip->ppu_timer); +cancel_work_sync (&chip->ppu_work); +mutex_unlock (&chip->ppu_mutex); } int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 217/268 net: fix geneve_opt length integer overflow
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
[ Upstream commit b27055a08ad4b415dcf15b63034f9cb236f7fb40 ]
struct geneve_opt uses 5 bit length for each single option, which means every vary size option should be smaller than 128 bytes.
However, all current related Netlink policies cannot promise this length condition and the attacker can exploit a exact 128-byte size option to *fake* a zero length option and confuse the parsing logic, further achieve heap out-of-bounds read.
One example crash log is like below:
[ 3.905425] ================================================================== [ 3.905925] BUG: KASAN: slab-out-of-bounds in nla_put+0xa9/0xe0 [ 3.906255] Read of size 124 at addr ffff888005f291cc by task poc/177 [ 3.906646] [ 3.906775] CPU: 0 PID: 177 Comm: poc-oob-read Not tainted 6.1.132 #1 [ 3.907131] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 3.907784] Call Trace: [ 3.907925] <TASK> [ 3.908048] dump_stack_lvl+0x44/0x5c [ 3.908258] print_report+0x184/0x4be [ 3.909151] kasan_report+0xc5/0x100 [ 3.909539] kasan_check_range+0xf3/0x1a0 [ 3.909794] memcpy+0x1f/0x60 [ 3.909968] nla_put+0xa9/0xe0 [ 3.910147] tunnel_key_dump+0x945/0xba0 [ 3.911536] tcf_action_dump_1+0x1c1/0x340 [ 3.912436] tcf_action_dump+0x101/0x180 [ 3.912689] tcf_exts_dump+0x164/0x1e0 [ 3.912905] fw_dump+0x18b/0x2d0 [ 3.913483] tcf_fill_node+0x2ee/0x460 [ 3.914778] tfilter_notify+0xf4/0x180 [ 3.915208] tc_new_tfilter+0xd51/0x10d0 [ 3.918615] rtnetlink_rcv_msg+0x4a2/0x560 [ 3.919118] netlink_rcv_skb+0xcd/0x200 [ 3.919787] netlink_unicast+0x395/0x530 [ 3.921032] netlink_sendmsg+0x3d0/0x6d0 [ 3.921987] __sock_sendmsg+0x99/0xa0 [ 3.922220] __sys_sendto+0x1b7/0x240 [ 3.922682] __x64_sys_sendto+0x72/0x90 [ 3.922906] do_syscall_64+0x5e/0x90 [ 3.923814] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 3.924122] RIP: 0033:0x7e83eab84407 [ 3.924331] Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 faf [ 3.925330] RSP: 002b:00007ffff505e370 EFLAGS: 00000202 ORIG_RAX: 000000000000002c [ 3.925752] RAX: ffffffffffffffda RBX: 00007e83eaafa740 RCX: 00007e83eab84407 [ 3.926173] RDX: 00000000000001a8 RSI: 00007ffff505e3c0 RDI: 0000000000000003 [ 3.926587] RBP: 00007ffff505f460 R08: 00007e83eace1000 R09: 000000000000000c [ 3.926977] R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffff505f3c0 [ 3.927367] R13: 00007ffff505f5c8 R14: 00007e83ead1b000 R15: 00005d4fbbe6dcb8
Fix these issues by enforing correct length condition in related policies.
--- net/ipv4/ip_tunnel_core.c | 2 +- net/netfilter/nft_tunnel.c | 2 +- net/sched/act_tunnel_key.c | 2 +- net/sched/cls_flower.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
net/ipv4/ip_tunnel_core.c +1 -1
@@ -450,7 +450,7 @@ static const struct nla_policy geneve_opt_policy[LWTUNNEL_IP_OPT_GENEVE_MAX + 1] = { [LWTUNNEL_IP_OPT_GENEVE_CLASS] = { .type = NLA_U16 }, [LWTUNNEL_IP_OPT_GENEVE_TYPE] = { .type = NLA_U8 }, - [LWTUNNEL_IP_OPT_GENEVE_DATA] = { .type = NLA_BINARY, .len = 128 }, + [LWTUNNEL_IP_OPT_GENEVE_DATA] = { .type = NLA_BINARY, .len = 127 }, }; static const struct nla_policy
net/netfilter/nft_tunnel.c +1 -1
@@ -333,7 +333,7 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr,static const struct nla_policy nft_tunnel_opts_geneve_policy[NFTA_TUNNEL_KEY_GENEVE_MAX +1 ] = { [NFTA_TUNNEL_KEY_GENEVE_CLASS ] = { .type =NLA_U16 }, [NFTA_TUNNEL_KEY_GENEVE_TYPE ] = { .type =NLA_U8 }, - [NFTA_TUNNEL_KEY_GENEVE_DATA ] = { .type =NLA_BINARY , .len =128 }, + [NFTA_TUNNEL_KEY_GENEVE_DATA ] = { .type =NLA_BINARY , .len =127 }, }; static int nft_tunnel_obj_geneve_init(const struct nlattr *attr,
net/sched/act_tunnel_key.c +1 -1
@@ -68,7 +68,7 @@ geneve_opt_policy[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX + 1] = { [TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS] = { .type = NLA_U16 }, [TCA_TUNNEL_KEY_ENC_OPT_GENEVE_TYPE] = { .type = NLA_U8 }, [TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA ] = { .type =NLA_BINARY , - .len = 128 }, + .len = 127 }, }; static const struct nla_policy
net/sched/cls_flower.c +1 -1
@@ -748,7 +748,7 @@ geneve_opt_policy[TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX + 1] = { [TCA_FLOWER_KEY_ENC_OPT_GENEVE_CLASS] = { .type = NLA_U16 }, [TCA_FLOWER_KEY_ENC_OPT_GENEVE_TYPE] = { .type = NLA_U8 }, [TCA_FLOWER_KEY_ENC_OPT_GENEVE_DATA ] = { .type =NLA_BINARY , - .len = 128 }, + .len = 127 }, }; static const struct nla_policy
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 218/268 ipv6: Start path selection from the first nexthop
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 4d0ab3a6885e3e9040310a8d8f54503366083626 ]
Cited commit transitioned IPv6 path selection to use hash-threshold instead of modulo-N. With hash-threshold, each nexthop is assigned a region boundary in the multipath hash function's output space and a nexthop is chosen if the calculated hash is smaller than the nexthop's region boundary.
Hash-threshold does not work correctly if path selection does not start with the first nexthop. For example, if fib6_select_path() is always passed the last nexthop in the group, then it will always be chosen because its region boundary covers the entire hash function's output space.
Fix this by starting the selection process from the first nexthop and do not consider nexthops for which rt6_score_route() provided a negative score.
--- net/ipv6/route.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
net/ipv6/route.c +35 -3
@@ -414,11 +414,35 @@ static bool rt6_check_expired(const struct rt6_info *rt)return false; } +static struct fib6_info * +rt6_multipath_first_sibling_rcu (const struct fib6_info *rt) +{ +struct fib6_info *iter; +struct fib6_node *fn; + + fn =rcu_dereference (rt->fib6_node); +if (!fn) + goto out; + iter =rcu_dereference (fn->leaf); +if (!iter) + goto out; + +while (iter) { +if (iter->fib6_metric == rt->fib6_metric && +rt6_qualify_for_ecmp (iter)) +return iter; + iter =rcu_dereference (iter->fib6_next); + } + +out: +return NULL ; +} +void fib6_select_path (const struct net *net,struct fib6_result *res,struct flowi6 *fl6,int oif,bool have_oif_match,const struct sk_buff *skb,int strict) { -struct fib6_info *match = res->f6i; +struct fib6_info *first, *match = res->f6i;struct fib6_info *sibling;if (!match->nh && (!match->fib6_nsiblings || have_oif_match))
@@ -442,10 +466,18 @@ void fib6_select_path(const struct net *net, struct fib6_result *res,return ; } -if (fl6->mp_hash <=atomic_read (&match->fib6_nh->fib_nh_upper_bound)) + first =rt6_multipath_first_sibling_rcu (match); +if (!first) goto out; -list_for_each_entry_rcu (sibling, &match->fib6_siblings, +if (fl6->mp_hash <=atomic_read (&first->fib6_nh->fib_nh_upper_bound) && +rt6_score_route (first->fib6_nh, first->fib6_flags, oif, + strict) >=0 ) { + match = first; + goto out; + } + +list_for_each_entry_rcu (sibling, &first->fib6_siblings, fib6_siblings) {const struct fib6_nh *nh = sibling->fib6_nh;int nh_upper_bound;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 219/268 ipv6: Do not consider link down nexthops in path selection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 8b8e0dd357165e0258d9f9cdab5366720ed2f619 ]
Nexthops whose link is down are not supposed to be considered during path selection when the "ignore_routes_with_linkdown" sysctl is set. This is done by assigning them a negative region boundary.
However, when comparing the computed hash (unsigned) with the region boundary (signed), the negative region boundary is treated as unsigned, resulting in incorrect nexthop selection.
Fix by treating the computed hash as signed. Note that the computed hash is always in range of [0, 2^31 - 1].
--- net/ipv6/route.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/ipv6/route.c +4 -2
@@ -444,6 +444,7 @@ void fib6_select_path(const struct net *net, struct fib6_result *res, {struct fib6_info *first, *match = res->f6i;struct fib6_info *sibling; +int hash;if (!match->nh && (!match->fib6_nsiblings || have_oif_match)) goto out;
@@ -470,7 +471,8 @@ void fib6_select_path(const struct net *net, struct fib6_result *res,if (!first) goto out; -if (fl6->mp_hash <=atomic_read (&first->fib6_nh->fib_nh_upper_bound) && + hash = fl6->mp_hash; +if (hash <=atomic_read (&first->fib6_nh->fib_nh_upper_bound) &&rt6_score_route (first->fib6_nh, first->fib6_flags, oif, strict) >=0 ) { match = first;
@@ -483,7 +485,7 @@ void fib6_select_path(const struct net *net, struct fib6_result *res,int nh_upper_bound; nh_upper_bound =atomic_read (&nh->fib_nh_upper_bound); -if (fl6->mp_hash > nh_upper_bound) +if (hash > nh_upper_bound)continue ;if (rt6_score_route (nh, sibling->fib6_flags, oif, strict) <0 )break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 220/268 arcnet: Add NULL check in com20020pci_probe()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Martin <[email protected]>
[ Upstream commit fda8c491db2a90ff3e6fbbae58e495b4ddddeca3 ]
devm_kasprintf() returns NULL when memory allocation fails. Currently, com20020pci_probe() does not check for this case, which results in a NULL pointer dereference.
Add NULL check after devm_kasprintf() to prevent this issue and ensure no resources are left allocated.
--- drivers/net/arcnet/com20020-pci.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/arcnet/com20020-pci.c +16 -1
@@ -250,18 +250,33 @@ static int com20020pci_probe(struct pci_dev *pdev, card->tx_led.default_trigger =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"arc%d-%d-tx" , dev->dev_id, i); +if (!card->tx_led.default_trigger) { + ret = -ENOMEM ; + goto err_free_arcdev; + } card->tx_led.name =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"pci:green:tx:%d-%d" , dev->dev_id, i); - +if (!card->tx_led.name) { + ret = -ENOMEM ; + goto err_free_arcdev; + } card->tx_led.dev = &dev->dev; card->recon_led.brightness_set = led_recon_set; card->recon_led.default_trigger =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"arc%d-%d-recon" , dev->dev_id, i); +if (!card->recon_led.default_trigger) { + ret = -ENOMEM ; + goto err_free_arcdev; + } card->recon_led.name =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"pci:red:recon:%d-%d" , dev->dev_id, i); +if (!card->recon_led.name) { + ret = -ENOMEM ; + goto err_free_arcdev; + } card->recon_led.dev = &dev->dev; ret =devm_led_classdev_register (&pdev->dev, &card->tx_led);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 221/268 net: ibmveth: make veth_pool_store stop hanging
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Marquardt <[email protected]>
[ Upstream commit 053f3ff67d7feefc75797863f3d84b47ad47086f ]
v2:
- Created a single error handling unlock and exit in veth_pool_store
- Greatly expanded commit message with previous explanatory-only text
Summary: Use rtnl_mutex to synchronize veth_pool_store with itself, ibmveth_close and ibmveth_open, preventing multiple calls in a row to napi_disable.
Background: Two (or more) threads could call veth_pool_store through writing to /sys/devices/vio/30000002/pool*/*. You can do this easily with a little shell script. This causes a hang.
I configured LOCKDEP, compiled ibmveth.c with DEBUG, and built a new kernel. I ran this test again and saw:
Setting pool0/active to 0
Setting pool1/active to 1
[ 73.911067][ T4365] ibmveth 30000002 eth0: close starting
Setting pool1/active to 1
Setting pool1/active to 0
[ 73.911367][ T4366] ibmveth 30000002 eth0: close starting
[ 73.916056][ T4365] ibmveth 30000002 eth0: close complete
[ 73.916064][ T4365] ibmveth 30000002 eth0: open starting
[ 110.808564][ T712] systemd-journald[712]: Sent WATCHDOG=1 notification.
[ 230.808495][ T712] systemd-journald[712]: Sent WATCHDOG=1 notification.
[ 243.683786][ T123] INFO: task stress.sh:4365 blocked for more than 122 seconds.
[ 243.683827][ T123] Not tainted 6.14.0-01103-g2df0c02dab82-dirty #8
[ 243.683833][ T123] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 243.683838][ T123] task:stress.sh state:D stack:28096 pid:4365 tgid:4365 ppid:4364 task_flags:0x400040 flags:0x00042000
[ 243.683852][ T123] Call Trace:
[ 243.683857][ T123] [c00000000c38f690] [0000000000000001] 0x1 (unreliable)
[ 243.683868][ T123] [c00000000c38f840] [c00000000001f908] __switch_to+0x318/0x4e0
[ 243.683878][ T123] [c00000000c38f8a0] [c000000001549a70] __schedule+0x500/0x12a0
[ 243.683888][ T123] [c00000000c38f9a0] [c00000000154a878] schedule+0x68/0x210
[ 243.683896][ T123] [c00000000c38f9d0] [c00000000154ac80] schedule_preempt_disabled+0x30/0x50
[ 243.683904][ T123] [c00000000c38fa00] [c00000000154dbb0] __mutex_lock+0x730/0x10f0
[ 243.683913][ T123] [c00000000c38fb10] [c000000001154d40] napi_enable+0x30/0x60
[ 243.683921][ T123] [c00000000c38fb40] [c000000000f4ae94] ibmveth_open+0x68/0x5dc
[ 243.683928][ T123] [c00000000c38fbe0] [c000000000f4aa20] veth_pool_store+0x220/0x270
[ 243.683936][ T123] [c00000000c38fc70] [c000000000826278] sysfs_kf_write+0x68/0xb0
[ 243.683944][ T123] [c00000000c38fcb0] [c0000000008240b8] kernfs_fop_write_iter+0x198/0x2d0
[ 243.683951][ T123] [c00000000c38fd00] [c00000000071b9ac] vfs_write+0x34c/0x650
[ 243.683958][ T123] [c00000000c38fdc0] [c00000000071bea8] ksys_write+0x88/0x150
[ 243.683966][ T123] [c00000000c38fe10] [c0000000000317f4] system_call_exception+0x124/0x340
[ 243.683973][ T123] [c00000000c38fe50] [c00000000000d05c] system_call_vectored_common+0x15c/0x2ec
...
[ 243.684087][ T123] Showing all locks held in the system:
[ 243.684095][ T123] 1 lock held by khungtaskd/123:
[ 243.684099][ T123] #0: c00000000278e370 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x50/0x248
[ 243.684114][ T123] 4 locks held by stress.sh/4365:
[ 243.684119][ T123] #0: c00000003a4cd3f8 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x88/0x150
[ 243.684132][ T123] #1: c000000041aea888 (&of->mutex#2){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x154/0x2d0
[ 243.684143][ T123] #2: c0000000366fb9a8 (kn->active#64){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x160/0x2d0
[ 243.684155][ T123] #3: c000000035ff4cb8 (&dev->lock){+.+.}-{3:3}, at: napi_enable+0x30/0x60
[ 243.684166][ T123] 5 locks held by stress.sh/4366:
[ 243.684170][ T123] #0: c00000003a4cd3f8 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x88/0x150
[ 243.684183][ T123] #1: c00000000aee2288 (&of->mutex#2){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x154/0x2d0
[ 243.684194][ T123] #2: c0000000366f4ba8 (kn->active#64){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x160/0x2d0
[ 243.684205][ T123] #3: c000000035ff4cb8 (&dev->lock){+.+.}-{3:3}, at: napi_disable+0x30/0x60
[ 243.684216][ T123] #4: c0000003ff9bbf18 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x138/0x12a0Quoted 1 line
From the ibmveth debug, two threads are calling
veth_pool_store, which
calls ibmveth_close and ibmveth_open. Here's the sequence:
T4365 T4366
----------------- ----------------- ---------
veth_pool_store veth_pool_store
ibmveth_close
ibmveth_close
napi_disable
napi_disable
ibmveth_open
napi_enable <- HANG
ibmveth_close calls napi_disable at the top and ibmveth_open calls napi_enable at the top.
https://docs.kernel.org/networking/napi.html]] says
The control APIs are not idempotent. Control API calls are safe against concurrent use of datapath APIs but an incorrect sequence of control API calls may result in crashes, deadlocks, or race conditions. For example, calling napi_disable() multiple times in a row will deadlock.
In the normal open and close paths, rtnl_mutex is acquired to prevent other callers. This is missing from veth_pool_store. Use rtnl_mutex in veth_pool_store fixes these hangs.
--- drivers/net/ethernet/ibm/ibmveth.c | 39 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-)
drivers/net/ethernet/ibm/ibmveth.c +27 -12
@@ -1824,18 +1824,22 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,long value =simple_strtol (buf,NULL ,10 );long rc; +rtnl_lock (); +if (attr == &veth_active_attr) {if (value && !pool->active) {if (netif_running (netdev)) {if (ibmveth_alloc_buffer_pool (pool)) {netdev_err (netdev,"unable to alloc pool\n" ); -return -ENOMEM ; + rc = -ENOMEM ; + goto unlock_err; } pool->active =1 ;ibmveth_close (netdev); -if ((rc =ibmveth_open (netdev))) -return rc; + rc =ibmveth_open (netdev); +if (rc) + goto unlock_err; }else { pool->active =1 ; }
@@ -1855,48 +1859,59 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,if (i ==IBMVETH_NUM_BUFF_POOLS ) {netdev_err (netdev,"no active pool >= MTU\n" ); -return -EPERM ; + rc = -EPERM ; + goto unlock_err; }if (netif_running (netdev)) {ibmveth_close (netdev); pool->active =0 ; -if ((rc =ibmveth_open (netdev))) -return rc; + rc =ibmveth_open (netdev); +if (rc) + goto unlock_err; } pool->active =0 ; } }else if (attr == &veth_num_attr) {if (value <=0 || value >IBMVETH_MAX_POOL_COUNT ) { -return -EINVAL ; + rc = -EINVAL ; + goto unlock_err; }else {if (netif_running (netdev)) {ibmveth_close (netdev); pool->size = value; -if ((rc =ibmveth_open (netdev))) -return rc; + rc =ibmveth_open (netdev); +if (rc) + goto unlock_err; }else { pool->size = value; } } }else if (attr == &veth_size_attr) {if (value <=IBMVETH_BUFF_OH || value >IBMVETH_MAX_BUF_SIZE ) { -return -EINVAL ; + rc = -EINVAL ; + goto unlock_err; }else {if (netif_running (netdev)) {ibmveth_close (netdev); pool->buff_size = value; -if ((rc =ibmveth_open (netdev))) -return rc; + rc =ibmveth_open (netdev); +if (rc) + goto unlock_err; }else { pool->buff_size = value; } } } +rtnl_unlock ();/* kick the interrupt handler to allocate/deallocate pools */ ibmveth_interrupt (netdev->irq, netdev);return count; + +unlock_err: +rtnl_unlock (); +return rc; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 222/268 drm/amdgpu/gfx11: fix num_mec
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 4161050d47e1b083a7e1b0b875c9907e1a6f1f1f ]
GC11 only has 1 mec.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -1318,7 +1318,7 @@ static int gfx_v11_0_sw_init(void *handle) adev->gfx.me.num_me =1 ; adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =1 ; - adev->gfx.mec.num_mec =2 ; + adev->gfx.mec.num_mec =1 ; adev->gfx.mec.num_pipe_per_mec =4 ; adev->gfx.mec.num_queue_per_pipe =4 ;break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 223/268 perf/core: Fix child_total_time_enabled accounting bug at task exit
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yeoreum Yun <[email protected]>
[ Upstream commit a3c3c66670cee11eb13aa43905904bf29cb92d32 ]
The perf events code fails to account for total_time_enabled of inactive events.
Here is a failure case for accounting total_time_enabled for CPU PMU events:
sudo ./perf stat -vvv -e armv8_pmuv3_0/event=0x08/ -e armv8_pmuv3_1/event=0x08/ -- stress-ng --pthread=2 -t 2s ...
armv8_pmuv3_0/event=0x08/: 1138698008 2289429840 2174835740 armv8_pmuv3_1/event=0x08/: 1826791390 1950025700 847648440
` ` `
` ` > total_time_running with child
` > total_time_enabled with child> count with child
Performance counter stats for 'stress-ng --pthread=2 -t 2s':
1,138,698,008 armv8_pmuv3_0/event=0x08/ (94.99%)
1,826,791,390 armv8_pmuv3_1/event=0x08/ (43.47%)The two events above are opened on two different CPU PMUs, for example, each event is opened for a cluster in an Arm big.LITTLE system, they will never run on the same CPU. In theory, the total enabled time should be same for both events, as two events are opened and closed together.
As the result show, the two events' total enabled time including child event is different (2289429840 vs 1950025700).
This is because child events are not accounted properly if a event is INACTIVE state when the task exits:
perf_event_exit_event()
`> perf_remove_from_context()
`> __perf_remove_from_context()
`> perf_child_detach() -> Accumulate child_total_time_enabled
`> list_del_event() -> Update child event's timeThe problem is the time accumulation happens prior to child event's time updating. Thus, it misses to account the last period's time when the event exits.
The perf core layer follows the rule that timekeeping is tied to state change. To address the issue, make __perf_remove_from_context() handle the task exit case by passing 'DETACH_EXIT' to it and invoke perf_event_state() for state alongside with accounting the time.
Then, perf_child_detach() populates the time into the parent's time metrics.
After this patch, the bug is fixed:
sudo ./perf stat -vvv -e armv8_pmuv3_0/event=0x08/ -e armv8_pmuv3_1/event=0x08/ -- stress-ng --pthread=2 -t 10s ... armv8_pmuv3_0/event=0x08/: 15396770398 32157963940 21898169000 armv8_pmuv3_1/event=0x08/: 22428964974 32157963940 10259794940
Performance counter stats for 'stress-ng --pthread=2 -t 10s':
15,396,770,398 armv8_pmuv3_0/event=0x08/ (68.10%)
22,428,964,974 armv8_pmuv3_1/event=0x08/ (31.90%)[ mingo: Clarified the changelog. ]
--- kernel/events/core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
kernel/events/core.c +9 -9
@@ -2333,6 +2333,7 @@ group_sched_out(struct perf_event *group_event, struct perf_event_context *ctx)#define DETACH_GROUP 0x01UL#define DETACH_CHILD 0x02UL#define DETACH_DEAD 0x04UL +#define DETACH_EXIT 0x08UL/* * Cross CPU call to remove a performance event
@@ -2347,6 +2348,7 @@ __perf_remove_from_context(struct perf_event *event, void *info) {struct perf_event_pmu_context *pmu_ctx = event->pmu_ctx; +enum perf_event_state state =PERF_EVENT_STATE_OFF ;unsigned long flags = (unsigned long )info;if (ctx->is_active &EVENT_TIME ) {
@@ -2358,16 +2360,19 @@ __perf_remove_from_context(struct perf_event *event,* Ensure event_sched_out() switches to OFF, at the very least * this avoids raising perf_pending_task() at this time. */ -if (flags &DETACH_DEAD ) +if (flags &DETACH_EXIT ) + state =PERF_EVENT_STATE_EXIT ; +if (flags &DETACH_DEAD ) { event->pending_disable =1 ; + state =PERF_EVENT_STATE_DEAD ; + }event_sched_out (event, ctx); +perf_event_set_state (event,min (event->state, state));if (flags &DETACH_GROUP )perf_group_detach (event);if (flags &DETACH_CHILD )perf_child_detach (event);list_del_event (event, ctx); -if (flags &DETACH_DEAD ) - event->state =PERF_EVENT_STATE_DEAD ;if (!pmu_ctx->nr_events) { pmu_ctx->rotate_necessary =0 ;
@@ -13140,12 +13145,7 @@ perf_event_exit_event(struct perf_event *event, struct perf_event_context *ctx)mutex_lock (&parent_event->child_mutex); } -perf_remove_from_context (event, detach_flags); - -raw_spin_lock_irq (&ctx->lock); -if (event->state >PERF_EVENT_STATE_EXIT ) -perf_event_set_state (event,PERF_EVENT_STATE_EXIT ); -raw_spin_unlock_irq (&ctx->lock); +perf_remove_from_context (event, detach_flags |DETACH_EXIT );/* * Child events can be freed.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 224/268 tracing: Allow creating instances with specified system events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (Google) <[email protected]>
[ Upstream commit d23569979ca1cd139a42c410e0c7b9e6014c3b3a ]
A trace instance may only need to enable specific events. As the eventfs directory of an instance currently creates all events which adds overhead, allow internal instances to be created with just the events in systems that they care about. This currently only deals with systems and not individual events, but this should bring down the overhead of creating instances for specific use cases quite bit.
The trace_array_get_by_name() now has another parameter "systems". This parameter is a const string pointer of a comma/space separated list of event systems that should be created by the trace_array. (Note if the trace_array already exists, this parameter is ignored).
The list of systems is saved and if a module is loaded, its events will not be added unless the system for those events also match the systems string.
Stable-dep-of: 0b4ffbe4888a ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
--- drivers/scsi/qla2xxx/qla_os.c | 2 +- include/linux/trace.h | 4 +-- kernel/trace/trace.c | 23 +++++++++++--- kernel/trace/trace.h | 1 + kernel/trace/trace_boot.c | 2 +- kernel/trace/trace_events.c | 48 +++++++++++++++++++++++++++-- samples/ftrace/sample-trace-array.c | 2 +- 7 files changed, 70 insertions(+), 12 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -2883,7 +2883,7 @@ static void qla2x00_iocb_work_fn(struct work_struct *work)static void qla_trace_init (void ) { - qla_trc_array =trace_array_get_by_name ("qla2xxx" ); + qla_trc_array =trace_array_get_by_name ("qla2xxx" ,NULL );if (!qla_trc_array) {ql_log (ql_log_fatal,NULL ,0x0001 ,"Unable to create qla2xxx trace instance, instance logging will be disabled.\n" );
include/linux/trace.h +2 -2
@@ -51,7 +51,7 @@ int trace_array_printk(struct trace_array *tr, unsigned long ip, const char *fmt, ...);int trace_array_init_printk (struct trace_array *tr);void trace_array_put (struct trace_array *tr); -struct trace_array *trace_array_get_by_name (const char *name); +struct trace_array *trace_array_get_by_name (const char *name,const char *systems);int trace_array_destroy (struct trace_array *tr);/* For osnoise tracer */
@@ -84,7 +84,7 @@ static inline int trace_array_init_printk(struct trace_array *tr)static inline void trace_array_put (struct trace_array *tr) { } -static inline struct trace_array *trace_array_get_by_name (const char *name) +static inline struct trace_array *trace_array_get_by_name (const char *name,const char *systems) {return NULL ; }
kernel/trace/trace.c +19 -4
@@ -9417,7 +9417,8 @@ static int trace_array_create_dir(struct trace_array *tr)return ret; } -static struct trace_array *trace_array_create (const char *name) +static struct trace_array * +trace_array_create_systems (const char *name,const char *systems) {struct trace_array *tr;int ret;
@@ -9437,6 +9438,12 @@ static struct trace_array *trace_array_create(const char *name)if (!zalloc_cpumask_var (&tr->pipe_cpumask,GFP_KERNEL )) goto out_free_tr; +if (systems) { + tr->system_names =kstrdup_const (systems,GFP_KERNEL ); +if (!tr->system_names) + goto out_free_tr; + } + tr->trace_flags = global_trace.trace_flags & ~ZEROED_TRACE_FLAGS ;cpumask_copy (tr->tracing_cpumask, cpu_all_mask);
@@ -9480,12 +9487,18 @@ static struct trace_array *trace_array_create(const char *name)free_trace_buffers (tr);free_cpumask_var (tr->pipe_cpumask);free_cpumask_var (tr->tracing_cpumask); +kfree_const (tr->system_names);kfree (tr->name);kfree (tr);return ERR_PTR (ret); } +static struct trace_array *trace_array_create (const char *name) +{ +return trace_array_create_systems (name,NULL ); +} +static int instance_mkdir (const char *name) {struct trace_array *tr;
@@ -9511,6 +9524,7 @@ static int instance_mkdir(const char *name)/** * trace_array_get_by_name - Create/Lookup a trace array, given its name. * @name: The name of the trace array to be looked up/created. +* @systems: A list of systems to create event directories for (NULL for all) * * Returns pointer to trace array with given name. * NULL, if it cannot be created.
@@ -9524,7 +9538,7 @@ static int instance_mkdir(const char *name)* trace_array_put() is called, user space can not delete it. * */ -struct trace_array *trace_array_get_by_name (const char *name) +struct trace_array *trace_array_get_by_name (const char *name,const char *systems) {struct trace_array *tr;
@@ -9536,7 +9550,7 @@ struct trace_array *trace_array_get_by_name(const char *name) goto out_unlock; } - tr =trace_array_create (name); + tr =trace_array_create_systems (name, systems);if (IS_ERR (tr)) tr =NULL ;
@@ -9583,6 +9597,7 @@ static int __remove_instance(struct trace_array *tr)free_cpumask_var (tr->pipe_cpumask);free_cpumask_var (tr->tracing_cpumask); +kfree_const (tr->system_names);kfree (tr->name);kfree (tr);
@@ -10301,7 +10316,7 @@ __init static void enable_instances(void)if (IS_ENABLED (CONFIG_TRACER_MAX_TRACE ))do_allocate_snapshot (tok); - tr =trace_array_get_by_name (tok); + tr =trace_array_get_by_name (tok,NULL );if (!tr) {pr_warn ("Failed to create instance buffer %s\n" , curr_str);continue ;
kernel/trace/trace.h +1 -0
@@ -377,6 +377,7 @@ struct trace_array {unsigned char trace_flags_index[TRACE_FLAGS_MAX_SIZE ];unsigned int flags;raw_spinlock_t start_lock; +const char *system_names;struct list_head err_log;struct dentry *dir;struct dentry *options;
kernel/trace/trace_boot.c +1 -1
@@ -633,7 +633,7 @@ trace_boot_init_instances(struct xbc_node *node)if (!p || *p =='\0' )continue ; - tr =trace_array_get_by_name (p); + tr =trace_array_get_by_name (p,NULL );if (!tr) {pr_err ("Failed to get trace instance %s\n" , p);continue ;
kernel/trace/trace_events.c +45 -3
76 lines not on this page · raw message
samples/ftrace/sample-trace-array.c +1 -1
@@ -105,7 +105,7 @@ static int __init sample_trace_array_init(void)* NOTE: This function increments the reference counter * associated with the trace array - "tr". */ - tr =trace_array_get_by_name ("sample-instance" ); + tr =trace_array_get_by_name ("sample-instance" ,"sched,timer,kprobes" );if (!tr)return -1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 225/268 tracing: Switch trace_events_hist.c code over to use guard()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
[ Upstream commit 2b36a97aeeb71b1e4a48bfedc7f21f44aeb1e6fb ]
There are a couple functions in trace_events_hist.c that have "goto out" or equivalent on error in order to release locks that were taken. This can be error prone or just simply make the code more complex.
Switch every location that ends with unlocking a mutex on error over to using the guard(mutex)() infrastructure to let the compiler worry about releasing locks. This makes the code easier to read and understand.
Stable-dep-of: 0b4ffbe4888a ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
--- kernel/trace/trace_events_hist.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-)
kernel/trace/trace_events_hist.c +10 -22
@@ -5605,25 +5605,19 @@ static int hist_show(struct seq_file *m, void *v) {struct event_trigger_data *data;struct trace_event_file *event_file; -int n =0 , ret =0 ; +int n =0 ; -mutex_lock (&event_mutex); +guard (mutex)(&event_mutex); event_file =event_file_file (m->private); -if (unlikely (!event_file)) { - ret = -ENODEV ; - goto out_unlock; - } +if (unlikely (!event_file)) +return -ENODEV ;list_for_each_entry (data, &event_file->triggers, list) {if (data->cmd_ops->trigger_type ==ETT_EVENT_HIST )hist_trigger_show (m, data, n++); } - - out_unlock: -mutex_unlock (&event_mutex); - -return ret; +return 0 ; }static int event_hist_open (struct inode *inode,struct file *file)
@@ -5884,25 +5878,19 @@ static int hist_debug_show(struct seq_file *m, void *v) {struct event_trigger_data *data;struct trace_event_file *event_file; -int n =0 , ret =0 ; +int n =0 ; -mutex_lock (&event_mutex); +guard (mutex)(&event_mutex); event_file =event_file_file (m->private); -if (unlikely (!event_file)) { - ret = -ENODEV ; - goto out_unlock; - } +if (unlikely (!event_file)) +return -ENODEV ;list_for_each_entry (data, &event_file->triggers, list) {if (data->cmd_ops->trigger_type ==ETT_EVENT_HIST )hist_trigger_debug_show (m, data, n++); } - - out_unlock: -mutex_unlock (&event_mutex); - -return ret; +return 0 ; }static int event_hist_debug_open (struct inode *inode,struct file *file)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 226/268 tracing/hist: Add poll(POLLIN) support on hist file
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
[ Upstream commit 1bd13edbbed6e7e396f1aab92b224a4775218e68 ]
Add poll syscall support on the hist file. The Waiter will be waken up when the histogram is updated with POLLIN.
Currently, there is no way to wait for a specific event in userspace. So user needs to peek the trace periodicaly, or wait on trace_pipe. But it is not a good idea to peek at the trace for an event that randomly happens. And trace_pipe is not coming back until a page is filled with events.
This allows a user to wait for a specific event on the hist file. User can set a histogram trigger on the event which they want to monitor and poll() on its hist file. Since this poll() returns POLLIN, the next poll() will return soon unless a read() happens on that hist file.
NOTE: To read the hist file again, you must set the file offset to 0, but just for monitoring the event, you may not need to read the histogram.
Stable-dep-of: 0b4ffbe4888a ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
--- include/linux/trace_events.h | 14 +++++++ kernel/trace/trace_events.c | 14 +++++++ kernel/trace/trace_events_hist.c | 70 ++++++++++++++++++++++++++++++-- 3 files changed, 95 insertions(+), 3 deletions(-)
include/linux/trace_events.h +14 -0
@@ -683,6 +683,20 @@ struct trace_event_file {atomic_t tm_ref;/* trigger-mode reference counter */ }; +#ifdef CONFIG_HIST_TRIGGERS +extern struct irq_work hist_poll_work; +extern wait_queue_head_t hist_poll_wq; + +static inline void hist_poll_wakeup (void ) +{ +if (wq_has_sleeper (&hist_poll_wq)) +irq_work_queue (&hist_poll_work); +} + +#define hist_poll_wait (file, wait) \ + poll_wait(file, &hist_poll_wq, wait) +#endif +#define __TRACE_EVENT_FLAGS (name, value) \ static int __init trace_init_flags_##name(void) \ { \
kernel/trace/trace_events.c +14 -0
@@ -3077,6 +3077,20 @@ static bool event_in_systems(struct trace_event_call *call,return !*p ||isspace (*p) || *p ==',' ; } +#ifdef CONFIG_HIST_TRIGGERS +/* +* Wake up waiter on the hist_poll_wq from irq_work because the hist trigger +* may happen in any context. +*/ +static void hist_poll_event_irq_work (struct irq_work *work) +{ +wake_up_all (&hist_poll_wq); +} + +DEFINE_IRQ_WORK (hist_poll_work, hist_poll_event_irq_work); +DECLARE_WAIT_QUEUE_HEAD (hist_poll_wq); +#endif +static struct trace_event_file *trace_create_new_event (struct trace_event_call *call,struct trace_array *tr)
kernel/trace/trace_events_hist.c +67 -3
115 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 227/268 tracing/hist: Support POLLPRI event for poll on histogram
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
[ Upstream commit 66fc6f521a0b91051ce6968a216a30bc52267bf8 ]
Since POLLIN will not be flushed until the hist file is read, the user needs to repeatedly read() and poll() on the hist file for monitoring the event continuously. But the read() is somewhat redundant when the user is only monitoring for event updates.
Add POLLPRI poll event on the hist file so the event returns when a histogram is updated after open(), poll() or read(). Thus it is possible to wait for the next event without having to issue a read().
Stable-dep-of: 0b4ffbe4888a ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
--- kernel/trace/trace_events_hist.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-)
kernel/trace/trace_events_hist.c +26 -3
@@ -5606,6 +5606,7 @@ static void hist_trigger_show(struct seq_file *m,struct hist_file_data {struct file *file;u64 last_read; +u64 last_act; };static u64 get_hist_hit_count (struct trace_event_file *event_file)
@@ -5641,6 +5642,11 @@ static int hist_show(struct seq_file *m, void *v)hist_trigger_show (m, data, n++); } hist_file->last_read =get_hist_hit_count (event_file); +/* +* Update last_act too so that poll()/POLLPRI can wait for the next +* event after any syscall on hist file. +*/ + hist_file->last_act = hist_file->last_read;return 0 ; }
@@ -5650,6 +5656,8 @@ static __poll_t event_hist_poll(struct file *file, struct poll_table_struct *waistruct trace_event_file *event_file;struct seq_file *m = file->private_data;struct hist_file_data *hist_file = m->private; +__poll_t ret =0 ; +u64 cnt;guard (mutex)(&event_mutex);
@@ -5659,10 +5667,15 @@ static __poll_t event_hist_poll(struct file *file, struct poll_table_struct *waihist_poll_wait (file, wait); -if (hist_file->last_read !=get_hist_hit_count (event_file)) -return EPOLLIN |EPOLLRDNORM ; + cnt =get_hist_hit_count (event_file); +if (hist_file->last_read != cnt) + ret |=EPOLLIN |EPOLLRDNORM ; +if (hist_file->last_act != cnt) { + hist_file->last_act = cnt; + ret |=EPOLLPRI ; + } -return 0 ; +return ret; }static int event_hist_release (struct inode *inode,struct file *file)
@@ -5676,6 +5689,7 @@ static int event_hist_release(struct inode *inode, struct file *file)static int event_hist_open (struct inode *inode,struct file *file) { +struct trace_event_file *event_file;struct hist_file_data *hist_file;int ret;
@@ -5683,16 +5697,25 @@ static int event_hist_open(struct inode *inode, struct file *file)if (ret)return ret; +guard (mutex)(&event_mutex); + + event_file =event_file_data (file); +if (!event_file) +return -ENODEV ; + hist_file =kzalloc (sizeof (*hist_file),GFP_KERNEL );if (!hist_file)return -ENOMEM ; + hist_file->file = file; + hist_file->last_act =get_hist_hit_count (event_file);/* Clear private_data to avoid warning in single_open() */ file->private_data =NULL ; ret =single_open (file, hist_show, hist_file);if (ret)kfree (hist_file); +return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 228/268 tracing: Correct the refcount if the hist/hist_debug file fails to open
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tengda Wu <[email protected]>
[ Upstream commit 0b4ffbe4888a2c71185eaf5c1a02dd3586a9bc04 ]
The function event_{hist,hist_debug}_open() maintains the refcount of 'file->tr' and 'file' through tracing_open_file_tr(). However, it does not roll back these counts on subsequent failure paths, resulting in a refcount leak.
A very obvious case is that if the hist/hist_debug file belongs to a specific instance, the refcount leak will prevent the deletion of that instance, as it relies on the condition 'tr->ref == 1' within __remove_instance().
Fix this by calling tracing_release_file_tr() on all failure paths in event_{hist,hist_debug}_open() to correct the refcount.
--- kernel/trace/trace_events_hist.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
kernel/trace/trace_events_hist.c +18 -6
@@ -5700,12 +5700,16 @@ static int event_hist_open(struct inode *inode, struct file *file)guard (mutex)(&event_mutex); event_file =event_file_data (file); -if (!event_file) -return -ENODEV ; +if (!event_file) { + ret = -ENODEV ; + goto err; + } hist_file =kzalloc (sizeof (*hist_file),GFP_KERNEL ); -if (!hist_file) -return -ENOMEM ; +if (!hist_file) { + ret = -ENOMEM ; + goto err; + } hist_file->file = file; hist_file->last_act =get_hist_hit_count (event_file);
@@ -5713,9 +5717,14 @@ static int event_hist_open(struct inode *inode, struct file *file)/* Clear private_data to avoid warning in single_open() */ file->private_data =NULL ; ret =single_open (file, hist_show, hist_file); -if (ret) +if (ret) {kfree (hist_file); + goto err; + } +return 0 ; +err: +tracing_release_file_tr (inode, file);return ret; }
@@ -5990,7 +5999,10 @@ static int event_hist_debug_open(struct inode *inode, struct file *file)/* Clear private_data to avoid warning in single_open() */ file->private_data =NULL ; -return single_open (file, hist_debug_show, file); + ret =single_open (file, hist_debug_show, file); +if (ret) +tracing_release_file_tr (inode, file); +return ret; }const struct file_operations event_hist_debug_fops = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 229/268 drm/amd/display: Check link_index before accessing dc->links[]
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Hung <[email protected]>
commit 8aa2864044b9d13e95fe224f32e808afbf79ecdf upstream.
[WHY & HOW]
dc->links[] has max size of MAX_LINKS and NULL is return when trying to access with out-of-bound index.
This fixes 3 OVERRUN and 1 RESOURCE_LEAK issues reported by Coverity.
[The macro MAX_LINKS is introduced by Commit 60df5628144b ("drm/amd/display:
handle invalid connector indices") after 6.10. So here we still use the original array length MAX_PIPES * 2]
--- drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +3 -0
@@ -37,6 +37,9 @@#include "dce/dce_i2c.h" struct dc_link *dc_get_link_at_index (struct dc *dc,uint32_t link_index) { +if (link_index >= (MAX_PIPES *2 )) +return NULL ; +return dc->links[link_index]; }
Greg Kroah-Hartman
maintainerPATCH 230/268 usbnet:fix NPE during rx_complete
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ying Lu <[email protected]>
commit 51de3600093429e3b712e5f091d767babc5dd6df upstream.
Missing usbnet_going_away Check in Critical Path. The usb_submit_urb function lacks a usbnet_going_away validation, whereas __usbnet_queue_skb includes this check.
This inconsistency creates a race condition where:
A URB request may succeed, but the corresponding SKB data fails to be queued.
Subsequent processes:
(e.g., rx_complete → defer_bh → __skb_unlink(skb, list)) attempt to access skb->next, triggering a NULL pointer dereference (Kernel Panic).
--- drivers/net/usb/usbnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/usb/usbnet.c +3 -3
@@ -530,7 +530,8 @@ static int rx_submit (struct usbnet *devnetif_device_present (dev->net) &&test_bit (EVENT_DEV_OPEN , &dev->flags) && !test_bit (EVENT_RX_HALT , &dev->flags) && - !test_bit (EVENT_DEV_ASLEEP, &dev->flags)) { + !test_bit (EVENT_DEV_ASLEEP , &dev->flags) && + !usbnet_going_away(dev)) { switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) {case -EPIPE :usbnet_defer_kevent (dev,EVENT_RX_HALT );
@@ -551,8 +552,7 @@ static int rx_submit (struct usbnet *devtasklet_schedule (&dev->bh);break ;case 0 : -if (!usbnet_going_away (dev)) -__usbnet_queue_skb (&dev->rxq, skb, rx_start); +__usbnet_queue_skb (&dev->rxq, skb, rx_start); } }else {netif_dbg (dev, ifdown, dev->net,"rx: stopped\n" );
Greg Kroah-Hartman
maintainerPATCH 231/268 LoongArch: Increase ARCH_DMA_MINALIGN up to 16
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit 4103cfe9dcb88010ae4911d3ff417457d1b6a720 upstream.
ARCH_DMA_MINALIGN is 1 by default, but some LoongArch-specific devices (such as APBDMA) require 16 bytes alignment. When the data buffer length is too small, the hardware may make an error writing cacheline. Thus, it is dangerous to allocate a small memory buffer for DMA. It's always safe to define ARCH_DMA_MINALIGN as L1_CACHE_BYTES but unnecessary (kmalloc() need small memory objects). Therefore, just increase it to 16.
--- arch/loongarch/include/asm/cache.h | 2 ++ 1 file changed, 2 insertions(+)
arch/loongarch/include/asm/cache.h +2 -0
@@ -8,6 +8,8 @@#define L1_CACHE_SHIFT CONFIG_L1_CACHE_SHIFT#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) +#define ARCH_DMA_MINALIGN (16) +#define __read_mostly __section(".data..read_mostly")#endif /* _ASM_CACHE_H */
Greg Kroah-Hartman
maintainerPATCH 232/268 LoongArch: BPF: Fix off-by-one error in build_prologue()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengqi Chen <[email protected]>
commit 7e2586991e36663c9bc48c828b83eab180ad30a9 upstream.
Vincent reported that running BPF progs with tailcalls on LoongArch causes kernel hard lockup. Debugging the issues shows that the JITed image missing a jirl instruction at the end of the epilogue.
There are two passes in JIT compiling, the first pass set the flags and the second pass generates JIT code based on those flags. With BPF progs mixing bpf2bpf and tailcalls, build_prologue() generates N insns in the first pass and then generates N+1 insns in the second pass. This makes epilogue_offset off by one and we will jump to some unexpected insn and cause lockup. Fix this by inserting a nop insn.
--- arch/loongarch/net/bpf_jit.c | 2 ++ arch/loongarch/net/bpf_jit.h | 5 +++++ 2 files changed, 7 insertions(+)
arch/loongarch/net/bpf_jit.c +2 -0
@@ -142,6 +142,8 @@ static void build_prologue(struct jit_ct*/ if (seen_tail_call (ctx) &&seen_call (ctx))move_reg (ctx,TCC_SAVED ,REG_TCC ); +else +emit_insn (ctx, nop); ctx->stack_size = stack_adjust; }
arch/loongarch/net/bpf_jit.h +5 -0
@@ -27,6 +27,11 @@ struct jit_data {struct jit_ctx ctx; }; +static inline void emit_nop (union loongarch_instruction *insn) +{ + insn->word =INSN_NOP ; +} +#define emit_insn (ctx, func, ...) \ do { \ if (ctx->image != NULL) { \
Greg Kroah-Hartman
maintainerPATCH 233/268 LoongArch: BPF: Dont override subprogs return value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengqi Chen <[email protected]>
commit 60f3caff1492e5b8616b9578c4bedb5c0a88ed14 upstream.
The verifier test calls: div by 0 in subprog triggers a panic at the ld.bu instruction. The ld.bu insn is trying to load byte from memory address returned by the subprog. The subprog actually set the correct address at the a5 register (dedicated register for BPF return values). But at commit 73c359d1d356 ("LoongArch: BPF: Sign-extend return values") we also sign extended a5 to the a0 register (return value in LoongArch). For function call insn, we later propagate the a0 register back to a5 register. This is right for native calls but wrong for bpf2bpf calls which expect zero-extended return value in a5 register. So only move a0 to a5 for native calls (i.e. non-BPF_PSEUDO_CALL).
--- arch/loongarch/net/bpf_jit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/loongarch/net/bpf_jit.c +4 -1
@@ -844,7 +844,10 @@ static int build_insn(const struct bpf_imove_addr (ctx, t1, func_addr);emit_insn (ctx, jirl,LOONGARCH_GPR_RA , t1,0 ); -move_reg (ctx, regmap[BPF_REG_0 ],LOONGARCH_GPR_A0 ); + +if (insn->src_reg !=BPF_PSEUDO_CALL ) +move_reg (ctx, regmap[BPF_REG_0 ],LOONGARCH_GPR_A0 ); +break ;/* tail call */
Greg Kroah-Hartman
maintainerPATCH 234/268 LoongArch: BPF: Use move_addr() for BPF_PSEUDO_FUNC
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengqi Chen <[email protected]>
commit 52266f1015a8b5aabec7d127f83d105f702b388e upstream.
Vincent reported that running XDP synproxy program on LoongArch results in the following error:
JIT doesn't support bpf-to-bpf calls
With dmesg:
multi-func JIT bug 1391 != 1390
The root cause is that verifier will refill the imm with the correct addresses of bpf_calls for BPF_PSEUDO_FUNC instructions and then run the last pass of JIT. So we generate different JIT code for the same instruction in two passes (one for placeholder and the other for the real address). Let's use move_addr() instead.
See commit 64f50f6575721ef0 ("LoongArch, bpf: Use 4 instructions for function address in JIT") for a similar fix.
--- arch/loongarch/net/bpf_jit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/loongarch/net/bpf_jit.c +4 -1
@@ -872,7 +872,10 @@ static int build_insn(const struct bpf_i {const u64 imm64 = (u64)(insn +1 )->imm <<32 | (u32 )insn->imm; -move_imm (ctx, dst, imm64, is32); +if (bpf_pseudo_func (insn)) +move_addr (ctx, dst, imm64); +else +move_imm (ctx, dst, imm64, is32);return 1 ; }
Greg Kroah-Hartman
maintainerPATCH 235/268 x86/hyperv: Fix check of return value from snp_set_vmsa()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianyu Lan <[email protected]>
commit e792d843aa3c9d039074cdce728d5803262e57a7 upstream.
snp_set_vmsa() returns 0 as success result and so fix it.
Message-ID: <[email protected]>
--- arch/x86/hyperv/ivm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/hyperv/ivm.c +1 -1
@@ -338,7 +338,7 @@ int hv_snp_boot_ap(int cpu, unsigned lon vmsa->sev_features = sev_status >>2 ; ret =snp_set_vmsa (vmsa, true); -if (!ret) { +if (ret) {pr_err ("RMPADJUST(%llx) failed: %llx\n" , (u64 )vmsa, ret);free_page ((u64 )vmsa);return ret;
Greg Kroah-Hartman
maintainerPATCH 236/268 x86/microcode/AMD: Fix __apply_microcode_amd()s return value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <[email protected]>
commit 31ab12df723543047c3fc19cb8f8c4498ec6267f upstream.
When verify_sha256_digest() fails, __apply_microcode_amd() should propagate the failure by returning false (and not -1 which is promoted to true).
--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -603,7 +603,7 @@ static bool __apply_microcode_amd(structunsigned long p_addr = (unsigned long )&mc->hdr.data_code;if (!verify_sha256_digest (mc->hdr.patch_id, *cur_rev, (const u8 *)p_addr, psize)) -return -1 ; +return false;native_wrmsrl (MSR_AMD64_PATCH_LOADER , p_addr);
Greg Kroah-Hartman
maintainerPATCH 237/268 ACPI: x86: Extend Lenovo Yoga Tab 3 quirk with skip GPIO event-handlers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 2fa87c71d2adb4b82c105f9191e6120340feff00 upstream.
Depending on the secureboot signature on EFI\BOOT\BOOTX86.EFI the Lenovo Yoga Tab 3 UEFI will switch its OSID ACPI variable between 1 (Windows) and 4 (Android(GMIN)).
In Windows mode a GPIO event handler gets installed for GPO1 pin 5, causing Linux' x86-android-tables code which deals with the general brokenness of this device's ACPI tables to fail to probe with:
[ 17.853705] x86_android_tablets: error -16 getting GPIO INT33FF:01 5 [ 17.859623] x86_android_tablets x86_android_tablets: probe with driver
which renders sound, the touchscreen, charging-management, battery-monitoring and more non functional.
Add ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS to the existing quirks for this device to fix this.
--- drivers/acpi/x86/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/x86/utils.c +2 -1
@@ -367,7 +367,8 @@ static const struct dmi_system_id acpi_q DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), }, .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | - ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), +ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY | + ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS), }, {/* Medion Lifetab S10346 */
Greg Kroah-Hartman
maintainerPATCH 238/268 platform/x86: ISST: Correct command storage data length
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Pandruvada <[email protected]>
commit 9462e74c5c983cce34019bfb27f734552bebe59f upstream.
After resume/online turbo limit ratio (TRL) is restored partially if the admin explicitly changed TRL from user space.
A hash table is used to store SST mail box and MSR settings when modified to restore those settings after resume or online. This uses a struct isst_cmd field "data" to store these settings. This is a 64 bit field. But isst_store_new_cmd() is only assigning as u32. This results in truncation of 32 bits.
Change the argument to u64 from u32.
--- drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +1 -1
@@ -84,7 +84,7 @@ static DECLARE_HASHTABLE(isst_hash, 8);static DEFINE_MUTEX (isst_hash_lock);static int isst_store_new_cmd (int cmd,u32 cpu,int mbox_cmd_type,u32 param, -u32 data) +u64 data) {struct isst_cmd *sst_cmd;
Greg Kroah-Hartman
maintainerPATCH 239/268 ntb_perf: Delete duplicate dmaengine_unmap_put() call in perf_copy_chunk()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Elfring <[email protected]>
commit 4279e72cab31dd3eb8c89591eb9d2affa90ab6aa upstream.
The function call “dmaengine_unmap_put(unmap)” was used in an if branch. The same call was immediately triggered by a subsequent goto statement. Thus avoid such a call repetition.
This issue was detected by using the Coccinelle software.
--- drivers/ntb/test/ntb_perf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/ntb/test/ntb_perf.c +1 -3
@@ -839,10 +839,8 @@ static int perf_copy_chunk(struct perf_tdma_set_unmap (tx, unmap); ret =dma_submit_error (dmaengine_submit (tx)); -if (ret) { -dmaengine_unmap_put (unmap); +if (ret) goto err_free_resource; - }dmaengine_unmap_put (unmap);
Greg Kroah-Hartman
maintainerPATCH 240/268 perf/x86/intel: Apply static call for drain_pebs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra (Intel) <[email protected]>
commit 314dfe10576912e1d786b13c5d4eee8c51b63caa upstream.
The x86_pmu_drain_pebs static call was introduced in commit 7c9903c9bf71 ("x86/perf, static_call: Optimize x86_pmu methods"), but it's not really used to replace the old method.
Apply the static call for drain_pebs.
--- arch/x86/events/intel/core.c | 2 +- arch/x86/events/intel/ds.c | 2 +- arch/x86/events/perf_event.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/events/intel/core.c +1 -1
@@ -3006,7 +3006,7 @@ static int handle_pmi_common(struct pt_r handled++;x86_pmu_handle_guest_pebs (regs, &data); - x86_pmu.drain_pebs (regs, &data); +static_call (x86_pmu_drain_pebs)(regs, &data); status &= intel_ctrl |GLOBAL_STATUS_TRACE_TOPAPMI ;/*
arch/x86/events/intel/ds.c +1 -1
@@ -847,7 +847,7 @@ static inline void intel_pmu_drain_pebs_ {struct perf_sample_data data; - x86_pmu.drain_pebs (NULL , &data); +static_call (x86_pmu_drain_pebs)(NULL , &data); }/*
arch/x86/events/perf_event.h +1 -0
@@ -1052,6 +1052,7 @@ extern struct x86_pmu x86_pmu __read_mosDECLARE_STATIC_CALL (x86_pmu_set_period, *x86_pmu.set_period);DECLARE_STATIC_CALL (x86_pmu_update, *x86_pmu.update); +DECLARE_STATIC_CALL (x86_pmu_drain_pebs, *x86_pmu.drain_pebs); static __always_inline struct x86_perf_task_context_opt *task_context_opt(void *ctx) {
Greg Kroah-Hartman
maintainerPATCH 241/268 perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kan Liang <[email protected]>
commit f9bdf1f953392c9edd69a7f884f78c0390127029 upstream.
The WARN_ON(this_cpu_read(cpu_hw_events.enabled)) in the intel_pmu_save_and_restart_reload() is triggered, when sampling read topdown events.
In a NMI handler, the cpu_hw_events.enabled is set and used to indicate the status of core PMU. The generic pmu->pmu_disable_count, updated in the perf_pmu_disable/enable pair, is not touched.
However, the perf_pmu_disable/enable pair is invoked when sampling read in a NMI handler. The cpuc->enabled is mistakenly set by the perf_pmu_enable().
Avoid disabling PMU if the core PMU is already disabled. Merge the logic together.
--- arch/x86/events/intel/core.c | 41 +++++++++++++++++++++++------------------ arch/x86/events/intel/ds.c | 11 +---------- arch/x86/events/perf_event.h | 2 +- 3 files changed, 25 insertions(+), 29 deletions(-)
arch/x86/events/intel/core.c +23 -18
@@ -2720,28 +2720,33 @@ static u64 adl_update_topdown_event(struDEFINE_STATIC_CALL (intel_pmu_update_topdown_event, x86_perf_event_update); -static void intel_pmu_read_topdown_event (struct perf_event *event) +static void intel_pmu_read_event (struct perf_event *event) { -struct cpu_hw_events *cpuc =this_cpu_ptr (&cpu_hw_events); +if (event->hw.flags & (PERF_X86_EVENT_AUTO_RELOAD |PERF_X86_EVENT_TOPDOWN )) { +struct cpu_hw_events *cpuc =this_cpu_ptr (&cpu_hw_events); +bool pmu_enabled = cpuc->enabled; + +/* Only need to call update_topdown_event() once for group read. */ +if (is_metric_event (event) && (cpuc->txn_flags &PERF_PMU_TXN_READ )) +return ; + + cpuc->enabled =0 ; +if (pmu_enabled) +intel_pmu_disable_all (); + +if (is_topdown_event (event)) +static_call (intel_pmu_update_topdown_event)(event); +else +intel_pmu_drain_pebs_buffer (); + + cpuc->enabled = pmu_enabled; +if (pmu_enabled) +intel_pmu_enable_all (0 ); -/* Only need to call update_topdown_event() once for group read. */ -if ((cpuc->txn_flags &PERF_PMU_TXN_READ ) && - !is_slots_event (event))return ; + } -perf_pmu_disable (event->pmu); -static_call (intel_pmu_update_topdown_event)(event); -perf_pmu_enable (event->pmu); -} - -static void intel_pmu_read_event (struct perf_event *event) -{ -if (event->hw.flags &PERF_X86_EVENT_AUTO_RELOAD ) -intel_pmu_auto_reload_read (event); -else if (is_topdown_count (event)) -intel_pmu_read_topdown_event (event); -else -x86_perf_event_update (event); +x86_perf_event_update (event); }static void intel_pmu_enable_fixed (struct perf_event *event)
arch/x86/events/intel/ds.c +1 -10
@@ -843,7 +843,7 @@ unlock:return 1 ; } -static inline void intel_pmu_drain_pebs_buffer (void ) +void intel_pmu_drain_pebs_buffer (void ) {struct perf_sample_data data;
@@ -1965,15 +1965,6 @@ get_next_pebs_record_by_bit(void *base,return NULL ; } -void intel_pmu_auto_reload_read (struct perf_event *event) -{ -WARN_ON (!(event->hw.flags &PERF_X86_EVENT_AUTO_RELOAD )); - -perf_pmu_disable (event->pmu); -intel_pmu_drain_pebs_buffer (); -perf_pmu_enable (event->pmu); -} -/* * Special variant of intel_pmu_save_and_restart() for auto-reload. */
arch/x86/events/perf_event.h +1 -1
@@ -1540,7 +1540,7 @@ void intel_pmu_pebs_disable_all(void);void intel_pmu_pebs_sched_task (struct perf_event_pmu_context *pmu_ctx,bool sched_in); -void intel_pmu_auto_reload_read (struct perf_event *event); +void intel_pmu_drain_pebs_buffer (void );void intel_pmu_store_pebs_lbrs (struct lbr_entry *lbr);
Greg Kroah-Hartman
maintainerPATCH 242/268 kunit/overflow: Fix UB in overflow_allocation_test
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Orlov <[email protected]>
commit 92e9bac18124682c4b99ede9ee3bcdd68f121e92 upstream.
The 'device_name' array doesn't exist out of the 'overflow_allocation_test' function scope. However, it is being used as a driver name when calling 'kunit_driver_create' from 'kunit_device_register'. It produces the kernel panic with KASAN enabled.
Since this variable is used in one place only, remove it and pass the device name into kunit_device_register directly as an ascii string.
--- lib/overflow_kunit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/overflow_kunit.c +1 -2
@@ -608,7 +608,6 @@ DEFINE_TEST_ALLOC(devm_kzalloc, devm_kfstatic void overflow_allocation_test (struct kunit *test) { -const char device_name[] ="overflow-test" ;struct device *dev;int count =0 ;
@@ -618,7 +617,7 @@ static void overflow_allocation_test(str }while (0 )/* Create dummy device for devm_kmalloc()-family tests. */ - dev =root_device_register (device_name); + dev =root_device_register ("overflow-test" );KUNIT_ASSERT_FALSE_MSG (test,IS_ERR (dev),"Cannot register test device\n" );
Greg Kroah-Hartman
maintainerPATCH 243/268 btrfs: handle errors from btrfs_dec_ref() properly
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
commit 5eb178f373b4f16f3b42d55ff88fc94dd95b93b1 upstream.
In walk_up_proc() we BUG_ON(ret) from btrfs_dec_ref(). This is incorrect, we have proper error handling here, return the error.
--- fs/btrfs/extent-tree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/btrfs/extent-tree.c +4 -1
@@ -5540,7 +5540,10 @@ static noinline int walk_up_proc(struct ret =btrfs_dec_ref (trans, root, eb,1 ); else ret =btrfs_dec_ref (trans, root, eb,0 ); -BUG_ON (ret);/* -ENOMEM */ +if (ret) { +btrfs_abort_transaction (trans, ret); +return ret; + }if (is_fstree (root->root_key.objectid)) { ret =btrfs_qgroup_trace_leaf_items (trans, eb);if (ret) {
Greg Kroah-Hartman
maintainerPATCH 244/268 x86/tsc: Always save/restore TSC sched_clock() on suspend/resume
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guilherme G. Piccoli <[email protected]>
commit d90c9de9de2f1712df56de6e4f7d6982d358cabe upstream.
TSC could be reset in deep ACPI sleep states, even with invariant TSC.
That's the reason we have sched_clock() save/restore functions, to deal with this situation. But what happens is that such functions are guarded with a check for the stability of sched_clock - if not considered stable, the save/restore routines aren't executed.
On top of that, we have a clear comment in native_sched_clock() saying that *even* with TSC unstable, we continue using TSC for sched_clock due to its speed.
In other words, if we have a situation of TSC getting detected as unstable, it marks the sched_clock as unstable as well, so subsequent S3 sleep cycles could bring bogus sched_clock values due to the lack of the save/restore mechanism, causing warnings like this:
[22.954918] ------------[ cut here ]------------ [22.954923] Delta way too big! 18446743750843854390 ts=18446744072977390405 before=322133536015 after=322133536015 write stamp=18446744072977390405 [22.954923] If you just came from a suspend/resume, [22.954923] please switch to the trace global clock: [22.954923] echo global > /sys/kernel/tracing/trace_clock [22.954923] or add trace_clock=global to the kernel command line [22.954937] WARNING: CPU: 2 PID: 5728 at kernel/trace/ring_buffer.c:2890 rb_add_timestamp+0x193/0x1c0
Notice that the above was reproduced even with "trace_clock=global".
The fix for that is to _always_ save/restore the sched_clock on suspend cycle _if TSC is used_ as sched_clock - only if we fallback to jiffies the sched_clock_stable() check becomes relevant to save/restore the sched_clock.
--- arch/x86/kernel/tsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/tsc.c +2 -2
@@ -955,7 +955,7 @@ static unsigned long long cyc2ns_suspendvoid tsc_save_sched_clock_state (void ) { -if (!sched_clock_stable ()) +if (!static_branch_likely (&__use_tsc) && !sched_clock_stable ())return ; cyc2ns_suspend =sched_clock ();
@@ -975,7 +975,7 @@ void tsc_restore_sched_clock_state(void)unsigned long flags;int cpu; -if (!sched_clock_stable ()) +if (!static_branch_likely (&__use_tsc) && !sched_clock_stable ())return ;local_irq_save (flags);
Greg Kroah-Hartman
maintainerPATCH 245/268 x86/mm: Fix flush_tlb_range() when used for zapping normal PMDs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit 3ef938c3503563bfc2ac15083557f880d29c2e64 upstream.
On the following path, flush_tlb_range() can be used for zapping normal PMD entries (PMD entries that point to page tables) together with the PTE entries in the pointed-to page table:
collapse_pte_mapped_thp
pmdp_collapse_flush
flush_tlb_range
The arm64 version of flush_tlb_range() has a comment describing that it can be used for page table removal, and does not use any last-level invalidation optimizations. Fix the X86 version by making it behave the same way.
Currently, X86 only uses this information for the following two purposes, which I think means the issue doesn't have much impact:
- In native_flush_tlb_multi() for checking if lazy TLB CPUs need to be IPI'd to avoid issues with speculative page table walks.
- In Hyper-V TLB paravirtualization, again for lazy TLB stuff.
The patch "x86/mm: only invalidate final translations with INVLPGB" which is currently under review (see
<https://lore.kernel.org/all/[email protected]/>)
would probably be making the impact of this a lot worse.
--- arch/x86/include/asm/tlbflush.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/tlbflush.h +1 -1
@@ -242,7 +242,7 @@ void flush_tlb_multi(const struct cpumasflush_tlb_mm_range ((vma)->vm_mm, start, end, \ ((vma)->vm_flags &VM_HUGETLB ) \ ?huge_page_shift (hstate_vma (vma)) \ - : PAGE_SHIFT, false) + : PAGE_SHIFT, true)extern void flush_tlb_all (void ); extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
Greg Kroah-Hartman
maintainerPATCH 246/268 acpi: nfit: fix narrowing conversion in acpi_nfit_ctl
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
commit 2ff0e408db36c21ed3fa5e3c1e0e687c82cf132f upstream.
Syzkaller has reported a warning in to_nfit_bus_uuid(): "only secondary bus families can be translated". This warning is emited if the argument is equal to NVDIMM_BUS_FAMILY_NFIT == 0. Function acpi_nfit_ctl() first verifies that a user-provided value call_pkg->nd_family of type u64 is not equal to 0. Then the value is converted to int, and only after that is compared to NVDIMM_BUS_FAMILY_MAX. This can lead to passing an invalid argument to acpi_nfit_ctl(), if call_pkg->nd_family is non-zero, while the lower 32 bits are zero.
Furthermore, it is best to return EINVAL immediately upon seeing the invalid user input. The WARNING is insufficient to prevent further undefined behavior based on other invalid user input.
All checks of the input value should be applied to the original variable call_pkg->nd_family.
[iweiny: update commit message]
--- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +1 -1
@@ -485,7 +485,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_desc cmd_mask = nd_desc->cmd_mask;if (cmd ==ND_CMD_CALL && call_pkg->nd_family) { family = call_pkg->nd_family; -if (family >NVDIMM_BUS_FAMILY_MAX || +if (call_pkg->nd_family >NVDIMM_BUS_FAMILY_MAX || !test_bit (family, &nd_desc->bus_family_mask))return -EINVAL ; family = array_index_nospec(family,
Greg Kroah-Hartman
maintainerPATCH 247/268 ACPI: resource: Skip IRQ override on ASUS Vivobook 14 X1404VAP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Menzel <[email protected]>
commit 2da31ea2a085cd189857f2db0f7b78d0162db87a upstream.
Like the ASUS Vivobook X1504VAP and Vivobook X1704VAP, the ASUS Vivobook 14 X1404VAP has its keyboard IRQ (1) described as ActiveLow in the DSDT, which the kernel overrides to EdgeHigh breaking the keyboard.
$ sudo dmidecode
[…]
System Information
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS Vivobook 14 X1404VAP_X1404VA
[…]
$ grep -A 30 PS2K dsdt.dsl | grep IRQ -A 1
IRQ (Level, ActiveLow, Exclusive, )
{1}Add the X1404VAP to the irq1_level_low_skip_override[] quirk table to fix this.
--- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/acpi/resource.c +7 -0
@@ -440,6 +440,13 @@ static const struct dmi_system_id asus_l }, }, { +/* Asus Vivobook X1404VAP */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_BOARD_NAME, "X1404VAP"), + }, + }, + {/* Asus Vivobook X1504VAP */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
Greg Kroah-Hartman
maintainerPATCH 248/268 mmc: omap: Fix memory leak in mmc_omap_new_slot
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
commit 3834a759afb817e23a7a2f09c2c9911b0ce5c588 upstream.
Add err_free_host label to properly pair mmc_alloc_host() with mmc_free_host() in GPIO error paths. The allocated host memory was leaked when GPIO lookups failed.
--- drivers/mmc/host/omap.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/mmc/host/omap.c +13 -6
@@ -1276,19 +1276,25 @@ static int mmc_omap_new_slot(struct mmc_/* Check for some optional GPIO controls */ slot->vsd =devm_gpiod_get_index_optional (host->dev,"vsd" , id,GPIOD_OUT_LOW ); -if (IS_ERR (slot->vsd)) -return dev_err_probe (host->dev,PTR_ERR (slot->vsd), +if (IS_ERR (slot->vsd)) { + r =dev_err_probe (host->dev,PTR_ERR (slot->vsd),"error looking up VSD GPIO\n" ); + goto err_free_host; + } slot->vio =devm_gpiod_get_index_optional (host->dev,"vio" , id,GPIOD_OUT_LOW ); -if (IS_ERR (slot->vio)) -return dev_err_probe (host->dev,PTR_ERR (slot->vio), +if (IS_ERR (slot->vio)) { + r =dev_err_probe (host->dev,PTR_ERR (slot->vio),"error looking up VIO GPIO\n" ); + goto err_free_host; + } slot->cover =devm_gpiod_get_index_optional (host->dev,"cover" , id,GPIOD_IN ); -if (IS_ERR (slot->cover)) -return dev_err_probe (host->dev,PTR_ERR (slot->cover), +if (IS_ERR (slot->cover)) { + r =dev_err_probe (host->dev,PTR_ERR (slot->cover),"error looking up cover switch GPIO\n" ); + goto err_free_host; + } host->slots[id] = slot;
@@ -1348,6 +1354,7 @@ err_remove_slot_name:device_remove_file (&mmc->class_dev, &dev_attr_slot_name); err_remove_host:mmc_remove_host (mmc); +err_free_host:mmc_free_host (mmc);return r; }
Greg Kroah-Hartman
maintainerPATCH 249/268 mmc: sdhci-pxav3: set NEED_RSP_BUSY capability
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karel Balej <[email protected]>
commit a41fcca4b342811b473bbaa4b44f1d34d87fcce6 upstream.
Set the MMC_CAP_NEED_RSP_BUSY capability for the sdhci-pxav3 host to prevent conversion of R1B responses to R1. Without this, the eMMC card in the samsung,coreprimevelte smartphone using the Marvell PXA1908 SoC with this mmc host doesn't probe with the ETIMEDOUT error originating in __mmc_poll_for_busy.
Note that the other issues reported for this phone and host, namely floods of "Tuning failed, falling back to fixed sampling clock" dmesg messages for the eMMC and unstable SDIO are not mitigated by this change.
--- drivers/mmc/host/sdhci-pxav3.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/sdhci-pxav3.c +1 -0
@@ -399,6 +399,7 @@ static int sdhci_pxav3_probe(struct platif (!IS_ERR (pxa->clk_core))clk_prepare_enable (pxa->clk_core); + host->mmc->caps |=MMC_CAP_NEED_RSP_BUSY ;/* enable 1/8V DDR capable */ host->mmc->caps |=MMC_CAP_1_8V_DDR ;
Greg Kroah-Hartman
maintainerPATCH 250/268 mmc: sdhci-omap: Disable MMC_CAP_AGGRESSIVE_PM for eMMC/SD
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulf Hansson <[email protected]>
commit 49d162635151d0dd04935070d7cf67137ab863aa upstream.
We have received reports about cards can become corrupt related to the aggressive PM support. Let's make a partial revert of the change that enabled the feature.
--- drivers/mmc/host/sdhci-omap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-omap.c +2 -2
@@ -1339,8 +1339,8 @@ static int sdhci_omap_probe(struct platf/* R1B responses is required to properly manage HW busy detection. */ mmc->caps |=MMC_CAP_NEED_RSP_BUSY ; -/* Allow card power off and runtime PM for eMMC/SD card devices */ - mmc->caps |=MMC_CAP_POWER_OFF_CARD |MMC_CAP_AGGRESSIVE_PM ; +/* Enable SDIO card power off. */ + mmc->caps |=MMC_CAP_POWER_OFF_CARD ; ret =sdhci_setup_host (host);if (ret)
Greg Kroah-Hartman
maintainerPATCH 251/268 ksmbd: add bounds check for durable handle context
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 542027e123fc0bfd61dd59e21ae0ee4ef2101b29 upstream.
Add missing bounds check for durable handle context.
--- fs/smb/server/smb2pdu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
fs/smb/server/smb2pdu.c +21 -0
@@ -2700,6 +2700,13 @@ static int parse_durable_handle_context( goto out; } +if (le16_to_cpu (context->DataOffset) + +le32_to_cpu (context->DataLength) < +sizeof (struct create_durable_reconn_v2_req )) { + err = -EINVAL ; + goto out; + } + recon_v2 = (struct create_durable_reconn_v2_req *)context; persistent_id = recon_v2->Fid.PersistentFileId; dh_info->fp =ksmbd_lookup_durable_fd (persistent_id);
@@ -2733,6 +2740,13 @@ static int parse_durable_handle_context( goto out; } +if (le16_to_cpu (context->DataOffset) + +le32_to_cpu (context->DataLength) < +sizeof (struct create_durable_reconn_req )) { + err = -EINVAL ; + goto out; + } + recon = (struct create_durable_reconn_req *)context; persistent_id = recon->Data.Fid.PersistentFileId; dh_info->fp =ksmbd_lookup_durable_fd (persistent_id);
@@ -2757,6 +2771,13 @@ static int parse_durable_handle_context( err = -EINVAL ; goto out; } + +if (le16_to_cpu (context->DataOffset) + +le32_to_cpu (context->DataLength) < +sizeof (struct create_durable_req_v2 )) { + err = -EINVAL ; + goto out; + } durable_v2_blob = (struct create_durable_req_v2 *)context;
Greg Kroah-Hartman
maintainerPATCH 252/268 ksmbd: add bounds check for create lease context
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Norbert Szetei <[email protected]>
commit bab703ed8472aa9d109c5f8c1863921533363dae upstream.
Add missing bounds check for create lease context.
--- fs/smb/server/oplock.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/smb/server/oplock.c +8 -0
@@ -1505,6 +1505,10 @@ struct lease_ctx_info *parse_lease_stateif (sizeof (struct lease_context_v2 ) ==le32_to_cpu (cc->DataLength)) {struct create_lease_v2 *lc = (struct create_lease_v2 *)cc; +if (le16_to_cpu (cc->DataOffset) +le32_to_cpu (cc->DataLength) < +sizeof (struct create_lease_v2 ) -4 ) +return NULL ; +memcpy (lreq->lease_key, lc->lcontext.LeaseKey,SMB2_LEASE_KEY_SIZE ); lreq->req_state = lc->lcontext.LeaseState; lreq->flags = lc->lcontext.LeaseFlags;
@@ -1517,6 +1521,10 @@ struct lease_ctx_info *parse_lease_state }else {struct create_lease *lc = (struct create_lease *)cc; +if (le16_to_cpu (cc->DataOffset) +le32_to_cpu (cc->DataLength) < +sizeof (struct create_lease )) +return NULL ; +memcpy (lreq->lease_key, lc->lcontext.LeaseKey,SMB2_LEASE_KEY_SIZE ); lreq->req_state = lc->lcontext.LeaseState; lreq->flags = lc->lcontext.LeaseFlags;
Greg Kroah-Hartman
maintainerPATCH 253/268 ksmbd: fix use-after-free in ksmbd_sessions_deregister()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 15a9605f8d69dc85005b1a00c31a050b8625e1aa upstream.
In multichannel mode, UAF issue can occur in session_deregister when the second channel sets up a session through the connection of the first channel. session that is freed through the global session table can be accessed again through ->sessions of connection.
--- fs/smb/server/mgmt/user_session.c | 3 +++ 1 file changed, 3 insertions(+)
fs/smb/server/mgmt/user_session.c +3 -0
@@ -229,6 +229,9 @@ void ksmbd_sessions_deregister(struct ksif (!ksmbd_chann_del (conn, sess) &&xa_empty (&sess->ksmbd_chann_list)) {hash_del (&sess->hlist); +down_write (&conn->session_lock); +xa_erase (&conn->sessions, sess->id); +up_write (&conn->session_lock);ksmbd_session_destroy (sess); } }
Greg Kroah-Hartman
maintainerPATCH 254/268 ksmbd: fix session use-after-free in multichannel connection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db upstream.
There is a race condition between session setup and ksmbd_sessions_deregister. The session can be freed before the connection is added to channel list of session.
This patch check reference count of session before freeing it.
--- fs/smb/server/auth.c | 4 ++-- fs/smb/server/mgmt/user_session.c | 14 ++++++++------ fs/smb/server/smb2pdu.c | 7 ++++--- 3 files changed, 14 insertions(+), 11 deletions(-)
fs/smb/server/auth.c +2 -2
@@ -1012,9 +1012,9 @@ static int ksmbd_get_encryption_key(stru ses_enc_key = enc ? sess->smb3encryptionkey : sess->smb3decryptionkey; -if (enc) -ksmbd_user_session_get (sess);memcpy (key, ses_enc_key,SMB3_ENC_DEC_KEY_SIZE ); +if (!enc) +ksmbd_user_session_put (sess);return 0 ; }
fs/smb/server/mgmt/user_session.c +8 -6
@@ -180,7 +180,7 @@ static void ksmbd_expire_session(structdown_write (&sessions_table_lock);down_write (&conn->session_lock);xa_for_each (&conn->sessions, id, sess) { -if (atomic_read (&sess->refcnt) ==0 && +if (atomic_read (&sess->refcnt) <=1 && (sess->state !=SMB2_SESSION_VALID ||time_after (jiffies, sess->last_active +SMB2_SESSION_TIMEOUT ))) {
@@ -232,7 +232,8 @@ void ksmbd_sessions_deregister(struct ksdown_write (&conn->session_lock);xa_erase (&conn->sessions, sess->id);up_write (&conn->session_lock); -ksmbd_session_destroy (sess); +if (atomic_dec_and_test (&sess->refcnt)) +ksmbd_session_destroy (sess); } } }
@@ -251,7 +252,8 @@ void ksmbd_sessions_deregister(struct ksif (xa_empty (&sess->ksmbd_chann_list)) {xa_erase (&conn->sessions, sess->id);hash_del (&sess->hlist); -ksmbd_session_destroy (sess); +if (atomic_dec_and_test (&sess->refcnt)) +ksmbd_session_destroy (sess); } }up_write (&conn->session_lock);
@@ -327,8 +329,8 @@ void ksmbd_user_session_put(struct ksmbdif (atomic_read (&sess->refcnt) <=0 )WARN_ON (1 ); -else -atomic_dec (&sess->refcnt); +else if (atomic_dec_and_test (&sess->refcnt)) +ksmbd_session_destroy (sess); } struct preauth_session *ksmbd_preauth_session_alloc(struct ksmbd_conn *conn,
@@ -433,7 +435,7 @@ static struct ksmbd_session *__session_cxa_init (&sess->rpc_handle_list); sess->sequence_number =1 ;rwlock_init (&sess->tree_conns_lock); -atomic_set (&sess->refcnt,1 ); +atomic_set (&sess->refcnt,2 ); ret =__init_smb2_session (sess);if (ret)
fs/smb/server/smb2pdu.c +4 -3
@@ -2231,13 +2231,14 @@ int smb2_session_logoff(struct ksmbd_worreturn -ENOENT ; } -ksmbd_destroy_file_table (&sess->file_table);down_write (&conn->session_lock); sess->state =SMB2_SESSION_EXPIRED ;up_write (&conn->session_lock); -ksmbd_free_user (sess->user); - sess->user =NULL ; +if (sess->user) { +ksmbd_free_user (sess->user); + sess->user =NULL ; + }ksmbd_all_conn_set_status (sess_id,KSMBD_SESS_NEED_NEGOTIATE ); rsp->StructureSize =cpu_to_le16 (4 );
Greg Kroah-Hartman
maintainerPATCH 255/268 ksmbd: validate zero num_subauth before sub_auth is accessed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Norbert Szetei <[email protected]>
commit bf21e29d78cd2c2371023953d9c82dfef82ebb36 upstream.
Access psid->sub_auth[psid->num_subauth - 1] without checking if num_subauth is non-zero leads to an out-of-bounds read. This patch adds a validation step to ensure num_subauth != 0 before sub_auth is accessed.
--- fs/smb/server/smbacl.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/smb/server/smbacl.c +5 -0
@@ -270,6 +270,11 @@ static int sid_to_id(struct mnt_idmap *ireturn -EIO ; } +if (psid->num_subauth ==0 ) { +pr_err ("%s: zero subauthorities!\n" , __func__); +return -EIO ; + } +if (sidtype ==SIDOWNER ) {kuid_t uid;uid_t id;
Greg Kroah-Hartman
maintainerPATCH 256/268 tracing: Fix use-after-free in print_graph_function_flags during tracer switching
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tengda Wu <[email protected]>
commit 7f81f27b1093e4895e87b74143c59c055c3b1906 upstream.
Kairui reported a UAF issue in print_graph_function_flags() during ftrace stress testing [1]. This issue can be reproduced if puting a 'mdelay(10)' after 'mutex_unlock(&trace_types_lock)' in s_start(), and executing the following script:
$ echo function_graph > current_tracer $ cat trace > /dev/null & $ sleep 5 # Ensure the 'cat' reaches the 'mdelay(10)' point $ echo timerlat > current_tracer
The root cause lies in the two calls to print_graph_function_flags within print_trace_line during each s_show():
* One through 'iter->trace->print_line()';
* Another through 'event->funcs->trace()', which is hidden in print_trace_fmt() before print_trace_line returns.
Tracer switching only updates the former, while the latter continues to use the print_line function of the old tracer, which in the script above is print_graph_function_flags.
Moreover, when switching from the 'function_graph' tracer to the 'timerlat' tracer, s_start only calls graph_trace_close of the 'function_graph' tracer to free 'iter->private', but does not set it to NULL. This provides an opportunity for 'event->funcs->trace()' to use an invalid 'iter->private'.
To fix this issue, set 'iter->private' to NULL immediately after freeing it in graph_trace_close(), ensuring that an invalid pointer is not passed to other tracers. Additionally, clean up the unnecessary 'iter->private = NULL' during each 'cat trace' when using wakeup and irqsoff tracers.
[1] https://lore.kernel.org/all/[email protected]/
--- kernel/trace/trace_functions_graph.c | 1 + kernel/trace/trace_irqsoff.c | 2 -- kernel/trace/trace_sched_wakeup.c | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-)
kernel/trace/trace_functions_graph.c +1 -0
@@ -1317,6 +1317,7 @@ void graph_trace_close(struct trace_iterif (data) {free_percpu (data->cpu_data);kfree (data); + iter->private =NULL ; } }
kernel/trace/trace_irqsoff.c +0 -2
@@ -231,8 +231,6 @@ static void irqsoff_trace_open(struct tr {if (is_graph (iter->tr))graph_trace_open (iter); -else - iter->private =NULL ; }static void irqsoff_trace_close (struct trace_iterator *iter)
kernel/trace/trace_sched_wakeup.c +0 -2
@@ -168,8 +168,6 @@ static void wakeup_trace_open(struct tra {if (is_graph (iter->tr))graph_trace_open (iter); -else - iter->private =NULL ; }static void wakeup_trace_close (struct trace_iterator *iter)
Greg Kroah-Hartman
maintainerPATCH 257/268 tracing: Ensure module defining synth event cannot be unloaded while tracing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Raillard <[email protected]>
commit 21581dd4e7ff6c07d0ab577e3c32b13a74b31522 upstream.
Currently, using synth_event_delete() will fail if the event is being used (tracing in progress), but that is normally done in the module exit function. At that stage, failing is problematic as returning a non-zero status means the module will become locked (impossible to unload or reload again).
Instead, ensure the module exit function does not get called in the first place by increasing the module refcnt when the event is enabled.
--- kernel/trace/trace_events_synth.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
kernel/trace/trace_events_synth.c +29 -1
@@ -859,6 +859,34 @@ static struct trace_event_fields synth_e {} }; +static int synth_event_reg (struct trace_event_call *call, +enum trace_reg type,void *data) +{ + struct synth_event *event = container_of(call, struct synth_event, call); + +switch (type) { +case TRACE_REG_REGISTER : +case TRACE_REG_PERF_REGISTER : +if (!try_module_get (event->mod)) +return -EBUSY ; +break ; +default : +break ; + } + +int ret =trace_event_reg (call, type, data); + +switch (type) { +case TRACE_REG_UNREGISTER : +case TRACE_REG_PERF_UNREGISTER : +module_put (event->mod); +break ; +default : +break ; + } +return ret; +} +static int register_synth_event (struct synth_event *event) {struct trace_event_call *call = &event->call;
@@ -888,7 +916,7 @@ static int register_synth_event(struct s goto out; } call->flags =TRACE_EVENT_FL_TRACEPOINT ; - call->class->reg = trace_event_reg; + call->class->reg = synth_event_reg; call->class->probe = trace_event_raw_event_synth; call->data = event; call->tp = event->tp;
Greg Kroah-Hartman
maintainerPATCH 258/268 tracing: Fix synth event printk format for str fields
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Raillard <[email protected]>
commit 4d38328eb442dc06aec4350fd9594ffa6488af02 upstream.
The printk format for synth event uses "%.*s" to print string fields, but then only passes the pointer part as var arg.
Replace %.*s with %s as the C string is guaranteed to be null-terminated.
The output in print fmt should never have been updated as __get_str() handles the string limit because it can access the length of the string in the string meta data that is saved in the ring buffer.
--- kernel/trace/trace_events_synth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_events_synth.c +1 -1
@@ -312,7 +312,7 @@ static const char *synth_field_fmt(charelse if (strcmp (type,"gfp_t" ) ==0 ) fmt ="%x" ;else if (synth_field_is_string (type)) - fmt ="%.*s" ; + fmt ="%s" ;else if (synth_field_is_stack (type)) fmt ="%s" ;
Greg Kroah-Hartman
maintainerPATCH 259/268 tracing/osnoise: Fix possible recursive locking for cpus_read_lock()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ran Xiaokai <[email protected]>
commit 7e6b3fcc9c5294aeafed0dbe1a09a1bc899bd0f2 upstream.
Lockdep reports this deadlock log:
osnoise: could not start sampling thread
============================================
WARNING: possible recursive locking detected
--------------------------------------------
CPU0
---- lock(cpu_hotplug_lock);
lock(cpu_hotplug_lock);
Call Trace: <TASK> print_deadlock_bug+0x282/0x3c0 __lock_acquire+0x1610/0x29a0 lock_acquire+0xcb/0x2d0 cpus_read_lock+0x49/0x120 stop_per_cpu_kthreads+0x7/0x60 start_kthread+0x103/0x120 osnoise_hotplug_workfn+0x5e/0x90 process_one_work+0x44f/0xb30 worker_thread+0x33e/0x5e0 kthread+0x206/0x3b0 ret_from_fork+0x31/0x50 ret_from_fork_asm+0x11/0x20 </TASK>
This is the deadlock scenario:osnoise_hotplug_workfn()
guard(cpus_read_lock)(); // first lock call
start_kthread(cpu)
if (IS_ERR(kthread)) {
stop_per_cpu_kthreads(); {
cpus_read_lock(); // second lock call. Cause the AA deadlock
}
}It is not necessary to call stop_per_cpu_kthreads() which stops osnoise kthread for every other CPUs in the system if a failure occurs during hotplug of a certain CPU.
For start_per_cpu_kthreads(), if the start_kthread() call fails, this function calls stop_per_cpu_kthreads() to handle the error. Therefore, similarly, there is no need to call stop_per_cpu_kthreads() again within start_kthread().
So just remove stop_per_cpu_kthreads() from start_kthread to solve this issue.
--- kernel/trace/trace_osnoise.c | 1 - 1 file changed, 1 deletion(-)
kernel/trace/trace_osnoise.c +0 -1
@@ -2038,7 +2038,6 @@ static int start_kthread(unsigned int cpif (IS_ERR (kthread)) {pr_err (BANNER "could not start sampling thread\n" ); -stop_per_cpu_kthreads ();return -ENOMEM ; }
Greg Kroah-Hartman
maintainerPATCH 260/268 arm64: Dont call NULL in do_compat_alignment_fixup()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Angelos Oikonomopoulos <[email protected]>
commit c28f31deeacda307acfee2f18c0ad904e5123aac upstream.
do_alignment_t32_to_handler() only fixes up alignment faults for specific instructions; it returns NULL otherwise (e.g. LDREX). When that's the case, signal to the caller that it needs to proceed with the regular alignment fault handling (i.e. SIGBUS). Without this patch, the kernel panics:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Mem abort info:
ESR = 0x0000000086000006
EC = 0x21: IABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
user pgtable: 4k pages, 48-bit VAs, pgdp=00000800164aa000
[0000000000000000] pgd=0800081fdbd22003, p4d=0800081fdbd22003, pud=08000815d51c6003, pmd=0000000000000000
Internal error: Oops: 0000000086000006 [#1] SMP
Modules linked in: cfg80211 rfkill xt_nat xt_tcpudp xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat br_netfilter veth nvme_fa>
libcrc32c crc32c_generic raid0 multipath linear dm_mod dax raid1 md_mod xhci_pci nvme xhci_hcd nvme_core t10_pi usbcore igb crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10dif_ce crct10dif_common usb_common i2c_algo_bit i2c>
CPU: 2 PID: 3932954 Comm: WPEWebProcess Not tainted 6.1.0-31-arm64 #1 Debian 6.1.128-1
Hardware name: GIGABYTE MP32-AR1-00/MP32-AR1-00, BIOS F18v (SCP: 1.08.20211002) 12/01/2021
pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : 0x0
lr : do_compat_alignment_fixup+0xd8/0x3dc
sp : ffff80000f973dd0
x29: ffff80000f973dd0 x28: ffff081b42526180 x27: 0000000000000000
x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
x23: 0000000000000004 x22: 0000000000000000 x21: 0000000000000001
x20: 00000000e8551f00 x19: ffff80000f973eb0 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : ffffaebc949bc488
x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000400000 x4 : 0000fffffffffffe x3 : 0000000000000000
x2 : ffff80000f973eb0 x1 : 00000000e8551f00 x0 : 0000000000000001
Call trace:
0x0
do_alignment_fault+0x40/0x50
do_mem_abort+0x4c/0xa0
el0_da+0x48/0xf0
el0t_32_sync_handler+0x110/0x140
el0t_32_sync+0x190/0x194
Code: bad PC value
---[ end trace 0000000000000000 ]------ arch/arm64/kernel/compat_alignment.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/kernel/compat_alignment.c +2 -0
@@ -368,6 +368,8 @@ int do_compat_alignment_fixup(unsigned lreturn 1 ; } +if (!handler) +return 1 ; type =handler (addr, instr, regs);if (type ==TYPE_ERROR || type ==TYPE_FAULT )
Greg Kroah-Hartman
maintainerPATCH 261/268 ext4: dont over-report free space or inodes in statvfs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit f87d3af7419307ae26e705a2b2db36140db367a2 upstream.
This fixes an analogus bug that was fixed in xfs in commit 4b8d867ca6e2 ("xfs: don't over-report free space or inodes in statvfs") where statfs can report misleading / incorrect information where project quota is enabled, and the free space is less than the remaining quota.
This commit will resolve a test failure in generic/762 which tests for this bug.
--- fs/ext4/super.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
fs/ext4/super.c +17 -10
@@ -6808,22 +6808,29 @@ static int ext4_statfs_project(struct su dquot->dq_dqb.dqb_bhardlimit); limit >>= sb->s_blocksize_bits; -if (limit && buf->f_blocks > limit) { +if (limit) { +uint64_t remaining =0 ; + curblock = (dquot->dq_dqb.dqb_curspace + dquot->dq_dqb.dqb_rsvspace) >> sb->s_blocksize_bits; - buf->f_blocks = limit; - buf->f_bfree = buf->f_bavail = - (buf->f_blocks > curblock) ? - (buf->f_blocks - curblock) :0 ; +if (limit > curblock) + remaining = limit - curblock; + + buf->f_blocks =min (buf->f_blocks, limit); + buf->f_bfree =min (buf->f_bfree, remaining); + buf->f_bavail =min (buf->f_bavail, remaining); } limit =min_not_zero (dquot->dq_dqb.dqb_isoftlimit, dquot->dq_dqb.dqb_ihardlimit); -if (limit && buf->f_files > limit) { - buf->f_files = limit; - buf->f_ffree = - (buf->f_files > dquot->dq_dqb.dqb_curinodes) ? - (buf->f_files - dquot->dq_dqb.dqb_curinodes) :0 ; +if (limit) { +uint64_t remaining =0 ; + +if (limit > dquot->dq_dqb.dqb_curinodes) + remaining = limit - dquot->dq_dqb.dqb_curinodes; + + buf->f_files =min (buf->f_files, limit); + buf->f_ffree =min (buf->f_ffree, remaining); }spin_unlock (&dquot->dq_dqb_lock);
Greg Kroah-Hartman
maintainerPATCH 262/268 ext4: fix OOB read when checking dotdot dir
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Acs, Jakub <[email protected]>
commit d5e206778e96e8667d3bde695ad372c296dc9353 upstream.
Mounting a corrupted filesystem with directory which contains '.' dir entry with rec_len == block size results in out-of-bounds read (later on, when the corrupted directory is removed).
ext4_empty_dir() assumes every ext4 directory contains at least '.' and '..' as directory entries in the first data block. It first loads the '.' dir entry, performs sanity checks by calling ext4_check_dir_entry() and then uses its rec_len member to compute the location of '..' dir entry (in ext4_next_entry). It assumes the '..' dir entry fits into the same data block.
If the rec_len of '.' is precisely one block (4KB), it slips through the sanity checks (it is considered the last directory entry in the data block) and leaves "struct ext4_dir_entry_2 *de" point exactly past the memory slot allocated to the data block. The following call to ext4_check_dir_entry() on new value of de then dereferences this pointer which results in out-of-bounds mem access.
Fix this by extending __ext4_check_dir_entry() to check for '.' dir entries that reach the end of data block. Make sure to ignore the phony dir entries for checksum (by checking name_len for non-zero).
Note: This is reported by KASAN as use-after-free in case another structure was recently freed from the slot past the bound, but it is really an OOB read.
This issue was found by syzkaller tool.
Call Trace: [ 38.594108] BUG: KASAN: slab-use-after-free in __ext4_check_dir_entry+0x67e/0x710 [ 38.594649] Read of size 2 at addr ffff88802b41a004 by task syz-executor/5375 [ 38.595158] [ 38.595288] CPU: 0 UID: 0 PID: 5375 Comm: syz-executor Not tainted 6.14.0-rc7 #1 [ 38.595298] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 [ 38.595304] Call Trace: [ 38.595308] <TASK> [ 38.595311] dump_stack_lvl+0xa7/0xd0 [ 38.595325] print_address_description.constprop.0+0x2c/0x3f0 [ 38.595339] ? __ext4_check_dir_entry+0x67e/0x710 [ 38.595349] print_report+0xaa/0x250 [ 38.595359] ? __ext4_check_dir_entry+0x67e/0x710 [ 38.595368] ? kasan_addr_to_slab+0x9/0x90 [ 38.595378] kasan_report+0xab/0xe0 [ 38.595389] ? __ext4_check_dir_entry+0x67e/0x710 [ 38.595400] __ext4_check_dir_entry+0x67e/0x710 [ 38.595410] ext4_empty_dir+0x465/0x990 [ 38.595421] ? __pfx_ext4_empty_dir+0x10/0x10 [ 38.595432] ext4_rmdir.part.0+0x29a/0xd10 [ 38.595441] ? __dquot_initialize+0x2a7/0xbf0 [ 38.595455] ? __pfx_ext4_rmdir.part.0+0x10/0x10 [ 38.595464] ? __pfx___dquot_initialize+0x10/0x10 [ 38.595478] ? down_write+0xdb/0x140 [ 38.595487] ? __pfx_down_write+0x10/0x10 [ 38.595497] ext4_rmdir+0xee/0x140 [ 38.595506] vfs_rmdir+0x209/0x670 [ 38.595517] ? lookup_one_qstr_excl+0x3b/0x190 [ 38.595529] do_rmdir+0x363/0x3c0 [ 38.595537] ? __pfx_do_rmdir+0x10/0x10 [ 38.595544] ? strncpy_from_user+0x1ff/0x2e0 [ 38.595561] __x64_sys_unlinkat+0xf0/0x130 [ 38.595570] do_syscall_64+0x5b/0x180 [ 38.595583] entry_SYSCALL_64_after_hwframe+0x76/0x7e
--- fs/ext4/dir.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ext4/dir.c +3 -0
@@ -104,6 +104,9 @@ int __ext4_check_dir_entry(const char *felse if (unlikely (le32_to_cpu (de->inode) >le32_to_cpu (EXT4_SB (dir->i_sb)->s_es->s_inodes_count))) error_msg ="inode out of bounds" ; +else if (unlikely (next_offset == size && de->name_len ==1 && + de->name[0 ] =='.' )) + error_msg ="'.' directory cannot be the last in data block" ;else return 0 ;
Greg Kroah-Hartman
maintainerPATCH 263/268 jfs: fix slab-out-of-bounds read in ea_get()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qasim Ijaz <[email protected]>
commit fdf480da5837c23b146c4743c18de97202fcab37 upstream.
During the "size_check" label in ea_get(), the code checks if the extended attribute list (xattr) size matches ea_size. If not, it logs "ea_get: invalid extended attribute" and calls print_hex_dump().
Here, EALIST_SIZE(ea_buf->xattr) returns 4110417968, which exceeds INT_MAX (2,147,483,647). Then ea_size is clamped:
int size = clamp_t(int, ea_size, 0, EALIST_SIZE(ea_buf->xattr));
Although clamp_t aims to bound ea_size between 0 and 4110417968, the upper limit is treated as an int, causing an overflow above 2^31 - 1. This leads "size" to wrap around and become negative (-184549328).
The "size" is then passed to print_hex_dump() (called "len" in print_hex_dump()), it is passed as type size_t (an unsigned type), this is then stored inside a variable called "int remaining", which is then assigned to "int linelen" which is then passed to hex_dump_to_buffer(). In print_hex_dump() the for loop, iterates through 0 to len-1, where len is 18446744073525002176, calling hex_dump_to_buffer() on each iteration:
for (i = 0; i < len; i += rowsize) {
linelen = min(remaining, rowsize);
remaining -= rowsize;
hex_dump_to_buffer(ptr + i, linelen, rowsize, groupsize,
linebuf, sizeof(linebuf), ascii);
...
}The expected stopping condition (i < len) is effectively broken since len is corrupted and very large. This eventually leads to the "ptr+i" being passed to hex_dump_to_buffer() to get closer to the end of the actual bounds of "ptr", eventually an out of bounds access is done in hex_dump_to_buffer() in the following for loop:
for (j = 0; j < len; j++) {
if (linebuflen < lx + 2)
goto overflow2;
ch = ptr[j];
...
}To fix this we should validate "EALIST_SIZE(ea_buf->xattr)" before it is utilised.
--- fs/jfs/xattr.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
fs/jfs/xattr.c +9 -4
@@ -559,11 +559,16 @@ static int ea_get(struct inode *inode, s size_check:if (EALIST_SIZE (ea_buf->xattr) != ea_size) { -int size =clamp_t (int, ea_size,0 ,EALIST_SIZE (ea_buf->xattr)); +if (unlikely (EALIST_SIZE (ea_buf->xattr) >INT_MAX )) { +printk (KERN_ERR "ea_get: extended attribute size too large: %u > INT_MAX\n" , +EALIST_SIZE (ea_buf->xattr)); + }else { +int size =clamp_t (int, ea_size,0 ,EALIST_SIZE (ea_buf->xattr)); -printk (KERN_ERR "ea_get: invalid extended attribute\n" ); -print_hex_dump (KERN_ERR ,"" ,DUMP_PREFIX_ADDRESS ,16 ,1 , - ea_buf->xattr, size,1 ); +printk (KERN_ERR "ea_get: invalid extended attribute\n" ); +print_hex_dump (KERN_ERR ,"" ,DUMP_PREFIX_ADDRESS ,16 ,1 , + ea_buf->xattr, size,1 ); + }ea_release (inode, ea_buf); rc = -EIO ; goto clean_up;
Greg Kroah-Hartman
maintainerPATCH 264/268 jfs: add index corruption check to DT_GETPAGE()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Smirnov <[email protected]>
commit a8dfb2168906944ea61acfc87846b816eeab882d upstream.
If the file system is corrupted, the header.stblindex variable may become greater than 127. Because of this, an array access out of bounds may occur:
------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:3096:10 index 237 is out of range for type 'struct dtslot[128]' CPU: 0 UID: 0 PID: 5822 Comm: syz-executor740 Not tainted 6.13.0-rc4-syzkaller-00110-g4099a71718b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0x121/0x150 lib/ubsan.c:429 dtReadFirst+0x622/0xc50 fs/jfs/jfs_dtree.c:3096 dtReadNext fs/jfs/jfs_dtree.c:3147 [inline] jfs_readdir+0x9aa/0x3c50 fs/jfs/jfs_dtree.c:2862 wrap_directory_iterator+0x91/0xd0 fs/readdir.c:65 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> ---[ end trace ]---
Add a stblindex check for corruption.
--- fs/jfs/jfs_dtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/jfs/jfs_dtree.c +2 -1
@@ -117,7 +117,8 @@ do { \if (!(RC )) { \if (((P )->header.nextindex > \ (((BN ) ==0 ) ?DTROOTMAXSLOT : (P )->header.maxslot)) || \ - ((BN ) && ((P )->header.maxslot >DTPAGEMAXSLOT ))) { \ + ((BN ) && (((P )->header.maxslot >DTPAGEMAXSLOT ) || \ + ((P )->header.stblindex >=DTPAGEMAXSLOT )))) { \BT_PUTPAGE (MP ); \jfs_error ((IP )->i_sb, \"DT_GETPAGE: dtree page corrupt\n" ); \
Greg Kroah-Hartman
maintainerPATCH 265/268 exec: fix the racy usage of fs_struct->in_exec
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit af7bb0d2ca459f15cb5ca604dab5d9af103643f0 upstream.
check_unsafe_exec() sets fs->in_exec under cred_guard_mutex, then execve() paths clear fs->in_exec lockless. This is fine if exec succeeds, but if it fails we have the following race:
T1 sets fs->in_exec = 1, fails, drops cred_guard_mutex T2 sets fs->in_exec = 1 T1 clears fs->in_exec T2 continues with fs->in_exec == 0
Change fs/exec.c to clear fs->in_exec with cred_guard_mutex held.
--- fs/exec.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
fs/exec.c +9 -6
@@ -1257,13 +1257,12 @@ int begin_new_exec(struct linux_binprm **/ bprm->point_of_no_return = true; -/* -* Make this the only thread in the thread group. -*/ +/* Make this the only thread in the thread group */ retval =de_thread (me);if (retval) goto out; - +/* see the comment in check_unsafe_exec() */ + current->fs->in_exec =0 ;/* * Cancel any io_uring activity across execve */
@@ -1516,6 +1515,8 @@ static void free_bprm(struct linux_binpr }free_arg_pages (bprm);if (bprm->cred) { +/* in case exec fails before de_thread() succeeds */ + current->fs->in_exec =0 ;mutex_unlock (¤t->signal->cred_guard_mutex);abort_creds (bprm->cred); }
@@ -1604,6 +1605,10 @@ static void check_unsafe_exec(struct lin* suid exec because the differently privileged task * will be able to manipulate the current directory, etc. * It would be nice to force an unshare instead... +* +* Otherwise we set fs->in_exec = 1 to deny clone(CLONE_FS) +* from another sub-thread until de_thread() succeeds, this +* state is protected by cred_guard_mutex we hold. */ t = p; n_fs =1 ;
@@ -1890,7 +1895,6 @@ static int bprm_execve(struct linux_binpsched_mm_cid_after_execve (current);/* execve succeeded */ - current->fs->in_exec =0 ; current->in_execve =0 ;rseq_execve (current);user_events_execve (current);
@@ -1910,7 +1914,6 @@ out: out_unmark:sched_mm_cid_after_execve (current); - current->fs->in_exec =0 ; current->in_execve =0 ;return retval;
Greg Kroah-Hartman
maintainerPATCH 266/268 media: streamzap: fix race between device disconnection and urb callback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Murad Masimov <[email protected]>
commit f656cfbc7a293a039d6a0c7100e1c846845148c1 upstream.
Syzkaller has reported a general protection fault at function ir_raw_event_store_with_filter(). This crash is caused by a NULL pointer dereference of dev->raw pointer, even though it is checked for NULL in the same function, which means there is a race condition. It occurs due to the incorrect order of actions in the streamzap_disconnect() function:rc_unregister_device() is called before usb_kill_urb(). The dev->raw pointer is freed and set to NULL in rc_unregister_device(), and only after that usb_kill_urb() waits for in-progress requests to finish.
If rc_unregister_device() is called while streamzap_callback() handler is not finished, this can lead to accessing freed resources. Thus rc_unregister_device() should be called after usb_kill_urb().
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/media/rc/streamzap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/streamzap.c +1 -1
@@ -385,8 +385,8 @@ static void streamzap_disconnect(structif (!sz)return ; -rc_unregister_device (sz->rdev);usb_kill_urb (sz->urb_in); +rc_unregister_device (sz->rdev);usb_free_urb (sz->urb_in);usb_free_coherent (usbdev, sz->buf_in_len, sz->buf_in, sz->dma_in);
Greg Kroah-Hartman
maintainerPATCH 267/268 nfsd: put dl_stid if fail to queue dl_recall
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Lingfeng <[email protected]>
commit 230ca758453c63bd38e4d9f4a21db698f7abada8 upstream.
Before calling nfsd4_run_cb to queue dl_recall to the callback_wq, we increment the reference count of dl_stid.
We expect that after the corresponding work_struct is processed, the reference count of dl_stid will be decremented through the callback function nfsd4_cb_recall_release.
However, if the call to nfsd4_run_cb fails, the incremented reference count of dl_stid will not be decremented correspondingly, leading to the following nfs4_stid leak:
unreferenced object 0xffff88812067b578 (size 344):
comm "nfsd", pid 2761, jiffies 4295044002 (age 5541.241s) hex dump (first 32 bytes):
01 00 00 00 6b 6b 6b 6b b8 02 c0 e2 81 88 ff ff ....kkkk........
00 6b 6b 6b 6b 6b 6b 6b 00 00 00 00 ad 4e ad de .kkkkkkk.....N..
backtrace:
kmem_cache_alloc+0x4b9/0x700
nfsd4_process_open1+0x34/0x300
nfsd4_open+0x2d1/0x9d0
nfsd4_proc_compound+0x7a2/0xe30
nfsd_dispatch+0x241/0x3e0
svc_process_common+0x5d3/0xcc0
svc_process+0x2a3/0x320
nfsd+0x180/0x2e0
kthread+0x199/0x1d0
ret_from_fork+0x30/0x50
ret_from_fork_asm+0x1b/0x30
unreferenced object 0xffff8881499f4d28 (size 368):
comm "nfsd", pid 2761, jiffies 4295044005 (age 5541.239s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 30 4d 9f 49 81 88 ff ff ........0M.I....
30 4d 9f 49 81 88 ff ff 20 00 00 00 01 00 00 00 0M.I.... .......
backtrace:
kmem_cache_alloc+0x4b9/0x700
nfs4_alloc_stid+0x29/0x210
alloc_init_deleg+0x92/0x2e0
nfs4_set_delegation+0x284/0xc00
nfs4_open_delegation+0x216/0x3f0
nfsd4_process_open2+0x2b3/0xee0
nfsd4_open+0x770/0x9d0
nfsd4_proc_compound+0x7a2/0xe30
nfsd_dispatch+0x241/0x3e0
svc_process_common+0x5d3/0xcc0
svc_process+0x2a3/0x320
nfsd+0x180/0x2e0
kthread+0x199/0x1d0
ret_from_fork+0x30/0x50
ret_from_fork_asm+0x1b/0x30Fix it by checking the result of nfsd4_run_cb and call nfs4_put_stid if fail to queue dl_recall.
--- fs/nfsd/nfs4state.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c +11 -1
@@ -1066,6 +1066,12 @@ static struct nfs4_ol_stateid * nfs4_allreturn openlockstateid (stid); } +/* +* As the sc_free callback of deleg, this may be called by nfs4_put_stid +* in nfsd_break_one_deleg. +* Considering nfsd_break_one_deleg is called with the flc->flc_lock held, +* this function mustn't ever sleep. +*/ static void nfs4_free_deleg (struct nfs4_stid *stid) {struct nfs4_delegation *dp =delegstateid (stid);
@@ -4920,6 +4926,7 @@ static const struct nfsd4_callback_ops nstatic void nfsd_break_one_deleg (struct nfs4_delegation *dp) { +bool queued;/* * We're assuming the state code never drops its reference * without first removing the lease. Since we're in this lease
@@ -4928,7 +4935,10 @@ static void nfsd_break_one_deleg(struct* we know it's safe to take a reference. */ refcount_inc (&dp->dl_stid.sc_count); -WARN_ON_ONCE (!nfsd4_run_cb (&dp->dl_recall)); + queued =nfsd4_run_cb (&dp->dl_recall); +WARN_ON_ONCE (!queued); +if (!queued) +nfs4_put_stid (&dp->dl_stid); }/* Called from break_lease() with flc_lock held. */
Greg Kroah-Hartman
maintainerPATCH 268/268 NFSD: Skip sending CB_RECALL_ANY when the backchannel isnt up
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit 8a388c1fabeb6606e16467b23242416c0dbeffad upstream.
NFSD sends CB_RECALL_ANY to clients when the server is low on memory or that client has a large number of delegations outstanding.
We've seen cases where NFSD attempts to send CB_RECALL_ANY requests to disconnected clients, and gets confused. These calls never go anywhere if a backchannel transport to the target client isn't available. Before the server can send any backchannel operation, the client has to connect first and then do a BIND_CONN_TO_SESSION.
This patch doesn't address the root cause of the confusion, but there's no need to queue up these optional operations if they can't go anywhere.
--- fs/nfsd/nfs4state.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
fs/nfsd/nfs4state.c +12 -7
@@ -6289,14 +6289,19 @@ deleg_reaper(struct nfsd_net *nn)spin_lock (&nn->client_lock);list_for_each_safe (pos, next, &nn->client_lru) { clp = list_entry(pos, struct nfs4_client, cl_lru); -if (clp->cl_state !=NFSD4_ACTIVE || -list_empty (&clp->cl_delegations) || -atomic_read (&clp->cl_delegs_in_recall) || -test_bit (NFSD4_CLIENT_CB_RECALL_ANY , &clp->cl_flags) || - (ktime_get_boottime_seconds () - - clp->cl_ra_time <5 )) { + +if (clp->cl_state !=NFSD4_ACTIVE ) +continue ; +if (list_empty (&clp->cl_delegations)) +continue ; +if (atomic_read (&clp->cl_delegs_in_recall)) +continue ; +if (test_bit (NFSD4_CLIENT_CB_RECALL_ANY , &clp->cl_flags)) +continue ; +if (ktime_get_boottime_seconds () - clp->cl_ra_time <5 ) +continue ; +if (clp->cl_cb_state !=NFSD4_CB_UP )continue ; - }list_add (&clp->cl_ra_cblist, &cblist);/* release in nfsd4_cb_recall_any_release */
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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.
Am 08.04.2025 um 12:46 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 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]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +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.87-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
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Hello,
Quoted 7 lines · On Tue, 8 Apr 2025 12:46:51 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +0000. Anything received after that time might be too late.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/damonitor/damon-tests/tree/next/corr
[2] 5c3c45826e66 ("Linux 6.6.87-rc1")
Thanks,
SJ
[...]
---
[32m
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh # SKIP
ok 12 selftests: damon-tests: build_m68k.sh # SKIP
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +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.87-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).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +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.87-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
All tests passing for Tegra ...
Test results for stable-v6.6:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.6.87-rc1-g5c3c45826e66
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +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.87-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
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.6.87-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: 5c3c45826e66d7aa24ccc47998543005bc190a84
* git describe: v6.6.86-269-g5c3c45826e66
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.86-269-g5c3c45826e66
## Test Regressions (compared to v6.6.83-270-g0d015475ca4d)
## Metric Regressions (compared to v6.6.83-270-g0d015475ca4d)
## Test Fixes (compared to v6.6.83-270-g0d015475ca4d)
## Metric Fixes (compared to v6.6.83-270-g0d015475ca4d)
## Test result summary
total: 93166, pass: 74695, fail: 3829, skip: 14230, xfail: 412
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 129 total, 128 passed, 1 failed
* arm64: 44 total, 42 passed, 2 failed
* i386: 27 total, 23 passed, 4 failed
* mips: 26 total, 25 passed, 1 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 32 total, 29 passed, 3 failed
* riscv: 20 total, 20 passed, 0 failed
* s390: 14 total, 12 passed, 2 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 7 total, 7 passed, 0 failed
* x86_64: 37 total, 34 passed, 3 failed
## Test suites summary
* boot
* commands
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-exec
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* kselftest-kvm
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-mincore
* kselftest-mqueue
* kselftest-net
* kselftest-net-mptcp
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-x86
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-build-clang
* log-parser-build-gcc
* log-parser-test
* ltp-capability
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.87 release. There are 268 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 Thu, 10 Apr 2025 10:47:53 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit