5.15.171-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainercover 5.15.171-rc1 review
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.171-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.15.171-rc1
Johannes Berg <[email protected]>
mac80211: always have ieee80211_sta_restart()
Jeongjun Park <[email protected]>
vt: prevent kernel-infoleak in con_font_get()
Rob Clark <[email protected]>
drm/i915: Fix potential context UAFs
Jason-JH.Lin <[email protected]>
Revert "drm/mipi-dsi: Set the fwnode for mipi_dsi_device"
Jeongjun Park <[email protected]>
mm: shmem: fix data-race in shmem_getattr()
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: fix 6 GHz scan construction
Ryusuke Konishi <[email protected]>
nilfs2: fix kernel bug due to missing clearing of checked flag
Pawan Gupta <[email protected]>
x86/bugs: Use code segment selector for VERW operand
Edward Adam Davis <[email protected]>
ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow
Matt Fleming <[email protected]>
mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves
Mel Gorman <[email protected]>
mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves
Mel Gorman <[email protected]>
mm/page_alloc: explicitly define what alloc flags deplete min reserves
Mel Gorman <[email protected]>
mm/page_alloc: explicitly record high-order atomic allocations in alloc_flags
Mel Gorman <[email protected]>
mm/page_alloc: treat RT tasks similar to __GFP_HIGH
Mel Gorman <[email protected]>
mm/page_alloc: rename ALLOC_HIGH to ALLOC_MIN_RESERVE
Mel Gorman <[email protected]>
mm/page_alloc: split out buddy removal code from rmqueue into separate helper
Wonhyuk Yang <[email protected]>
mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked()
Eric Dumazet <[email protected]>
mm/page_alloc: call check_new_pages() while zone spinlock is not held
Chunyan Zhang <[email protected]>
riscv: Remove duplicated GET_RM
Chunyan Zhang <[email protected]>
riscv: Remove unused GENERATING_ASM_OFFSETS
WangYuli <[email protected]>
riscv: Use '%u' to format the output of 'cpu'
Heinrich Schuchardt <[email protected]>
riscv: efi: Set NX compat flag in PE/COFF header
Alexandre Ghiti <[email protected]>
riscv: vdso: Prevent the compiler from inserting calls to memset()
Ryusuke Konishi <[email protected]>
nilfs2: fix potential deadlock with newly created symlinks
Javier Carrasco <[email protected]>
iio: light: veml6030: fix microlux value calculation
Zicheng Qu <[email protected]>
iio: adc: ad7124: fix division by zero in ad7124_set_channel_odr()
Zicheng Qu <[email protected]>
staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg()
Ville Syrjälä <[email protected]>
wifi: iwlegacy: Clear stale interrupts before resuming device
Manikanta Pubbisetty <[email protected]>
wifi: ath10k: Fix memory leak in management tx
Felix Fietkau <[email protected]>
wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
Greg Kroah-Hartman <[email protected]>
Revert "driver core: Fix uevent_show() vs driver detach race"
Basavaraj Natikar <[email protected]>
xhci: Use pm_runtime_get to prevent RPM on unsupported systems
Faisal Hassan <[email protected]>
xhci: Fix Link TRB DMA in command ring stopped completion event
Javier Carrasco <[email protected]>
usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes()
Zijun Hu <[email protected]>
usb: phy: Fix API devm_usb_put_phy() can not release the phy
Zongmin Zhou <[email protected]>
usbip: tools: Fix detach_port() invalid port error path
Dimitri Sivanich <[email protected]>
misc: sgi-gru: Don't disable preemption in GRU driver
Dai Ngo <[email protected]>
NFS: remove revoked delegation from server's delegation list
Daniel Palmer <[email protected]>
net: amd: mvme147: Fix probe banner message
Benjamin Marzinski <[email protected]>
scsi: scsi_transport_fc: Allow setting rport state to current state
Konstantin Komarov <[email protected]>
fs/ntfs3: Additional check in ni_clear()
Konstantin Komarov <[email protected]>
fs/ntfs3: Fix possible deadlock in mi_read
Konstantin Komarov <[email protected]>
fs/ntfs3: Fix warning possible deadlock in ntfs_set_state
Andrew Ballance <[email protected]>
fs/ntfs3: Check if more than chunk-size bytes are written
Pierre Gondois <[email protected]>
ACPI: CPPC: Make rmw_lock a raw_spin_lock
Xiongfeng Wang <[email protected]>
firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state()
Pablo Neira Ayuso <[email protected]>
netfilter: nft_payload: sanitize offset and length before calling skb_checksum()
Benoît Monin <[email protected]>
net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension
Dong Chenchen <[email protected]>
netfilter: Fix use-after-free in get_info()
Byeonguk Jeong <[email protected]>
bpf: Fix out-of-bounds write in trie_get_next_key()
Zichen Xie <[email protected]>
netdevsim: Add trailing zero to terminate the string in nsim_nexthop_bucket_activity_write()
Pedro Tammela <[email protected]>
net/sched: stop qdisc_tree_reduce_backlog on TC_H_ROOT
Pablo Neira Ayuso <[email protected]>
gtp: allow -1 to be specified as file description from userspace
Ido Schimmel <[email protected]>
ipv4: ip_tunnel: Fix suspicious RCU usage warning in ip_tunnel_init_flow()
Wander Lairson Costa <[email protected]>
igb: Disable threaded IRQ for igb_msix_other
Furong Xu <[email protected]>
net: stmmac: TSO: Fix unbalanced DMA map/unmap for non-paged SKB data
Christophe JAILLET <[email protected]>
ASoC: cs42l51: Fix some error handling paths in cs42l51_probe()
Daniel Gabay <[email protected]>
wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()
Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: mvm: disconnect station vifs if recovery failed
Youghandhar Chintala <[email protected]>
mac80211: Add support to trigger sta disconnect on hardware restart
Johannes Berg <[email protected]>
mac80211: do drv_reconfig_complete() before restarting all
Selvin Xavier <[email protected]>
RDMA/bnxt_re: synchronize the qp-handle table array
Patrisious Haddad <[email protected]>
RDMA/mlx5: Round max_rd_atomic/max_dest_rd_atomic up instead of down
Leon Romanovsky <[email protected]>
RDMA/cxgb4: Dump vendor specific QP details
Geert Uytterhoeven <[email protected]>
wifi: brcm80211: BRCM_TRACING should depend on TRACING
Felix Fietkau <[email protected]>
wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys
Geert Uytterhoeven <[email protected]>
mac80211: MAC80211_MESSAGE_TRACING should depend on TRACING
Xiu Jianfeng <[email protected]>
cgroup: Fix potential overflow issue when checking max_depth
Koba Ko <[email protected]>
ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context
Sudeep Holla <[email protected]>
ACPI: PRM: Change handler_addr type to void pointer
Aubrey Li <[email protected]>
ACPI: PRM: Remove unnecessary blank lines
Namjae Jeon <[email protected]>
ksmbd: fix user-after-free from session log off
Donet Tom <[email protected]>
selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test
-------------
Diffstat:
Makefile | 4 +- arch/riscv/kernel/asm-offsets.c | 2 - arch/riscv/kernel/cpu-hotplug.c | 2 +- arch/riscv/kernel/efi-header.S | 2 +- arch/riscv/kernel/traps_misaligned.c | 2 - arch/riscv/kernel/vdso/Makefile | 1 + arch/x86/include/asm/nospec-branch.h | 11 +- drivers/acpi/cppc_acpi.c | 9 +- drivers/acpi/prmt.c | 33 ++-- drivers/base/core.c | 13 +- drivers/base/module.c | 4 - drivers/firmware/arm_sdei.c | 2 +- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++- drivers/iio/adc/ad7124.c | 2 +- drivers/iio/light/veml6030.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 + drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 2 + drivers/infiniband/hw/cxgb4/provider.c | 1 + drivers/infiniband/hw/mlx5/qp.c | 4 +- drivers/misc/sgi-gru/grukservices.c | 2 - drivers/misc/sgi-gru/grumain.c | 4 - drivers/misc/sgi-gru/grutlbpurge.c | 2 - drivers/net/ethernet/amd/mvme147.c | 7 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 ++- drivers/net/gtp.c | 22 +-- drivers/net/netdevsim/fib.c | 4 +- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 7 +- drivers/net/wireless/ath/ath10k/wmi.c | 2 + drivers/net/wireless/broadcom/brcm80211/Kconfig | 1 + drivers/net/wireless/intel/iwlegacy/common.c | 2 + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 22 ++- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 3 +- drivers/scsi/scsi_transport_fc.c | 4 +- drivers/staging/iio/frequency/ad9832.c | 7 +- drivers/tty/vt/vt.c | 2 +- drivers/usb/host/xhci-pci.c | 6 +- drivers/usb/host/xhci-ring.c | 16 +- drivers/usb/phy/phy.c | 2 +- drivers/usb/typec/class.c | 1 + fs/ksmbd/mgmt/user_session.c | 26 ++- fs/ksmbd/mgmt/user_session.h | 4 + fs/ksmbd/server.c | 2 + fs/ksmbd/smb2pdu.c | 8 +- fs/nfs/delegation.c | 5 + fs/nilfs2/namei.c | 3 + fs/nilfs2/page.c | 1 + fs/ntfs3/frecord.c | 4 +- fs/ntfs3/lznt.c | 3 + fs/ntfs3/namei.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/file.c | 8 + include/acpi/cppc_acpi.h | 2 +- include/net/ip_tunnels.h | 2 +- include/net/mac80211.h | 10 ++ include/trace/events/kmem.h | 14 +- kernel/bpf/lpm_trie.c | 2 +- kernel/cgroup/cgroup.c | 4 +- mm/internal.h | 13 +- mm/page_alloc.c | 185 +++++++++++++--------- mm/shmem.c | 2 + net/core/dev.c | 4 + net/mac80211/Kconfig | 2 +- net/mac80211/cfg.c | 3 +- net/mac80211/ieee80211_i.h | 3 + net/mac80211/key.c | 42 +++-- net/mac80211/mlme.c | 14 +- net/mac80211/util.c | 45 ++++-- net/netfilter/nft_payload.c | 3 + net/netfilter/x_tables.c | 2 +- net/sched/sch_api.c | 2 +- sound/soc/codecs/cs42l51.c | 7 +- tools/testing/selftests/vm/hmm-tests.c | 2 +- tools/usb/usbip/src/usbip_detach.c | 1 + 76 files changed, 481 insertions(+), 230 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/73 selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test
5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donet Tom <[email protected]>
[ Upstream commit 76503e1fa1a53ef041a120825d5ce81c7fe7bdd7 ]
The hmm2 double_map test was failing due to an incorrect buffer->mirror size. The buffer->mirror size was 6, while buffer->ptr size was 6 * PAGE_SIZE. The test failed because the kernel's copy_to_user function was attempting to copy a 6 * PAGE_SIZE buffer to buffer->mirror. Since the size of buffer->mirror was incorrect, copy_to_user failed.
This patch corrects the buffer->mirror size to 6 * PAGE_SIZE.
Test Result without this patch
==============================
# RUN hmm2.hmm2_device_private.double_map ...
# hmm-tests.c:1680:double_map:Expected ret (-14) == 0 (0) # double_map: Test terminated by assertion
# FAIL hmm2.hmm2_device_private.double_map
not ok 53 hmm2.hmm2_device_private.double_map
Test Result with this patch
===========================
# RUN hmm2.hmm2_device_private.double_map ...
# OK hmm2.hmm2_device_private.double_map
ok 53 hmm2.hmm2_device_private.double_map
--- tools/testing/selftests/vm/hmm-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/hmm-tests.c +1 -1
@@ -1482,7 +1482,7 @@ TEST_F(hmm2, double_map) buffer->fd =-1 ; buffer->size = size; - buffer->mirror =malloc (npages); + buffer->mirror =malloc (size);ASSERT_NE (buffer->mirror,NULL );/* Reserve a range of addresses. */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 2/73 ksmbd: fix user-after-free from session log off
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
[ Upstream commit 7aa8804c0b67b3cb263a472d17f2cb50d7f1a930 ]
There is racy issue between smb2 session log off and smb2 session setup. It will cause user-after-free from session log off.
This add session_lock when setting SMB2_SESSION_EXPIRED and referece count to session struct not to free session while it is being used.
--- fs/ksmbd/mgmt/user_session.c | 26 +++++++++++++++++++++----- fs/ksmbd/mgmt/user_session.h | 4 ++++ fs/ksmbd/server.c | 2 ++ fs/ksmbd/smb2pdu.c | 8 +++++++- 4 files changed, 34 insertions(+), 6 deletions(-)
fs/ksmbd/mgmt/user_session.c +21 -5
@@ -176,9 +176,10 @@ static void ksmbd_expire_session(struct ksmbd_conn *conn)down_write (&conn->session_lock);xa_for_each (&conn->sessions, id, sess) { -if (sess->state !=SMB2_SESSION_VALID || -time_after (jiffies, - sess->last_active +SMB2_SESSION_TIMEOUT )) { +if (atomic_read (&sess->refcnt) ==0 && + (sess->state !=SMB2_SESSION_VALID || +time_after (jiffies, + sess->last_active +SMB2_SESSION_TIMEOUT ))) {xa_erase (&conn->sessions, sess->id);hash_del (&sess->hlist);ksmbd_session_destroy (sess);
@@ -268,8 +269,6 @@ struct ksmbd_session *ksmbd_session_lookup_slowpath(unsigned long long id)down_read (&sessions_table_lock); sess =__session_lookup (id); -if (sess) - sess->last_active = jiffies;up_read (&sessions_table_lock);return sess;
@@ -288,6 +287,22 @@ struct ksmbd_session *ksmbd_session_lookup_all(struct ksmbd_conn *conn,return sess; } +void ksmbd_user_session_get (struct ksmbd_session *sess) +{ +atomic_inc (&sess->refcnt); +} + +void ksmbd_user_session_put (struct ksmbd_session *sess) +{ +if (!sess) +return ; + +if (atomic_read (&sess->refcnt) <=0 ) +WARN_ON (1 ); +else +atomic_dec (&sess->refcnt); +} +struct preauth_session *ksmbd_preauth_session_alloc (struct ksmbd_conn *conn,u64 sess_id) {
@@ -356,6 +371,7 @@ static struct ksmbd_session *__session_create(int protocol)xa_init (&sess->rpc_handle_list); sess->sequence_number =1 ;rwlock_init (&sess->tree_conns_lock); +atomic_set (&sess->refcnt,1 ); ret =__init_smb2_session (sess);if (ret)
fs/ksmbd/mgmt/user_session.h +4 -0
@@ -61,6 +61,8 @@ struct ksmbd_session {struct ksmbd_file_table file_table;unsigned long last_active;rwlock_t tree_conns_lock; + +atomic_t refcnt; };static inline int test_session_flag (struct ksmbd_session *sess,int bit)
@@ -101,4 +103,6 @@ void ksmbd_release_tree_conn_id(struct ksmbd_session *sess, int id);int ksmbd_session_rpc_open (struct ksmbd_session *sess,char *rpc_name);void ksmbd_session_rpc_close (struct ksmbd_session *sess,int id);int ksmbd_session_rpc_method (struct ksmbd_session *sess,int id); +void ksmbd_user_session_get (struct ksmbd_session *sess); +void ksmbd_user_session_put (struct ksmbd_session *sess);#endif /* __USER_SESSION_MANAGEMENT_H__ */
fs/ksmbd/server.c +2 -0
@@ -238,6 +238,8 @@ static void __handle_ksmbd_work(struct ksmbd_work *work, }while (is_chained == true); send: +if (work->sess) +ksmbd_user_session_put (work->sess);if (work->tcon)ksmbd_tree_connect_put (work->tcon);smb3_preauth_hash_rsp (work);
fs/ksmbd/smb2pdu.c +7 -1
@@ -606,8 +606,10 @@ int smb2_check_user_session(struct ksmbd_work *work)/* Check for validity of user session */ work->sess =ksmbd_session_lookup_all (conn, sess_id); -if (work->sess) +if (work->sess) { +ksmbd_user_session_get (work->sess);return 1 ; + }ksmbd_debug (SMB ,"Invalid user session, Uid %llu\n" , sess_id);return -ENOENT ; }
@@ -1761,6 +1763,7 @@ int smb2_sess_setup(struct ksmbd_work *work) } conn->binding = true; +ksmbd_user_session_get (sess); }else if ((conn->dialect <SMB30_PROT_ID || server_conf.flags &KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL ) && (req->Flags &SMB2_SESSION_REQ_FLAG_BINDING )) {
@@ -1787,6 +1790,7 @@ int smb2_sess_setup(struct ksmbd_work *work) } conn->binding = false; +ksmbd_user_session_get (sess); } work->sess = sess;
@@ -2235,7 +2239,9 @@ int smb2_session_logoff(struct ksmbd_work *work) }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 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 3/73 ACPI: PRM: Remove unnecessary blank lines
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aubrey Li <[email protected]>
[ Upstream commit caa2bd07f5c5f09acf62072906daeaa667e2b645 ]
Just remove unnecessary blank lines, no other code changes
Stable-dep-of: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
--- drivers/acpi/prmt.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/acpi/prmt.c +0 -4
@@ -49,7 +49,6 @@ struct prm_context_buffer { };#pragma pack() -static LIST_HEAD (prm_module_list);struct prm_handler_info {
@@ -73,7 +72,6 @@ struct prm_module_info {struct prm_handler_info handlers[]; }; -static u64 efi_pa_va_lookup (u64 pa) {efi_memory_desc_t *md;
@@ -88,7 +86,6 @@ static u64 efi_pa_va_lookup(u64 pa)return 0 ; } -#define get_first_handler (a) ((struct acpi_prmt_handler_info *) ((char *) (a) + a->handler_info_offset))#define get_next_handler (a) ((struct acpi_prmt_handler_info *) (sizeof(struct acpi_prmt_handler_info) + (char *) a))
@@ -171,7 +168,6 @@ static void *find_guid_info(const guid_t *guid, u8 mode)return NULL ; } -static struct prm_module_info *find_prm_module (const guid_t *guid) {return (struct prm_module_info *)find_guid_info (guid,GET_MODULE );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 4/73 ACPI: PRM: Change handler_addr type to void pointer
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <[email protected]>
[ Upstream commit 353efd5e97a7973d78f2634274b57309d0966e29 ]
handler_addr is a virtual address passed to efi_call_virt_pointer. While x86 currently type cast it into the pointer in it's arch specific arch_efi_call_virt() implementation, ARM64 is restrictive for right reasons.
Convert the handler_addr type from u64 to void pointer.
Stable-dep-of: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
--- drivers/acpi/prmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/prmt.c +2 -2
@@ -53,7 +53,7 @@ static LIST_HEAD(prm_module_list);struct prm_handler_info {guid_t guid; -u64 handler_addr; +void *handler_addr;u64 static_data_buffer_addr;u64 acpi_param_buffer_addr;
@@ -136,7 +136,7 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) th = &tm->handlers[cur_handler];guid_copy (&th->guid, (guid_t *)handler_info->handler_guid); - th->handler_addr =efi_pa_va_lookup (handler_info->handler_address); + th->handler_addr = (void *)efi_pa_va_lookup (handler_info->handler_address); th->static_data_buffer_addr =efi_pa_va_lookup (handler_info->static_data_buffer_address); th->acpi_param_buffer_addr =efi_pa_va_lookup (handler_info->acpi_param_buffer_address); }while (++cur_handler < tm->handler_count && (handler_info =get_next_handler (handler_info)));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/73 ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koba Ko <[email protected]>
[ Upstream commit 088984c8d54c0053fc4ae606981291d741c5924b ]
PRMT needs to find the correct type of block to translate the PA-VA mapping for EFI runtime services.
The issue arises because the PRMT is finding a block of type EFI_CONVENTIONAL_MEMORY, which is not appropriate for runtime services as described in Section 2.2.2 (Runtime Services) of the UEFI Specification [1]. Since the PRM handler is a type of runtime service, this causes an exception when the PRM handler is called.
[Firmware Bug]: Unable to handle paging request in EFI runtime service
WARNING: CPU: 22 PID: 4330 at drivers/firmware/efi/runtime-wrappers.c:341
__efi_queue_work+0x11c/0x170
Call trace:
Let PRMT find a block with EFI_MEMORY_RUNTIME for PRM handler and PRM context.
If no suitable block is found, a warning message will be printed, but the procedure continues to manage the next PRM handler.
However, if the PRM handler is actually called without proper allocation, it would result in a failure during error handling.
By using the correct memory types for runtime services, ensure that the PRM handler and the context are properly mapped in the virtual address space during runtime, preventing the paging request error.
The issue is really that only memory that has been remapped for runtime by the firmware can be used by the PRM handler, and so the region needs to have the EFI_MEMORY_RUNTIME attribute.
--- drivers/acpi/prmt.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)
drivers/acpi/prmt.c +22 -5
@@ -72,17 +72,21 @@ struct prm_module_info {struct prm_handler_info handlers[]; }; -static u64 efi_pa_va_lookup (u64 pa) +static u64 efi_pa_va_lookup (efi_guid_t *guid,u64 pa) {efi_memory_desc_t *md;u64 pa_offset = pa & ~PAGE_MASK ;u64 page = pa &PAGE_MASK ;for_each_efi_memory_desc (md) { -if (md->phys_addr < pa && pa < md->phys_addr +PAGE_SIZE * md->num_pages) +if ((md->attribute &EFI_MEMORY_RUNTIME ) && + (md->phys_addr < pa && pa < md->phys_addr +PAGE_SIZE * md->num_pages)) {return pa_offset + md->virt_addr + page - md->phys_addr; + } } +pr_warn ("Failed to find VA for GUID: %pUL, PA: 0x%llx" , guid, pa); +return 0 ; }
@@ -136,9 +140,15 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) th = &tm->handlers[cur_handler];guid_copy (&th->guid, (guid_t *)handler_info->handler_guid); - th->handler_addr = (void *)efi_pa_va_lookup (handler_info->handler_address); - th->static_data_buffer_addr =efi_pa_va_lookup (handler_info->static_data_buffer_address); - th->acpi_param_buffer_addr =efi_pa_va_lookup (handler_info->acpi_param_buffer_address); + th->handler_addr = + (void *)efi_pa_va_lookup (&th->guid, handler_info->handler_address); + + th->static_data_buffer_addr = +efi_pa_va_lookup (&th->guid, handler_info->static_data_buffer_address); + + th->acpi_param_buffer_addr = +efi_pa_va_lookup (&th->guid, handler_info->acpi_param_buffer_address); + }while (++cur_handler < tm->handler_count && (handler_info =get_next_handler (handler_info)));return 0 ;
@@ -232,6 +242,13 @@ static acpi_status acpi_platformrt_space_handler(u32 function,if (!handler || !module) goto invalid_guid; +if (!handler->handler_addr || + !handler->static_data_buffer_addr || + !handler->acpi_param_buffer_addr) { + buffer->prm_status =PRM_HANDLER_ERROR ; +return AE_OK ; + } +ACPI_COPY_NAMESEG (context.signature,"PRMC" ); context.revision =0x0 ; context.reserved =0x0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/73 cgroup: Fix potential overflow issue when checking max_depth
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiu Jianfeng <[email protected]>
[ Upstream commit 3cc4e13bb1617f6a13e5e6882465984148743cf4 ]
cgroup.max.depth is the maximum allowed descent depth below the current cgroup. If the actual descent depth is equal or larger, an attempt to create a new child cgroup will fail. However due to the cgroup->max_depth is of int type and having the default value INT_MAX, the condition 'level > cgroup->max_depth' will never be satisfied, and it will cause an overflow of the level after it reaches to INT_MAX.
Fix it by starting the level from 0 and using '>=' instead.
It's worth mentioning that this issue is unlikely to occur in reality, as it's impossible to have a depth of INT_MAX hierarchy, but should be be avoided logically.
--- kernel/cgroup/cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup/cgroup.c +2 -2
@@ -5527,7 +5527,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent) {struct cgroup *cgroup;int ret = false; -int level =1 ; +int level =0 ;lockdep_assert_held (&cgroup_mutex);
@@ -5535,7 +5535,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent)if (cgroup->nr_descendants >= cgroup->max_descendants) goto fail; -if (level > cgroup->max_depth) +if (level >= cgroup->max_depth) goto fail; level++;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/73 mac80211: MAC80211_MESSAGE_TRACING should depend on TRACING
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit b3e046c31441d182b954fc2f57b2dc38c71ad4bc ]
When tracing is disabled, there is no point in asking the user about enabling tracing of all mac80211 debug messages.
--- net/mac80211/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/Kconfig +1 -1
@@ -86,7 +86,7 @@ config MAC80211_DEBUGFS config MAC80211_MESSAGE_TRACING bool "Trace all mac80211 debug messages" - depends on MAC80211 + depends on MAC80211 && TRACING help Select this option to have mac80211 register the mac80211_msg trace subsystem with tracepoints to
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/73 wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 52009b419355195912a628d0a9847922e90c348c ]
Sync iterator conditions with ieee80211_iter_keys_rcu.
--- net/mac80211/key.c | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-)
net/mac80211/key.c +25 -17
@@ -918,6 +918,26 @@ void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata)mutex_unlock (&sdata->local->key_mtx); } +static void +ieee80211_key_iter (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_key *key, +void (*iter)(struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +struct ieee80211_key_conf *key, +void *data), +void *iter_data) +{ +/* skip keys of station in removal process */ +if (key->sta && key->sta->removed) +return ; +if (!(key->flags &KEY_FLAG_UPLOADED_TO_HARDWARE )) +return ; +iter (hw, vif, key->sta ? &key->sta->sta :NULL , + &key->conf, iter_data); +} + void ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void (*iter)(struct ieee80211_hw *hw,
@@ -937,16 +957,13 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,if (vif) { sdata =vif_to_sdata (vif);list_for_each_entry_safe (key, tmp, &sdata->key_list, list) -iter (hw, &sdata->vif, - key->sta ? &key->sta->sta :NULL , - &key->conf, iter_data); +ieee80211_key_iter (hw, vif, key, iter, iter_data); }else {list_for_each_entry (sdata, &local->interfaces, list)list_for_each_entry_safe (key, tmp, &sdata->key_list, list) -iter (hw, &sdata->vif, - key->sta ? &key->sta->sta :NULL , - &key->conf, iter_data); +ieee80211_key_iter (hw, &sdata->vif, key, + iter, iter_data); }mutex_unlock (&local->key_mtx); }
@@ -964,17 +981,8 @@ _ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, {struct ieee80211_key *key; -list_for_each_entry_rcu (key, &sdata->key_list, list) { -/* skip keys of station in removal process */ -if (key->sta && key->sta->removed) -continue ; -if (!(key->flags &KEY_FLAG_UPLOADED_TO_HARDWARE )) -continue ; - -iter (hw, &sdata->vif, - key->sta ? &key->sta->sta :NULL , - &key->conf, iter_data); - } +list_for_each_entry_rcu (key, &sdata->key_list, list) +ieee80211_key_iter (hw, &sdata->vif, key, iter, iter_data); } void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/73 wifi: brcm80211: BRCM_TRACING should depend on TRACING
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit b73b2069528f90ec49d5fa1010a759baa2c2be05 ]
When tracing is disabled, there is no point in asking the user about enabling Broadcom wireless device tracing.
--- drivers/net/wireless/broadcom/brcm80211/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/broadcom/brcm80211/Kconfig +1 -0
@@ -23,6 +23,7 @@ source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig" config BRCM_TRACING bool "Broadcom device tracing" depends on BRCMSMAC || BRCMFMAC + depends on TRACING help If you say Y here, the Broadcom wireless drivers will register with ftrace to dump event information into the trace ringbuffer.
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 10/73 RDMA/cxgb4: Dump vendor specific QP details
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
[ Upstream commit 89f8c6f197f480fe05edf91eb9359d5425869d04 ]
Restore the missing functionality to dump vendor specific QP details, which was mistakenly removed in the commit mentioned in Fixes line.
--- drivers/infiniband/hw/cxgb4/provider.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/cxgb4/provider.c +1 -0
@@ -469,6 +469,7 @@ static const struct ib_device_ops c4iw_dev_ops = { .fill_res_cq_entry = c4iw_fill_res_cq_entry, .fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry, .fill_res_mr_entry = c4iw_fill_res_mr_entry, + .fill_res_qp_entry = c4iw_fill_res_qp_entry, .get_dev_fw_str = get_dev_fw_str, .get_dma_mr = c4iw_get_dma_mr, .get_hw_stats = c4iw_get_mib,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/73 RDMA/mlx5: Round max_rd_atomic/max_dest_rd_atomic up instead of down
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrisious Haddad <[email protected]>
[ Upstream commit 78ed28e08e74da6265e49e19206e1bcb8b9a7f0d ]
After the cited commit below max_dest_rd_atomic and max_rd_atomic values are being rounded down to the next power of 2. As opposed to the old behavior and mlx4 driver where they used to be rounded up instead.
In order to stay consistent with older code and other drivers, revert to using fls round function which rounds up to the next power of 2.
--- drivers/infiniband/hw/mlx5/qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +2 -2
@@ -4182,14 +4182,14 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,MLX5_SET (qpc, qpc, retry_count, attr->retry_cnt);if (attr_mask &IB_QP_MAX_QP_RD_ATOMIC && attr->max_rd_atomic) -MLX5_SET (qpc, qpc, log_sra_max,ilog2 (attr->max_rd_atomic)); +MLX5_SET (qpc, qpc, log_sra_max,fls (attr->max_rd_atomic -1 ));if (attr_mask &IB_QP_SQ_PSN )MLX5_SET (qpc, qpc, next_send_psn, attr->sq_psn);if (attr_mask &IB_QP_MAX_DEST_RD_ATOMIC && attr->max_dest_rd_atomic)MLX5_SET (qpc, qpc, log_rra_max, -ilog2 (attr->max_dest_rd_atomic)); +fls (attr->max_dest_rd_atomic -1 ));if (attr_mask & (IB_QP_ACCESS_FLAGS |IB_QP_MAX_DEST_RD_ATOMIC )) { err =set_qpc_atomic_flags (qp, attr, attr_mask, qpc);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/73 RDMA/bnxt_re: synchronize the qp-handle table array
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <[email protected]>
[ Upstream commit 76d3ddff7153cc0bcc14a63798d19f5d0693ea71 ]
There is a race between the CREQ tasklet and destroy qp when accessing the qp-handle table. There is a chance of reading a valid qp-handle in the CREQ tasklet handler while the QP is already moving ahead with the destruction.
Fixing this race by implementing a table-lock to synchronize the access.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 4 ++++ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 +++++++++---- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +4 -0
@@ -1494,9 +1494,11 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,u32 tbl_indx;int rc; +spin_lock_bh (&rcfw->tbl_lock); tbl_indx =map_qp_id_to_tbl_indx (qp->id, rcfw); rcfw->qp_tbl[tbl_indx].qp_id =BNXT_QPLIB_QP_ID_INVALID ; rcfw->qp_tbl[tbl_indx].qp_handle =NULL ; +spin_unlock_bh (&rcfw->tbl_lock);RCFW_CMD_PREP (req,DESTROY_QP , cmd_flags);
@@ -1504,8 +1506,10 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, rc =bnxt_qplib_rcfw_send_message (rcfw, (void *)&req, (void *)&resp,NULL ,0 );if (rc) { +spin_lock_bh (&rcfw->tbl_lock); rcfw->qp_tbl[tbl_indx].qp_id = qp->id; rcfw->qp_tbl[tbl_indx].qp_handle = qp; +spin_unlock_bh (&rcfw->tbl_lock);return rc; }
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +9 -4
@@ -320,17 +320,21 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION : err_event = (struct creq_qp_error_notification *)qp_event; qp_id =le32_to_cpu (err_event->xid); +spin_lock (&rcfw->tbl_lock); tbl_indx =map_qp_id_to_tbl_indx (qp_id, rcfw); qp = rcfw->qp_tbl[tbl_indx].qp_handle; +if (!qp) { +spin_unlock (&rcfw->tbl_lock); +break ; + } +bnxt_qplib_mark_qp_error (qp); + rc = rcfw->creq.aeq_handler (rcfw, qp_event, qp); +spin_unlock (&rcfw->tbl_lock);dev_dbg (&pdev->dev,"Received QP error notification\n" );dev_dbg (&pdev->dev,"qpid 0x%x, req_err=0x%x, resp_err=0x%x\n" , qp_id, err_event->req_err_state_reason, err_event->res_err_state_reason); -if (!qp) -break ; -bnxt_qplib_mark_qp_error (qp); - rc = rcfw->creq.aeq_handler (rcfw, qp_event, qp);break ;default :/*
@@ -631,6 +635,7 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res, GFP_KERNEL);if (!rcfw->qp_tbl) goto fail; +spin_lock_init (&rcfw->tbl_lock);return 0 ;
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +2 -0
@@ -186,6 +186,8 @@ struct bnxt_qplib_rcfw {struct bnxt_qplib_crsqe *crsqe_tbl;int qp_tbl_size;struct bnxt_qplib_qp_node *qp_tbl; +/* To synchronize the qp-handle hash table */ +spinlock_t tbl_lock;u64 oos_prev;u32 init_oos_stats;u32 cmdq_depth;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/73 mac80211: do drv_reconfig_complete() before restarting all
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 13dee10b30c058ee2c58c5da00339cc0d4201aa6 ]
When we reconfigure, the driver might do some things to complete the reconfiguration. It's strange and could be broken in some cases because we restart other works (e.g. remain-on-channel and TX) before this happens, yet only start queues later.
Change this to do the reconfig complete when reconfiguration is actually complete, not when we've already started doing other things again.
For iwlwifi, this should fix a race where the reconfig can race with TX, for ath10k and ath11k that also use this it won't make a difference because they just start queues there, and mac80211 also stopped the queues and will restart them later as before.
Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
--- net/mac80211/util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
net/mac80211/util.c +7 -7
@@ -2656,6 +2656,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)mutex_unlock (&local->sta_mtx); } +/* +* If this is for hw restart things are still running. +* We may want to change that later, however. +*/ +if (local->open_count && (!suspended || reconfig_due_to_wowlan)) +drv_reconfig_complete (local,IEEE80211_RECONFIG_TYPE_RESTART ); +if (local->in_reconfig) { local->in_reconfig = false;barrier ();
@@ -2674,13 +2681,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)IEEE80211_QUEUE_STOP_REASON_SUSPEND , false); -/* -* If this is for hw restart things are still running. -* We may want to change that later, however. -*/ -if (local->open_count && (!suspended || reconfig_due_to_wowlan)) -drv_reconfig_complete (local,IEEE80211_RECONFIG_TYPE_RESTART ); -if (!suspended)return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/73 mac80211: Add support to trigger sta disconnect on hardware restart
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Youghandhar Chintala <[email protected]>
[ Upstream commit 7d352ccf1e9935b5222ca84e8baeb07a0c8f94b9 ]
Currently in case of target hardware restart, we just reconfig and re-enable the security keys and enable the network queues to start data traffic back from where it was interrupted.
Many ath10k wifi chipsets have sequence numbers for the data packets assigned by firmware and the mac sequence number will restart from zero after target hardware restart leading to mismatch in the sequence number expected by the remote peer vs the sequence number of the frame sent by the target firmware.
This mismatch in sequence number will cause out-of-order packets on the remote peer and all the frames sent by the device are dropped until we reach the sequence number which was sent before we restarted the target hardware
In order to fix this, we trigger a sta disconnect, in case of target hw restart. After this there will be a fresh connection and thereby avoiding the dropping of frames by remote peer.
The right fix would be to pull the entire data path into the host which is not feasible or would need lots of complex changes and will still be inefficient.
Tested on ath10k using WCN3990, QCA6174
Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
--- include/net/mac80211.h | 10 ++++++++++ net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/mlme.c | 12 ++++++++++++ net/mac80211/util.c | 33 ++++++++++++++++++++++++++++++--- 4 files changed, 55 insertions(+), 3 deletions(-)
include/net/mac80211.h +10 -0
@@ -6009,6 +6009,16 @@ void ieee80211_disconnect(struct ieee80211_vif *vif, bool reconnect);*/ void ieee80211_resume_disconnect (struct ieee80211_vif *vif); +/** +* ieee80211_hw_restart_disconnect - disconnect from AP after +* hardware restart +* @vif: &struct ieee80211_vif pointer from the add_interface callback. +* +* Instructs mac80211 to disconnect from the AP after +* hardware restart. +*/ +void ieee80211_hw_restart_disconnect (struct ieee80211_vif *vif); +/** * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring * rssi threshold triggered
net/mac80211/ieee80211_i.h +3 -0
@@ -765,6 +765,8 @@ struct ieee80211_if_mesh {* back to wireless media and to the local net stack. * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume. * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver +* @IEEE80211_SDATA_DISCONNECT_HW_RESTART: Disconnect after hardware restart +* recovery */ enum ieee80211_sub_if_data_flags {IEEE80211_SDATA_ALLMULTI =BIT (0 ),
@@ -772,6 +774,7 @@ enum ieee80211_sub_if_data_flags {IEEE80211_SDATA_DONT_BRIDGE_PACKETS =BIT (3 ),IEEE80211_SDATA_DISCONNECT_RESUME =BIT (4 ),IEEE80211_SDATA_IN_DRIVER =BIT (5 ), + IEEE80211_SDATA_DISCONNECT_HW_RESTART = BIT(6), };/**
net/mac80211/mlme.c +12 -0
@@ -4853,6 +4853,18 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)sdata_unlock (sdata); return; } + +if (sdata->flags &IEEE80211_SDATA_DISCONNECT_HW_RESTART ) { + sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_HW_RESTART ; +mlme_dbg (sdata,"driver requested disconnect after hardware restart\n" ); +ieee80211_sta_connection_lost (sdata, + ifmgd->associated->bssid, +WLAN_REASON_UNSPECIFIED , + true); +sdata_unlock (sdata); +return ; + } +sdata_unlock (sdata); }#endif
net/mac80211/util.c +30 -3
@@ -2313,6 +2313,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)struct cfg80211_sched_scan_request *sched_scan_req;bool sched_scan_stopped = false;bool suspended = local->suspended; +bool in_reconfig = false;/* nothing to do if HW shouldn't run */ if (!local->open_count)
@@ -2664,6 +2665,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)drv_reconfig_complete (local,IEEE80211_RECONFIG_TYPE_RESTART );if (local->in_reconfig) { + in_reconfig = local->in_reconfig; local->in_reconfig = false;barrier ();
@@ -2681,6 +2683,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)IEEE80211_QUEUE_STOP_REASON_SUSPEND , false); +if (in_reconfig) { +list_for_each_entry (sdata, &local->interfaces, list) { +if (!ieee80211_sdata_running (sdata)) +continue ; +if (sdata->vif.type ==NL80211_IFTYPE_STATION ) +ieee80211_sta_restart (sdata); + } + } +if (!suspended)return 0 ;
@@ -2710,7 +2721,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)return 0 ; } -void ieee80211_resume_disconnect (struct ieee80211_vif *vif) +static void ieee80211_reconfig_disconnect (struct ieee80211_vif *vif,u8 flag) {struct ieee80211_sub_if_data *sdata;struct ieee80211_local *local;
@@ -2722,19 +2733,35 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif) sdata =vif_to_sdata (vif); local = sdata->local; -if (WARN_ON (!local->resuming)) +if (WARN_ON (flag &IEEE80211_SDATA_DISCONNECT_RESUME && + !local->resuming)) +return ; + +if (WARN_ON (flag &IEEE80211_SDATA_DISCONNECT_HW_RESTART && + !local->in_reconfig))return ;if (WARN_ON (vif->type !=NL80211_IFTYPE_STATION ))return ; - sdata->flags |=IEEE80211_SDATA_DISCONNECT_RESUME ; + sdata->flags |= flag;mutex_lock (&local->key_mtx);list_for_each_entry (key, &sdata->key_list, list) key->flags |=KEY_FLAG_TAINTED ;mutex_unlock (&local->key_mtx); } + +void ieee80211_hw_restart_disconnect (struct ieee80211_vif *vif) +{ +ieee80211_reconfig_disconnect (vif,IEEE80211_SDATA_DISCONNECT_HW_RESTART ); +} +EXPORT_SYMBOL_GPL (ieee80211_hw_restart_disconnect); + +void ieee80211_resume_disconnect (struct ieee80211_vif *vif) +{ +ieee80211_reconfig_disconnect (vif,IEEE80211_SDATA_DISCONNECT_RESUME ); +}EXPORT_SYMBOL_GPL (ieee80211_resume_disconnect);void ieee80211_recalc_smps (struct ieee80211_sub_if_data *sdata)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/73 wifi: iwlwifi: mvm: disconnect station vifs if recovery failed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit e50a88e5cb8792cc416866496288c5f4d1eb4b1f ]
This will allow to reconnect immediately instead of leaving the connection in a limbo state.
Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +13 -1
@@ -1272,6 +1272,13 @@ void iwl_mvm_get_acpi_tables(struct iwl_mvm *mvm) }#endif /* CONFIG_ACPI */ +static void iwl_mvm_disconnect_iterator (void *data,u8 *mac, +struct ieee80211_vif *vif) +{ +if (vif->type ==NL80211_IFTYPE_STATION ) +ieee80211_hw_restart_disconnect (vif); +} +void iwl_mvm_send_recovery_cmd (struct iwl_mvm *mvm,u32 flags) {u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
@@ -1316,10 +1323,15 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)/* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */ if (flags &ERROR_RECOVERY_UPDATE_DB ) { resp =le32_to_cpu (*(__le32 *)host_cmd.resp_pkt->data); -if (resp) +if (resp) {IWL_ERR (mvm,"Failed to send recovery cmd blob was invalid %d\n" , resp); + +ieee80211_iterate_interfaces (mvm->hw,0 , + iwl_mvm_disconnect_iterator, + mvm); + } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/73 wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Gabay <[email protected]>
[ Upstream commit 07a6e3b78a65f4b2796a8d0d4adb1a15a81edead ]
1. The size of the response packet is not validated.
2. The response buffer is not freed.
Resolve these issues by switching to iwl_mvm_send_cmd_status(), which handles both size validation and frees the buffer.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +4 -6
@@ -1282,8 +1282,8 @@ static void iwl_mvm_disconnect_iterator(void *data, u8 *mac,void iwl_mvm_send_recovery_cmd (struct iwl_mvm *mvm,u32 flags) {u32 error_log_size = mvm->fw->ucode_capa.error_log_size; +u32 status =0 ;int ret; -u32 resp;struct iwl_fw_error_recovery_cmd recovery_cmd = { .flags =cpu_to_le32 (flags),
@@ -1291,7 +1291,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) };struct iwl_host_cmd host_cmd = { .id =WIDE_ID (SYSTEM_GROUP ,FW_ERROR_RECOVERY_CMD ), - .flags =CMD_WANT_SKB , .data = {&recovery_cmd, }, .len = {sizeof (recovery_cmd), }, };
@@ -1311,7 +1310,7 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) recovery_cmd.buf_size =cpu_to_le32 (error_log_size); } - ret =iwl_mvm_send_cmd (mvm, &host_cmd); + ret =iwl_mvm_send_cmd_status (mvm, &host_cmd, &status);kfree (mvm->error_recovery_buf); mvm->error_recovery_buf =NULL ;
@@ -1322,11 +1321,10 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)/* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */ if (flags &ERROR_RECOVERY_UPDATE_DB ) { - resp =le32_to_cpu (*(__le32 *)host_cmd.resp_pkt->data); -if (resp) { +if (status) {IWL_ERR (mvm,"Failed to send recovery cmd blob was invalid %d\n" , - resp); + status); ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_disconnect_iterator,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/73 ASoC: cs42l51: Fix some error handling paths in cs42l51_probe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit d221b844ee79823ffc29b7badc4010bdb0960224 ]
If devm_gpiod_get_optional() fails, we need to disable previously enabled regulators, as done in the other error handling path of the function.
Also, gpiod_set_value_cansleep(, 1) needs to be called to undo a potential gpiod_set_value_cansleep(, 0).
If the "reset" gpio is not defined, this additional call is just a no-op.
This behavior is the same as the one already in the .remove() function.
--- sound/soc/codecs/cs42l51.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/codecs/cs42l51.c +5 -2
@@ -754,8 +754,10 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap) cs42l51->reset_gpio =devm_gpiod_get_optional (dev,"reset" ,GPIOD_OUT_LOW ); -if (IS_ERR (cs42l51->reset_gpio)) -return PTR_ERR (cs42l51->reset_gpio); +if (IS_ERR (cs42l51->reset_gpio)) { + ret =PTR_ERR (cs42l51->reset_gpio); + goto error; + }if (cs42l51->reset_gpio) {dev_dbg (dev,"Release reset gpio\n" );
@@ -787,6 +789,7 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)return 0 ; error: +gpiod_set_value_cansleep (cs42l51->reset_gpio,1 );regulator_bulk_disable (ARRAY_SIZE (cs42l51->supplies), cs42l51->supplies);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/73 net: stmmac: TSO: Fix unbalanced DMA map/unmap for non-paged SKB data
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <[email protected]>
[ Upstream commit 66600fac7a984dea4ae095411f644770b2561ede ]
In case the non-paged data of a SKB carries protocol header and protocol payload to be transmitted on a certain platform that the DMA AXI address width is configured to 40-bit/48-bit, or the size of the non-paged data is bigger than TSO_MAX_BUFF_SIZE on a certain platform that the DMA AXI address width is configured to 32-bit, then this SKB requires at least two DMA transmit descriptors to serve it.
For example, three descriptors are allocated to split one DMA buffer mapped from one piece of non-paged data:
dma_desc[N + 0],
dma_desc[N + 1],
dma_desc[N + 2].
Then three elements of tx_q->tx_skbuff_dma[] will be allocated to hold
extra information to be reused in stmmac_tx_clean():
tx_q->tx_skbuff_dma[N + 0],
tx_q->tx_skbuff_dma[N + 1],
tx_q->tx_skbuff_dma[N + 2].Now we focus on tx_q->tx_skbuff_dma[entry].buf, which is the DMA buffer address returned by DMA mapping call. stmmac_tx_clean() will try to unmap the DMA buffer _ONLY_IF_ tx_q->tx_skbuff_dma[entry].buf is a valid buffer address.
The expected behavior that saves DMA buffer address of this non-paged data to tx_q->tx_skbuff_dma[entry].buf is:
tx_q->tx_skbuff_dma[N + 0].buf = NULL;
tx_q->tx_skbuff_dma[N + 1].buf = NULL;
tx_q->tx_skbuff_dma[N + 2].buf = dma_map_single();
Unfortunately, the current code misbehaves like this:
tx_q->tx_skbuff_dma[N + 0].buf = dma_map_single();
tx_q->tx_skbuff_dma[N + 1].buf = NULL;
tx_q->tx_skbuff_dma[N + 2].buf = NULL;On the stmmac_tx_clean() side, when dma_desc[N + 0] is closed by the DMA engine, tx_q->tx_skbuff_dma[N + 0].buf is a valid buffer address obviously, then the DMA buffer will be unmapped immediately. There may be a rare case that the DMA engine does not finish the pending dma_desc[N + 1], dma_desc[N + 2] yet. Now things will go horribly wrong, DMA is going to access a unmapped/unreferenced memory region, corrupted data will be transmited or iommu fault will be triggered :(
In contrast, the for-loop that maps SKB fragments behaves perfectly as expected, and that is how the driver should do for both non-paged data and paged frags actually.
This patch corrects DMA map/unmap sequences by fixing the array index for tx_q->tx_skbuff_dma[entry].buf when assigning DMA buffer address.
Tested and verified on DWXGMAC CORE 3.20a
--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +17 -5
@@ -4110,11 +4110,6 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)if (dma_mapping_error (priv->device, des)) goto dma_map_err; - tx_q->tx_skbuff_dma[first_entry].buf = des; - tx_q->tx_skbuff_dma[first_entry].len =skb_headlen (skb); - tx_q->tx_skbuff_dma[first_entry].map_as_page = false; - tx_q->tx_skbuff_dma[first_entry].buf_type =STMMAC_TXBUF_T_SKB ; -if (priv->dma_cap.addr64 <=32 ) { first->des0 =cpu_to_le32 (des);
@@ -4133,6 +4128,23 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)stmmac_tso_allocator (priv, des, tmp_pay_len, (nfrags ==0 ), queue); +/* In case two or more DMA transmit descriptors are allocated for this +* non-paged SKB data, the DMA buffer address should be saved to +* tx_q->tx_skbuff_dma[].buf corresponding to the last descriptor, +* and leave the other tx_q->tx_skbuff_dma[].buf as NULL to guarantee +* that stmmac_tx_clean() does not unmap the entire DMA buffer too early +* since the tail areas of the DMA buffer can be accessed by DMA engine +* sooner or later. +* By saving the DMA buffer address to tx_q->tx_skbuff_dma[].buf +* corresponding to the last descriptor, stmmac_tx_clean() will unmap +* this DMA buffer right after the DMA engine completely finishes the +* full buffer transmission. +*/ + tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des; + tx_q->tx_skbuff_dma[tx_q->cur_tx].len =skb_headlen (skb); + tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false; + tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type =STMMAC_TXBUF_T_SKB ; +/* Prepare fragments */ for (i =0 ; i < nfrags; i++) {const skb_frag_t *frag = &skb_shinfo (skb)->frags[i];
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 19/73 igb: Disable threaded IRQ for igb_msix_other
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wander Lairson Costa <[email protected]>
[ Upstream commit 338c4d3902feb5be49bfda530a72c7ab860e2c9f ]
During testing of SR-IOV, Red Hat QE encountered an issue where the ip link up command intermittently fails for the igbvf interfaces when using the PREEMPT_RT variant. Investigation revealed that e1000_write_posted_mbx returns an error due to the lack of an ACK from e1000_poll_for_ack.
The underlying issue arises from the fact that IRQs are threaded by default under PREEMPT_RT. While the exact hardware details are not available, it appears that the IRQ handled by igb_msix_other must be processed before e1000_poll_for_ack times out. However, e1000_write_posted_mbx is called with preemption disabled, leading to a scenario where the IRQ is serviced only after the failure of e1000_write_posted_mbx.
To resolve this, we set IRQF_NO_THREAD for the affected interrupt, ensuring that the kernel handles it immediately, thereby preventing the aforementioned error.
Reproducer:
#!/bin/bash
# echo 2 > /sys/class/net/ens14f0/device/sriov_numvfs
ipaddr_vlan=3
nic_test=ens14f0
vf=${nic_test}v0
while true; do
ip link set ${nic_test} mtu 1500
ip link set ${vf} mtu 1500
ip link set $vf up
ip link set ${nic_test} vf 0 vlan ${ipaddr_vlan}
ip addr add 172.30.${ipaddr_vlan}.1/24 dev ${vf}
ip addr add 2021:db8:${ipaddr_vlan}::1/64 dev ${vf}
if ! ip link show $vf | grep 'state UP'; then
echo 'Error found'
break
fi
ip link set $vf down
done--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -937,7 +937,7 @@ static int igb_request_msix(struct igb_adapter *adapter)int i, err =0 , vector =0 , free_vector =0 ; err =request_irq (adapter->msix_entries[vector].vector, - igb_msix_other,0 , netdev->name, adapter); + igb_msix_other,IRQF_NO_THREAD , netdev->name, adapter);if (err) goto err_out;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/73 ipv4: ip_tunnel: Fix suspicious RCU usage warning in ip_tunnel_init_flow()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit ad4a3ca6a8e886f6491910a3ae5d53595e40597d ]
There are code paths from which the function is called without holding the RCU read lock, resulting in a suspicious RCU usage warning [1].
Fix by using l3mdev_master_upper_ifindex_by_index() which will acquire the RCU read lock before calling l3mdev_master_upper_ifindex_by_index_rcu().
[1]
WARNING: suspicious RCU usage 6.12.0-rc3-custom-gac8f72681cf2 #141 Not tainted
-----------------------------net/core/dev.c:876 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by ip/361:
#0: ffffffff86fc7cb0 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x377/0xf60
stack backtrace: CPU: 3 UID: 0 PID: 361 Comm: ip Not tainted 6.12.0-rc3-custom-gac8f72681cf2 #141 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 Call Trace: <TASK> dump_stack_lvl+0xba/0x110 lockdep_rcu_suspicious.cold+0x4f/0xd6 dev_get_by_index_rcu+0x1d3/0x210 l3mdev_master_upper_ifindex_by_index_rcu+0x2b/0xf0 ip_tunnel_bind_dev+0x72f/0xa00 ip_tunnel_newlink+0x368/0x7a0 ipgre_newlink+0x14c/0x170 __rtnl_newlink+0x1173/0x19c0 rtnl_newlink+0x6c/0xa0 rtnetlink_rcv_msg+0x3cc/0xf60 netlink_rcv_skb+0x171/0x450 netlink_unicast+0x539/0x7f0 netlink_sendmsg+0x8c1/0xd80 ____sys_sendmsg+0x8f9/0xc20 ___sys_sendmsg+0x197/0x1e0 __sys_sendmsg+0x122/0x1f0 do_syscall_64+0xbb/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- include/net/ip_tunnels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/ip_tunnels.h +1 -1
@@ -247,7 +247,7 @@ static inline void ip_tunnel_init_flow(struct flowi4 *fl4,memset (fl4,0 ,sizeof (*fl4));if (oif) { - fl4->flowi4_l3mdev =l3mdev_master_upper_ifindex_by_index_rcu (net, oif); + fl4->flowi4_l3mdev =l3mdev_master_upper_ifindex_by_index (net, oif);/* Legacy VRF/l3mdev use case */ fl4->flowi4_oif = fl4->flowi4_l3mdev ?0 : oif; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 21/73 gtp: allow -1 to be specified as file description from userspace
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 7515e37bce5c428a56a9b04ea7e96b3f53f17150 ]
Existing user space applications maintained by the Osmocom project are breaking since a recent fix that addresses incorrect error checking.
Restore operation for user space programs that specify -1 as file descriptor to skip GTPv0 or GTPv1 only sockets.
--- drivers/net/gtp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/net/gtp.c +13 -9
@@ -858,20 +858,24 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[])unsigned int role =GTP_ROLE_GGSN ;if (data[IFLA_GTP_FD0 ]) { -u32 fd0 =nla_get_u32 (data[IFLA_GTP_FD0 ]); +int fd0 =nla_get_u32 (data[IFLA_GTP_FD0 ]); - sk0 =gtp_encap_enable_socket (fd0,UDP_ENCAP_GTP0 , gtp); -if (IS_ERR (sk0)) -return PTR_ERR (sk0); +if (fd0 >=0 ) { + sk0 =gtp_encap_enable_socket (fd0,UDP_ENCAP_GTP0 , gtp); +if (IS_ERR (sk0)) +return PTR_ERR (sk0); + } }if (data[IFLA_GTP_FD1 ]) { -u32 fd1 =nla_get_u32 (data[IFLA_GTP_FD1 ]); +int fd1 =nla_get_u32 (data[IFLA_GTP_FD1 ]); - sk1u =gtp_encap_enable_socket (fd1,UDP_ENCAP_GTP1U , gtp); -if (IS_ERR (sk1u)) { -gtp_encap_disable_sock (sk0); -return PTR_ERR (sk1u); +if (fd1 >=0 ) { + sk1u =gtp_encap_enable_socket (fd1,UDP_ENCAP_GTP1U , gtp); +if (IS_ERR (sk1u)) { +gtp_encap_disable_sock (sk0); +return PTR_ERR (sk1u); + } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 22/73 net/sched: stop qdisc_tree_reduce_backlog on TC_H_ROOT
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Tammela <[email protected]>
[ Upstream commit 2e95c4384438adeaa772caa560244b1a2efef816 ]
In qdisc_tree_reduce_backlog, Qdiscs with major handle ffff: are assumed to be either root or ingress. This assumption is bogus since it's valid to create egress qdiscs with major handle ffff:
Budimir Markovic found that for qdiscs like DRR that maintain an active class list, it will cause a UAF with a dangling class pointer.
In 066a3b5b2346, the concern was to avoid iterating over the ingress qdisc since its parent is itself. The proper fix is to stop when parent TC_H_ROOT is reached because the only way to retrieve ingress is when a hierarchy which does not contain a ffff: major handle call into qdisc_lookup with TC_H_MAJ(TC_H_ROOT).
In the scenario where major ffff: is an egress qdisc in any of the tree levels, the updates will also propagate to TC_H_ROOT, which then the iteration must stop.
net/sched/sch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- net/sched/sch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_api.c +1 -1
@@ -780,7 +780,7 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len) drops =max_t (int, n,0 );rcu_read_lock ();while ((parentid = sch->parent)) { -if (TC_H_MAJ (parentid) ==TC_H_MAJ (TC_H_INGRESS )) +if (parentid ==TC_H_ROOT )break ;if (sch->flags &TCQ_F_NOPARENT )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/73 netdevsim: Add trailing zero to terminate the string in nsim_nexthop_bucket_activity_write()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zichen Xie <[email protected]>
[ Upstream commit 4ce1f56a1eaced2523329bef800d004e30f2f76c ]
This was found by a static analyzer.
We should not forget the trailing zero after copy_from_user() if we will further do some string operations, sscanf() in this case. Adding a trailing zero will ensure that the function performs properly.
--- drivers/net/netdevsim/fib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/netdevsim/fib.c +3 -1
@@ -1366,10 +1366,12 @@ static ssize_t nsim_nexthop_bucket_activity_write(struct file *file,if (pos !=0 )return -EINVAL ; -if (size >sizeof (buf)) +if (size >sizeof (buf) -1 )return -EINVAL ;if (copy_from_user (buf, user_buf, size))return -EFAULT ; + buf[size] =0 ; +if (sscanf (buf,"%u %hu" , &nhid, &bucket_index) !=2 )return -EINVAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/73 bpf: Fix out-of-bounds write in trie_get_next_key()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Byeonguk Jeong <[email protected]>
[ Upstream commit 13400ac8fb80c57c2bfb12ebd35ee121ce9b4d21 ]
trie_get_next_key() allocates a node stack with size trie->max_prefixlen, while it writes (trie->max_prefixlen + 1) nodes to the stack when it has full paths from the root to leaves. For example, consider a trie with max_prefixlen is 8, and the nodes with key 0x00/0, 0x00/1, 0x00/2, ... 0x00/8 inserted. Subsequent calls to trie_get_next_key with _key with .prefixlen = 8 make 9 nodes be written on the node stack with size 8.
--- kernel/bpf/lpm_trie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/lpm_trie.c +1 -1
@@ -644,7 +644,7 @@ static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key)if (!key || key->prefixlen > trie->max_prefixlen) goto find_leftmost; - node_stack =kmalloc_array (trie->max_prefixlen, + node_stack =kmalloc_array (trie->max_prefixlen +1 ,sizeof (struct lpm_trie_node *),GFP_ATOMIC | __GFP_NOWARN);if (!node_stack)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/73 netfilter: Fix use-after-free in get_info()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dong Chenchen <[email protected]>
[ Upstream commit f48d258f0ac540f00fa617dac496c4c18b5dc2fa ]
ip6table_nat module unload has refcnt warning for UAF. call trace is:
WARNING: CPU: 1 PID: 379 at kernel/module/main.c:853 module_put+0x6f/0x80 Modules linked in: ip6table_nat(-) CPU: 1 UID: 0 PID: 379 Comm: ip6tables Not tainted 6.12.0-rc4-00047-gc2ee9f594da8-dirty #205 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:module_put+0x6f/0x80 Call Trace: <TASK> get_info+0x128/0x180 do_ip6t_get_ctl+0x6a/0x430 nf_getsockopt+0x46/0x80 ipv6_getsockopt+0xb9/0x100 rawv6_getsockopt+0x42/0x190 do_sock_getsockopt+0xaa/0x180 __sys_getsockopt+0x70/0xc0 __x64_sys_getsockopt+0x20/0x30 do_syscall_64+0xa2/0x1a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Concurrent execution of module unload and get_info() trigered the warning. The root cause is as follows:
cpu0 cpu1module_exit
//mod->state = MODULE_STATE_GOING
ip6table_nat_exit
xt_unregister_template
kfree(t)
//removed from templ_list
getinfo()
t = xt_find_table_lock
list_for_each_entry(tmpl, &xt_templates[af]...)
if (strcmp(tmpl->name, name))
continue; //table not found
try_module_get
list_for_each_entry(t, &xt_net->tables[af]...)
return t; //not get refcnt
module_put(t->me) //uaf
unregister_pernet_subsys
//remove table from xt_net listWhile xt_table module was going away and has been removed from xt_templates list, we couldnt get refcnt of xt_table->me. Check module in xt_net->tables list re-traversal to fix it.
--- net/netfilter/x_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/x_tables.c +1 -1
@@ -1268,7 +1268,7 @@ struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,/* and once again: */ list_for_each_entry (t, &xt_net->tables[af], list) -if (strcmp (t->name, name) ==0 ) +if (strcmp (t->name, name) ==0 && owner == t->me)return t;module_put (owner);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/73 net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benoît Monin <[email protected]>
[ Upstream commit 04c20a9356f283da623903e81e7c6d5df7e4dc3c ]
As documented in skbuff.h, devices with NETIF_F_IPV6_CSUM capability can only checksum TCP and UDP over IPv6 if the IP header does not contains extension.
This is enforced for UDP packets emitted from user-space to an IPv6 address as they go through ip6_make_skb(), which calls __ip6_append_data() where a check is done on the header size before setting CHECKSUM_PARTIAL.
But the introduction of UDP encapsulation with fou6 added a code-path where it is possible to get an skb with a partial UDP checksum and an IPv6 header with extension:
* fou6 adds a UDP header with a partial checksum if the inner packet does not contains a valid checksum.
* ip6_tunnel adds an IPv6 header with a destination option extension header if encap_limit is non-zero (the default value is 4).
The thread linked below describes in more details how to reproduce the problem with GRE-in-UDP tunnel.
Add a check on the network header size in skb_csum_hwoffload_help() to make sure no IPv6 packet with extension header is handed to a network device with NETIF_F_IPV6_CSUM capability.
--- net/core/dev.c | 4 ++++ 1 file changed, 4 insertions(+)
net/core/dev.c +4 -0
@@ -3668,6 +3668,9 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,return 0 ;if (features & (NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM )) { +if (vlan_get_protocol (skb) ==htons (ETH_P_IPV6 ) && +skb_network_header_len (skb) !=sizeof (struct ipv6hdr )) + goto sw_checksum;switch (skb->csum_offset) {case offsetof(struct tcphdr , check):case offsetof(struct udphdr , check):
@@ -3675,6 +3678,7 @@ int skb_csum_hwoffload_help(struct sk_buff *skb, } } +sw_checksum:return skb_checksum_help (skb); }EXPORT_SYMBOL (skb_csum_hwoffload_help);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/73 netfilter: nft_payload: sanitize offset and length before calling skb_checksum()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit d5953d680f7e96208c29ce4139a0e38de87a57fe ]
If access to offset + length is larger than the skbuff length, then skb_checksum() triggers BUG_ON().
skb_checksum() internally subtracts the length parameter while iterating over skbuff, BUG_ON(len) at the end of it checks that the expected length to be included in the checksum calculation is fully consumed.
--- net/netfilter/nft_payload.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nft_payload.c +3 -0
@@ -749,6 +749,9 @@ static void nft_payload_set_eval(const struct nft_expr *expr, ((priv->base != NFT_PAYLOAD_TRANSPORT_HEADER && priv->base != NFT_PAYLOAD_INNER_HEADER) || skb->ip_summed != CHECKSUM_PARTIAL)) { +if (offset + priv->len > skb->len) + goto err; + fsum =skb_checksum (skb, offset, priv->len,0 ); tsum =csum_partial (src, priv->len,0 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/73 firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiongfeng Wang <[email protected]>
[ Upstream commit c83212d79be2c9886d3e6039759ecd388fd5fed1 ]
In sdei_device_freeze(), the input parameter of cpuhp_remove_state() is passed as 'sdei_entry_point' by mistake. Change it to 'sdei_hp_state'.
--- drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_sdei.c +1 -1
@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state); err =sdei_unregister_shared ();if (err)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 29/73 ACPI: CPPC: Make rmw_lock a raw_spin_lock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pierre Gondois <[email protected]>
[ Upstream commit 1c10941e34c5fdc0357e46a25bd130d9cf40b925 ]
The following BUG was triggered:
=============================
[ BUG: Invalid wait context ]
6.12.0-rc2-XXX #406 Not tainted
-----------------------------
kworker/1:1/62 is trying to lock:ffffff8801593030 (&cpc_ptr->rmw_lock){+.+.}-{3:3}, at: cpc_write+0xcc/0x370 other info that might help us debug this:
context-{5:5}
2 locks held by kworker/1:1/62:
#0: ffffff897ef5ec98 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2c/0x50 #1: ffffff880154e238 (&sg_policy->update_lock){....}-{2:2}, at: sugov_update_shared+0x3c/0x280
stack backtrace: CPU: 1 UID: 0 PID: 62 Comm: kworker/1:1 Not tainted 6.12.0-rc2-g9654bd3e8806 #406 Workqueue: 0x0 (events) Call trace: dump_backtrace+0xa4/0x130 show_stack+0x20/0x38 dump_stack_lvl+0x90/0xd0 dump_stack+0x18/0x28 __lock_acquire+0x480/0x1ad8 lock_acquire+0x114/0x310 _raw_spin_lock+0x50/0x70 cpc_write+0xcc/0x370 cppc_set_perf+0xa0/0x3a8 cppc_cpufreq_fast_switch+0x40/0xc0 cpufreq_driver_fast_switch+0x4c/0x218 sugov_update_shared+0x234/0x280 update_load_avg+0x6ec/0x7b8 dequeue_entities+0x108/0x830 dequeue_task_fair+0x58/0x408 __schedule+0x4f0/0x1070 schedule+0x54/0x130 worker_thread+0xc0/0x2e8 kthread+0x130/0x148 ret_from_fork+0x10/0x20
sugov_update_shared() locks a raw_spinlock while cpc_write() locks a spinlock.
To have a correct wait-type order, update rmw_lock to a raw spinlock and ensure that interrupts will be disabled on the CPU holding it.
--- drivers/acpi/cppc_acpi.c | 9 +++++---- include/acpi/cppc_acpi.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/acpi/cppc_acpi.c +5 -4
@@ -813,7 +813,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Store CPU Logical ID */ cpc_ptr->cpu_id = pr->id; -spin_lock_init (&cpc_ptr->rmw_lock); +raw_spin_lock_init (&cpc_ptr->rmw_lock);/* Parse PSD data for this CPU */ ret =acpi_get_psd (cpc_ptr, handle);
@@ -1020,6 +1020,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)int pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg;struct cpc_desc *cpc_desc; +unsigned long flags; size =GET_BIT_WIDTH (reg);
@@ -1047,7 +1048,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)return -ENODEV ; } -spin_lock (&cpc_desc->rmw_lock); +raw_spin_lock_irqsave (&cpc_desc->rmw_lock, flags);switch (size) {case 8 : prev_val =readb_relaxed (vaddr);
@@ -1062,7 +1063,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) prev_val =readq_relaxed (vaddr);break ;default : -spin_unlock (&cpc_desc->rmw_lock); +raw_spin_unlock_irqrestore (&cpc_desc->rmw_lock, flags);return -EFAULT ; } val =MASK_VAL_WRITE (reg, prev_val, val);
@@ -1095,7 +1096,7 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) }if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) -spin_unlock (&cpc_desc->rmw_lock); +raw_spin_unlock_irqrestore (&cpc_desc->rmw_lock, flags);return ret_val; }
include/acpi/cppc_acpi.h +1 -1
@@ -65,7 +65,7 @@ struct cpc_desc {int write_cmd_status;int write_cmd_id;/* Lock used for RMW operations in cpc_write() */ -spinlock_t rmw_lock; +raw_spinlock_t rmw_lock;struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT ];struct acpi_psd_package domain_info;struct kobject kobj;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 30/73 fs/ntfs3: Check if more than chunk-size bytes are written
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Ballance <[email protected]>
[ Upstream commit 9931122d04c6d431b2c11b5bb7b10f28584067f0 ]
A incorrectly formatted chunk may decompress into more than LZNT_CHUNK_SIZE bytes and a index out of bounds will occur in s_max_off.
--- fs/ntfs3/lznt.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ntfs3/lznt.c +3 -0
@@ -236,6 +236,9 @@ static inline ssize_t decompress_chunk(u8 *unc, u8 *unc_end, const u8 *cmpr,/* Do decompression until pointers are inside range. */ while (up < unc_end && cmpr < cmpr_end) { +// return err if more than LZNT_CHUNK_SIZE bytes are written +if (up - unc >LZNT_CHUNK_SIZE ) +return -EINVAL ;/* Correct index */ while (unc + s_max_off[index] < up) index +=1 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 31/73 fs/ntfs3: Fix warning possible deadlock in ntfs_set_state
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit 5b2db723455a89dc96743d34d8bdaa23a402db2f ]
Use non-zero subkey to skip analyzer warnings.
--- fs/ntfs3/ntfs_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/ntfs_fs.h +1 -1
@@ -328,7 +328,7 @@ struct mft_inode {/* Nested class for ntfs_inode::ni_lock. */ enum ntfs_inode_mutex_lock_class { -NTFS_INODE_MUTEX_DIRTY , +NTFS_INODE_MUTEX_DIRTY =1 ,NTFS_INODE_MUTEX_SECURITY ,NTFS_INODE_MUTEX_OBJID ,NTFS_INODE_MUTEX_REPARSE ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 32/73 fs/ntfs3: Fix possible deadlock in mi_read
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit 03b097099eef255fbf85ea6a786ae3c91b11f041 ]
Mutex lock with another subclass used in ni_lock_dir().
--- fs/ntfs3/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/namei.c +1 -1
@@ -79,7 +79,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,if (err <0 ) inode =ERR_PTR (err);else { -ni_lock (ni); +ni_lock_dir (ni); inode =dir_search_u (dir, uni,NULL );ni_unlock (ni); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 33/73 fs/ntfs3: Additional check in ni_clear()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit d178944db36b3369b78a08ba520de109b89bf2a9 ]
Checking of NTFS_FLAGS_LOG_REPLAYING added to prevent access to uninitialized bitmap during replay process.
--- fs/ntfs3/frecord.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ntfs3/frecord.c +3 -1
@@ -101,7 +101,9 @@ void ni_clear(struct ntfs_inode *ni) {struct rb_node *node; -if (!ni->vfs_inode.i_nlink && ni->mi.mrec &&is_rec_inuse (ni->mi.mrec)) +if (!ni->vfs_inode.i_nlink && ni->mi.mrec && +is_rec_inuse (ni->mi.mrec) && + !(ni->mi.sbi->flags &NTFS_FLAGS_LOG_REPLAYING ))ni_delete_all (ni);al_destroy (ni);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 34/73 scsi: scsi_transport_fc: Allow setting rport state to current state
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Marzinski <[email protected]>
[ Upstream commit d539a871ae47a1f27a609a62e06093fa69d7ce99 ]
The only input fc_rport_set_marginal_state() currently accepts is "Marginal" when port_state is "Online", and "Online" when the port_state is "Marginal". It should also allow setting port_state to its current state, either "Marginal or "Online".
--- drivers/scsi/scsi_transport_fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_fc.c +2 -2
@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,*/ if (rport->port_state ==FC_PORTSTATE_ONLINE ) rport->port_state = port_state; -else +else if (port_state != rport->port_state)return -EINVAL ; }else if (port_state ==FC_PORTSTATE_ONLINE ) {/*
@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,*/ if (rport->port_state ==FC_PORTSTATE_MARGINAL ) rport->port_state = port_state; -else +else if (port_state != rport->port_state)return -EINVAL ; }else return -EINVAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 35/73 net: amd: mvme147: Fix probe banner message
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Palmer <[email protected]>
[ Upstream commit 82c5b53140faf89c31ea2b3a0985a2f291694169 ]
Currently this driver prints this line with what looks like a rogue format specifier when the device is probed:
[ 2.840000] eth%d: MVME147 at 0xfffe1800, irq 12, Hardware Address xx:xx:xx:xx:xx:xx
Change the printk() for netdev_info() and move it after the registration has completed so it prints out the name of the interface properly.
--- drivers/net/ethernet/amd/mvme147.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/amd/mvme147.c +3 -4
@@ -103,10 +103,6 @@ static struct net_device * __init mvme147lance_probe(void) address = address >>8 ; dev->dev_addr[3 ] = address&0xff ; -printk ("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n" , - dev->name, dev->base_addr,MVME147_LANCE_IRQ , - dev->dev_addr); - lp =netdev_priv (dev); lp->ram =__get_dma_pages (GFP_ATOMIC ,3 );/* 32K */ if (!lp->ram) {
@@ -136,6 +132,9 @@ static struct net_device * __init mvme147lance_probe(void)return ERR_PTR (err); } +netdev_info (dev,"MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n" , + dev->base_addr,MVME147_LANCE_IRQ , dev->dev_addr); +return dev; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 36/73 NFS: remove revoked delegation from servers delegation list
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dai Ngo <[email protected]>
[ Upstream commit 7ef60108069b7e3cc66432304e1dd197d5c0a9b5 ]
After the delegation is returned to the NFS server remove it from the server's delegations list to reduce the time it takes to scan this list.
Network trace captured while running the below script shows the time taken to service the CB_RECALL increases gradually due to the overhead of traversing the delegation list in nfs_delegation_find_inode_server.
The NFS server in this test is a Solaris server which issues CB_RECALL when receiving the all-zero stateid in the SETATTR.
mount=/mnt/data
for i in $(seq 1 20)
do
echo $i
mkdir $mount/testtarfile$i
time tar -C $mount/testtarfile$i -xf 5000_files.tar
done
--- fs/nfs/delegation.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/nfs/delegation.c +5 -0
@@ -981,6 +981,11 @@ void nfs_delegation_mark_returned(struct inode *inode, }nfs_mark_delegation_revoked (delegation); +clear_bit (NFS_DELEGATION_RETURNING , &delegation->flags); +spin_unlock (&delegation->lock); +if (nfs_detach_delegation (NFS_I (inode), delegation,NFS_SERVER (inode))) +nfs_put_delegation (delegation); + goto out_rcu_unlock; out_clear_returning:clear_bit (NFS_DELEGATION_RETURNING , &delegation->flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 37/73 misc: sgi-gru: Dont disable preemption in GRU driver
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dimitri Sivanich <[email protected]>
[ Upstream commit b983b271662bd6104d429b0fd97af3333ba760bf ]
Disabling preemption in the GRU driver is unnecessary, and clashes with sleeping locks in several code paths. Remove preempt_disable and preempt_enable from the GRU driver.
--- drivers/misc/sgi-gru/grukservices.c | 2 -- drivers/misc/sgi-gru/grumain.c | 4 ---- drivers/misc/sgi-gru/grutlbpurge.c | 2 -- 3 files changed, 8 deletions(-)
drivers/misc/sgi-gru/grukservices.c +0 -2
@@ -258,7 +258,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)int lcpu;BUG_ON (dsr_bytes >GRU_NUM_KERNEL_DSR_BYTES ); -preempt_disable (); bs =gru_lock_kernel_context (-1 ); lcpu =uv_blade_processor_id (); *cb = bs->kernel_cb + lcpu *GRU_HANDLE_STRIDE ;
@@ -272,7 +271,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)static void gru_free_cpu_resources (void *cb,void *dsr) {gru_unlock_kernel_context (uv_numa_blade_id ()); -preempt_enable (); }/*
drivers/misc/sgi-gru/grumain.c +0 -4
@@ -941,10 +941,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf) again:mutex_lock (>s->ts_ctxlock); -preempt_disable ();if (gru_check_context_placement (gts)) { -preempt_enable ();mutex_unlock (>s->ts_ctxlock);gru_unload_context (gts,1 );return VM_FAULT_NOPAGE ;
@@ -953,7 +951,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf)if (!gts->ts_gru) {STAT (load_user_context);if (!gru_assign_gru_context (gts)) { -preempt_enable ();mutex_unlock (>s->ts_ctxlock);set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (GRU_ASSIGN_DELAY );/* true hack ZZZ */
@@ -969,7 +966,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf) vma->vm_page_prot); } -preempt_enable ();mutex_unlock (>s->ts_ctxlock);return VM_FAULT_NOPAGE ;
drivers/misc/sgi-gru/grutlbpurge.c +0 -2
@@ -65,7 +65,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_statestruct gru_tlb_global_handle *tgh;int n; -preempt_disable ();if (uv_numa_blade_id () == gru->gs_blade_id) n =get_on_blade_tgh (gru);else
@@ -79,7 +78,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_statestatic void get_unlock_tgh_handle (struct gru_tlb_global_handle *tgh) {unlock_tgh_handle (tgh); -preempt_enable (); }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 38/73 usbip: tools: Fix detach_port() invalid port error path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zongmin Zhou <[email protected]>
commit e7cd4b811c9e019f5acbce85699c622b30194c24 upstream.
The detach_port() doesn't return error
when detach is attempted on an invalid port.
--- tools/usb/usbip/src/usbip_detach.c | 1 + 1 file changed, 1 insertion(+)
tools/usb/usbip/src/usbip_detach.c +1 -0
@@ -68,6 +68,7 @@ static int detach_port(char *port) }if (!found) { + ret =-1 ;err ("Invalid port %s > maxports %d" , port, vhci_driver->nports); goto call_driver_close;
Greg Kroah-Hartman
maintainerPATCH 39/73 usb: phy: Fix API devm_usb_put_phy() can not release the phy
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
commit fdce49b5da6e0fb6d077986dec3e90ef2b094b50 upstream.
For devm_usb_put_phy(), its comment says it needs to invoke usb_put_phy() to release the phy, but it does not do that actually, so it can not fully undo what the API devm_usb_get_phy() does, that is wrong, fixed by using devres_release() instead of devres_destroy() within the API.
--- drivers/usb/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy.c +1 -1
@@ -628,7 +628,7 @@ void devm_usb_put_phy(struct device *dev {int r; - r =devres_destroy (dev, devm_usb_phy_release, devm_usb_phy_match, phy); + r =devres_release (dev, devm_usb_phy_release, devm_usb_phy_match, phy);dev_WARN_ONCE (dev, r,"couldn't find PHY resource\n" ); }EXPORT_SYMBOL_GPL (devm_usb_put_phy);
Greg Kroah-Hartman
maintainerPATCH 40/73 usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <[email protected]>
commit 9581acb91eaf5bbe70086bbb6fca808220d358ba upstream.
The 'altmodes_node' fwnode_handle is never released after it is no longer required, which leaks the resource.
Add the required call to fwnode_handle_put() when 'altmodes_node' is no longer required.
--- drivers/usb/typec/class.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/typec/class.c +1 -0
@@ -2026,6 +2026,7 @@ void typec_port_register_altmodes(struct altmodes[index] = alt; index++; } +fwnode_handle_put (altmodes_node); }EXPORT_SYMBOL_GPL (typec_port_register_altmodes);
Greg Kroah-Hartman
maintainerPATCH 41/73 xhci: Fix Link TRB DMA in command ring stopped completion event
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Faisal Hassan <[email protected]>
commit 075919f6df5dd82ad0b1894898b315fbb3c29b84 upstream.
During the aborting of a command, the software receives a command completion event for the command ring stopped, with the TRB pointing to the next TRB after the aborted command.
If the command we abort is located just before the Link TRB in the command ring, then during the 'command ring stopped' completion event, the xHC gives the Link TRB in the event's cmd DMA, which causes a mismatch in handling command completion event.
To address this situation, move the 'command ring stopped' completion event check slightly earlier, since the specific command it stopped on isn't of significant concern.
--- drivers/usb/host/xhci-ring.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-ring.c +8 -8
@@ -1769,6 +1769,14 @@ static void handle_cmd_completion(structtrace_xhci_handle_command (xhci->cmd_ring, &cmd_trb->generic); + cmd_comp_code =GET_COMP_CODE (le32_to_cpu (event->status)); + +/* If CMD ring stopped we own the trbs between enqueue and dequeue */ +if (cmd_comp_code ==COMP_COMMAND_RING_STOPPED ) { +complete_all (&xhci->cmd_ring_stop_completion); +return ; + } + cmd_dequeue_dma =xhci_trb_virt_to_dma (xhci->cmd_ring->deq_seg, cmd_trb);/*
@@ -1785,14 +1793,6 @@ static void handle_cmd_completion(structcancel_delayed_work (&xhci->cmd_timer); - cmd_comp_code =GET_COMP_CODE (le32_to_cpu (event->status)); - -/* If CMD ring stopped we own the trbs between enqueue and dequeue */ -if (cmd_comp_code ==COMP_COMMAND_RING_STOPPED ) { -complete_all (&xhci->cmd_ring_stop_completion); -return ; - } -if (cmd->command_trb != xhci->cmd_ring->dequeue) {xhci_err (xhci,"Command completion event does not match command\n" );
Greg Kroah-Hartman
maintainerPATCH 42/73 xhci: Use pm_runtime_get to prevent RPM on unsupported systems
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Basavaraj Natikar <[email protected]>
commit 31004740e42846a6f0bb255e6348281df3eb8032 upstream.
Use pm_runtime_put in the remove function and pm_runtime_get to disable RPM on platforms that don't support runtime D3, as re-enabling it through sysfs auto power control may cause the controller to malfunction. This can lead to issues such as hotplug devices not being detected due to failed interrupt generation.
--- drivers/usb/host/xhci-pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-pci.c +4 -2
@@ -527,7 +527,7 @@ static int xhci_pci_probe(struct pci_devpm_runtime_put_noidle (&dev->dev);if (pci_choose_state (dev,PMSG_SUSPEND ) ==PCI_D0 ) -pm_runtime_forbid (&dev->dev); +pm_runtime_get (&dev->dev);else if (xhci->quirks &XHCI_DEFAULT_PM_RUNTIME_ALLOW )pm_runtime_allow (&dev->dev);
@@ -554,7 +554,9 @@ static void xhci_pci_remove(struct pci_d xhci->xhc_state |=XHCI_STATE_REMOVING ; -if (xhci->quirks &XHCI_DEFAULT_PM_RUNTIME_ALLOW ) +if (pci_choose_state (dev,PMSG_SUSPEND ) ==PCI_D0 ) +pm_runtime_put (&dev->dev); +else if (xhci->quirks &XHCI_DEFAULT_PM_RUNTIME_ALLOW )pm_runtime_forbid (&dev->dev);if (xhci->shared_hcd) {
Greg Kroah-Hartman
maintainerPATCH 43/73 Revert "driver core: Fix uevent_show() vs driver detach race"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 9a71892cbcdb9d1459c84f5a4c722b14354158a5 upstream.
This reverts commit 15fffc6a5624b13b428bb1c6e9088e32a55eb82c.
This commit causes a regression, so revert it for now until it can come back in a way that works for everyone.
--- drivers/base/core.c | 13 +++++-------- drivers/base/module.c | 4 ---- 2 files changed, 5 insertions(+), 12 deletions(-)
drivers/base/core.c +5 -8
@@ -25,7 +25,6 @@#include <linux/mutex.h> #include <linux/pm_runtime.h> #include <linux/netdevice.h> -#include <linux/rcupdate.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h> #include <linux/swiotlb.h>
@@ -2306,7 +2305,6 @@ static int dev_uevent(struct kset *kset, struct kobj_uevent_env *env) {struct device *dev =kobj_to_dev (kobj); -struct device_driver *driver;int retval =0 ;/* add device node properties if present */
@@ -2335,12 +2333,8 @@ static int dev_uevent(struct kset *kset,if (dev->type && dev->type->name)add_uevent_var (env,"DEVTYPE=%s" , dev->type->name); -/* Synchronize with module_remove_driver() */ -rcu_read_lock (); - driver =READ_ONCE (dev->driver); -if (driver) -add_uevent_var (env,"DRIVER=%s" , driver->name); -rcu_read_unlock (); +if (dev->driver) +add_uevent_var (env,"DRIVER=%s" , dev->driver->name);/* Add common DT information about the device */ of_device_uevent (dev, env);
@@ -2410,8 +2404,11 @@ static ssize_t uevent_show(struct deviceif (!env)return -ENOMEM ; +/* Synchronize with really_probe() */ +device_lock (dev);/* let the kset specific function add its keys */ retval = kset->uevent_ops->uevent (kset, &dev->kobj, env); +device_unlock (dev);if (retval) goto out;
drivers/base/module.c +0 -4
@@ -7,7 +7,6 @@#include <linux/errno.h> #include <linux/slab.h> #include <linux/string.h> -#include <linux/rcupdate.h> #include "base.h" static char *make_driver_name (struct device_driver *drv)
@@ -78,9 +77,6 @@ void module_remove_driver(struct device_if (!drv)return ; -/* Synchronize with dev_uevent() */ -synchronize_rcu (); -sysfs_remove_link (&drv->p->kobj,"module" );if (drv->owner)
Greg Kroah-Hartman
maintainerPATCH 44/73 wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 393b6bc174b0dd21bb2a36c13b36e62fc3474a23 upstream.
Avoid potentially crashing in the driver because of uninitialized private data
--- net/mac80211/cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +2 -1
@@ -2757,7 +2757,8 @@ static int ieee80211_get_tx_power(structstruct ieee80211_local *local =wiphy_priv (wiphy);struct ieee80211_sub_if_data *sdata =IEEE80211_WDEV_TO_SUB_IF (wdev); -if (local->ops->get_txpower) +if (local->ops->get_txpower && + (sdata->flags &IEEE80211_SDATA_IN_DRIVER ))return drv_get_txpower (local, sdata, dbm);if (!local->use_chanctx)
Greg Kroah-Hartman
maintainerPATCH 45/73 wifi: ath10k: Fix memory leak in management tx
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manikanta Pubbisetty <[email protected]>
commit e15d84b3bba187aa372dff7c58ce1fd5cb48a076 upstream.
In the current logic, memory is allocated for storing the MSDU context during management packet TX but this memory is not being freed during management TX completion. Similar leaks are seen in the management TX cleanup logic.
Kmemleak reports this problem as below,
unreferenced object 0xffffff80b64ed250 (size 16):
comm "kworker/u16:7", pid 148, jiffies 4294687130 (age 714.199s) hex dump (first 16 bytes):
00 2b d8 d8 80 ff ff ff c4 74 e9 fd 07 00 00 00 .+.......t......
backtrace:
[<ffffffe6e7b245dc>] __kmem_cache_alloc_node+0x1e4/0x2d8
[<ffffffe6e7adde88>] kmalloc_trace+0x48/0x110
[<ffffffe6bbd765fc>] ath10k_wmi_tlv_op_gen_mgmt_tx_send+0xd4/0x1d8 [ath10k_core]
[<ffffffe6bbd3eed4>] ath10k_mgmt_over_wmi_tx_work+0x134/0x298 [ath10k_core]
[<ffffffe6e78d5974>] process_scheduled_works+0x1ac/0x400
[<ffffffe6e78d60b8>] worker_thread+0x208/0x328
[<ffffffe6e78dc890>] kthread+0x100/0x1c0
[<ffffffe6e78166c0>] ret_from_fork+0x10/0x20Free the memory during completion and cleanup to fix the leak.
Protect the mgmt_pending_tx idr_remove() operation in ath10k_wmi_tlv_op_cleanup_mgmt_tx_send() using ar->data_lock similar to other instances.
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 7 ++++++- drivers/net/wireless/ath/ath10k/wmi.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi-tlv.c +6 -1
@@ -3035,9 +3035,14 @@ ath10k_wmi_tlv_op_cleanup_mgmt_tx_send(s struct sk_buff *msdu) {struct ath10k_skb_cb *cb =ATH10K_SKB_CB (msdu); +struct ath10k_mgmt_tx_pkt_addr *pkt_addr;struct ath10k_wmi *wmi = &ar->wmi; -idr_remove (&wmi->mgmt_pending_tx, cb->msdu_id); +spin_lock_bh (&ar->data_lock); + pkt_addr =idr_remove (&wmi->mgmt_pending_tx, cb->msdu_id); +spin_unlock_bh (&ar->data_lock); + +kfree (pkt_addr);return 0 ; }
drivers/net/wireless/ath/ath10k/wmi.c +2 -0
@@ -2440,6 +2440,7 @@ wmi_process_mgmt_tx_comp(struct ath10k *dma_unmap_single (ar->dev, pkt_addr->paddr, msdu->len,DMA_TO_DEVICE ); info =IEEE80211_SKB_CB (msdu); +kfree (pkt_addr);if (param->status) { info->flags &= ~IEEE80211_TX_STAT_ACK ;
@@ -9581,6 +9582,7 @@ static int ath10k_wmi_mgmt_tx_clean_up_pdma_unmap_single (ar->dev, pkt_addr->paddr, msdu->len,DMA_TO_DEVICE );ieee80211_free_txskb (ar->hw, msdu); +kfree (pkt_addr);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 46/73 wifi: iwlegacy: Clear stale interrupts before resuming device
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit 07c90acb071b9954e1fecb1e4f4f13d12c544b34 upstream.
iwl4965 fails upon resume from hibernation on my laptop. The reason seems to be a stale interrupt which isn't being cleared out before interrupts are enabled. We end up with a race beween the resume trying to bring things back up, and the restart work (queued form the interrupt handler) trying to bring things down. Eventually the whole thing blows up.
Fix the problem by clearing out any stale interrupts before interrupts get enabled during resume.
Here's a debug log of the indicent:
[ 12.042589] ieee80211 phy0: il_isr ISR inta 0x00000080, enabled 0xaa00008b, fh 0x00000000 [ 12.042625] ieee80211 phy0: il4965_irq_tasklet inta 0x00000080, enabled 0x00000000, fh 0x00000000 [ 12.042651] iwl4965 0000:10:00.0: RF_KILL bit toggled to enable radio. [ 12.042653] iwl4965 0000:10:00.0: On demand firmware reload [ 12.042690] ieee80211 phy0: il4965_irq_tasklet End inta 0x00000000, enabled 0xaa00008b, fh 0x00000000, flags 0x00000282 [ 12.052207] ieee80211 phy0: il4965_mac_start enter [ 12.052212] ieee80211 phy0: il_prep_station Add STA to driver ID 31: ff:ff:ff:ff:ff:ff [ 12.052244] ieee80211 phy0: il4965_set_hw_ready hardware ready [ 12.052324] ieee80211 phy0: il_apm_init Init card's basic functions [ 12.052348] ieee80211 phy0: il_apm_init L1 Enabled; Disabling L0S [ 12.055727] ieee80211 phy0: il4965_load_bsm Begin load bsm [ 12.056140] ieee80211 phy0: il4965_verify_bsm Begin verify bsm [ 12.058642] ieee80211 phy0: il4965_verify_bsm BSM bootstrap uCode image OK [ 12.058721] ieee80211 phy0: il4965_load_bsm BSM write complete, poll 1 iterations [ 12.058734] ieee80211 phy0: __il4965_up iwl4965 is coming up [ 12.058737] ieee80211 phy0: il4965_mac_start Start UP work done. [ 12.058757] ieee80211 phy0: __il4965_down iwl4965 is going down [ 12.058761] ieee80211 phy0: il_scan_cancel_timeout Scan cancel timeout [ 12.058762] ieee80211 phy0: il_do_scan_abort Not performing scan to abort [ 12.058765] ieee80211 phy0: il_clear_ucode_stations Clearing ucode stations in driver [ 12.058767] ieee80211 phy0: il_clear_ucode_stations No active stations found to be cleared [ 12.058819] ieee80211 phy0: _il_apm_stop Stop card, put in low power state [ 12.058827] ieee80211 phy0: _il_apm_stop_master stop master [ 12.058864] ieee80211 phy0: il4965_clear_free_frames 0 frames on pre-allocated heap on clear. [ 12.058869] ieee80211 phy0: Hardware restart was requested [ 16.132299] iwl4965 0000:10:00.0: START_ALIVE timeout after 4000ms. [ 16.132303] ------------[ cut here ]------------ [ 16.132304] Hardware became unavailable upon resume. This could be a software issue prior to suspend or a hardware issue. [ 16.132338] WARNING: CPU: 0 PID: 181 at net/mac80211/util.c:1826 ieee80211_reconfig+0x8f/0x14b0 [mac80211] [ 16.132390] Modules linked in: ctr ccm sch_fq_codel xt_tcpudp xt_multiport xt_state iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv4 ip_tables x_tables binfmt_misc joydev mousedev btusb btrtl btintel btbcm bluetooth ecdh_generic ecc iTCO_wdt i2c_dev iwl4965 iwlegacy coretemp snd_hda_codec_analog pcspkr psmouse mac80211 snd_hda_codec_generic libarc4 sdhci_pci cqhci sha256_generic sdhci libsha256 firewire_ohci snd_hda_intel snd_intel_dspcfg mmc_core snd_hda_codec snd_hwdep firewire_core led_class iosf_mbi snd_hda_core uhci_hcd lpc_ich crc_itu_t cfg80211 ehci_pci ehci_hcd snd_pcm usbcore mfd_core rfkill snd_timer snd usb_common soundcore video parport_pc parport intel_agp wmi intel_gtt backlight e1000e agpgart evdev [ 16.132456] CPU: 0 UID: 0 PID: 181 Comm: kworker/u8:6 Not tainted 6.11.0-cl+ #143 [ 16.132460] Hardware name: Hewlett-Packard HP Compaq 6910p/30BE, BIOS 68MCU Ver. F.19 07/06/2010 [ 16.132463] Workqueue: async async_run_entry_fn [ 16.132469] RIP: 0010:ieee80211_reconfig+0x8f/0x14b0 [mac80211] [ 16.132501] Code: da 02 00 00 c6 83 ad 05 00 00 00 48 89 df e8 98 1b fc ff 85 c0 41 89 c7 0f 84 e9 02 00 00 48 c7 c7 a0 e6 48 a0 e8 d1 77 c4 e0 <0f> 0b eb 2d 84 c0 0f 85 8b 01 00 00 c6 87 ad 05 00 00 00 e8 69 1b [ 16.132504] RSP: 0018:ffffc9000029fcf0 EFLAGS: 00010282 [ 16.132507] RAX: 0000000000000000 RBX: ffff8880072008e0 RCX: 0000000000000001 [ 16.132509] RDX: ffffffff81f21a18 RSI: 0000000000000086 RDI: 0000000000000001 [ 16.132510] RBP: ffff8880072003c0 R08: 0000000000000000 R09: 0000000000000003 [ 16.132512] R10: 0000000000000000 R11: ffff88807e5b0000 R12: 0000000000000001 [ 16.132514] R13: 0000000000000000 R14: 0000000000000000 R15: 00000000ffffff92 [ 16.132515] FS: 0000000000000000(0000) GS:ffff88807c200000(0000) knlGS:0000000000000000 [ 16.132517] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 16.132519] CR2: 000055dd43786c08 CR3: 000000000978f000 CR4: 00000000000006f0 [ 16.132521] Call Trace: [ 16.132525] <TASK> [ 16.132526] ? __warn+0x77/0x120 [ 16.132532] ? ieee80211_reconfig+0x8f/0x14b0 [mac80211] [ 16.132564] ? report_bug+0x15c/0x190 [ 16.132568] ? handle_bug+0x36/0x70 [ 16.132571] ? exc_invalid_op+0x13/0x60 [ 16.132573] ? asm_exc_invalid_op+0x16/0x20 [ 16.132579] ? ieee80211_reconfig+0x8f/0x14b0 [mac80211] [ 16.132611] ? snd_hdac_bus_init_cmd_io+0x24/0x200 [snd_hda_core] [ 16.132617] ? pick_eevdf+0x133/0x1c0 [ 16.132622] ? check_preempt_wakeup_fair+0x70/0x90 [ 16.132626] ? wakeup_preempt+0x4a/0x60 [ 16.132628] ? ttwu_do_activate.isra.0+0x5a/0x190 [ 16.132632] wiphy_resume+0x79/0x1a0 [cfg80211] [ 16.132675] ? wiphy_suspend+0x2a0/0x2a0 [cfg80211] [ 16.132697] dpm_run_callback+0x75/0x1b0 [ 16.132703] device_resume+0x97/0x200 [ 16.132707] async_resume+0x14/0x20 [ 16.132711] async_run_entry_fn+0x1b/0xa0 [ 16.132714] process_one_work+0x13d/0x350 [ 16.132718] worker_thread+0x2be/0x3d0 [ 16.132722] ? cancel_delayed_work_sync+0x70/0x70 [ 16.132725] kthread+0xc0/0xf0 [ 16.132729] ? kthread_park+0x80/0x80 [ 16.132732] ret_from_fork+0x28/0x40 [ 16.132735] ? kthread_park+0x80/0x80 [ 16.132738] ret_from_fork_asm+0x11/0x20 [ 16.132741] </TASK> [ 16.132742] ---[ end trace 0000000000000000 ]--- [ 16.132930] ------------[ cut here ]------------ [ 16.132932] WARNING: CPU: 0 PID: 181 at net/mac80211/driver-ops.c:41 drv_stop+0xe7/0xf0 [mac80211] [ 16.132957] Modules linked in: ctr ccm sch_fq_codel xt_tcpudp xt_multiport xt_state iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv4 ip_tables x_tables binfmt_misc joydev mousedev btusb btrtl btintel btbcm bluetooth ecdh_generic ecc iTCO_wdt i2c_dev iwl4965 iwlegacy coretemp snd_hda_codec_analog pcspkr psmouse mac80211 snd_hda_codec_generic libarc4 sdhci_pci cqhci sha256_generic sdhci libsha256 firewire_ohci snd_hda_intel snd_intel_dspcfg mmc_core snd_hda_codec snd_hwdep firewire_core led_class iosf_mbi snd_hda_core uhci_hcd lpc_ich crc_itu_t cfg80211 ehci_pci ehci_hcd snd_pcm usbcore mfd_core rfkill snd_timer snd usb_common soundcore video parport_pc parport intel_agp wmi intel_gtt backlight e1000e agpgart evdev [ 16.133014] CPU: 0 UID: 0 PID: 181 Comm: kworker/u8:6 Tainted: G W 6.11.0-cl+ #143 [ 16.133018] Tainted: [W]=WARN [ 16.133019] Hardware name: Hewlett-Packard HP Compaq 6910p/30BE, BIOS 68MCU Ver. F.19 07/06/2010 [ 16.133021] Workqueue: async async_run_entry_fn [ 16.133025] RIP: 0010:drv_stop+0xe7/0xf0 [mac80211] [ 16.133048] Code: 48 85 c0 74 0e 48 8b 78 08 89 ea 48 89 de e8 e0 87 04 00 65 ff 0d d1 de c4 5f 0f 85 42 ff ff ff e8 be 52 c2 e0 e9 38 ff ff ff <0f> 0b 5b 5d c3 0f 1f 40 00 41 54 49 89 fc 55 53 48 89 f3 2e 2e 2e [ 16.133050] RSP: 0018:ffffc9000029fc50 EFLAGS: 00010246 [ 16.133053] RAX: 0000000000000000 RBX: ffff8880072008e0 RCX: ffff88800377f6c0 [ 16.133054] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff8880072008e0 [ 16.133056] RBP: 0000000000000000 R08: ffffffff81f238d8 R09: 0000000000000000 [ 16.133058] R10: ffff8880080520f0 R11: 0000000000000000 R12: ffff888008051c60 [ 16.133060] R13: ffff8880072008e0 R14: 0000000000000000 R15: ffff8880072011d8 [ 16.133061] FS: 0000000000000000(0000) GS:ffff88807c200000(0000) knlGS:0000000000000000 [ 16.133063] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 16.133065] CR2: 000055dd43786c08 CR3: 000000000978f000 CR4: 00000000000006f0 [ 16.133067] Call Trace: [ 16.133069] <TASK> [ 16.133070] ? __warn+0x77/0x120 [ 16.133075] ? drv_stop+0xe7/0xf0 [mac80211] [ 16.133098] ? report_bug+0x15c/0x190 [ 16.133100] ? handle_bug+0x36/0x70 [ 16.133103] ? exc_invalid_op+0x13/0x60 [ 16.133105] ? asm_exc_invalid_op+0x16/0x20 [ 16.133109] ? drv_stop+0xe7/0xf0 [mac80211] [ 16.133132] ieee80211_do_stop+0x55a/0x810 [mac80211] [ 16.133161] ? fq_codel_reset+0xa5/0xc0 [sch_fq_codel] [ 16.133164] ieee80211_stop+0x4f/0x180 [mac80211] [ 16.133192] __dev_close_many+0xa2/0x120 [ 16.133195] dev_close_many+0x90/0x150 [ 16.133198] dev_close+0x5d/0x80 [ 16.133200] cfg80211_shutdown_all_interfaces+0x40/0xe0 [cfg80211] [ 16.133223] wiphy_resume+0xb2/0x1a0 [cfg80211] [ 16.133247] ? wiphy_suspend+0x2a0/0x2a0 [cfg80211] [ 16.133269] dpm_run_callback+0x75/0x1b0 [ 16.133273] device_resume+0x97/0x200 [ 16.133277] async_resume+0x14/0x20 [ 16.133280] async_run_entry_fn+0x1b/0xa0 [ 16.133283] process_one_work+0x13d/0x350 [ 16.133287] worker_thread+0x2be/0x3d0 [ 16.133290] ? cancel_delayed_work_sync+0x70/0x70 [ 16.133294] kthread+0xc0/0xf0 [ 16.133296] ? kthread_park+0x80/0x80 [ 16.133299] ret_from_fork+0x28/0x40 [ 16.133302] ? kthread_park+0x80/0x80 [ 16.133304] ret_from_fork_asm+0x11/0x20 [ 16.133307] </TASK> [ 16.133308] ---[ end trace 0000000000000000 ]--- [ 16.133335] ieee80211 phy0: PM: dpm_run_callback(): wiphy_resume [cfg80211] returns -110 [ 16.133360] ieee80211 phy0: PM: failed to restore async: error -110
--- drivers/net/wireless/intel/iwlegacy/common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlegacy/common.c +2 -0
@@ -4960,6 +4960,8 @@ il_pci_resume(struct device *device)*/ pci_write_config_byte (pdev,PCI_CFG_RETRY_TIMEOUT ,0x00 ); +_il_wr (il,CSR_INT ,0xffffffff ); +_il_wr (il,CSR_FH_INT_STATUS ,0xffffffff );il_enable_interrupts (il);if (!(_il_rd (il,CSR_GP_CNTRL ) &CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW ))
Greg Kroah-Hartman
maintainerPATCH 47/73 staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zicheng Qu <[email protected]>
commit 6bd301819f8f69331a55ae2336c8b111fc933f3d upstream.
In the ad9832_write_frequency() function, clk_get_rate() might return 0. This can lead to a division by zero when calling ad9832_calc_freqreg(). The check if (fout > (clk_get_rate(st->mclk) / 2)) does not protect against the case when fout is 0. The ad9832_write_frequency() function is called from ad9832_write(), and fout is derived from a text buffer, which can contain any value.
--- drivers/staging/iio/frequency/ad9832.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/staging/iio/frequency/ad9832.c +5 -2
@@ -129,12 +129,15 @@ static unsigned long ad9832_calc_freqregstatic int ad9832_write_frequency (struct ad9832_state *st,unsigned int addr,unsigned long fout) { +unsigned long clk_freq;unsigned long regval; -if (fout > (clk_get_rate (st->mclk) /2 )) + clk_freq =clk_get_rate (st->mclk); + +if (!clk_freq || fout > (clk_freq /2 ))return -EINVAL ; - regval =ad9832_calc_freqreg (clk_get_rate (st->mclk), fout); + regval =ad9832_calc_freqreg (clk_freq, fout); st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) | (addr << ADD_SHIFT) |
Greg Kroah-Hartman
maintainerPATCH 48/73 iio: adc: ad7124: fix division by zero in ad7124_set_channel_odr()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zicheng Qu <[email protected]>
commit efa353ae1b0541981bc96dbf2e586387d0392baa upstream.
In the ad7124_write_raw() function, parameter val can potentially be zero. This may lead to a division by zero when DIV_ROUND_CLOSEST() is called within ad7124_set_channel_odr(). The ad7124_write_raw() function is invoked through the sequence: iio_write_channel_raw() -> iio_write_channel_attribute() -> iio_channel_write(), with no checks in place to ensure val is non-zero.
--- drivers/iio/adc/ad7124.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7124.c +1 -1
@@ -596,7 +596,7 @@ static int ad7124_write_raw(struct iio_dswitch (info) {case IIO_CHAN_INFO_SAMP_FREQ : -if (val2 !=0 ) { +if (val2 !=0 || val ==0 ) { ret = -EINVAL ;break ; }
Greg Kroah-Hartman
maintainerPATCH 49/73 iio: light: veml6030: fix microlux value calculation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <[email protected]>
commit 63dd163cd61dda6f38343776b42331cc6b7e56e0 upstream.
The raw value conversion to obtain a measurement in lux as INT_PLUS_MICRO does not calculate the decimal part properly to display it as micro (in this case microlux). It only calculates the module to obtain the decimal part from a resolution that is 10000 times the provided in the datasheet (0.5376 lux/cnt for the veml6030). The resulting value must still be multiplied by 100 to make it micro.
This bug was introduced with the original implementation of the driver.
Only the illuminance channel is fixed becuase the scale is non sensical for the intensity channels anyway.
--- drivers/iio/light/veml6030.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/veml6030.c +1 -1
@@ -522,7 +522,7 @@ static int veml6030_read_raw(struct iio_ }if (mask ==IIO_CHAN_INFO_PROCESSED ) { *val = (reg * data->cur_resolution) /10000 ; - *val2 = (reg * data->cur_resolution) %10000 ; + *val2 = (reg * data->cur_resolution) %10000 *100 ;return IIO_VAL_INT_PLUS_MICRO ; } *val = reg;
Greg Kroah-Hartman
maintainerPATCH 50/73 nilfs2: fix potential deadlock with newly created symlinks
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
commit b3a033e3ecd3471248d474ef263aadc0059e516a upstream.
Syzbot reported that page_symlink(), called by nilfs_symlink(), triggers memory reclamation involving the filesystem layer, which can result in circular lock dependencies among the reader/writer semaphore nilfs->ns_segctor_sem, s_writers percpu_rwsem (intwrite) and the fs_reclaim pseudo lock.
This is because after commit 21fc61c73c39 ("don't put symlink bodies in pagecache into highmem"), the gfp flags of the page cache for symbolic links are overwritten to GFP_KERNEL via inode_nohighmem().
This is not a problem for symlinks read from the backing device, because the __GFP_FS flag is dropped after inode_nohighmem() is called. However, when a new symlink is created with nilfs_symlink(), the gfp flags remain overwritten to GFP_KERNEL. Then, memory allocation called from page_symlink() etc. triggers memory reclamation including the FS layer, which may call nilfs_evict_inode() or nilfs_dirty_inode(). And these can cause a deadlock if they are called while nilfs->ns_segctor_sem is held:
Fix this issue by dropping the __GFP_FS flag from the page cache GFP flags of newly created symlinks in the same way that nilfs_new_inode() and __nilfs_read_inode() do, as a workaround until we adopt nofs allocation scope consistently or improve the locking constraints.
--- fs/nilfs2/namei.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nilfs2/namei.c +3 -0
@@ -157,6 +157,9 @@ static int nilfs_symlink(struct user_nam/* slow symlink */ inode->i_op = &nilfs_symlink_inode_operations;inode_nohighmem (inode); +mapping_set_gfp_mask (inode->i_mapping, +mapping_gfp_constraint (inode->i_mapping, + ~__GFP_FS)); inode->i_mapping->a_ops = &nilfs_aops; err =page_symlink (inode, symname, l);if (err)
Greg Kroah-Hartman
maintainerPATCH 51/73 riscv: vdso: Prevent the compiler from inserting calls to memset()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Ghiti <[email protected]>
[ Upstream commit bf40167d54d55d4b54d0103713d86a8638fb9290 ]
The compiler is smart enough to insert a call to memset() in riscv_vdso_get_cpus(), which generates a dynamic relocation.
So prevent this by using -fno-builtin option.
--- arch/riscv/kernel/vdso/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kernel/vdso/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o ccflags-y := -fno-stack-protector ccflags-y += -DDISABLE_BRANCH_PROFILING +ccflags-y += -fno-builtin ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 52/73 riscv: efi: Set NX compat flag in PE/COFF header
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heinrich Schuchardt <[email protected]>
[ Upstream commit d41373a4b910961df5a5e3527d7bde6ad45ca438 ]
The IMAGE_DLLCHARACTERISTICS_NX_COMPAT informs the firmware that the EFI binary does not rely on pages that are both executable and writable.
The flag is used by some distro versions of GRUB to decide if the EFI binary may be executed.
As the Linux kernel neither has RWX sections nor needs RWX pages for relocation we should set the flag.
--- arch/riscv/kernel/efi-header.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/efi-header.S +1 -1
@@ -59,7 +59,7 @@ extra_header_fields: .long efi_header_end - _start // SizeOfHeaders .long 0 // CheckSum .short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem - .short 0 // DllCharacteristics + .short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics .quad 0 // SizeOfStackReserve .quad 0 // SizeOfStackCommit .quad 0 // SizeOfHeapReserve
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 53/73 riscv: Use %u to format the output of cpu
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: WangYuli <[email protected]>
[ Upstream commit e0872ab72630dada3ae055bfa410bf463ff1d1e0 ]
'cpu' is an unsigned integer, so its conversion specifier should be %u, not %d.
--- arch/riscv/kernel/cpu-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/cpu-hotplug.c +1 -1
@@ -71,7 +71,7 @@ void __cpu_die(unsigned int cpu)if (cpu_ops[cpu]->cpu_is_stopped) ret = cpu_ops[cpu]->cpu_is_stopped (cpu);if (ret) -pr_warn ("CPU%d may not have stopped: %d\n" , cpu, ret); +pr_warn ("CPU%u may not have stopped: %d\n" , cpu, ret); }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 54/73 riscv: Remove unused GENERATING_ASM_OFFSETS
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chunyan Zhang <[email protected]>
[ Upstream commit 46d4e5ac6f2f801f97bcd0ec82365969197dc9b1 ]
The macro is not used in the current version of kernel, it looks like can be removed to avoid a build warning:
../arch/riscv/kernel/asm-offsets.c: At top level:../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros]
7 | #define GENERATING_ASM_OFFSETS
--- arch/riscv/kernel/asm-offsets.c | 2 -- 1 file changed, 2 deletions(-)
arch/riscv/kernel/asm-offsets.c +0 -2
@@ -4,8 +4,6 @@* Copyright (C) 2017 SiFive */ -#define GENERATING_ASM_OFFSETS -#include <linux/kbuild.h> #include <linux/sched.h> #include <asm/thread_info.h>
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 55/73 riscv: Remove duplicated GET_RM
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chunyan Zhang <[email protected]>
[ Upstream commit 164f66de6bb6ef454893f193c898dc8f1da6d18b ]
The macro GET_RM defined twice in this file, one can be removed.
--- arch/riscv/kernel/traps_misaligned.c | 2 -- 1 file changed, 2 deletions(-)
arch/riscv/kernel/traps_misaligned.c +0 -2
@@ -131,8 +131,6 @@#define REG_PTR (insn, pos, regs) \ (ulong *)((ulong)(regs) + REG_OFFSET(insn, pos)) -#define GET_RM (insn) (((insn) >> 12) & 7) -#define GET_RS1 (insn, regs) (*REG_PTR(insn, SH_RS1, regs))#define GET_RS2 (insn, regs) (*REG_PTR(insn, SH_RS2, regs))#define GET_RS1S (insn, regs) (*REG_PTR(RVC_RS1S(insn), 0, regs))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 56/73 mm/page_alloc: call check_new_pages() while zone spinlock is not held
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 3313204c8ad553cf93f1ee8cc89456c73a7df938 ]
For high order pages not using pcp, rmqueue() is currently calling the costly check_new_pages() while zone spinlock is held, and hard irqs masked.
This is not needed, we can release the spinlock sooner to reduce zone spinlock contention.
Note that after this patch, we call __mod_zone_freepage_state() before deciding to leak the page because it is in bad state.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
mm/page_alloc.c +9 -9
@@ -3698,10 +3698,10 @@ struct page *rmqueue(struct zone *preferred_zone,* allocate greater than order-1 page units with __GFP_NOFAIL. */ WARN_ON_ONCE ((gfp_flags & __GFP_NOFAIL) && (order >1 )); -spin_lock_irqsave (&zone->lock, flags); do { page = NULL; + spin_lock_irqsave(&zone->lock, flags); /* * order-0 request can reach here when the pcplist is skipped * due to non-CMA allocation context. HIGHATOMIC area is
@@ -3713,15 +3713,15 @@ struct page *rmqueue(struct zone *preferred_zone,if (page)trace_mm_page_alloc_zone_locked (page, order, migratetype); } -if (!page) +if (!page) { page =__rmqueue (zone, order, migratetype, alloc_flags); - }while (page &&check_new_pages (page, order)); -if (!page) - goto failed; - -__mod_zone_freepage_state (zone, -(1 << order), -get_pcppage_migratetype (page)); -spin_unlock_irqrestore (&zone->lock, flags); +if (!page) + goto failed; + } +__mod_zone_freepage_state (zone, -(1 << order), +get_pcppage_migratetype (page)); +spin_unlock_irqrestore (&zone->lock, flags); + }while (check_new_pages (page, order));__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order);zone_statistics (preferred_zone, zone,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 57/73 mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wonhyuk Yang <[email protected]>
[ Upstream commit 10e0f7530205799e7e971aba699a7cb3a47456de ]
Currently, trace point mm_page_alloc_zone_locked() doesn't show correct information.
First, when alloc_flag has ALLOC_HARDER/ALLOC_CMA, page can be allocated from MIGRATE_HIGHATOMIC/MIGRATE_CMA. Nevertheless, tracepoint use requested migration type not MIGRATE_HIGHATOMIC and MIGRATE_CMA.
Second, after commit 44042b4498728 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") percpu-list can store high order pages. But trace point determine whether it is a refiil of percpu-list by comparing requested order and 0.
To handle these problems, make mm_page_alloc_zone_locked() only be called by __rmqueue_smallest with correct migration type. With a new argument called percpu_refill, it can show roughly whether it is a refill of percpu-list.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- include/trace/events/kmem.h | 14 +++++++++----- mm/page_alloc.c | 13 +++++-------- 2 files changed, 14 insertions(+), 13 deletions(-)
include/trace/events/kmem.h +9 -5
@@ -229,20 +229,23 @@ TRACE_EVENT(mm_page_alloc, DECLARE_EVENT_CLASS(mm_page, - TP_PROTO(struct page *page, unsigned int order, int migratetype), + TP_PROTO(struct page *page, unsigned int order, int migratetype, + int percpu_refill), - TP_ARGS(page, order, migratetype), + TP_ARGS(page, order, migratetype, percpu_refill), TP_STRUCT__entry( __field( unsigned long, pfn ) __field( unsigned int, order ) __field( int, migratetype ) + __field( int, percpu_refill ) ), TP_fast_assign( __entry->pfn = page ? page_to_pfn(page) : -1UL; __entry->order = order; __entry->migratetype = migratetype; + __entry->percpu_refill = percpu_refill; ), TP_printk("page=%p pfn=0x%lx order=%u migratetype=%d percpu_refill=%d",
@@ -250,14 +253,15 @@ DECLARE_EVENT_CLASS(mm_page, __entry->pfn !=-1UL ? __entry->pfn :0 , __entry->order, __entry->migratetype, - __entry->order == 0) + __entry->percpu_refill) );DEFINE_EVENT (mm_page, mm_page_alloc_zone_locked, - TP_PROTO(struct page *page, unsigned int order, int migratetype), + TP_PROTO(struct page *page, unsigned int order, int migratetype, + int percpu_refill), -TP_ARGS (page, order, migratetype) +TP_ARGS (page, order, migratetype, percpu_refill) ); TRACE_EVENT(mm_page_pcpu_drain,
mm/page_alloc.c +5 -8
@@ -2461,6 +2461,9 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,del_page_from_free_list (page, zone, current_order);expand (zone, page, order, current_order, migratetype);set_pcppage_migratetype (page, migratetype); +trace_mm_page_alloc_zone_locked (page, order, migratetype, +pcp_allowed_order (order) && + migratetype <MIGRATE_PCPTYPES );return page; }
@@ -2988,7 +2991,7 @@ __rmqueue(struct zone *zone, unsigned int order, int migratetype, zone_page_state(zone, NR_FREE_PAGES) / 2) { page =__rmqueue_cma_fallback (zone, order);if (page) - goto out; +return page; } } retry:
@@ -3001,9 +3004,6 @@ __rmqueue(struct zone *zone, unsigned int order, int migratetype, alloc_flags)) goto retry; } -out: -if (page) -trace_mm_page_alloc_zone_locked (page, order, migratetype);return page; }
@@ -3708,11 +3708,8 @@ struct page *rmqueue(struct zone *preferred_zone,* reserved for high-order atomic allocation, so order-0 * request should skip it. */ -if (order >0 && alloc_flags &ALLOC_HARDER ) { +if (order >0 && alloc_flags &ALLOC_HARDER ) page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC ); -if (page) -trace_mm_page_alloc_zone_locked (page, order, migratetype); - }if (!page) { page =__rmqueue (zone, order, migratetype, alloc_flags);if (!page)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 58/73 mm/page_alloc: split out buddy removal code from rmqueue into separate helper
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit 589d9973c1d2c3344a94a57441071340b0c71097 ]
This is a preparation page to allow the buddy removal code to be reused in a later patch.
No functional change.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/page_alloc.c | 81 ++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 34 deletions(-)
mm/page_alloc.c +47 -34
@@ -3597,6 +3597,43 @@ static inline void zone_statistics(struct zone *preferred_zone, struct zone *z,#endif } +static __always_inline +struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone, +unsigned int order,unsigned int alloc_flags, +int migratetype) +{ +struct page *page; +unsigned long flags; + +do { + page =NULL ; +spin_lock_irqsave (&zone->lock, flags); +/* +* order-0 request can reach here when the pcplist is skipped +* due to non-CMA allocation context. HIGHATOMIC area is +* reserved for high-order atomic allocation, so order-0 +* request should skip it. +*/ +if (order >0 && alloc_flags &ALLOC_HARDER ) + page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC ); +if (!page) { + page =__rmqueue (zone, order, migratetype, alloc_flags); +if (!page) { +spin_unlock_irqrestore (&zone->lock, flags); +return NULL ; + } + } +__mod_zone_freepage_state (zone, -(1 << order), +get_pcppage_migratetype (page)); +spin_unlock_irqrestore (&zone->lock, flags); + }while (check_new_pages (page, order)); + +__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order); +zone_statistics (preferred_zone, zone,1 ); + +return page; +} +/* Remove page from the per-cpu list, caller must protect the list */ static inline struct page *__rmqueue_pcplist(struct zone *zone, unsigned int order,
@@ -3677,9 +3714,14 @@ struct page *rmqueue(struct zone *preferred_zone, gfp_t gfp_flags, unsigned int alloc_flags, int migratetype) { - unsigned long flags; struct page *page; +/* +* We most definitely don't want callers attempting to +* allocate greater than order-1 page units with __GFP_NOFAIL. +*/ +WARN_ON_ONCE ((gfp_flags & __GFP_NOFAIL) && (order >1 )); +if (likely (pcp_allowed_order (order))) {/* * MIGRATE_MOVABLE pcplist could have the pages on CMA area and
@@ -3693,35 +3735,10 @@ struct page *rmqueue(struct zone *preferred_zone, } } -/* -* We most definitely don't want callers attempting to -* allocate greater than order-1 page units with __GFP_NOFAIL. -*/ -WARN_ON_ONCE ((gfp_flags & __GFP_NOFAIL) && (order >1 )); - -do { - page =NULL ; -spin_lock_irqsave (&zone->lock, flags); -/* -* order-0 request can reach here when the pcplist is skipped -* due to non-CMA allocation context. HIGHATOMIC area is -* reserved for high-order atomic allocation, so order-0 -* request should skip it. -*/ -if (order >0 && alloc_flags &ALLOC_HARDER ) - page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC ); -if (!page) { - page =__rmqueue (zone, order, migratetype, alloc_flags); -if (!page) - goto failed; - } -__mod_zone_freepage_state (zone, -(1 << order), -get_pcppage_migratetype (page)); -spin_unlock_irqrestore (&zone->lock, flags); - }while (check_new_pages (page, order)); - -__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order); -zone_statistics (preferred_zone, zone,1 ); + page =rmqueue_buddy (preferred_zone, zone, order, alloc_flags, + migratetype); +if (unlikely (!page)) +return NULL ; out:/* Separate test+clear to avoid unnecessary atomics */
@@ -3732,10 +3749,6 @@ struct page *rmqueue(struct zone *preferred_zone,VM_BUG_ON_PAGE (page &&bad_range (zone, page), page);return page; - -failed: -spin_unlock_irqrestore (&zone->lock, flags); -return NULL ; }#ifdef CONFIG_FAIL_PAGE_ALLOC
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 59/73 mm/page_alloc: rename ALLOC_HIGH to ALLOC_MIN_RESERVE
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit 524c48072e5673f4511f1ad81493e2485863fd65 ]
Patch series "Discard __GFP_ATOMIC", v3.
Neil's patch has been residing in mm-unstable as commit 2fafb4fe8f7a ("mm:
discard __GFP_ATOMIC") for a long time and recently brought up again. Most recently, I was worried that __GFP_HIGH allocations could use high-order atomic reserves which is unintentional but there was no response so lets revisit -- this series reworks how min reserves are used, protects highorder reserves and then finishes with Neil's patch with very minor modifications so it fits on top.
There was a review discussion on renaming __GFP_DIRECT_RECLAIM to __GFP_ALLOW_BLOCKING but I didn't think it was that big an issue and is orthogonal to the removal of __GFP_ATOMIC.
There were some concerns about how the gfp flags affect the min reserves but it never reached a solid conclusion so I made my own attempt.
The series tries to iron out some of the details on how reserves are used. ALLOC_HIGH becomes ALLOC_MIN_RESERVE and ALLOC_HARDER becomes ALLOC_NON_BLOCK and documents how the reserves are affected. For example, ALLOC_NON_BLOCK (no direct reclaim) on its own allows 25% of the min reserve. ALLOC_MIN_RESERVE (__GFP_HIGH) allows 50% and both combined allows deeper access again. ALLOC_OOM allows access to 75%.
High-order atomic allocations are explicitly handled with the caveat that no __GFP_ATOMIC flag means that any high-order allocation that specifies GFP_HIGH and cannot enter direct reclaim will be treated as if it was GFP_ATOMIC.
This patch (of 6):
__GFP_HIGH aliases to ALLOC_HIGH but the name does not really hint what it means. As ALLOC_HIGH is internal to the allocator, rename it to ALLOC_MIN_RESERVE to document that the min reserves can be depleted.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/internal.h | 4 +++- mm/page_alloc.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
mm/internal.h +3 -1
@@ -593,7 +593,9 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#endif #define ALLOC_HARDER 0x10/* try to alloc harder */ -#define ALLOC_HIGH 0x20/* __GFP_HIGH set */ +#define ALLOC_MIN_RESERVE 0x20/* __GFP_HIGH set. Allow access to 50% +* of the min watermark. +*/ #define ALLOC_CPUSET 0x40/* check for correct cpuset */ #define ALLOC_CMA 0x80/* allow allocations from CMA areas */ #ifdef CONFIG_ZONE_DMA32
mm/page_alloc.c +4 -4
@@ -3865,7 +3865,7 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,/* free_pages may go negative - that's OK */ free_pages -=__zone_watermark_unusable_free (z, order, alloc_flags); -if (alloc_flags &ALLOC_HIGH ) +if (alloc_flags &ALLOC_MIN_RESERVE ) min -= min /2 ;if (unlikely (alloc_harder)) {
@@ -4696,18 +4696,18 @@ gfp_to_alloc_flags(gfp_t gfp_mask)unsigned int alloc_flags =ALLOC_WMARK_MIN |ALLOC_CPUSET ;/* -* __GFP_HIGH is assumed to be the same as ALLOC_HIGH +* __GFP_HIGH is assumed to be the same as ALLOC_MIN_RESERVE * and __GFP_KSWAPD_RECLAIM is assumed to be the same as ALLOC_KSWAPD * to save two branches. */ -BUILD_BUG_ON (__GFP_HIGH != (__force gfp_t )ALLOC_HIGH ); +BUILD_BUG_ON (__GFP_HIGH != (__force gfp_t )ALLOC_MIN_RESERVE );BUILD_BUG_ON (__GFP_KSWAPD_RECLAIM != (__force gfp_t )ALLOC_KSWAPD );/* * The caller may dip into page reserves a bit more if the caller * cannot run direct reclaim, or if the caller has realtime scheduling * policy or is asking for __GFP_HIGH memory. GFP_ATOMIC requests will -* set both ALLOC_HARDER (__GFP_ATOMIC) and ALLOC_HIGH (__GFP_HIGH). +* set both ALLOC_HARDER (__GFP_ATOMIC) and ALLOC_MIN_RESERVE(__GFP_HIGH). */ alloc_flags |= (__force int ) (gfp_mask & (__GFP_HIGH | __GFP_KSWAPD_RECLAIM));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 60/73 mm/page_alloc: treat RT tasks similar to __GFP_HIGH
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit c988dcbecf3fd5430921eaa3fe9054754f76d185 ]
RT tasks are allowed to dip below the min reserve but ALLOC_HARDER is typically combined with ALLOC_MIN_RESERVE so RT tasks are a little unusual. While there is some justification for allowing RT tasks access to memory reserves, there is a strong chance that a RT task that is also under memory pressure is at risk of missing deadlines anyway. Relax how much reserves an RT task can access by treating it the same as __GFP_HIGH allocations.
Note that in a future kernel release that the RT special casing will be removed. Hard realtime tasks should be locking down resources in advance and ensuring enough memory is available. Even a soft-realtime task like audio or video live decoding which cannot jitter should be allocating both memory and any disk space required up-front before the recording starts instead of relying on reserves. At best, reserve access will only delay the problem by a very short interval.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -4725,7 +4725,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask)*/ alloc_flags &= ~ALLOC_CPUSET ; }else if (unlikely (rt_task (current)) &&in_task ()) - alloc_flags |=ALLOC_HARDER ; + alloc_flags |=ALLOC_MIN_RESERVE ; alloc_flags =gfp_to_alloc_flags_cma (gfp_mask, alloc_flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 61/73 mm/page_alloc: explicitly record high-order atomic allocations in alloc_flags
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit eb2e2b425c6984ca8034448a3f2c680622bd3d4d ]
A high-order ALLOC_HARDER allocation is assumed to be atomic. While that is accurate, it changes later in the series. In preparation, explicitly record high-order atomic allocations in gfp_to_alloc_flags().
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/internal.h | 1 + mm/page_alloc.c | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-)
mm/internal.h +1 -0
@@ -603,6 +603,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#else #define ALLOC_NOFRAGMENT 0x0#endif +#define ALLOC_HIGHATOMIC 0x200/* Allows access to MIGRATE_HIGHATOMIC */ #define ALLOC_KSWAPD 0x800/* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */ enum ttu_flags ;
mm/page_alloc.c +23 -6
@@ -3614,10 +3614,20 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,* reserved for high-order atomic allocation, so order-0 * request should skip it. */ -if (order >0 && alloc_flags &ALLOC_HARDER ) +if (alloc_flags &ALLOC_HIGHATOMIC ) page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC );if (!page) { page =__rmqueue (zone, order, migratetype, alloc_flags); + +/* +* If the allocation fails, allow OOM handling access +* to HIGHATOMIC reserves as failing now is worse than +* failing a high-order atomic allocation in the +* future. +*/ +if (!page && (alloc_flags &ALLOC_OOM )) + page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC ); +if (!page) {spin_unlock_irqrestore (&zone->lock, flags);return NULL ;
@@ -3912,8 +3922,10 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, return true; }#endif -if (alloc_harder && !free_area_empty (area,MIGRATE_HIGHATOMIC )) +if ((alloc_flags & (ALLOC_HIGHATOMIC |ALLOC_OOM )) && + !free_area_empty (area,MIGRATE_HIGHATOMIC )) {return true; + } }return false; }
@@ -4172,7 +4184,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,* If this is a high-order atomic allocation then check * if the pageblock should be reserved for the future */ -if (unlikely (order && (alloc_flags &ALLOC_HARDER ))) +if (unlikely (alloc_flags &ALLOC_HIGHATOMIC ))reserve_highatomic_pageblock (page, zone, order);return page;
@@ -4691,7 +4703,7 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, }static inline unsigned int -gfp_to_alloc_flags (gfp_t gfp_mask) +gfp_to_alloc_flags (gfp_t gfp_mask,unsigned int order) {unsigned int alloc_flags =ALLOC_WMARK_MIN |ALLOC_CPUSET ;
@@ -4717,8 +4729,13 @@ gfp_to_alloc_flags(gfp_t gfp_mask)* Not worth trying to allocate harder for __GFP_NOMEMALLOC even * if it can't schedule. */ -if (!(gfp_mask & __GFP_NOMEMALLOC)) +if (!(gfp_mask & __GFP_NOMEMALLOC)) { alloc_flags |=ALLOC_HARDER ; + +if (order >0 ) + alloc_flags |=ALLOC_HIGHATOMIC ; + } +/* * Ignore cpuset mems for GFP_ATOMIC rather than fail, see the * comment for __cpuset_node_allowed().
@@ -4946,7 +4963,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,* kswapd needs to be woken up, and to avoid the cost of setting up * alloc_flags precisely. So we do that now. */ - alloc_flags =gfp_to_alloc_flags (gfp_mask); + alloc_flags =gfp_to_alloc_flags (gfp_mask, order);/* * We need to recalculate the starting point for the zonelist iterator
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 62/73 mm/page_alloc: explicitly define what alloc flags deplete min reserves
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit ab3508854353793cd35e348fde89a5c09b2fd8b5 ]
As there are more ALLOC_ flags that affect reserves, define what flags affect reserves and clarify the effect of each flag.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/internal.h | 3 +++ mm/page_alloc.c | 34 ++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-)
mm/internal.h +3 -0
@@ -606,6 +606,9 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#define ALLOC_HIGHATOMIC 0x200/* Allows access to MIGRATE_HIGHATOMIC */ #define ALLOC_KSWAPD 0x800/* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */ +/* Flags that allow allocations below the min watermark. */ +#define ALLOC_RESERVES (ALLOC_HARDER|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM) +enum ttu_flags ;struct tlbflush_unmap_batch ;
mm/page_alloc.c +22 -12
@@ -3838,15 +3838,14 @@ ALLOW_ERROR_INJECTION(should_fail_alloc_page, TRUE);static inline long __zone_watermark_unusable_free (struct zone *z,unsigned int order,unsigned int alloc_flags) { -const bool alloc_harder = (alloc_flags & (ALLOC_HARDER |ALLOC_OOM ));long unusable_free = (1 << order) -1 ;/* -* If the caller does not have rights to ALLOC_HARDER then subtract -* the high-atomic reserves. This will over-estimate the size of the -* atomic reserve but it avoids a search. +* If the caller does not have rights to reserves below the min +* watermark then subtract the high-atomic reserves. This will +* over-estimate the size of the atomic reserve but it avoids a search. */ -if (likely (!alloc_harder)) +if (likely (!(alloc_flags &ALLOC_RESERVES ))) unusable_free += z->nr_reserved_highatomic;#ifdef CONFIG_CMA
@@ -3870,25 +3869,36 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, {long min = mark;int o; -const bool alloc_harder = (alloc_flags & (ALLOC_HARDER |ALLOC_OOM ));/* free_pages may go negative - that's OK */ free_pages -=__zone_watermark_unusable_free (z, order, alloc_flags); -if (alloc_flags &ALLOC_MIN_RESERVE ) - min -= min /2 ; +if (unlikely (alloc_flags &ALLOC_RESERVES )) { +/* +* __GFP_HIGH allows access to 50% of the min reserve as well +* as OOM. +*/ +if (alloc_flags &ALLOC_MIN_RESERVE ) + min -= min /2 ; -if (unlikely (alloc_harder)) {/* -* OOM victims can try even harder than normal ALLOC_HARDER +* Non-blocking allocations can access some of the reserve +* with more access if also __GFP_HIGH. The reasoning is that +* a non-blocking caller may incur a more severe penalty +* if it cannot get memory quickly, particularly if it's +* also __GFP_HIGH. +*/ +if (alloc_flags &ALLOC_HARDER ) + min -= min /4 ; + +/* +* OOM victims can try even harder than the normal reserve * users on the grounds that it's definitely going to be in * the exit path shortly and free memory. Any allocation it * makes during the free path will be small and short-lived. */ if (alloc_flags &ALLOC_OOM ) min -= min /2 ; -else - min -= min /4 ; }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 63/73 mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <[email protected]>
[ Upstream commit 1ebbb21811b76c3b932959787f37985af36f62fa ]
GFP_ATOMIC allocations get flagged ALLOC_HARDER which is a vague description. In preparation for the removal of GFP_ATOMIC redefine __GFP_ATOMIC to simply mean non-blocking and renaming ALLOC_HARDER to ALLOC_NON_BLOCK accordingly. __GFP_HIGH is required for access to reserves but non-blocking is granted more access. For example, GFP_NOWAIT is non-blocking but has no special access to reserves. A __GFP_NOFAIL blocking allocation is granted access similar to __GFP_HIGH if the only alternative is an OOM kill.
Stable-dep-of: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
--- mm/internal.h | 7 +++++-- mm/page_alloc.c | 44 ++++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 22 deletions(-)
mm/internal.h +5 -2
@@ -592,7 +592,10 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#define ALLOC_OOM ALLOC_NO_WATERMARKS#endif -#define ALLOC_HARDER 0x10/* try to alloc harder */ +#define ALLOC_NON_BLOCK 0x10/* Caller cannot block. Allow access +* to 25% of the min watermark or +* 62.5% if __GFP_HIGH is set. +*/ #define ALLOC_MIN_RESERVE 0x20/* __GFP_HIGH set. Allow access to 50% * of the min watermark. */
@@ -607,7 +610,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,#define ALLOC_KSWAPD 0x800/* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */ /* Flags that allow allocations below the min watermark. */ -#define ALLOC_RESERVES (ALLOC_HARDER|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM) +#define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)enum ttu_flags ;struct tlbflush_unmap_batch ;
mm/page_alloc.c +24 -20
82 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 64/73 mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Fleming <[email protected]>
[ Upstream commit 281dd25c1a018261a04d1b8bf41a0674000bfe38 ]
Under memory pressure it's possible for GFP_ATOMIC order-0 allocations to fail even though free pages are available in the highatomic reserves. GFP_ATOMIC allocations cannot trigger unreserve_highatomic_pageblock() since it's only run from reclaim.
Given that such allocations will pass the watermarks in __zone_watermark_unusable_free(), it makes sense to fallback to highatomic reserves the same way that ALLOC_OOM can.
This fixes order-0 page allocation failures observed on Cloudflare's fleet when handling network packets:
kswapd1: page allocation failure: order:0, mode:0x820(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0-7
CPU: 10 PID: 696 Comm: kswapd1 Kdump: loaded Tainted: G O 6.6.43-CUSTOM #1 Hardware name: MACHINE Call Trace: <IRQ> dump_stack_lvl+0x3c/0x50 warn_alloc+0x13a/0x1c0 __alloc_pages_slowpath.constprop.0+0xc9d/0xd10 __alloc_pages+0x327/0x340 __napi_alloc_skb+0x16d/0x1f0 bnxt_rx_page_skb+0x96/0x1b0 [bnxt_en] bnxt_rx_pkt+0x201/0x15e0 [bnxt_en] __bnxt_poll_work+0x156/0x2b0 [bnxt_en] bnxt_poll+0xd9/0x1c0 [bnxt_en] __napi_poll+0x2b/0x1b0 bpf_trampoline_6442524138+0x7d/0x1000 __napi_poll+0x5/0x1b0 net_rx_action+0x342/0x740 handle_softirqs+0xcf/0x2b0 irq_exit_rcu+0x6c/0x90 sysvec_apic_timer_interrupt+0x72/0x90 </IRQ>
--- mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
mm/page_alloc.c +5 -5
@@ -3620,12 +3620,12 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone, page =__rmqueue (zone, order, migratetype, alloc_flags);/* -* If the allocation fails, allow OOM handling access -* to HIGHATOMIC reserves as failing now is worse than -* failing a high-order atomic allocation in the -* future. +* If the allocation fails, allow OOM handling and +* order-0 (atomic) allocs access to HIGHATOMIC +* reserves as failing now is worse than failing a +* high-order atomic allocation in the future. */ -if (!page && (alloc_flags &ALLOC_OOM )) +if (!page && (alloc_flags & (ALLOC_OOM |ALLOC_NON_BLOCK ))) page =__rmqueue_smallest (zone, order,MIGRATE_HIGHATOMIC );if (!page) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 65/73 ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
[ Upstream commit bc0a2f3a73fcdac651fca64df39306d1e5ebe3b0 ]
Syzbot reported a kernel BUG in ocfs2_truncate_inline. There are two reasons for this: first, the parameter value passed is greater than ocfs2_max_inline_data_with_xattr, second, the start and end parameters of ocfs2_truncate_inline are "unsigned int".
So, we need to add a sanity check for byte_start and byte_len right before ocfs2_truncate_inline() in ocfs2_remove_inode_range(), if they are greater than ocfs2_max_inline_data_with_xattr return -EINVAL.
--- fs/ocfs2/file.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ocfs2/file.c +8 -0
@@ -1787,6 +1787,14 @@ int ocfs2_remove_inode_range(struct inode *inode,return 0 ;if (OCFS2_I (inode)->ip_dyn_features &OCFS2_INLINE_DATA_FL ) { +int id_count =ocfs2_max_inline_data_with_xattr (inode->i_sb, di); + +if (byte_start > id_count || byte_start + byte_len > id_count) { + ret = -EINVAL ; +mlog_errno (ret); + goto out; + } + ret =ocfs2_truncate_inline (inode, di_bh, byte_start, byte_start + byte_len,0 );if (ret) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 66/73 x86/bugs: Use code segment selector for VERW operand
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pawan Gupta <[email protected]>
commit e4d2102018542e3ae5e297bc6e229303abff8a0f upstream.
Robert Gill reported below #GP in 32-bit mode when dosemu software was executing vm86() system call:
general protection fault: 0000 [#1] PREEMPT SMP CPU: 4 PID: 4610 Comm: dosemu.bin Not tainted 6.6.21-gentoo-x86 #1 Hardware name: Dell Inc. PowerEdge 1950/0H723K, BIOS 2.7.0 10/30/2010 EIP: restore_all_switch_stack+0xbe/0xcf EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000 ESI: 00000000 EDI: 00000000 EBP: 00000000 ESP: ff8affdc DS: 0000 ES: 0000 FS: 0000 GS: 0033 SS: 0068 EFLAGS: 00010046 CR0: 80050033 CR2: 00c2101c CR3: 04b6d000 CR4: 000406d0 Call Trace: show_regs+0x70/0x78 die_addr+0x29/0x70 exc_general_protection+0x13c/0x348 exc_bounds+0x98/0x98 handle_exception+0x14d/0x14d exc_bounds+0x98/0x98 restore_all_switch_stack+0xbe/0xcf exc_bounds+0x98/0x98 restore_all_switch_stack+0xbe/0xcf
This only happens in 32-bit mode when VERW based mitigations like MDS/RFDS are enabled. This is because segment registers with an arbitrary user value can result in #GP when executing VERW. Intel SDM vol. 2C documents the following behavior for VERW instruction:
#GP(0) - If a memory operand effective address is outside the CS, DS, ES,
FS, or GS segment limit.
CLEAR_CPU_BUFFERS macro executes VERW instruction before returning to user space. Use %cs selector to reference VERW operand. This ensures VERW will not #GP for an arbitrary user %ds.
[ mingo: Fixed the SOB chain. ]
--- arch/x86/include/asm/nospec-branch.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/include/asm/nospec-branch.h +10 -1
@@ -199,7 +199,16 @@*/ .macro CLEAR_CPU_BUFFERS ALTERNATIVE "jmp .Lskip_verw_\@", "", X86_FEATURE_CLEAR_CPU_BUF - verw _ASM_RIP(mds_verw_sel) +#ifdef CONFIG_X86_64 + verw mds_verw_sel(%rip) +#else +/* +* In 32bit mode, the memory operand must be a %cs reference. The data +* segments may not be usable (vm86 mode), and the stack segment may not +* be flat (ESPFIX32). +*/ + verw %cs:mds_verw_sel +#endif .Lskip_verw_\@: .endm
Greg Kroah-Hartman
maintainerPATCH 67/73 nilfs2: fix kernel bug due to missing clearing of checked flag
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <[email protected]>
commit 41e192ad2779cae0102879612dfe46726e4396aa upstream.
Syzbot reported that in directory operations after nilfs2 detects filesystem corruption and degrades to read-only, __block_write_begin_int(), which is called to prepare block writes, may fail the BUG_ON check for accesses exceeding the folio/page size, triggering a kernel bug.
This was found to be because the "checked" flag of a page/folio was not cleared when it was discarded by nilfs2's own routine, which causes the sanity check of directory entries to be skipped when the directory page/folio is reloaded. So, fix that.
This was necessary when the use of nilfs2's own page discard routine was applied to more than just metadata files.
--- fs/nilfs2/page.c | 1 + 1 file changed, 1 insertion(+)
fs/nilfs2/page.c +1 -0
@@ -404,6 +404,7 @@ void nilfs_clear_dirty_page(struct pageClearPageUptodate (page);ClearPageMappedToDisk (page); +ClearPageChecked (page);if (page_has_buffers (page)) {struct buffer_head *bh, *head;
Greg Kroah-Hartman
maintainerPATCH 68/73 wifi: iwlwifi: mvm: fix 6 GHz scan construction
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 7245012f0f496162dd95d888ed2ceb5a35170f1a upstream.
If more than 255 colocated APs exist for the set of all APs found during 2.4/5 GHz scanning, then the 6 GHz scan construction will loop forever since the loop variable has type u8, which can never reach the number found when that's bigger than 255, and is stored in a u32 variable. Also move it into the loops to have a smaller scope.
Using a u32 there is fine, we limit the number of APs in the scan list and each has a limit on the number of RNR entries due to the frame size. With a limit of 1000 scan results, a frame size upper bound of 4096 (really it's more like ~2300) and a TBTT entry size of at least 11, we get an upper bound for the number of ~372k, well in the bounds of a u32.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +2 -1
@@ -1753,7 +1753,8 @@ iwl_mvm_umac_scan_cfg_channels_v6_6g(str &cp->channel_config[i];u32 s_ssid_bitmap =0 , bssid_bitmap =0 , flags =0 ; -u8 j, k, s_max =0 , b_max =0 , n_used_bssid_entries; +u8 k, s_max =0 , b_max =0 , n_used_bssid_entries; +u32 j;bool force_passive, found = false, allow_passive = true, unsolicited_probe_on_chan = false, psc_no_listen = false;
Greg Kroah-Hartman
maintainerPATCH 69/73 mm: shmem: fix data-race in shmem_getattr()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit d949d1d14fa281ace388b1de978e8f2cd52875cf upstream.
I got the following KCSAN report during syzbot testing:
==================================================================
BUG: KCSAN: data-race in generic_fillattr / inode_set_ctime_current
write to 0xffff888102eb3260 of 4 bytes by task 6565 on cpu 1:
inode_set_ctime_to_ts include/linux/fs.h:1638 [inline] inode_set_ctime_current+0x169/0x1d0 fs/inode.c:2626 shmem_mknod+0x117/0x180 mm/shmem.c:3443 shmem_create+0x34/0x40 mm/shmem.c:3497 lookup_open fs/namei.c:3578 [inline] open_last_lookups fs/namei.c:3647 [inline] path_openat+0xdbc/0x1f00 fs/namei.c:3883 do_filp_open+0xf7/0x200 fs/namei.c:3913 do_sys_openat2+0xab/0x120 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0xf3/0x120 fs/open.c:1442 x64_sys_call+0x1025/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e
read to 0xffff888102eb3260 of 4 bytes by task 3498 on cpu 0:
inode_get_ctime_nsec include/linux/fs.h:1623 [inline] inode_get_ctime include/linux/fs.h:1629 [inline] generic_fillattr+0x1dd/0x2f0 fs/stat.c:62 shmem_getattr+0x17b/0x200 mm/shmem.c:1157 vfs_getattr_nosec fs/stat.c:166 [inline] vfs_getattr+0x19b/0x1e0 fs/stat.c:207 vfs_statx_path fs/stat.c:251 [inline] vfs_statx+0x134/0x2f0 fs/stat.c:315 vfs_fstatat+0xec/0x110 fs/stat.c:341 __do_sys_newfstatat fs/stat.c:505 [inline] __se_sys_newfstatat+0x58/0x260 fs/stat.c:499 __x64_sys_newfstatat+0x55/0x70 fs/stat.c:499 x64_sys_call+0x141f/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:263 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x54/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e
value changed: 0x2755ae53 -> 0x27ee44d3
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3498 Comm: udevd Not tainted 6.11.0-rc6-syzkaller-00326-gd1f2d51b711a-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 ==================================================================
When calling generic_fillattr(), if you don't hold read lock, data-race will occur in inode member variables, which can cause unexpected behavior.
Since there is no special protection when shmem_getattr() calls generic_fillattr(), data-race occurs by functions such as shmem_unlink() or shmem_mknod(). This can cause unexpected results, so commenting it out is not enough.
Therefore, when calling generic_fillattr() from shmem_getattr(), it is appropriate to protect the inode using inode_lock_shared() and inode_unlock_shared() to prevent data-race.
--- mm/shmem.c | 2 ++ 1 file changed, 2 insertions(+)
mm/shmem.c +2 -0
@@ -1077,7 +1077,9 @@ static int shmem_getattr(struct user_namshmem_recalc_inode (inode);spin_unlock_irq (&info->lock); } +inode_lock_shared (inode);generic_fillattr (&init_user_ns, inode, stat); +inode_unlock_shared (inode);if (shmem_is_huge (NULL , inode,0 )) stat->blksize =HPAGE_PMD_SIZE ;
Greg Kroah-Hartman
maintainerPATCH 70/73 Revert "drm/mipi-dsi: Set the fwnode for mipi_dsi_device"
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Jason-JH.Lin" <[email protected]>
This reverts commit ac88a1f41f93499df6f50fd18ea835e6ff4f3200 which is commit a26cc2934331b57b5a7164bff344f0a2ec245fc0 upstream.
Reason for revert:
1. The commit [1] does not land on linux-5.15, so this patch does not fix anything.
2. Since the fw_devlink improvements series [2] does not land on linux-5.15, using device_set_fwnode() causes the panel to flash during bootup.
Incorrect link management may lead to incorrect device initialization, affecting firmware node links and consumer relationships. The fwnode setting of panel to the DSI device would cause a DSI initialization error without series[2], so this patch was reverted to avoid using the incomplete fw_devlink functionality.
[1] commit 3fb16866b51d ("driver core: fw_devlink: Make cycle detection more robust")
[2] Link: https://lore.kernel.org/all/[email protected]
--- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_mipi_dsi.c +1 -1
@@ -221,7 +221,7 @@ mipi_dsi_device_register_full(struct mipreturn dsi; } -device_set_node (&dsi->dev,of_fwnode_handle (info->node)); + dsi->dev.of_node = info->node; dsi->channel = info->channel;strlcpy (dsi->name, info->type,sizeof (dsi->name));
Greg Kroah-Hartman
maintainerPATCH 71/73 drm/i915: Fix potential context UAFs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <[email protected]>
commit afce71ff6daa9c0f852df0727fe32c6fb107f0fa upstream.
gem_context_register() makes the context visible to userspace, and which point a separate thread can trigger the I915_GEM_CONTEXT_DESTROY ioctl. So we need to ensure that nothing uses the ctx ptr after this. And we need to ensure that adding the ctx to the xarray is the *last* thing that gem_context_register() does with the ctx pointer.
[ Sherry: bp to fix CVE-2023-52913, ignore context conflicts due to
missing commit 49bd54b390c2 "drm/i915: Track all user contexts per client")]
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +18 -6
@@ -1436,6 +1436,10 @@ void i915_gem_init__contexts(struct drm_init_contexts (&i915->gem.contexts); } +/* +* Note that this implicitly consumes the ctx reference, by placing +* the ctx in the context_xa. +*/ static void gem_context_register (struct i915_gem_context *ctx,struct drm_i915_file_private *fpriv,u32 id)
@@ -1449,13 +1453,13 @@ static void gem_context_register(structsnprintf (ctx->name,sizeof (ctx->name),"%s[%d]" , current->comm,pid_nr (ctx->pid)); -/* And finally expose ourselves to userspace via the idr */ - old =xa_store (&fpriv->context_xa, id, ctx,GFP_KERNEL ); -WARN_ON (old); -spin_lock (&i915->gem.contexts.lock);list_add_tail (&ctx->link, &i915->gem.contexts.list);spin_unlock (&i915->gem.contexts.lock); + +/* And finally expose ourselves to userspace via the idr */ + old =xa_store (&fpriv->context_xa, id, ctx,GFP_KERNEL ); +WARN_ON (old); } int i915_gem_context_open(struct drm_i915_private *i915,
@@ -1932,14 +1936,22 @@ finalize_create_context_locked(struct drif (IS_ERR (ctx))return ctx; +/* +* One for the xarray and one for the caller. We need to grab +* the reference *prior* to making the ctx visble to userspace +* in gem_context_register(), as at any point after that +* userspace can try to race us with another thread destroying +* the context under our feet. +*/ +i915_gem_context_get (ctx); +gem_context_register (ctx, file_priv, id); old =xa_erase (&file_priv->proto_context_xa, id);GEM_BUG_ON (old != pc);proto_context_close (pc); -/* One for the xarray and one for the caller */ -return i915_gem_context_get (ctx); +return ctx; } struct i915_gem_context *
Greg Kroah-Hartman
maintainerPATCH 72/73 vt: prevent kernel-infoleak in con_font_get()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit f956052e00de211b5c9ebaa1958366c23f82ee9e upstream.
font.data may not initialize all memory spaces depending on the implementation of vc->vc_sw->con_font_get. This may cause info-leak, so to prevent this, it is safest to modify it to initialize the allocated memory space to 0, and it generally does not affect the overall performance of the system.
--- drivers/tty/vt/vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/vt/vt.c +1 -1
@@ -4594,7 +4594,7 @@ static int con_font_get(struct vc_data *int c;if (op->data) { - font.data =kmalloc (max_font_size,GFP_KERNEL ); + font.data =kzalloc (max_font_size,GFP_KERNEL );if (!font.data)return -ENOMEM ; }else
Greg Kroah-Hartman
maintainerPATCH 73/73 mac80211: always have ieee80211_sta_restart()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 3fa5a0f5b0d69e31c6476cd81afeca3cc25a4927 upstream.
When CONFIG_PM isn't defined we don't have the function ieee80211_sta_restart() compiled in, but we always need it now for firmware restart. Move it out of the ifdef.
--- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -1
@@ -4832,6 +4832,7 @@ void ieee80211_mgd_quiesce(struct ieee80 sdata_unlock(sdata); } +#endif void ieee80211_sta_restart (struct ieee80211_sub_if_data *sdata) {
@@ -4867,7 +4868,6 @@ void ieee80211_sta_restart(struct ieee80sdata_unlock (sdata); } -#endif /* interface setup */ void ieee80211_sta_setup_sdata (struct ieee80211_sub_if_data *sdata)
Hello,
Quoted 7 lines · On Wed, 6 Nov 2024 13:05:04 +0100 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +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] 7a95f8fff07f ("Linux 5.15.171-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.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 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +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/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.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.
NOTE:
----
The following build warnings have been noticed on x86_64 with various build configs.
drivers/acpi/prmt.c:144:29: warning: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Walign-mismatch]
144 | (void *)efi_pa_va_lookup(&th->guid,handler_info->handler_address);
| ^drivers/acpi/prmt.c:147:21: warning: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Walign-mismatch]
147 | efi_pa_va_lookup(&th->guid,handler_info->static_data_buffer_address);
| ^drivers/acpi/prmt.c:150:21: warning: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Walign-mismatch]
150 | efi_pa_va_lookup(&th->guid,handler_info->acpi_param_buffer_address);
| ^
3 warnings generated.
Links:
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2oTjBf6W7vsijHrkw8ZdOnL9Iby/
## Build
* kernel: 5.15.171-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: 7a95f8fff07f7c8bab8da252016221fad81e010c
* git describe: v5.15.168-239-g7a95f8fff07f
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.15.y/build/v5.15.168-239-g7a95f8fff07f
## Test Regressions (compared to v5.15.168-164-gcebe213d2a87)
## Metric Regressions (compared to v5.15.168-164-gcebe213d2a87)
## Test Fixes (compared to v5.15.168-164-gcebe213d2a87)
## Metric Fixes (compared to v5.15.168-164-gcebe213d2a87)
## Test result summary
total: 60712, pass: 45080, fail: 1728, skip: 13822, xfail: 82
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 102 total, 102 passed, 0 failed
* arm64: 29 total, 29 passed, 0 failed
* i386: 23 total, 23 passed, 0 failed
* mips: 22 total, 22 passed, 0 failed
* parisc: 3 total, 3 passed, 0 failed
* powerpc: 24 total, 24 passed, 0 failed
* riscv: 8 total, 8 passed, 0 failed
* s390: 9 total, 9 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 25 total, 25 passed, 0 failed
## Test suites summary
* boot
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* 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-watchdog
* kselftest-x86
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* 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
PATCH 1/1 ACPI: PRM: Clean up guid type in struct prm_handler_info
From: Dan Carpenter <[email protected]>
commit 3d1c651272cf1df8aac7d9b6d92d836d27bed50f upstream.
Clang 19 prints a warning when we pass &th->guid to efi_pa_va_lookup():
drivers/acpi/prmt.c:156:29: error: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Werror,-Walign-mismatch]
156 | (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
| ^
The problem is that efi_pa_va_lookup() takes a efi_guid_t and &th->guid is a regular guid_t. The difference between the two types is the alignment. efi_guid_t is a typedef.
typedef guid_t efi_guid_t __aligned(__alignof__(u32));
It's possible that this a bug in Clang 19. Even though the alignment of &th->guid is not explicitly specified, it will still end up being aligned at 4 or 8 bytes.
Anyway, as Ard points out, it's cleaner to change guid to efi_guid_t type and that also makes the warning go away.
---
This resolves the warning that Naresh reported, which breaks the build with CONFIG_WERROR=y:
https://lore.kernel.org/CA+G9fYtgOA-5y73G1YEixQ+OjmG=awBQjdKjK+b0qLNYvAAVpQ@mail.gmail.com/
https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2ogNnyGv40aCb0Jqybv8RlPt3S7/build.log
--- drivers/acpi/prmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/prmt.c +1 -1
@@ -52,7 +52,7 @@ struct prm_context_buffer {static LIST_HEAD (prm_module_list);struct prm_handler_info { -guid_t guid; +efi_guid_t guid;void *handler_addr;u64 static_data_buffer_addr;u64 acpi_param_buffer_addr;
base-commit: 3c17fc4839052076b9f27f22551d0d0bd8557822
Signature · 1 line
2.47.0
Greg KH
maintainerRe: [PATCH 5.15] ACPI: PRM: Clean up guid type in struct prm_handler_info
Quoted 36 lines · Nathan Chancellor
From: Dan Carpenter <[email protected]>
commit
3d1c651272cf1df8aac7d9b6d92d836d27bed50fupstream.Clang 19 prints a warning when we pass
&th->guidtoefi_pa_va_lookup():
drivers/acpi/prmt.c:156:29: error: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Werror,-Walign-mismatch]
156 | (void *)efi_pa_va_lookup(&th->guid,handler_info->handler_address);
| ^The problem is that
efi_pa_va_lookup()takes aefi_guid_tand&th->guidis a regularguid_t. The difference between the two types is the alignment.efi_guid_tis a typedef.typedef guid_t efi_guid_t __aligned(__alignof__(u32));It's possible that this a bug in Clang 19. Even though the alignment of
&th->guidis not explicitly specified, it will still end up being aligned at 4 or 8 bytes.Anyway, as Ard points out, it's cleaner to change guid to
efi_guid_ttype and that also makes the warning go away.Fixes 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")Suggested-by Ard Biesheuvel <[email protected]>Signed-off-by Dan Carpenter <[email protected]>Tested-by Paul E. McKenney <[email protected]>Acked-by Ard Biesheuvel <[email protected]>[ rjw: Subject edit ]Signed-off-by Rafael J. Wysocki <[email protected]>[nathan: Fix conflicts due to lack of e38abdab441c]Signed-off-by Nathan Chancellor <[email protected]>
Quoted 6 lines
---
This resolves the warning that Naresh reported, which breaks the build withCONFIG_WERROR=y:https://lore.kernel.org/CA+G9fYtgOA-5y73G1YEixQ+OjmG=awBQjdKjK+b0qLNYvAAVpQ@mail.gmail.com/
https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2ogNnyGv40aCb0Jqybv8RlPt3S7/build.log
Now queued up,t hanks.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +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/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.15:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
101 tests: 101 pass, 0 failLinux version: 5.15.171-rc1-g31772df529ef
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +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/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.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
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +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/v5.x/stable-review/patch-5.15.171-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Thanks,
Hardik
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 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.
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.171 release. There are 73 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 08 Nov 2024 12:02:47 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit