Linux 6.18.25
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.18.25 kernel.
All users of the 6.18 kernel series must upgrade.
The updated 6.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.18.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/arch/arm64/silicon-errata.rst | 2 Makefile | 2 arch/arm64/Kconfig | 12 ++ arch/arm64/include/asm/cpucaps.h | 2 arch/arm64/include/asm/cputype.h | 2 arch/arm64/include/asm/fpsimd.h | 21 +++ arch/arm64/include/asm/tlbbatch.h | 10 + arch/arm64/include/asm/tlbflush.h | 143 ++++++++++++++++++++++----- arch/arm64/kernel/cpu_errata.c | 30 +++++ arch/arm64/kernel/entry-common.c | 3 arch/arm64/kernel/fpsimd.c | 79 ++++++++++++++ arch/arm64/kernel/process.c | 36 ++++++ arch/arm64/kernel/sys_compat.c | 2 arch/arm64/kvm/hyp/nvhe/mm.c | 2 arch/arm64/kvm/hyp/nvhe/tlb.c | 8 - arch/arm64/kvm/hyp/pgtable.c | 2 arch/arm64/kvm/hyp/vhe/tlb.c | 10 - arch/arm64/tools/cpucaps | 1 crypto/authencesn.c | 6 - crypto/krb5enc.c | 51 +++++---- drivers/crypto/ccp/sev-dev.c | 19 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 39 +++---- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 22 +++- drivers/net/ethernet/mediatek/mtk_ppe.c | 30 +++++ drivers/net/ethernet/mediatek/mtk_ppe.h | 1 fs/f2fs/compress.c | 14 ++ fs/f2fs/data.c | 7 - fs/f2fs/f2fs.h | 2 fs/f2fs/namei.c | 1 fs/f2fs/segment.c | 6 - fs/f2fs/super.c | 11 +- fs/fs-writeback.c | 36 +++--- fs/fuse/control.c | 4 fs/fuse/dev.c | 30 +++-- fs/fuse/fuse_i.h | 1 fs/fuse/inode.c | 1 fs/fuse/readdir.c | 4 fs/ntfs3/fslog.c | 12 ++ fs/smb/client/cifsacl.c | 1 fs/smb/client/smb2ops.c | 6 + fs/smb/server/connection.c | 5 fs/smb/server/mgmt/user_config.c | 6 - fs/smb/server/mgmt/user_session.c | 7 - fs/smb/server/oplock.c | 7 + fs/smb/server/oplock.h | 1 fs/smb/server/smb2pdu.c | 5 fs/smb/server/smbacl.c | 61 +++++++++-- fs/smb/server/transport_ipc.c | 16 ++- fs/smb/server/transport_tcp.c | 4 fs/smb/server/vfs_cache.c | 128 ++++++++++++++++++++---- fs/smb/server/vfs_cache.h | 12 ++ kernel/sched/debug.c | 4 lib/crc/.kunitconfig | 3 lib/crc/Kconfig | 17 ++- lib/crc/tests/crc_kunit.c | 28 ++++- lib/crypto/.kunitconfig | 11 ++ lib/crypto/tests/Kconfig | 32 ++++-- net/ipv6/exthdrs.c | 4 net/ipv6/seg6_hmac.c | 2 net/packet/af_packet.c | 21 ++- net/rxrpc/key.c | 4 scripts/dtc/dtc-lexer.l | 3 scripts/generate_rust_analyzer.py | 14 ++ sound/hda/codecs/realtek/alc269.c | 1 sound/usb/caiaq/device.c | 4 sound/usb/mixer.c | 7 + tools/testing/kunit/configs/all_tests.config | 4 67 files changed, 867 insertions(+), 215 deletions(-)
Anderson Nascimento (1):
rxrpc: Fix missing validation of ticket length in non-XDR key preparsing
Berk Cem Goksel (1):
ALSA: caiaq: take a reference on the USB device in create_card()
Bernd Schubert (1):
fuse: Check for large folio with SPLICE_F_MOVE
Bingquan Chen (1):
net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()
Catalin Marinas (4):
arm64: tlb: Introduce __tlbi_sync_s1ish_{kernel,batch}() for TLB maintenance
arm64: tlb: Pass the corresponding mm to __tlbi_sync_s1ish()
arm64: cputype: Add C1-Pro definitions
arm64: errata: Work around early CME DVMSync acknowledgement
Chao Yu (3):
f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally
f2fs: fix to avoid memory leak in f2fs_rename()
f2fs: fix to avoid uninit-value access in f2fs_sanity_check_node_footer
Cryolitia PukNgae (1):
ALSA: usb-audio: apply quirk for MOONDROP JU Jiu
DaeMyung Kang (2):
smb: server: fix max_connections off-by-one in tcp accept path
ksmbd: reset rcount per connection in ksmbd_conn_wait_idle_sess_id()
Daniel Golle (1):
net: ethernet: mtk_eth_soc: initialize PPE per-tag-layer MTU registers
Darrick J. Wong (1):
fuse: quiet down complaints in fuse_conn_limit_write
Dudu Lu (1):
crypto: krb5enc - fix async decrypt skipping hash verification
Eric Biggers (8):
lib/crc: tests: Make crc_kunit test only the enabled CRC variants lib/crc: tests: Add CRC_ENABLE_ALL_FOR_KUNIT
lib/crc: tests: Add a .kunitconfig file
kunit: configs: Enable all CRC tests in all_tests.config lib/crypto: tests: Add a .kunitconfig file
lib/crypto: tests: Introduce CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT
kunit: configs: Enable all crypto library tests in all_tests.config lib/crypto: tests: Drop the default to CRYPTO_SELFTESTS
Eric Naim (1):
ALSA: hda/realtek: Add quirk for Legion S7 15IMH
George Saad (1):
f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
Greg Kroah-Hartman (2):
fs/ntfs3: validate rec->used in journal-replay file record check
Linux 6.18.25Herbert Xu (1):
crypto: authencesn - Fix src offset when decrypting in-place
Jan Kara (1):
writeback: Fix use after free in inode_switch_wbs_work_fn()
Mark Rutland (2):
arm64: tlb: Allow XZR argument to TLBI ops
arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
Michael Bommarito (6):
ksmbd: require minimum ACE size in smb_check_perm_dacl()
smb: server: fix active_num_conn leak on transport allocation failure
smb: client: require a full NFS mode SID before reading mode bits
smb: client: fix OOB read in smb2_ioctl_query_info QUERY_INFO path
ksmbd: validate response sizes in ipc_validate_msg()
ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()
Mikhail Gavrilov (1):
drm/amdgpu: replace PASID IDR with XArray
Miklos Szeredi (2):
fuse: abort on fatal signal during sync init
fuse: fuse_dev_ioctl_clone() should wait for device file to be initialized
Minhong He (1):
ipv6: add NULL checks for idev in SRv6 paths
Namjae Jeon (2):
ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger
ksmbd: validate owner of durable handle on reconnect
Nathan Chancellor (1):
scripts/dtc: Remove unused dts_version in dtc-lexer.l
Peter Zijlstra (1):
sched/debug: Fix avg_vruntime() usage
Samuel Page (1):
fuse: reject oversized dirents in page cache
Sean Christopherson (3):
crypto: ccp: Don't attempt to copy CSR to userspace if PSP command failed
crypto: ccp: Don't attempt to copy PDH cert to userspace if PSP command failed
crypto: ccp: Don't attempt to copy ID to userspace if PSP command failed
Tamir Duberstein (1):
scripts: generate_rust_analyzer.py: define scripts
Tristan Madani (2):
ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment
ksmbd: use check_add_overflow() to prevent u16 DACL size overflow
Wesley Atwell (1):
crypto: krb5enc - fix sleepable flag handling in encrypt dispatch
Yongpeng Yang (1):
f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()
Greg Kroah-Hartman
maintainerDocumentation/arch/arm64/silicon-errata.rst +2 -0
@@ -202,6 +202,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | C1-Pro | #4193714 | ARM64_ERRATUM_4193714 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | MMU-500 | #841119,826419 | ARM_SMMU_MMU_500_CPRE_ERRATA| | | | #562869,1047329 | | +----------------+-----------------+-----------------+-----------------------------+
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 18 -SUBLEVEL = 24 +SUBLEVEL = 25 EXTRAVERSION = NAME = Baby Opossum Posse
arch/arm64/Kconfig +12 -0
@@ -1154,6 +1154,18 @@ config ARM64_ERRATUM_3194386 If unsure, say Y. +config ARM64_ERRATUM_4193714 + bool "C1-Pro: 4193714: SME DVMSync early acknowledgement" + depends on ARM64_SME + default y + help + Enable workaround for C1-Pro acknowledging the DVMSync before + the SME memory accesses are complete. This will cause TLB + maintenance for processes using SME to also issue an IPI to + the affected CPUs. + + If unsure, say Y. + config CAVIUM_ERRATUM_22375 bool "Cavium erratum 22375, 24313" default y
arch/arm64/include/asm/cpucaps.h +2 -0
@@ -66,6 +66,8 @@ cpucap_is_possible(const unsigned int cap)return IS_ENABLED (CONFIG_ARM64_WORKAROUND_REPEAT_TLBI );case ARM64_WORKAROUND_SPECULATIVE_SSBS :return IS_ENABLED (CONFIG_ARM64_ERRATUM_3194386 ); +case ARM64_WORKAROUND_4193714 : +return IS_ENABLED (CONFIG_ARM64_ERRATUM_4193714 );case ARM64_MPAM :/* * KVM MPAM support doesn't rely on the host kernel supporting MPAM.
arch/arm64/include/asm/cputype.h +2 -0
@@ -98,6 +98,7 @@#define ARM_CPU_PART_CORTEX_A725 0xD87#define ARM_CPU_PART_CORTEX_A720AE 0xD89#define ARM_CPU_PART_NEOVERSE_N3 0xD8E +#define ARM_CPU_PART_C1_PRO 0xD8B#define APM_CPU_PART_XGENE 0x000#define APM_CPU_VAR_POTENZA 0x00
@@ -189,6 +190,7 @@#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)#define MIDR_CORTEX_A720AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720AE)#define MIDR_NEOVERSE_N3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N3) +#define MIDR_C1_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_PRO)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
arch/arm64/include/asm/fpsimd.h +21 -0
@@ -428,6 +428,24 @@ static inline size_t sme_state_size(struct task_struct const *task) return __sme_state_size(task_get_sme_vl(task)); } +void sme_enable_dvmsync (void ); +void sme_set_active (void ); +void sme_clear_active (void ); + +static inline void sme_enter_from_user_mode (void ) +{ +if (alternative_has_cap_unlikely (ARM64_WORKAROUND_4193714 ) && +test_thread_flag (TIF_SME )) +sme_clear_active (); +} + +static inline void sme_exit_to_user_mode (void ) +{ +if (alternative_has_cap_unlikely (ARM64_WORKAROUND_4193714 ) && +test_thread_flag (TIF_SME )) +sme_set_active (); +} +#else static inline void sme_user_disable (void ) {BUILD_BUG (); }
@@ -456,6 +474,9 @@ static inline size_t sme_state_size(struct task_struct const *task) return 0; } +static inline void sme_enter_from_user_mode (void ) { } +static inline void sme_exit_to_user_mode (void ) { } +#endif /* ! CONFIG_ARM64_SME */ /* For use by EFI runtime services calls only */
arch/arm64/include/asm/tlbbatch.h +8 -2
@@ -2,11 +2,17 @@#ifndef _ARCH_ARM64_TLBBATCH_H#define _ARCH_ARM64_TLBBATCH_H +#include <linux/cpumask.h> +struct arch_tlbflush_unmap_batch { +#ifdef CONFIG_ARM64_ERRATUM_4193714 /* -* For arm64, HW can do tlb shootdown, so we don't -* need to record cpumask for sending IPI +* Track CPUs that need SME DVMSync on completion of this batch. +* Otherwise, the arm64 HW can do tlb shootdown, so we don't need to +* record cpumask for sending IPI */ +cpumask_var_t cpumask; +#endif };#endif /* _ARCH_ARM64_TLBBATCH_H */
arch/arm64/include/asm/tlbflush.h +117 -26
216 lines not on this page · raw message
arch/arm64/kernel/cpu_errata.c +30 -0
@@ -11,6 +11,7 @@#include <asm/cpu.h> #include <asm/cputype.h> #include <asm/cpufeature.h> +#include <asm/fpsimd.h> #include <asm/kvm_asm.h> #include <asm/smp_plat.h>
@@ -551,6 +552,23 @@ static const struct midr_range erratum_spec_ssbs_list[] = { };#endif +#ifdef CONFIG_ARM64_ERRATUM_4193714 +static bool has_sme_dvmsync_erratum (const struct arm64_cpu_capabilities *entry, +int scope) +{ +if (!id_aa64pfr1_sme (read_sanitised_ftr_reg (SYS_ID_AA64PFR1_EL1 ))) +return false; + +return is_affected_midr_range (entry, scope); +} + +static void cpu_enable_sme_dvmsync (const struct arm64_cpu_capabilities *__unused) +{ +if (this_cpu_has_cap (ARM64_WORKAROUND_4193714 )) +sme_enable_dvmsync (); +} +#endif +#ifdef CONFIG_AMPERE_ERRATUM_AC03_CPU_38 static const struct midr_range erratum_ac03_cpu_38_list[] = { MIDR_ALL_VERSIONS(MIDR_AMPERE1),
@@ -870,6 +888,18 @@ const struct arm64_cpu_capabilities arm64_errata[] = { ERRATA_MIDR_RANGE_LIST(erratum_spec_ssbs_list), },#endif +#ifdef CONFIG_ARM64_ERRATUM_4193714 + { + .desc = "C1-Pro SME DVMSync early acknowledgement", + .capability = ARM64_WORKAROUND_4193714, + .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, + .matches = has_sme_dvmsync_erratum, + .cpu_enable = cpu_enable_sme_dvmsync, +/* C1-Pro r0p0 - r1p2 (the latter only when REVIDR_EL1[0]==0) */ + .midr_range =MIDR_RANGE (MIDR_C1_PRO ,0 ,0 ,1 ,2 ), +MIDR_FIXED (MIDR_CPU_VAR_REV (1 ,2 ),BIT (0 )), + }, +#endif #ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD { .desc = "ARM errata 2966298, 3117295",
arch/arm64/kernel/entry-common.c +3 -0
@@ -21,6 +21,7 @@#include <asm/daifflags.h> #include <asm/esr.h> #include <asm/exception.h> +#include <asm/fpsimd.h> #include <asm/irq_regs.h> #include <asm/kprobes.h> #include <asm/mmu.h>
@@ -84,6 +85,7 @@ static __always_inline void __enter_from_user_mode(struct pt_regs *regs) {enter_from_user_mode (regs);mte_disable_tco_entry (current); +sme_enter_from_user_mode (); } static __always_inline void arm64_enter_from_user_mode(struct pt_regs *regs)
@@ -102,6 +104,7 @@ static __always_inline void arm64_exit_to_user_mode(struct pt_regs *regs)local_irq_disable ();exit_to_user_mode_prepare (regs);local_daif_mask (); +sme_exit_to_user_mode ();mte_check_tfsr_exit ();exit_to_user_mode (); }
arch/arm64/kernel/fpsimd.c +79 -0
97 lines not on this page · raw message
arch/arm64/kernel/process.c +36 -0
@@ -26,6 +26,7 @@#include <linux/reboot.h> #include <linux/interrupt.h> #include <linux/init.h> +#include <linux/cpumask.h> #include <linux/cpu.h> #include <linux/elfcore.h> #include <linux/pm.h>
@@ -339,8 +340,41 @@ void flush_thread(void)flush_gcs (); } +#ifdef CONFIG_ARM64_ERRATUM_4193714 + +static void arch_dup_tlbbatch_mask (struct task_struct *dst) +{ +/* +* Clear the inherited cpumask with memset() to cover both cases where +* cpumask_var_t is a pointer or an array. It will be allocated lazily +* in sme_dvmsync_add_pending() if CPUMASK_OFFSTACK=y. +*/ +if (alternative_has_cap_unlikely (ARM64_WORKAROUND_4193714 )) +memset (&dst->tlb_ubc.arch.cpumask,0 , +sizeof (dst->tlb_ubc.arch.cpumask)); +} + +static void arch_release_tlbbatch_mask (struct task_struct *tsk) +{ +if (alternative_has_cap_unlikely (ARM64_WORKAROUND_4193714 )) +free_cpumask_var (tsk->tlb_ubc.arch.cpumask); +} + +#else + +static void arch_dup_tlbbatch_mask (struct task_struct *dst) +{ +} + +static void arch_release_tlbbatch_mask (struct task_struct *tsk) +{ +} + +#endif /* CONFIG_ARM64_ERRATUM_4193714 */ +void arch_release_task_struct (struct task_struct *tsk) { +arch_release_tlbbatch_mask (tsk);fpsimd_release_task (tsk); }
@@ -356,6 +390,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) *dst = *src; +arch_dup_tlbbatch_mask (dst); +/* * Drop stale reference to src's sve_state and convert dst to * non-streaming FPSIMD mode.
arch/arm64/kernel/sys_compat.c +1 -1
@@ -37,7 +37,7 @@ __do_compat_cache_op(unsigned long start, unsigned long end)* We pick the reserved-ASID to minimise the impact. */ __tlbi (aside1is,__TLBI_VADDR (0 ,0 )); -dsb (ish); +__tlbi_sync_s1ish (current->mm); } ret =caches_clean_inval_user_pou (start, start + chunk);
arch/arm64/kvm/hyp/nvhe/mm.c +1 -1
@@ -271,7 +271,7 @@ static void fixmap_clear_slot(struct hyp_fixmap_slot *slot)*/ dsb (ishst);__tlbi_level (vale2is,__TLBI_VADDR (addr,0 ), level); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb (); }
arch/arm64/kvm/hyp/nvhe/tlb.c +4 -4
@@ -169,7 +169,7 @@ void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu,*/ dsb (ish);__tlbi (vmalle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -226,7 +226,7 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,dsb (ish);__tlbi (vmalle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -240,7 +240,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu)enter_vmid_context (mmu, &cxt, false);__tlbi (vmalls12e1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -266,5 +266,5 @@ void __kvm_flush_vm_context(void)/* Same remark as in enter_vmid_context() */ dsb (ish);__tlbi (alle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp (); }
arch/arm64/kvm/hyp/pgtable.c +1 -1
@@ -483,7 +483,7 @@ static int hyp_unmap_walker(const struct kvm_pgtable_visit_ctx *ctx, *unmapped += granule; } -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb (); mm_ops->put_page (ctx->ptep);
arch/arm64/kvm/hyp/vhe/tlb.c +5 -5
@@ -115,7 +115,7 @@ void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu,*/ dsb (ish);__tlbi (vmalle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -176,7 +176,7 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,dsb (ish);__tlbi (vmalle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -192,7 +192,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu)enter_vmid_context (mmu, &cxt);__tlbi (vmalls12e1is); -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();exit_vmid_context (&cxt);
@@ -217,7 +217,7 @@ void __kvm_flush_vm_context(void) {dsb (ishst);__tlbi (alle1is); -dsb (ish); +__tlbi_sync_s1ish_hyp (); }/*
@@ -358,7 +358,7 @@ int __kvm_tlbi_s1e2(struct kvm_s2_mmu *mmu, u64 va, u64 sys_encoding)default : ret = -EINVAL ; } -dsb (ish); +__tlbi_sync_s1ish_hyp ();isb ();if (mmu)
arch/arm64/tools/cpucaps +1 -0
@@ -101,6 +101,7 @@ WORKAROUND_2077057 WORKAROUND_2457168 WORKAROUND_2645198 WORKAROUND_2658417 +WORKAROUND_4193714 WORKAROUND_AMPERE_AC03_CPU_38 WORKAROUND_AMPERE_AC04_CPU_23 WORKAROUND_TRBE_OVERWRITE_FILL_MODE
crypto/authencesn.c +4 -2
@@ -228,9 +228,11 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req, decrypt: -if (src != dst) - src =scatterwalk_ffwd (areq_ctx->src, src, assoclen); dst =scatterwalk_ffwd (areq_ctx->dst, dst, assoclen); +if (req->src == req->dst) + src = dst; +else + src =scatterwalk_ffwd (areq_ctx->src, src, assoclen);skcipher_request_set_tfm (skreq, ctx->enc); skcipher_request_set_callback(skreq, flags,
crypto/krb5enc.c +31 -20
114 lines not on this page · raw message
drivers/crypto/ccp/sev-dev.c +17 -2
@@ -1833,7 +1833,10 @@ static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp, bool writable) ret =__sev_do_cmd_locked (SEV_CMD_PEK_CSR , &data, &argp->error); -/* If we query the CSR length, FW responded with expected data. */ +/* +* Firmware will returns the length of the CSR blob (either the minimum +* required length or the actual length written), return it to the user. +*/ input.length = data.len;if (copy_to_user ((void __user *)argp->data, &input,sizeof (input))) {
@@ -1841,6 +1844,9 @@ static int sev_ioctl_do_pek_csr(struct sev_issue_cmd *argp, bool writable) goto e_free_blob; } +if (ret ||WARN_ON_ONCE (argp->error)) + goto e_free_blob; +if (blob) {if (copy_to_user (input_address, blob, input.length)) ret = -EFAULT ;
@@ -2191,6 +2197,9 @@ static int sev_ioctl_do_get_id2(struct sev_issue_cmd *argp) goto e_free; } +if (ret ||WARN_ON_ONCE (argp->error)) + goto e_free; +if (id_blob) {if (copy_to_user (input_address, id_blob, data.len)) { ret = -EFAULT ;
@@ -2307,7 +2316,10 @@ static int sev_ioctl_do_pdh_export(struct sev_issue_cmd *argp, bool writable) ret =__sev_do_cmd_locked (SEV_CMD_PDH_CERT_EXPORT , &data, &argp->error); -/* If we query the length, FW responded with expected data. */ +/* +* Firmware will return the length of the blobs (either the minimum +* required length or the actual length written), return 'em to the user. +*/ input.cert_chain_len = data.cert_chain_len; input.pdh_cert_len = data.pdh_cert_len;
@@ -2316,6 +2328,9 @@ static int sev_ioctl_do_pdh_export(struct sev_issue_cmd *argp, bool writable) goto e_free_cert; } +if (ret ||WARN_ON_ONCE (argp->error)) + goto e_free_cert; +if (pdh_blob) {if (copy_to_user (input_pdh_cert_address, pdh_blob, input.pdh_cert_len)) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +19 -20
@@ -22,7 +22,7 @@*/ #include "amdgpu_ids.h" -#include <linux/idr.h> +#include <linux/xarray.h> #include <linux/dma-fence-array.h>
@@ -40,8 +40,8 @@* VMs are looked up from the PASID per amdgpu_device. */ -static DEFINE_IDR (amdgpu_pasid_idr); -static DEFINE_SPINLOCK (amdgpu_pasid_idr_lock); +static DEFINE_XARRAY_FLAGS(amdgpu_pasid_xa, XA_FLAGS_LOCK_IRQ | XA_FLAGS_ALLOC1); +static u32 amdgpu_pasid_xa_next;/* Helper to free pasid from a fence callback */ struct amdgpu_pasid_cb {
@@ -62,36 +62,37 @@ struct amdgpu_pasid_cb {*/ int amdgpu_pasid_alloc (unsigned int bits) { -int pasid; +u32 pasid; +int r;if (bits ==0 )return -EINVAL ; -spin_lock (&amdgpu_pasid_idr_lock); -/* TODO: Need to replace the idr with an xarry, and then -* handle the internal locking with ATOMIC safe paths. -*/ - pasid =idr_alloc_cyclic (&amdgpu_pasid_idr,NULL ,1 , -1U << bits,GFP_ATOMIC ); -spin_unlock (&amdgpu_pasid_idr_lock); - -if (pasid >=0 ) -trace_amdgpu_pasid_allocated (pasid); + r =xa_alloc_cyclic_irq (&amdgpu_pasid_xa, &pasid,xa_mk_value (0 ), +XA_LIMIT (1 , (1U << bits) -1 ), + &amdgpu_pasid_xa_next,GFP_KERNEL ); +if (r <0 ) +return r; +trace_amdgpu_pasid_allocated (pasid);return pasid; }/** * amdgpu_pasid_free - Free a PASID * @pasid: PASID to free +* +* Called in IRQ context. */ void amdgpu_pasid_free (u32 pasid) { +unsigned long flags; +trace_amdgpu_pasid_freed (pasid); -spin_lock (&amdgpu_pasid_idr_lock); -idr_remove (&amdgpu_pasid_idr, pasid); -spin_unlock (&amdgpu_pasid_idr_lock); +xa_lock_irqsave (&amdgpu_pasid_xa, flags); +__xa_erase (&amdgpu_pasid_xa, pasid); +xa_unlock_irqrestore (&amdgpu_pasid_xa, flags); } static void amdgpu_pasid_free_cb(struct dma_fence *fence,
@@ -658,7 +659,5 @@ void amdgpu_vmid_mgr_fini(struct amdgpu_device *adev)*/ void amdgpu_pasid_mgr_cleanup (void ) { -spin_lock (&amdgpu_pasid_idr_lock); -idr_destroy (&amdgpu_pasid_idr); -spin_unlock (&amdgpu_pasid_idr_lock); +xa_destroy (&amdgpu_pasid_xa); }
drivers/net/ethernet/mediatek/mtk_eth_soc.c +21 -1
@@ -3567,12 +3567,23 @@ static int mtk_device_event(struct notifier_block *n, unsigned long event, voidreturn NOTIFY_DONE ; } +static int mtk_max_gmac_mtu (struct mtk_eth *eth) +{ +int i, max_mtu =ETH_DATA_LEN ; + +for (i =0 ; i <ARRAY_SIZE (eth->netdev); i++) +if (eth->netdev[i] && eth->netdev[i]->mtu > max_mtu) + max_mtu = eth->netdev[i]->mtu; + +return max_mtu; +} +static int mtk_open (struct net_device *dev) {struct mtk_mac *mac =netdev_priv (dev);struct mtk_eth *eth = mac->hw;struct mtk_mac *target_mac; -int i, err, ppe_num; +int i, err, ppe_num, mtu; ppe_num = eth->soc->ppe_num;
@@ -3619,6 +3630,10 @@ static int mtk_open(struct net_device *dev)mtk_gdm_config (eth, target_mac->id, gdm_config); } + mtu =mtk_max_gmac_mtu (eth); +for (i =0 ; i <ARRAY_SIZE (eth->ppe); i++) +mtk_ppe_update_mtu (eth->ppe[i], mtu); +napi_enable (ð->tx_napi);napi_enable (ð->rx_napi);mtk_tx_irq_enable (eth,MTK_TX_DONE_INT );
@@ -4312,6 +4327,7 @@ static int mtk_change_mtu(struct net_device *dev, int new_mtu)int length = new_mtu +MTK_RX_ETH_HLEN ;struct mtk_mac *mac =netdev_priv (dev);struct mtk_eth *eth = mac->hw; +int max_mtu, i;if (rcu_access_pointer (eth->prog) && length >MTK_PP_MAX_BUF_SIZE ) {
@@ -4322,6 +4338,10 @@ static int mtk_change_mtu(struct net_device *dev, int new_mtu)mtk_set_mcr_max_rx (mac, length);WRITE_ONCE (dev->mtu, new_mtu); + max_mtu =mtk_max_gmac_mtu (eth); +for (i =0 ; i <ARRAY_SIZE (eth->ppe); i++) +mtk_ppe_update_mtu (eth->ppe[i], max_mtu); +return 0 ; }
drivers/net/ethernet/mediatek/mtk_ppe.c +30 -0
@@ -973,6 +973,36 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe) } } +void mtk_ppe_update_mtu (struct mtk_ppe *ppe,int mtu) +{ +int base; +u32 val; + +if (!ppe) +return ; + +/* The PPE checks output frame size against per-tag-layer MTU limits, +* treating PPPoE and DSA tags just like 802.1Q VLAN tags. The Linux +* device MTU already accounts for PPPoE (PPPOE_SES_HLEN) and DSA tag +* overhead, but 802.1Q VLAN tags are handled transparently without +* being reflected by the lower device MTU being increased by 4. +* Use the maximum MTU across all GMAC interfaces so that PPE output +* frame limits are sufficiently high regardless of which port a flow +* egresses through. +*/ + base =ETH_HLEN + mtu; + + val =FIELD_PREP (MTK_PPE_VLAN_MTU0_NONE , base) | +FIELD_PREP (MTK_PPE_VLAN_MTU0_1TAG , base +VLAN_HLEN ); +ppe_w32 (ppe,MTK_PPE_VLAN_MTU0 , val); + + val =FIELD_PREP (MTK_PPE_VLAN_MTU1_2TAG , + base +2 *VLAN_HLEN ) | +FIELD_PREP (MTK_PPE_VLAN_MTU1_3TAG , + base +3 *VLAN_HLEN ); +ppe_w32 (ppe,MTK_PPE_VLAN_MTU1 , val); +} +void mtk_ppe_start (struct mtk_ppe *ppe) {u32 val;
drivers/net/ethernet/mediatek/mtk_ppe.h +1 -0
@@ -346,6 +346,7 @@ struct mtk_ppe {struct mtk_ppe *mtk_ppe_init (struct mtk_eth *eth,void __iomem *base,int index);void mtk_ppe_deinit (struct mtk_eth *eth); +void mtk_ppe_update_mtu (struct mtk_ppe *ppe,int mtu);void mtk_ppe_start (struct mtk_ppe *ppe);int mtk_ppe_stop (struct mtk_ppe *ppe);int mtk_ppe_prepare_reset (struct mtk_ppe *ppe);
fs/f2fs/compress.c +11 -3
@@ -1489,10 +1489,10 @@ void f2fs_compress_write_end_io(struct bio *bio, struct folio *folio)f2fs_compress_free_page (page); -dec_page_count (sbi, type); - -if (atomic_dec_return (&cic->pending_pages)) +if (atomic_dec_return (&cic->pending_pages)) { +dec_page_count (sbi, type);return ; + }for (i =0 ; i < cic->nr_rpages; i++) {WARN_ON (!cic->rpages[i]);
@@ -1502,6 +1502,14 @@ void f2fs_compress_write_end_io(struct bio *bio, struct folio *folio)page_array_free (sbi, cic->rpages, cic->nr_rpages);kmem_cache_free (cic_entry_slab, cic); + +/* +* Make sure dec_page_count() is the last access to sbi. +* Once it drops the F2FS_WB_CP_DATA counter to zero, the +* unmount thread can proceed to destroy sbi and +* sbi->page_array_slab. +*/ +dec_page_count (sbi, type); } static int f2fs_write_raw_pages(struct compress_ctx *cc,
fs/f2fs/data.c +4 -3
@@ -152,7 +152,8 @@ static void f2fs_finish_read_bio(struct bio *bio, bool in_task)dec_page_count (F2FS_F_SB (folio),__read_io_type (folio)); -if (F2FS_F_SB (folio)->node_inode &&is_node_folio (folio) && +if (bio->bi_status ==BLK_STS_OK && +F2FS_F_SB (folio)->node_inode &&is_node_folio (folio) &&f2fs_sanity_check_node_footer (F2FS_F_SB (folio), folio, folio->index,NODE_TYPE_REGULAR , true)) bio->bi_status =BLK_STS_IOERR ;
@@ -363,6 +364,8 @@ static void f2fs_write_end_io(struct bio *bio) folio->index, NODE_TYPE_REGULAR, true);f2fs_bug_on (sbi, folio->index !=nid_of_node (folio)); } +if (f2fs_in_warm_node_list (sbi, folio)) +f2fs_del_fsync_node_entry (sbi, folio);dec_page_count (sbi, type);
@@ -374,8 +377,6 @@ static void f2fs_write_end_io(struct bio *bio) wq_has_sleeper(&sbi->cp_wait))wake_up (&sbi->cp_wait); -if (f2fs_in_warm_node_list (sbi, folio)) -f2fs_del_fsync_node_entry (sbi, folio);folio_clear_f2fs_gcing (folio);folio_end_writeback (folio); }
fs/f2fs/f2fs.h +1 -1
@@ -3930,7 +3930,7 @@ bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr);int f2fs_start_discard_thread (struct f2fs_sb_info *sbi);void f2fs_drop_discard_cmd (struct f2fs_sb_info *sbi);void f2fs_stop_discard_thread (struct f2fs_sb_info *sbi); -bool f2fs_issue_discard_timeout (struct f2fs_sb_info *sbi); +bool f2fs_issue_discard_timeout (struct f2fs_sb_info *sbi,bool need_check);void f2fs_clear_prefree_segments (struct f2fs_sb_info *sbi,struct cp_control *cpc);void f2fs_dirty_to_prefree (struct f2fs_sb_info *sbi);
fs/f2fs/namei.c +1 -0
@@ -949,6 +949,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,return err; err =f2fs_create_whiteout (idmap, old_dir, &whiteout, &fname); +f2fs_free_filename (&fname);if (err)return err; }
fs/f2fs/segment.c +3 -3
@@ -1895,7 +1895,7 @@ void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi)* * Return true if issued all discard cmd or no discard cmd need issue, otherwise return false. */ -bool f2fs_issue_discard_timeout (struct f2fs_sb_info *sbi) +bool f2fs_issue_discard_timeout (struct f2fs_sb_info *sbi,bool need_check) {struct discard_cmd_control *dcc =SM_I (sbi)->dcc_info;struct discard_policy dpolicy;
@@ -1912,7 +1912,7 @@ bool f2fs_issue_discard_timeout(struct f2fs_sb_info *sbi)/* just to make sure there is no pending discard commands */ __wait_all_discard_cmd (sbi,NULL ); -f2fs_bug_on (sbi,atomic_read (&dcc->discard_cmd_cnt)); +f2fs_bug_on (sbi, need_check &&atomic_read (&dcc->discard_cmd_cnt));return !dropped; }
@@ -2382,7 +2382,7 @@ static void destroy_discard_cmd_control(struct f2fs_sb_info *sbi)* Recovery can cache discard commands, so in error path of * fill_super(), it needs to give a chance to handle them. */ -f2fs_issue_discard_timeout (sbi); +f2fs_issue_discard_timeout (sbi, true);kfree (dcc);SM_I (sbi)->dcc_info =NULL ;
fs/f2fs/super.c +8 -3
@@ -1961,7 +1961,7 @@ static void f2fs_put_super(struct super_block *sb) }/* be sure to wait for any on-going discard commands */ - done =f2fs_issue_discard_timeout (sbi); + done =f2fs_issue_discard_timeout (sbi, true);if (f2fs_realtime_discard_enable (sbi) && !sbi->discard_blks && done) {struct cp_control cpc = { .reason =CP_UMOUNT |CP_TRIMMED ,
@@ -2104,7 +2104,7 @@ static int f2fs_unfreeze(struct super_block *sb)* will recover after removal of snapshot. */ if (test_opt (sbi,DISCARD ) && !f2fs_hw_support_discard (sbi)) -f2fs_issue_discard_timeout (sbi); +f2fs_issue_discard_timeout (sbi, true);clear_sbi_flag (F2FS_SB (sb),SBI_IS_FREEZING );return 0 ;
@@ -2884,7 +2884,12 @@ static int __f2fs_remount(struct fs_context *fc, struct super_block *sb) need_stop_discard = true; }else {f2fs_stop_discard_thread (sbi); -f2fs_issue_discard_timeout (sbi); +/* +* f2fs_ioc_fitrim() won't race w/ "remount ro" +* so it's safe to check discard_cmd_cnt in +* f2fs_issue_discard_timeout(). +*/ +f2fs_issue_discard_timeout (sbi, flags &SB_RDONLY ); need_restart_discard = true; } }
fs/fs-writeback.c +19 -17
@@ -558,28 +558,30 @@ void inode_switch_wbs_work_fn(struct work_struct *work)struct inode_switch_wbs_context *isw, *next_isw;struct llist_node *list; + list =llist_del_all (&new_wb->switch_wbs_ctxs);/* -* Grab out reference to wb so that it cannot get freed under us +* Nothing to do? That would be a problem as references held by isw +* items protect wb from freeing... +*/ +if (WARN_ON_ONCE (!list)) +return ; + +/* +* Grab our reference to wb so that it cannot get freed under us * after we process all the isw items. */ wb_get (new_wb); -while (1 ) { - list =llist_del_all (&new_wb->switch_wbs_ctxs); -/* Nothing to do? */ -if (!list) -break ; -/* -* In addition to synchronizing among switchers, I_WB_SWITCH -* tells the RCU protected stat update paths to grab the i_page -* lock so that stat transfer can synchronize against them. -* Let's continue after I_WB_SWITCH is guaranteed to be -* visible. -*/ -synchronize_rcu (); +/* +* In addition to synchronizing among switchers, I_WB_SWITCH +* tells the RCU protected stat update paths to grab the i_page +* lock so that stat transfer can synchronize against them. +* Let's continue after I_WB_SWITCH is guaranteed to be +* visible. +*/ +synchronize_rcu (); -llist_for_each_entry_safe (isw, next_isw, list, list) -process_inode_switch_wbs (new_wb, isw); - } +llist_for_each_entry_safe (isw, next_isw, list, list) +process_inode_switch_wbs (new_wb, isw);wb_put (new_wb); }
fs/fuse/control.c +2 -2
@@ -121,7 +121,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned val; + unsigned int val = 0;ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
@@ -163,7 +163,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned val; + unsigned int val = 0;struct fuse_conn *fc;ssize_t ret;
fs/fuse/dev.c +18 -12
@@ -570,6 +570,11 @@ static void request_wait_answer(struct fuse_req *req)if (!err)return ; +if (req->args->abort_on_kill) { +fuse_abort_conn (fc); +return ; + } +if (test_bit (FR_URING , &req->flags)) removed =fuse_uring_remove_pending_req (req);else
@@ -676,7 +681,8 @@ ssize_t __fuse_simple_request(struct mnt_idmap *idmap,fuse_force_creds (req);__set_bit (FR_WAITING , &req->flags); -__set_bit (FR_FORCE , &req->flags); +if (!args->abort_on_kill) +__set_bit (FR_FORCE , &req->flags); }else {WARN_ON (args->nocreds); req =fuse_get_req (idmap, fm, false);
@@ -1011,6 +1017,9 @@ static int fuse_try_move_folio(struct fuse_copy_state *cs, struct folio **foliopfolio_clear_uptodate (newfolio);folio_clear_mappedtodisk (newfolio); +if (folio_test_large (newfolio)) + goto out_fallback_unlock; +if (fuse_check_folio (newfolio) !=0 ) goto out_fallback_unlock;
@@ -2590,9 +2599,8 @@ static int fuse_device_clone(struct fuse_conn *fc, struct file *new)static long fuse_dev_ioctl_clone (struct file *file,__u32 __user *argp) { -int res;int oldfd; -struct fuse_dev *fud =NULL ; +struct fuse_dev *fud;if (get_user (oldfd, argp))return -EFAULT ;
@@ -2605,17 +2613,15 @@ static long fuse_dev_ioctl_clone(struct file *file, __u32 __user *argp)* Check against file->f_op because CUSE * uses the same ioctl handler. */ -if (fd_file (f)->f_op == file->f_op) - fud =__fuse_get_dev (fd_file (f)); +if (fd_file (f)->f_op != file->f_op) +return -EINVAL ; - res = -EINVAL ; -if (fud) { -mutex_lock (&fuse_mutex); - res =fuse_device_clone (fud->fc, file); -mutex_unlock (&fuse_mutex); - } + fud =fuse_get_dev (fd_file (f)); +if (IS_ERR (fud)) +return PTR_ERR (fud); -return res; +guard (mutex)(&fuse_mutex); +return fuse_device_clone (fud->fc, file); } static long fuse_dev_ioctl_backing_open(struct file *file,
fs/fuse/fuse_i.h +1 -0
@@ -333,6 +333,7 @@ struct fuse_args { bool is_ext:1; bool is_pinned:1; bool invalidate_vmap:1; + bool abort_on_kill:1;struct fuse_in_arg in_args[4 ];struct fuse_arg out_args[2 ];void (*end)(struct fuse_mount *fm,struct fuse_args *args,int error);
fs/fuse/inode.c +1 -0
@@ -1548,6 +1548,7 @@ int fuse_send_init(struct fuse_mount *fm)int err;if (fm->fc->sync_init) { + ia->args.abort_on_kill = true; err =fuse_simple_request (fm, &ia->args);/* Ignore size of init reply */ if (err >0 )
fs/fuse/readdir.c +4 -0
@@ -41,6 +41,10 @@ static void fuse_add_dirent_to_cache(struct file *file,unsigned int offset;void *addr; +/* Dirent doesn't fit in readdir cache page? Skip caching. */ +if (reclen >PAGE_SIZE ) +return ; +spin_lock (&fi->rdc.lock);/* * Is cache already completed? Or this entry does not go at the end of
fs/ntfs3/fslog.c +11 -1
@@ -2789,13 +2789,14 @@ static inline bool check_file_record(const struct MFT_REC *rec,u16 fn =le16_to_cpu (rec->rhdr.fix_num);u16 ao =le16_to_cpu (rec->attr_off);u32 rs = sbi->record_size; +u32 used =le32_to_cpu (rec->used);/* Check the file record header for consistency. */ if (rec->rhdr.sign !=NTFS_FILE_SIGNATURE || fo > (SECTOR_SIZE - ((rs >>SECTOR_SHIFT ) +1 ) *sizeof (short )) || (fn -1 ) *SECTOR_SIZE != rs || ao <MFTRECORD_FIXUP_OFFSET_1 || ao > sbi->record_size -SIZEOF_RESIDENT || !is_rec_inuse (rec) || -le32_to_cpu (rec->total) != rs) { +le32_to_cpu (rec->total) != rs || used > rs || used < ao) {return false; }
@@ -2807,6 +2808,15 @@ static inline bool check_file_record(const struct MFT_REC *rec,return false; } +/* +* The do_action() handlers compute memmove lengths as +* "rec->used - <offset of validated attr>", which underflows when +* rec->used is smaller than the attribute walk reached. At this +* point attr is the ATTR_END marker; rec->used must cover it. +*/ +if (used <PtrOffset (rec, attr) +sizeof (attr->type)) +return false; +return true; }
fs/smb/client/cifsacl.c +1 -0
@@ -831,6 +831,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,dump_ace (ppace[i], end_of_acl);#endif if (mode_from_special_sid && + ppace[i]->sid.num_subauth >=3 && (compare_sids (&(ppace[i]->sid), &sid_unix_NFS_mode) ==0 )) {/*
fs/smb/client/smb2ops.c +6 -0
@@ -1775,6 +1775,12 @@ smb2_ioctl_query_info(const unsigned int xid, qi_rsp = (struct smb2_query_info_rsp *)rsp_iov[1 ].iov_base;if (le32_to_cpu (qi_rsp->OutputBufferLength) < qi.input_buffer_length) qi.input_buffer_length =le32_to_cpu (qi_rsp->OutputBufferLength); +if (qi.input_buffer_length >0 && +struct_size (qi_rsp, Buffer, qi.input_buffer_length) > + rsp_iov[1 ].iov_len) { + rc = -EFAULT ; + goto out; + }if (copy_to_user (&pqi->input_buffer_length, &qi.input_buffer_length,sizeof (qi.input_buffer_length))) {
fs/smb/server/connection.c +2 -3
@@ -180,7 +180,7 @@ int ksmbd_conn_wait_idle_sess_id(struct ksmbd_conn *curr_conn, u64 sess_id) {struct ksmbd_conn *conn;int rc, retry_count =0 , max_timeout =120 ; -int rcount =1 , bkt; +int rcount, bkt; retry_idle:if (retry_count >= max_timeout)
@@ -189,8 +189,7 @@ int ksmbd_conn_wait_idle_sess_id(struct ksmbd_conn *curr_conn, u64 sess_id)down_read (&conn_list_lock);hash_for_each (conn_list, bkt, conn, hlist) {if (conn->binding ||xa_load (&conn->sessions, sess_id)) { -if (conn == curr_conn) - rcount =2 ; + rcount = (conn == curr_conn) ?2 :1 ;if (atomic_read (&conn->req_running) >= rcount) { rc = wait_event_timeout(conn->req_running_q, atomic_read(&conn->req_running) < rcount,
fs/smb/server/mgmt/user_config.c +0 -6
@@ -56,12 +56,6 @@ struct ksmbd_user *ksmbd_alloc_user(struct ksmbd_login_response *resp, goto err_free;if (resp_ext) { -if (resp_ext->ngroups >NGROUPS_MAX ) { -pr_err ("ngroups(%u) from login response exceeds max groups(%d)\n" , - resp_ext->ngroups,NGROUPS_MAX ); - goto err_free; - } - user->sgid =kmemdup (resp_ext->____payload, resp_ext->ngroups *sizeof (gid_t),KSMBD_DEFAULT_GFP );
fs/smb/server/mgmt/user_session.c +3 -4
@@ -161,11 +161,10 @@ void ksmbd_session_destroy(struct ksmbd_session *sess)if (!sess)return ; +ksmbd_tree_conn_session_logoff (sess); +ksmbd_destroy_file_table (sess);if (sess->user)ksmbd_free_user (sess->user); - -ksmbd_tree_conn_session_logoff (sess); -ksmbd_destroy_file_table (&sess->file_table);ksmbd_launch_ksmbd_durable_scavenger ();ksmbd_session_rpc_clear_list (sess);free_channel_list (sess);
@@ -396,7 +395,7 @@ void destroy_previous_session(struct ksmbd_conn *conn, goto out; } -ksmbd_destroy_file_table (&prev_sess->file_table); +ksmbd_destroy_file_table (prev_sess); prev_sess->state =SMB2_SESSION_EXPIRED ;ksmbd_all_conn_set_status (id,KSMBD_SESS_NEED_SETUP );ksmbd_launch_ksmbd_durable_scavenger ();
fs/smb/server/oplock.c +7 -0
@@ -1841,6 +1841,7 @@ int smb2_check_durable_oplock(struct ksmbd_conn *conn,struct ksmbd_share_config *share, struct ksmbd_file *fp, struct lease_ctx_info *lctx, + struct ksmbd_user *user, char *name) { struct oplock_info *opinfo = opinfo_get(fp);
@@ -1849,6 +1850,12 @@ int smb2_check_durable_oplock(struct ksmbd_conn *conn,if (!opinfo)return 0 ; +if (ksmbd_vfs_compare_durable_owner (fp, user) == false) { +ksmbd_debug (SMB ,"Durable handle reconnect failed: owner mismatch\n" ); + ret = -EBADF ; + goto out; + } +if (opinfo->is_lease == false) {if (lctx) {pr_err ("create context include lease\n" );
fs/smb/server/oplock.h +1 -0
@@ -126,5 +126,6 @@ int smb2_check_durable_oplock(struct ksmbd_conn *conn,struct ksmbd_share_config *share, struct ksmbd_file *fp, struct lease_ctx_info *lctx, + struct ksmbd_user *user, char *name);#endif /* __KSMBD_OPLOCK_H */
fs/smb/server/smb2pdu.c +4 -1
@@ -3022,7 +3022,8 @@ int smb2_open(struct ksmbd_work *work) }if (dh_info.reconnected == true) { - rc =smb2_check_durable_oplock (conn, share, dh_info.fp, lc, name); + rc =smb2_check_durable_oplock (conn, share, dh_info.fp, + lc, sess->user, name);if (rc) {ksmbd_put_durable_fd (dh_info.fp); goto err_out2;
@@ -4830,6 +4831,8 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp,/* align next xattr entry at 4 byte bundary */ alignment_bytes = ((next_offset +3 ) & ~3 ) - next_offset;if (alignment_bytes) { +if (buf_free_len < alignment_bytes) +break ;memset (ptr,'\0' , alignment_bytes); ptr += alignment_bytes; next_offset += alignment_bytes;
fs/smb/server/smbacl.c +48 -13
134 lines not on this page · raw message
fs/smb/server/transport_ipc.c +13 -3
@@ -13,6 +13,7 @@#include <net/genetlink.h> #include <linux/socket.h> #include <linux/workqueue.h> +#include <linux/overflow.h> #include "vfs_cache.h" #include "transport_ipc.h"
@@ -497,7 +498,9 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry) {struct ksmbd_rpc_command *resp = entry->response; - msg_sz =sizeof (struct ksmbd_rpc_command ) + resp->payload_sz; +if (check_add_overflow (sizeof (struct ksmbd_rpc_command ), + resp->payload_sz, &msg_sz)) +return -EINVAL ;break ; }case KSMBD_EVENT_SPNEGO_AUTHEN_REQUEST :
@@ -516,8 +519,9 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry)if (resp->payload_sz < resp->veto_list_sz)return -EINVAL ; - msg_sz =sizeof (struct ksmbd_share_config_response ) + - resp->payload_sz; +if (check_add_overflow (sizeof (struct ksmbd_share_config_response ), + resp->payload_sz, &msg_sz)) +return -EINVAL ; }break ; }
@@ -526,6 +530,12 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry)struct ksmbd_login_response_ext *resp = entry->response;if (resp->ngroups) { +if (resp->ngroups <0 || + resp->ngroups >NGROUPS_MAX ) { +pr_err ("ngroups(%d) from login response exceeds max groups(%d)\n" , + resp->ngroups,NGROUPS_MAX ); +return -EINVAL ; + } msg_sz =sizeof (struct ksmbd_login_response_ext ) + resp->ngroups *sizeof (gid_t); }
fs/smb/server/transport_tcp.c +3 -1
@@ -197,6 +197,8 @@ static int ksmbd_tcp_new_connection(struct socket *client_sk) t =alloc_transport (client_sk);if (!t) {sock_release (client_sk); +if (server_conf.max_connections) +atomic_dec (&active_num_conn);return -ENOMEM ; }
@@ -299,7 +301,7 @@ static int ksmbd_kthread_fn(void *p) skip_max_ip_conns_limit:if (server_conf.max_connections && -atomic_inc_return (&active_num_conn) >= server_conf.max_connections) { +atomic_inc_return (&active_num_conn) > server_conf.max_connections) {pr_info_ratelimited ("Limit the maximum number of connections(%u)\n" ,atomic_read (&active_num_conn));atomic_dec (&active_num_conn);
fs/smb/server/vfs_cache.c +108 -20
230 lines not on this page · raw message
fs/smb/server/vfs_cache.h +11 -1
@@ -68,6 +68,13 @@ enum {FP_CLOSED }; +/* Owner information for durable handle reconnect */ +struct durable_owner { +unsigned int uid; +unsigned int gid; +char *name; +}; +struct ksmbd_file {struct file *filp;u64 persistent_id;
@@ -114,6 +121,7 @@ struct ksmbd_file {bool is_resilient;bool is_posix_ctxt; +struct durable_owner owner; }; static inline void set_ctx_actor(struct dir_context *ctx,
@@ -140,7 +148,7 @@ static inline bool ksmbd_stream_fd(struct ksmbd_file *fp) }int ksmbd_init_file_table (struct ksmbd_file_table *ft); -void ksmbd_destroy_file_table (struct ksmbd_file_table *ft); +void ksmbd_destroy_file_table (struct ksmbd_session *sess);int ksmbd_close_fd (struct ksmbd_work *work,u64 id);struct ksmbd_file *ksmbd_lookup_fd_fast (struct ksmbd_work *work,u64 id);struct ksmbd_file *ksmbd_lookup_foreign_fd (struct ksmbd_work *work,u64 id);
@@ -166,6 +174,8 @@ void ksmbd_free_global_file_table(void);void ksmbd_set_fd_limit (unsigned long limit);void ksmbd_update_fstate (struct ksmbd_file_table *ft,struct ksmbd_file *fp,unsigned int state); +bool ksmbd_vfs_compare_durable_owner (struct ksmbd_file *fp, +struct ksmbd_user *user);/* * INODE hash
kernel/sched/debug.c +3 -1
@@ -798,6 +798,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)void print_cfs_rq (struct seq_file *m,int cpu,struct cfs_rq *cfs_rq) {s64 left_vruntime =-1 , zero_vruntime, right_vruntime =-1 , left_deadline =-1 , spread; +u64 avruntime;struct sched_entity *last, *first, *root;struct rq *rq =cpu_rq (cpu);unsigned long flags;
@@ -821,6 +822,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)if (last) right_vruntime = last->vruntime; zero_vruntime = cfs_rq->zero_vruntime; + avruntime =avg_vruntime (cfs_rq);raw_spin_rq_unlock_irqrestore (rq, flags); SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "left_deadline",
@@ -830,7 +832,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)SEQ_printf (m," .%-30s: %Ld.%06ld\n" ,"zero_vruntime" ,SPLIT_NS (zero_vruntime));SEQ_printf (m," .%-30s: %Ld.%06ld\n" ,"avg_vruntime" , -SPLIT_NS (avg_vruntime (cfs_rq))); +SPLIT_NS (avruntime));SEQ_printf (m," .%-30s: %Ld.%06ld\n" ,"right_vruntime" ,SPLIT_NS (right_vruntime)); spread = right_vruntime - left_vruntime;
lib/crc/.kunitconfig new file +3 -0
@@ -0,0 +1,3 @@ +CONFIG_KUNIT=y +CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y +CONFIG_CRC_KUNIT_TEST=y
lib/crc/Kconfig +13 -4
@@ -99,18 +99,27 @@ config CRC_OPTIMIZATIONS config CRC_KUNIT_TEST tristate "KUnit tests for CRC functions" if !KUNIT_ALL_TESTS - depends on KUNIT + depends on KUNIT && (CRC7 || CRC16 || CRC_T10DIF || CRC32 || CRC64) default KUNIT_ALL_TESTS + help + Unit tests for the CRC library functions. + + This is intended to help people writing architecture-specific + optimized versions. If unsure, say N. + +config CRC_ENABLE_ALL_FOR_KUNIT + tristate "Enable all CRC functions for KUnit test" + depends on KUNIT select CRC7 select CRC16 select CRC_T10DIF select CRC32 select CRC64 help - Unit tests for the CRC library functions. + Enable all CRC functions that have test code in CRC_KUNIT_TEST. - This is intended to help people writing architecture-specific - optimized versions. If unsure, say N. + Enable this only if you'd like the CRC KUnit test suite to test all + the CRC variants, even ones that wouldn't otherwise need to be built. config CRC_BENCHMARK bool "Benchmark for the CRC functions"
lib/crc/tests/crc_kunit.c +22 -6
@@ -268,8 +268,7 @@ crc_benchmark(struct kunit *test, } } -/* crc7_be */ - +#if IS_REACHABLE (CONFIG_CRC7 )static u64 crc7_be_wrapper (u64 crc,const u8 *p,size_t len) {/*
@@ -294,9 +293,9 @@ static void crc7_be_benchmark(struct kunit *test) {crc_benchmark (test, crc7_be_wrapper); } +#endif /* CONFIG_CRC7 */ -/* crc16 */ - +#if IS_REACHABLE (CONFIG_CRC16 )static u64 crc16_wrapper (u64 crc,const u8 *p,size_t len) {return crc16 (crc, p, len);
@@ -318,9 +317,9 @@ static void crc16_benchmark(struct kunit *test) {crc_benchmark (test, crc16_wrapper); } +#endif /* CONFIG_CRC16 */ -/* crc_t10dif */ - +#if IS_REACHABLE (CONFIG_CRC_T10DIF )static u64 crc_t10dif_wrapper (u64 crc,const u8 *p,size_t len) {return crc_t10dif_update (crc, p, len);
@@ -342,6 +341,9 @@ static void crc_t10dif_benchmark(struct kunit *test) {crc_benchmark (test, crc_t10dif_wrapper); } +#endif /* CONFIG_CRC_T10DIF */ + +#if IS_REACHABLE (CONFIG_CRC32 )/* crc32_le */
@@ -414,6 +416,9 @@ static void crc32c_benchmark(struct kunit *test) {crc_benchmark (test, crc32c_wrapper); } +#endif /* CONFIG_CRC32 */ + +#if IS_REACHABLE (CONFIG_CRC64 )/* crc64_be */
@@ -463,24 +468,35 @@ static void crc64_nvme_benchmark(struct kunit *test) {crc_benchmark (test, crc64_nvme_wrapper); } +#endif /* CONFIG_CRC64 */ static struct kunit_case crc_test_cases[] = { +#if IS_REACHABLE(CONFIG_CRC7)KUNIT_CASE (crc7_be_test),KUNIT_CASE (crc7_be_benchmark), +#endif +#if IS_REACHABLE(CONFIG_CRC16)KUNIT_CASE (crc16_test),KUNIT_CASE (crc16_benchmark), +#endif +#if IS_REACHABLE(CONFIG_CRC_T10DIF)KUNIT_CASE (crc_t10dif_test),KUNIT_CASE (crc_t10dif_benchmark), +#endif +#if IS_REACHABLE(CONFIG_CRC32)KUNIT_CASE (crc32_le_test),KUNIT_CASE (crc32_le_benchmark),KUNIT_CASE (crc32_be_test),KUNIT_CASE (crc32_be_benchmark),KUNIT_CASE (crc32c_test),KUNIT_CASE (crc32c_benchmark), +#endif +#if IS_REACHABLE(CONFIG_CRC64)KUNIT_CASE (crc64_be_test),KUNIT_CASE (crc64_be_benchmark),KUNIT_CASE (crc64_nvme_test),KUNIT_CASE (crc64_nvme_benchmark), +#endif {}, };
lib/crypto/.kunitconfig new file +11 -0
@@ -0,0 +1,11 @@ +CONFIG_KUNIT=y + +CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT=y + +CONFIG_CRYPTO_LIB_BLAKE2S_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_CURVE25519_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_MD5_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_POLY1305_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_SHA1_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_SHA256_KUNIT_TEST=y +CONFIG_CRYPTO_LIB_SHA512_KUNIT_TEST=y
lib/crypto/tests/Kconfig +25 -7
@@ -3,7 +3,7 @@ config CRYPTO_LIB_BLAKE2S_KUNIT_TEST tristate "KUnit tests for BLAKE2s" if !KUNIT_ALL_TESTS depends on KUNIT - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE # No need to depend on CRYPTO_LIB_BLAKE2S here, as that option doesn't # exist; the BLAKE2s code is always built-in for the /dev/random driver.
@@ -13,7 +13,7 @@ config CRYPTO_LIB_BLAKE2S_KUNIT_TEST config CRYPTO_LIB_CURVE25519_KUNIT_TEST tristate "KUnit tests for Curve25519" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_CURVE25519 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the Curve25519 Diffie-Hellman function.
@@ -21,7 +21,7 @@ config CRYPTO_LIB_CURVE25519_KUNIT_TEST config CRYPTO_LIB_MD5_KUNIT_TEST tristate "KUnit tests for MD5" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_MD5 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the MD5 cryptographic hash function and its
@@ -30,7 +30,7 @@ config CRYPTO_LIB_MD5_KUNIT_TEST config CRYPTO_LIB_POLY1305_KUNIT_TEST tristate "KUnit tests for Poly1305" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_POLY1305 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the Poly1305 library functions.
@@ -38,7 +38,7 @@ config CRYPTO_LIB_POLY1305_KUNIT_TEST config CRYPTO_LIB_SHA1_KUNIT_TEST tristate "KUnit tests for SHA-1" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_SHA1 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the SHA-1 cryptographic hash function and its
@@ -49,7 +49,7 @@ config CRYPTO_LIB_SHA1_KUNIT_TEST config CRYPTO_LIB_SHA256_KUNIT_TEST tristate "KUnit tests for SHA-224 and SHA-256" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_SHA256 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the SHA-224 and SHA-256 cryptographic hash functions
@@ -60,12 +60,30 @@ config CRYPTO_LIB_SHA256_KUNIT_TEST config CRYPTO_LIB_SHA512_KUNIT_TEST tristate "KUnit tests for SHA-384 and SHA-512" if !KUNIT_ALL_TESTS depends on KUNIT && CRYPTO_LIB_SHA512 - default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS + default KUNIT_ALL_TESTS select CRYPTO_LIB_BENCHMARK_VISIBLE help KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions and their corresponding HMACs. +config CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT + tristate "Enable all crypto library code for KUnit tests" + depends on KUNIT + select CRYPTO_LIB_CURVE25519 + select CRYPTO_LIB_MD5 + select CRYPTO_LIB_POLY1305 + select CRYPTO_LIB_SHA1 + select CRYPTO_LIB_SHA256 + select CRYPTO_LIB_SHA512 + help + Enable all the crypto library code that has KUnit tests. + + Enable this only if you'd like to test all the crypto library code, + even code that wouldn't otherwise need to be built. + + You'll still need to enable the tests themselves, either individually + or using KUNIT_ALL_TESTS. + config CRYPTO_LIB_BENCHMARK_VISIBLE bool
net/ipv6/exthdrs.c +4 -0
@@ -379,6 +379,10 @@ static int ipv6_srh_rcv(struct sk_buff *skb) hdr = (struct ipv6_sr_hdr *)skb_transport_header (skb); idev =__in6_dev_get (skb->dev); +if (!idev) { +kfree_skb (skb); +return -1 ; + } accept_seg6 =min (READ_ONCE (net->ipv6.devconf_all->seg6_enabled),READ_ONCE (idev->cnf.seg6_enabled));
net/ipv6/seg6_hmac.c +2 -0
@@ -184,6 +184,8 @@ bool seg6_hmac_validate_skb(struct sk_buff *skb)int require_hmac; idev =__in6_dev_get (skb->dev); +if (!idev) +return false; srh = (struct ipv6_sr_hdr *)skb_transport_header (skb);
net/packet/af_packet.c +13 -8
@@ -2717,7 +2717,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) {struct sk_buff *skb =NULL ;struct net_device *dev; -struct virtio_net_hdr *vnet_hdr =NULL ; +struct virtio_net_hdr vnet_hdr; +bool has_vnet_hdr = false;struct sockcm_cookie sockc;__be16 proto;int err, reserve =0 ;
@@ -2818,16 +2819,20 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) hlen =LL_RESERVED_SPACE (dev); tlen = dev->needed_tailroom;if (vnet_hdr_sz) { - vnet_hdr = data; data += vnet_hdr_sz; tp_len -= vnet_hdr_sz; -if (tp_len <0 || -__packet_snd_vnet_parse (vnet_hdr, tp_len)) { +if (tp_len <0 ) { + tp_len = -EINVAL ; + goto tpacket_error; + } +memcpy (&vnet_hdr, data - vnet_hdr_sz,sizeof (vnet_hdr)); +if (__packet_snd_vnet_parse (&vnet_hdr, tp_len)) { tp_len = -EINVAL ; goto tpacket_error; } copylen =__virtio16_to_cpu (vio_le (), - vnet_hdr->hdr_len); + vnet_hdr.hdr_len); + has_vnet_hdr = true; } copylen =max_t (int, copylen, dev->hard_header_len); skb = sock_alloc_send_skb(&po->sk,
@@ -2864,12 +2869,12 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) } } -if (vnet_hdr_sz) { -if (virtio_net_hdr_to_skb (skb, vnet_hdr,vio_le ())) { +if (has_vnet_hdr) { +if (virtio_net_hdr_to_skb (skb, &vnet_hdr,vio_le ())) { tp_len = -EINVAL ; goto tpacket_error; } -virtio_net_hdr_set_proto (skb, vnet_hdr); +virtio_net_hdr_set_proto (skb, &vnet_hdr); } skb->destructor = tpacket_destruct_skb;
net/rxrpc/key.c +4 -0
@@ -502,6 +502,10 @@ static int rxrpc_preparse(struct key_preparsed_payload *prep)if (v1->security_index !=RXRPC_SECURITY_RXKAD ) goto error; + ret = -EKEYREJECTED ; +if (v1->ticket_length >AFSTOKEN_RK_TIX_MAX ) + goto error; + plen =sizeof (*token->kad) + v1->ticket_length; prep->quotalen += plen +sizeof (*token);
scripts/dtc/dtc-lexer.l +0 -3
@@ -39,8 +39,6 @@ extern bool treesource_error; #define DPRINT(fmt, ...) do { } while (0) #endif -static int dts_version = 1; - #define BEGIN_DEFAULT() DPRINT("<V1>\n"); \ BEGIN(V1); \
@@ -101,7 +99,6 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...); <*>"/dts-v1/" { DPRINT("Keyword: /dts-v1/\n"); - dts_version = 1; BEGIN_DEFAULT(); return DT_V1; }
scripts/generate_rust_analyzer.py +13 -1
@@ -166,6 +166,18 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit append_crate_with_generated("uapi", ["core", "ffi", "pin_init"]) append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"]) + scripts = srctree / "scripts" + makefile = (scripts / "Makefile").read_text() + for path in scripts.glob("*.rs"): + name = path.stem + if f"{name}-rust" not in makefile: + continue + append_crate( + name, + path, + ["std"], + ) + def is_root_crate(build_file, target): try: contents = build_file.read_text()
@@ -182,7 +194,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit for folder in extra_dirs: for path in folder.rglob("*.rs"): logging.info("Checking %s", path) - name = path.name.replace(".rs", "") + name = path.stem # Skip those that are not crate roots. if not is_root_crate(path.parent / "Makefile", name) and \
sound/hda/codecs/realtek/alc269.c +1 -0
@@ -7392,6 +7392,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x17aa ,0x3801 ,"Lenovo Yoga9 14IAP7" ,ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN ),HDA_CODEC_QUIRK (0x17aa ,0x3802 ,"DuetITL 2021" ,ALC287_FIXUP_YOGA7_14ITL_SPEAKERS ),SND_PCI_QUIRK (0x17aa ,0x3802 ,"Lenovo Yoga Pro 9 14IRP8" ,ALC287_FIXUP_TAS2781_I2C ), +SND_PCI_QUIRK (0x17aa ,0x3811 ,"Legion S7 15IMH05" ,ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS ),SND_PCI_QUIRK (0x17aa ,0x3813 ,"Legion 7i 15IMHG05" ,ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS ),SND_PCI_QUIRK (0x17aa ,0x3818 ,"Lenovo C940 / Yoga Duet 7" ,ALC298_FIXUP_LENOVO_C940_DUET7 ), SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
sound/usb/caiaq/device.c +2 -2
@@ -384,7 +384,7 @@ static void card_free(struct snd_card *card)snd_usb_caiaq_input_free (cdev);#endif snd_usb_caiaq_audio_free (cdev); -usb_reset_device (cdev->chip.dev); +usb_put_dev (cdev->chip.dev); } static int create_card(struct usb_device *usb_dev,
@@ -410,7 +410,7 @@ static int create_card(struct usb_device *usb_dev,return err; cdev =caiaqdev (card); - cdev->chip.dev = usb_dev; + cdev->chip.dev =usb_get_dev (usb_dev); cdev->chip.card = card; cdev->chip.usb_id =USB_ID (le16_to_cpu (usb_dev->descriptor.idVendor),le16_to_cpu (usb_dev->descriptor.idProduct));
sound/usb/mixer.c +7 -0
@@ -1204,6 +1204,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, cval->min =-11264 ;/* Mute under it */ }break ; +case USB_ID (0x31b2 ,0x0111 ):/* MOONDROP JU Jiu */ +if (!strcmp (kctl->id.name,"PCM Playback Volume" )) { +usb_audio_info (chip, +"set volume quirk for MOONDROP JU Jiu\n" ); + cval->min =-10880 ;/* Mute under it */ + } +break ; } }
tools/testing/kunit/configs/all_tests.config +4 -0
@@ -44,8 +44,12 @@ CONFIG_REGMAP_BUILD=y CONFIG_AUDIT=y +CONFIG_CRYPTO_LIB_ENABLE_ALL_FOR_KUNIT=y + CONFIG_PRIME_NUMBERS=y +CONFIG_CRC_ENABLE_ALL_FOR_KUNIT=y + CONFIG_SECURITY=y CONFIG_SECURITY_APPARMOR=y CONFIG_SECURITY_LANDLOCK=y