Linux 7.1.3
Greg Kroah-Hartman
maintainerI'm announcing the release of the 7.1.3 kernel.
All users of the 7.1 kernel series must upgrade.
The updated 7.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-7.1.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
------------
Makefile | 29 ++- arch/arm64/kvm/mmu.c | 5 arch/loongarch/kernel/smp.c | 1 arch/mips/dec/prom/console.c | 7 arch/mips/kernel/smp.c | 2 arch/riscv/include/asm/cacheflush.h | 25 +-- arch/riscv/include/asm/kfence.h | 7 arch/riscv/kernel/entry.S | 6 arch/x86/kvm/hyperv.c | 5 arch/x86/kvm/mmu/mmu.c | 28 ++- arch/x86/kvm/svm/sev.c | 1 block/bdev.c | 5 block/blk-cgroup.c | 21 +- drivers/crypto/intel/qat/qat_common/adf_accel_devices.h | 5 drivers/crypto/nx/nx.c | 6 drivers/crypto/nx/nx.h | 2 drivers/dma/idxd/registers.h | 3 drivers/fpga/of-fpga-region.c | 3 drivers/i2c/i2c-core-base.c | 8 - drivers/irqchip/irq-imgpdc.c | 6 drivers/net/wan/hdlc_ppp.c | 15 +- drivers/net/wireless/ath/ath11k/dp.c | 1 drivers/net/wireless/intel/iwlwifi/mld/agg.c | 9 + drivers/net/wireless/intel/iwlwifi/mld/ptp.c | 2 drivers/net/wireless/intel/iwlwifi/mvm/ptp.c | 2 drivers/net/wireless/mediatek/mt76/mac80211.c | 15 +- drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 1 drivers/net/wireless/mediatek/mt76/mt7925/main.c | 3 drivers/net/wireless/realtek/rtl8xxxu/8188e.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8188f.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8192c.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8192e.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8192f.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8710b.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8723a.c | 1 drivers/net/wireless/realtek/rtl8xxxu/8723b.c | 1 drivers/net/wireless/realtek/rtl8xxxu/core.c | 64 ++++++++ drivers/net/wireless/realtek/rtl8xxxu/regs.h | 2 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 7 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h | 2 drivers/net/wireless/realtek/rtw88/tx.c | 7 drivers/net/wireless/realtek/rtw88/usb.c | 13 + drivers/ntb/hw/epf/ntb_hw_epf.c | 3 drivers/pci/p2pdma.c | 10 + drivers/power/reset/linkstation-poweroff.c | 2 drivers/power/sequencing/core.c | 14 + drivers/rpmsg/rpmsg_char.c | 15 +- drivers/video/fbdev/core/fbcon.c | 7 drivers/video/fbdev/core/fbmem.c | 12 + drivers/video/fbdev/core/fbsysfs.c | 10 + drivers/video/fbdev/core/modedb.c | 5 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 9 + fs/crypto/fscrypt_private.h | 52 ++++--- fs/crypto/inline_crypt.c | 8 - fs/crypto/keyring.c | 23 +-- fs/crypto/keysetup.c | 118 ++++++++++------ fs/exfat/dir.c | 4 fs/f2fs/acl.c | 18 ++ fs/f2fs/checkpoint.c | 14 + fs/f2fs/data.c | 49 ++++-- fs/f2fs/extent_cache.c | 19 -- fs/f2fs/f2fs.h | 1 fs/f2fs/file.c | 11 + fs/f2fs/gc.c | 56 +++++-- fs/f2fs/inode.c | 26 ++- fs/f2fs/node.c | 8 - fs/gfs2/super.c | 1 fs/nfs/client.c | 1 fs/nfs/flexfilelayout/flexfilelayout.c | 4 fs/nfs/nfs4proc.c | 5 fs/nfs/pnfs.c | 2 fs/nfs/pnfs_nfs.c | 4 fs/nfsd/nfs2acl.c | 17 +- fs/nfsd/nfs3acl.c | 17 +- fs/nfsd/nfs4layouts.c | 12 - fs/nfsd/nfs4proc.c | 19 +- fs/nfsd/nfs4recover.c | 3 fs/nfsd/nfs4state.c | 1 fs/nfsd/nfs4xdr.c | 3 fs/nfsd/vfs.c | 6 fs/ntfs/file.c | 17 +- fs/ntfs/super.c | 19 +- fs/ntfs/volume.h | 2 fs/ntfs3/xattr.c | 12 + fs/ocfs2/suballoc.c | 22 ++ fs/smb/server/smbacl.c | 4 fs/userfaultfd.c | 2 include/keys/request_key_auth-type.h | 2 include/linux/blkdev.h | 16 -- include/linux/err.h | 12 - include/linux/f2fs_fs.h | 1 include/linux/kvm_host.h | 7 include/linux/mm.h | 39 +++++ include/linux/pci_ids.h | 8 + include/linux/skmsg.h | 15 +- include/linux/userfaultfd_k.h | 4 include/net/rtnetlink.h | 2 kernel/bpf/cgroup.c | 2 kernel/fork.c | 1 kernel/sched/core.c | 27 ++- net/9p/client.c | 3 net/batman-adv/bat_iv_ogm.c | 11 + net/batman-adv/bat_v.c | 1 net/batman-adv/bat_v_ogm.c | 23 ++- net/batman-adv/bridge_loop_avoidance.c | 28 +-- net/batman-adv/distributed-arp-table.c | 12 + net/batman-adv/fragmentation.c | 22 ++ net/batman-adv/fragmentation.h | 3 net/batman-adv/hard-interface.c | 28 --- net/batman-adv/netlink.c | 8 - net/batman-adv/routing.c | 73 +++++++++ net/batman-adv/tp_meter.c | 113 ++++++++++----- net/batman-adv/translation-table.c | 12 + net/batman-adv/tvlv.c | 69 ++++++++- net/batman-adv/types.h | 21 +- net/core/filter.c | 27 +++ net/core/rtnetlink.c | 8 + net/core/skmsg.c | 2 net/ipv4/ip_gre.c | 6 net/ipv4/ip_output.c | 7 net/ipv4/tcp_ao.c | 4 net/ipv6/ip6_output.c | 9 - net/mac802154/llsec.c | 14 + net/tipc/crypto.c | 9 + net/tls/tls_sw.c | 4 security/apparmor/include/policy_unpack.h | 19 ++ security/apparmor/lsm.c | 16 ++ security/apparmor/net.c | 2 security/apparmor/policy.c | 8 - security/keys/internal.h | 2 security/keys/keyctl.c | 24 ++- security/keys/keyctl_pkey.c | 9 + security/keys/request_key_auth.c | 33 ++++ virt/kvm/eventfd.c | 12 - 134 files changed, 1323 insertions(+), 448 deletions(-)
Ard Biesheuvel (1):
KVM: arm64: Omit tag sync on stage-2 mappings of the zero page
Arnd Bergmann (1):
err.h: use __always_inline on all error pointer helpers
Ashutosh Desai (1):
KVM: SVM: Fix page overflow in sev_dbg_crypt() for ENCRYPT path
Bitterblue Smith (2):
wifi: rtl8xxxu: Detect the maximum supported channel width
wifi: rtlwifi: rtl8821ae: Fix C2H bit location in RX descriptor
Bryam Vargas (2):
apparmor: mediate the implicit connect of TCP fast open sendmsg
f2fs: bound i_inline_xattr_size for non-inline-xattr inodes
Chao Yu (2):
f2fs: fix to do sanity check on f2fs_get_node_folio_ra()
f2fs: atomic: fix UAF issue on f2fs_inode_info.atomic_inode
Chris Mason (1):
nfsd: release layout stid on setlease failure
Dawei Feng (1):
bpf: use kvfree() for replaced sysctl write buffer
Denis Arefev (1):
block: Avoid mounting the bdev pseudo-filesystem in userspace
Dominik Woźniak (1):
nfsd: check get_user() return when reading princhashlen
Doruk Tan Ozturk (2):
mac802154: llsec: add skb_cow_data() before in-place crypto
tipc: fix slab-use-after-free Read in tipc_aead_decrypt_done
ElXreno (1):
wifi: mt76: mt7925: don't disable AP BSS when removing TDLS peer
Eric Biggers (1):
fscrypt: Fix key setup in edge case with multiple data unit sizes
Fan Wu (1):
hdlc_ppp: sync per-proto timers before freeing hdlc state
Greg Kroah-Hartman (1):
Linux 7.1.3
Guannan Wang (1):
NFSD: Fix SECINFO_NO_NAME decode error cleanup
HanQuan (1):
net/tcp-ao: fix use-after-free of key in del_async path
Hem Parekh (1):
ksmbd: fix out-of-bounds read in smb_check_perm_dacl()
Hongling Zeng (1):
fbdev: omap2: fix use-after-free in omapfb_mmap
Huacai Chen (1):
LoongArch: Report dying CPU to RCU in stop_this_cpu()
Hyunchul Lee (1):
ntfs: serialize volume label accesses
Hyunwoo Kim (1):
KVM: x86: hyper-v: Bound the bank index when querying sparse banks
Ian Bridges (2):
fbdev: fix use-after-free in store_modes()
fbdev: Fix fb_new_modelist to prevent null-ptr-deref in fb_videomode_to_var
Igor Raits (1):
NFSv4: clear exception state on successful mkdir retry
Jarkko Sakkinen (1):
KEYS: fix overflow in keyctl_pkey_params_get_2()
Jeff Layton (6):
nfsd: fix posix_acl leak on SETACL decode failure
nfsd: fix inverted cp_ttl check in async copy reaper
nfsd: fix posix_acl leak and ignored error in nfsd4_create_file
nfsd: fix dead ACL conflict guard in nfsd4_create
nfsd: avoid leaking pre-allocated openowner on unconfirmed retry race
nfsd: reset write verifier on deferred writeback errors
Jiajia Liu (1):
wifi: mt76: add wcid publish check in mt76_sta_add
Johan Hovold (1):
i2c: core: fix adapter registration race
John Johansen (1):
apparmor: advertise the tcp fast open fix is applied
Jonas Jelonek (1):
MIPS: smp: report dying CPU to RCU in stop_this_cpu()
Jose Ignacio Tornos Martinez (1):
wifi: ath11k: fix warning when unbinding
Junjie Cao (2):
wifi: iwlwifi: mvm: fix race condition in PTP removal
wifi: iwlwifi: mld: fix race condition in PTP removal
Junrui Luo (1):
wifi: iwlwifi: mld: validate sta_mask before ffs() in BA session handlers
Kiryl Shutsemau (Meta) (1):
userfaultfd: build __VMA_UFFD_FLAGS from config-gated masks
Koichiro Den (1):
NTB: epf: Avoid pci_iounmap() with offset when PEER_SPAD and CONFIG share BAR
Konstantin Khorenko (1):
gcov: use atomic counter updates to fix concurrent access crashes
Konstantin Komarov (1):
ntfs3: reject direct userspace writes to reserved $LX* xattrs
Luka Gejak (2):
wifi: rtw88: increase TX report timeout to fix race condition
wifi: rtw88: usb: fix memory leaks on USB write failures
Lukas Wunner (1):
PCI/P2PDMA: Add Intel QAT, DSA, IAA devices to whitelist
Maciej W. Rozycki (1):
MIPS: DEC: Prevent initial console buffer from landing in XKPHYS
Maoyi Xie (1):
net: ip_gre: require CAP_NET_ADMIN in the device netns for changelink
Markus Elfring (1):
NFS: Prevent resource leak in nfs_alloc_server()
Michael Bommarito (3):
exfat: fix potential use-after-free in exfat_find_dir_entry() NFSv4/flexfiles: reject zero filehandle version count NFSv4/pNFS: reject zero-length r_addr in nfs4_decode_mp_ds_addr
Michal Koutný (1):
blk-cgroup: fix UAF in __blkcg_rstat_flush()
Mike Rapoport (Microsoft) (1):
userfaultfd: ensure mremap_userfaultfd_fail() releases mmap_changing
Mikhail Lobanov (1):
f2fs: read COW data with the original inode during atomic write
Mingyu Wang (1):
fbdev: fbcon: fix out-of-bounds read in err_out of fbcon_do_set_font()
Paolo Bonzini (1):
KVM: x86: Fix shadow paging use-after-free due to unexpected role
Qingshuang Fu (1):
irqchip/imgpdc: Fix resource leak, add missing chained handler cleanup on remove
Rik van Riel (1):
sched/mmcid: Fix OOB clear_bit when CID is MM_CID_UNSET in fixup path
Ruslan Valiyev (1):
apparmor: fix use-after-free in rawdata dedup loop
Sam James (1):
crypto: nx - fix nx_crypto_ctx_exit argument
Sean Christopherson (2):
KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level
KVM: Replace guest-triggerable BUG_ON() in ioeventfd datamatch with get_unaligned()
Shaomin Chen (1):
keys: Pin request_key_auth payload in instantiate paths
Steffen Persvold (1):
fbdev: modedb: Fix misaligned fields in the 1920x1080-60 mode
Sunmin Jeong (1):
f2fs: fix to round down start offset of fallocate for pin file
Sven Eckelmann (26):
batman-adv: tp_meter: keep unacked list in ascending ordered
batman-adv: tp_meter: initialize dup_acks explicitly
batman-adv: tp_meter: initialize dec_cwnd explicitly
batman-adv: tp_meter: avoid window underflow
batman-adv: tp_meter: avoid divide-by-zero for dec_cwnd
batman-adv: tp_meter: fix fast recovery precondition
batman-adv: tp_meter: handle seqno wrap-around for fast recovery detection
batman-adv: tp_meter: add only finished tp_vars to lists
batman-adv: bla: annotate lasttime access with READ/WRITE_ONCE
batman-adv: prevent ELP transmission interval underflow
batman-adv: tp_meter: initialize last_recv_time during init
batman-adv: gw: don't deselect gateway with active hardif
batman-adv: ensure bcast is writable before modifying TTL
batman-adv: fix (m|b)cast csum after decrementing TTL
batman-adv: frag: ensure fragment is writable before modifying TTL
batman-adv: frag: avoid underflow of TTL
batman-adv: v: prevent OGM aggregation on disabled hardif
batman-adv: tp_meter: restrict number of unacked list entries
batman-adv: tp_meter: annotate last_recv_time access with READ/WRITE_ONCE
batman-adv: tp_meter: prevent parallel modifications of last_recv
batman-adv: tp_meter: handle overlapping packets
batman-adv: tt: don't merge change entries with different VIDs
batman-adv: tt: track roam count per VID
batman-adv: dat: prevent false sharing between VLANs
batman-adv: tvlv: enforce 2-byte alignment
batman-adv: tvlv: avoid race of cifsnotfound handler state
Tristan Madani (1):
gfs2: fix use-after-free in gfs2_qd_dealloc
Tuo Li (1):
fbdev: modedb: fix a possible UAF in fb_find_mode()
Usama Arif (2):
kernel/fork: clear PF_BLOCK_TS in copy_process()
block: invalidate cached plug timestamp after task switch
Vivian Wang (2):
riscv: mm: Extract helper mark_new_valid_map()
riscv: kfence: Call mark_new_valid_map() for kfence_unprotect()
Wenjie Qi (6):
f2fs: fix missing read bio submission on large folio error
f2fs: pass correct iostat type for single node writes
f2fs: reject setattr size changes on large folio files
f2fs: validate orphan inode entry count
f2fs: validate compress cache inode only when enabled
f2fs: keep atomic write retry from zeroing original data
Wentao Liang (4):
pwrseq: core: fix use-after-free in pwrseq_debugfs_seq_next()
pNFS: Fix use-after-free in pnfs_update_layout()
fpga: region: fix use-after-free in child_regions_with_firmware()
power: reset: linkstation-poweroff: fix use-after-free in the linkstation_poweroff_init()
Wongi Lee (2):
ipv6: account for fraggap on the paged allocation path
ipv4: account for fraggap on the paged allocation path
Yiming Qian (1):
net: skmsg: preserve sg.copy across SG transforms
Yizhou Zhao (1):
9p: avoid putting oldfid in p9_client_walk() error path
Yongpeng Yang (1):
f2fs: fix incorrect FI_NO_EXTENT handling in __destroy_extent_node()
Yuho Choi (1):
rpmsg: char: Fix use-after-free on probe error path
Zenm Chen (1):
wifi: mt76: mt76x2u: Add support for ELECOM WDC-867SU3S
Zhang Cen (2):
f2fs: validate ACL entry sizes in f2fs_acl_from_disk()
ocfs2: reject oversized group bitmap descriptors
Zhaoyang Huang (1):
Revert "f2fs: remove non-uptodate folio from the page cache in move_data_block"
Greg Kroah-Hartman
maintainerMakefile +22 -7
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 7 PATCHLEVEL = 1 -SUBLEVEL = 2 +SUBLEVEL = 3 EXTRAVERSION = NAME = Baby Opossum Posse
@@ -827,12 +827,6 @@ endif # KBUILD_EXTMOD # Defaults to vmlinux, but the arch makefile usually adds further targets all: vmlinux -CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -ifdef CONFIG_CC_IS_GCC -CFLAGS_GCOV += -fno-tree-loop-im -endif -export CFLAGS_GCOV - # The arch Makefiles can override CC_FLAGS_FTRACE. We may also append it later. ifdef CONFIG_FUNCTION_TRACER CC_FLAGS_FTRACE := -pg
@@ -1150,6 +1144,27 @@ endif # Ensure compilers do not transform certain loops into calls to wcslen() KBUILD_CFLAGS += -fno-builtin-wcslen +CFLAGS_GCOV := -fprofile-arcs -ftest-coverage +ifdef CONFIG_CC_IS_GCC +CFLAGS_GCOV += -fno-tree-loop-im +# Use atomic counter updates to avoid concurrent-access crashes in GCOV. +# Only enable if -fprofile-update=prefer-atomic does not introduce new +# undefined symbols (e.g. libatomic calls that the kernel cannot link). +CFLAGS_GCOV += $(call try-run,\ + echo 'long long x; void f(void){x++;}' | \ + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w -fprofile-arcs \ + -ftest-coverage -x c - -c -o "$$TMP.base" && \ + echo 'long long x; void f(void){x++;}' | \ + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w -fprofile-arcs \ + -ftest-coverage -fprofile-update=prefer-atomic \ + -x c - -c -o "$$TMP" && \ + $(NM) "$$TMP.base" | grep ' U ' > "$$TMP.ubase" || true ; \ + $(NM) "$$TMP" | grep ' U ' > "$$TMP.utest" || true ; \ + cmp -s "$$TMP.ubase" "$$TMP.utest",\ + -fprofile-update=prefer-atomic) +endif +export CFLAGS_GCOV + # change __FILE__ to the relative path to the source directory ifdef building_out_of_srctree KBUILD_CPPFLAGS += -fmacro-prefix-map=$(srcroot)/=
arch/arm64/kvm/mmu.c +5 -0
@@ -1479,6 +1479,11 @@ static void sanitise_mte_tags(struct kvm *kvm, kvm_pfn_t pfn,if (!kvm_has_mte (kvm))return ; +if (is_zero_pfn (pfn)) { +WARN_ON_ONCE (nr_pages !=1 ); +return ; + } +if (folio_test_hugetlb (folio)) {/* Hugetlb has MTE flags set on head page only */ if (folio_try_hugetlb_mte_tagging (folio)) {
arch/loongarch/kernel/smp.c +1 -0
@@ -705,6 +705,7 @@ static void stop_this_cpu(void *dummy)set_cpu_online (smp_processor_id (), false);calculate_cpu_foreign_map ();local_irq_disable (); +rcutree_report_cpu_dead ();while (true); }
arch/mips/dec/prom/console.c +5 -2
@@ -2,8 +2,9 @@/* * DECstation PROM-based early console support. * -* Copyright (C) 2004, 2007 Maciej W. Rozycki +* Copyright (C) 2004, 2007, 2026 Maciej W. Rozycki */ +#include <linux/bug.h> #include <linux/console.h> #include <linux/init.h> #include <linux/kernel.h>
@@ -14,9 +15,11 @@static void __init prom_console_write (struct console *con,const char *s,unsigned int c) { -char buf[81 ]; +static char buf[81 ]__initdata = {0 };unsigned int chunk =sizeof (buf) -1 ; +BUG_ON ((long )buf != (int )(long )buf); +while (c >0 ) {if (chunk > c) chunk = c;
arch/mips/kernel/smp.c +2 -0
@@ -20,6 +20,7 @@#include <linux/sched/mm.h> #include <linux/cpumask.h> #include <linux/cpu.h> +#include <linux/rcupdate.h> #include <linux/err.h> #include <linux/ftrace.h> #include <linux/irqdomain.h>
@@ -422,6 +423,7 @@ static void stop_this_cpu(void *dummy)set_cpu_online (smp_processor_id (), false);calculate_cpu_foreign_map ();local_irq_disable (); +rcutree_report_cpu_dead ();while (1 ); }
arch/riscv/include/asm/cacheflush.h +14 -11
@@ -43,20 +43,23 @@ do { \#ifdef CONFIG_64BIT extern u64 new_vmalloc[NR_CPUS /sizeof (u64) +1 ];extern char _end[]; +static inline void mark_new_valid_map (void ) +{ +int i; + +/* +* We don't care if concurrently a cpu resets this value since +* the only place this can happen is in handle_exception() where +* an sfence.vma is emitted. +*/ +for (i =0 ; i <ARRAY_SIZE (new_vmalloc); ++i) + new_vmalloc[i] =-1ULL ; +}#define flush_cache_vmap flush_cache_vmapstatic inline void flush_cache_vmap (unsigned long start,unsigned long end) { -if (is_vmalloc_or_module_addr ((void *)start)) { -int i; - -/* -* We don't care if concurrently a cpu resets this value since -* the only place this can happen is in handle_exception() where -* an sfence.vma is emitted. -*/ -for (i =0 ; i <ARRAY_SIZE (new_vmalloc); ++i) - new_vmalloc[i] =-1ULL ; - } +if (is_vmalloc_or_module_addr ((void *)start)) +mark_new_valid_map (); }#define flush_cache_vmap_early (start, end) local_flush_tlb_kernel_range(start, end)#endif
arch/riscv/include/asm/kfence.h +5 -2
@@ -6,6 +6,7 @@#include <linux/kfence.h> #include <linux/pfn.h> #include <asm-generic/pgalloc.h> +#include <asm/cacheflush.h> #include <asm/pgtable.h> static inline bool arch_kfence_init_pool (void )
@@ -17,10 +18,12 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect) {pte_t *pte =virt_to_kpte (addr); -if (protect) +if (protect) {set_pte (pte,__pte (pte_val (ptep_get (pte)) & ~_PAGE_PRESENT)); -else + }else {set_pte (pte,__pte (pte_val (ptep_get (pte)) | _PAGE_PRESENT)); +mark_new_valid_map (); + }preempt_disable ();local_flush_tlb_kernel_range (addr, addr +PAGE_SIZE );
arch/riscv/kernel/entry.S +4 -2
@@ -136,8 +136,10 @@ SYM_CODE_START(handle_exception) #ifdef CONFIG_64BIT /* - * The RISC-V kernel does not eagerly emit a sfence.vma after each - * new vmalloc mapping, which may result in exceptions: + * The RISC-V kernel does not flush TLBs on all CPUS after each new + * vmalloc mapping or kfence_unprotect(), which may result in + * exceptions: + * * - if the uarch caches invalid entries, the new mapping would not be * observed by the page table walker and an invalidation is needed. * - if the uarch does not cache invalid entries, a reordered access
arch/x86/kvm/hyperv.c +5 -0
@@ -1839,6 +1839,11 @@ static bool hv_is_vp_in_sparse_set(u32 vp_id, u64 valid_bank_mask, u64 sparse_baint valid_bit_nr = vp_id /HV_VCPUS_PER_SPARSE_BANK ;unsigned long sbank; +BUILD_BUG_ON (BITS_PER_TYPE (valid_bank_mask) !=HV_MAX_SPARSE_VCPU_BANKS ); + +if (valid_bit_nr >=HV_MAX_SPARSE_VCPU_BANKS ) +return false; +if (!test_bit (valid_bit_nr, (unsigned long *)&valid_bank_mask))return false;
arch/x86/kvm/mmu/mmu.c +18 -10
@@ -2453,13 +2453,15 @@ static struct kvm_mmu_page *kvm_mmu_get_child_sp(struct kvm_vcpu *vcpu, u64 *sptep, gfn_t gfn, bool direct, unsigned int access) { - union kvm_mmu_page_role role; + union kvm_mmu_page_role role = kvm_mmu_child_role(sptep, direct, access); -if (is_shadow_present_pte (*sptep) && !is_large_pte (*sptep) && -spte_to_child_sp (*sptep) &&spte_to_child_sp (*sptep)->gfn == gfn) +if (is_shadow_present_pte (*sptep) && + !is_large_pte (*sptep) && +spte_to_child_sp (*sptep) && +spte_to_child_sp (*sptep)->gfn == gfn && +spte_to_child_sp (*sptep)->role.word == role.word)return ERR_PTR (-EEXIST ); - role =kvm_mmu_child_role (sptep, direct, access);return kvm_mmu_get_shadow_page (vcpu, gfn, role); }
@@ -7286,13 +7288,19 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm, sp =sptep_to_sp (sptep);/* -* We cannot do huge page mapping for indirect shadow pages, -* which are found on the last rmap (level = 1) when not using -* tdp; such shadow pages are synced with the page table in -* the guest, and the guest page table is using 4K page size -* mapping if the indirect sp has level = 1. +* Direct shadow page can be replaced by a hugepage if the host +* mapping level allows it and the memslot maps all of the host +* hugepage. Note! If the memslot maps only part of the +* hugepage, sp->gfn may be below slot->base_gfn, and querying +* the max mapping level would cause an out-of-bounds lpage_info +* access. So the gfn bounds check *must* be done first. +* +* Indirect shadow pages are created when the guest page tables +* are using 4K pages. Since the host mapping is always +* constrained by the page size in the guest, indirect shadow +* pages are never collapsible. */ -if (sp->role.direct && +if (sp->role.direct &&is_gfn_in_memslot (slot, sp->gfn) && sp->role.level <kvm_mmu_max_mapping_level (kvm,NULL , slot, sp->gfn)) {kvm_zap_one_rmap_spte (kvm, rmap_head, sptep);
arch/x86/kvm/svm/sev.c +1 -0
@@ -1396,6 +1396,7 @@ static int sev_dbg_crypt(struct kvm *kvm, struct kvm_sev_cmd *argp, bool dec) s_off = vaddr & ~PAGE_MASK ; d_off = dst_vaddr & ~PAGE_MASK ; len =min_t (size_t, (PAGE_SIZE - s_off), size); + len =min_t (size_t, len,PAGE_SIZE - d_off);if (dec) ret = __sev_dbg_decrypt_user(kvm,
block/bdev.c +0 -5
@@ -446,15 +446,10 @@ EXPORT_SYMBOL_GPL(blockdev_superblock);void __init bdev_cache_init (void ) { -int err; - bdev_cachep =kmem_cache_create ("bdev_cache" ,sizeof (struct bdev_inode ),0 , (SLAB_HWCACHE_ALIGN |SLAB_RECLAIM_ACCOUNT |SLAB_ACCOUNT |SLAB_PANIC ), init_once); - err =register_filesystem (&bd_type); -if (err) -panic ("Cannot register bdev pseudo-fs" ); blockdev_mnt =kern_mount (&bd_type);if (IS_ERR (blockdev_mnt))panic ("Cannot create bdev pseudo-fs" );
block/blk-cgroup.c +11 -10
@@ -164,20 +164,10 @@ static void blkg_free(struct blkcg_gq *blkg)static void __blkg_release (struct rcu_head *rcu) { struct blkcg_gq *blkg = container_of(rcu, struct blkcg_gq, rcu_head); -struct blkcg *blkcg = blkg->blkcg; -int cpu;#ifdef CONFIG_BLK_CGROUP_PUNT_BIO WARN_ON (!bio_list_empty (&blkg->async_bios));#endif -/* -* Flush all the non-empty percpu lockless lists before releasing -* us, given these stat belongs to us. -* -* blkg_stat_lock is for serializing blkg stat update -*/ -for_each_possible_cpu (cpu) -__blkcg_rstat_flush (blkcg, cpu);/* release the blkcg and parent blkg refs this blkg has been holding */ css_put (&blkg->blkcg->css);
@@ -195,6 +185,17 @@ static void __blkg_release(struct rcu_head *rcu)static void blkg_release (struct percpu_ref *ref) { struct blkcg_gq *blkg = container_of(ref, struct blkcg_gq, refcnt); +struct blkcg *blkcg = blkg->blkcg; +int cpu; + +/* +* Flush all the non-empty percpu lockless lists before releasing +* us, given these stat belongs to us. +* +* blkg_stat_lock is for serializing blkg stat update +*/ +for_each_possible_cpu (cpu) +__blkcg_rstat_flush (blkcg, cpu);call_rcu (&blkg->rcu_head, __blkg_release); }
drivers/crypto/intel/qat/qat_common/adf_accel_devices.h +0 -5
@@ -28,15 +28,10 @@#define ADF_4XXX_DEVICE_NAME "4xxx"#define ADF_420XX_DEVICE_NAME "420xx"#define ADF_6XXX_DEVICE_NAME "6xxx" -#define PCI_DEVICE_ID_INTEL_QAT_4XXX 0x4940#define PCI_DEVICE_ID_INTEL_QAT_4XXXIOV 0x4941 -#define PCI_DEVICE_ID_INTEL_QAT_401XX 0x4942#define PCI_DEVICE_ID_INTEL_QAT_401XXIOV 0x4943 -#define PCI_DEVICE_ID_INTEL_QAT_402XX 0x4944#define PCI_DEVICE_ID_INTEL_QAT_402XXIOV 0x4945 -#define PCI_DEVICE_ID_INTEL_QAT_420XX 0x4946#define PCI_DEVICE_ID_INTEL_QAT_420XXIOV 0x4947 -#define PCI_DEVICE_ID_INTEL_QAT_6XXX 0x4948#define PCI_DEVICE_ID_INTEL_QAT_6XXX_IOV 0x4949#define ADF_DEVICE_FUSECTL_OFFSET 0x40
drivers/crypto/nx/nx.c +2 -4
@@ -714,15 +714,13 @@ int nx_crypto_ctx_aes_xcbc_init(struct crypto_shash *tfm)/** * nx_crypto_ctx_exit - destroy a crypto api context * -* @tfm: the crypto transform pointer for the context +* @nx_ctx: the crypto api context * * As crypto API contexts are destroyed, this exit hook is called to free the * memory associated with it. */ -void nx_crypto_ctx_exit (struct crypto_tfm *tfm) +void nx_crypto_ctx_exit (struct nx_crypto_ctx *nx_ctx) { -struct nx_crypto_ctx *nx_ctx =crypto_tfm_ctx (tfm); -kfree_sensitive (nx_ctx->kmem); nx_ctx->csbcpb =NULL ; nx_ctx->csbcpb_aead =NULL ;
drivers/crypto/nx/nx.h +1 -1
@@ -153,7 +153,7 @@ int nx_crypto_ctx_aes_ctr_init(struct crypto_skcipher *tfm);int nx_crypto_ctx_aes_cbc_init (struct crypto_skcipher *tfm);int nx_crypto_ctx_aes_ecb_init (struct crypto_skcipher *tfm);int nx_crypto_ctx_sha_init (struct crypto_shash *tfm); -void nx_crypto_ctx_exit (struct crypto_tfm *tfm); +void nx_crypto_ctx_exit (struct nx_crypto_ctx *nx_ctx);void nx_crypto_ctx_skcipher_exit (struct crypto_skcipher *tfm);void nx_crypto_ctx_aead_exit (struct crypto_aead *tfm);void nx_crypto_ctx_shash_exit (struct crypto_shash *tfm);
drivers/dma/idxd/registers.h +0 -3
@@ -10,9 +10,6 @@#endif /* PCI Config */ -#define PCI_DEVICE_ID_INTEL_DSA_GNRD 0x11fb -#define PCI_DEVICE_ID_INTEL_DSA_DMR 0x1212 -#define PCI_DEVICE_ID_INTEL_IAA_DMR 0x1216#define PCI_DEVICE_ID_INTEL_IAA_PTL 0xb02d#define PCI_DEVICE_ID_INTEL_IAA_WCL 0xfd2d
drivers/fpga/of-fpga-region.c +1 -2
@@ -168,11 +168,10 @@ static int child_regions_with_firmware(struct device_node *overlay) fpga_region_of_match); } -of_node_put (child_region); -if (ret)pr_err ("firmware-name not allowed in child FPGA region: %pOF" , child_region); +of_node_put (child_region);return ret; }
drivers/i2c/i2c-core-base.c +6 -2
@@ -1569,6 +1569,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)pm_suspend_ignore_children (&adap->dev, true);pm_runtime_enable (&adap->dev); +mutex_lock (&core_lock); +idr_replace (&i2c_adapter_idr, adap, adap->nr); +mutex_unlock (&core_lock); + res =device_add (&adap->dev);if (res) {pr_err ("adapter '%s': can't register device (%d)\n" , adap->name, res);
@@ -1627,7 +1631,7 @@ static int __i2c_add_numbered_adapter(struct i2c_adapter *adap)int id;mutex_lock (&core_lock); - id =idr_alloc (&i2c_adapter_idr, adap, adap->nr, adap->nr +1 ,GFP_KERNEL ); + id =idr_alloc (&i2c_adapter_idr,NULL , adap->nr, adap->nr +1 ,GFP_KERNEL );mutex_unlock (&core_lock);if (WARN (id <0 ,"couldn't get idr" ))return id == -ENOSPC ? -EBUSY : id;
@@ -1661,7 +1665,7 @@ int i2c_add_adapter(struct i2c_adapter *adapter) }mutex_lock (&core_lock); - id =idr_alloc (&i2c_adapter_idr, adapter, + id =idr_alloc (&i2c_adapter_idr,NULL , __i2c_first_dynamic_bus_num,0 ,GFP_KERNEL );mutex_unlock (&core_lock);if (WARN (id <0 ,"couldn't get idr" ))
drivers/irqchip/irq-imgpdc.c +6 -0
@@ -378,6 +378,7 @@ static int pdc_intc_probe(struct platform_device *pdev)dev_err (&pdev->dev,"cannot add IRQ domain\n" );return -ENOMEM ; } + priv->domain->flags |=IRQ_DOMAIN_FLAG_DESTROY_GC ;/* * Set up 2 generic irq chips with 2 chip types.
@@ -465,6 +466,11 @@ static void pdc_intc_remove(struct platform_device *pdev) {struct pdc_intc_priv *priv =platform_get_drvdata (pdev); +for (unsigned int i =0 ; i < priv->nr_perips; ++i) +irq_set_chained_handler_and_data (priv->perip_irqs[i],NULL ,NULL ); + +irq_set_chained_handler_and_data (priv->syswake_irq,NULL ,NULL ); +irq_domain_remove (priv->domain); }
drivers/net/wan/hdlc_ppp.c +13 -2
@@ -619,7 +619,6 @@ static void ppp_start(struct net_device *dev)struct proto *proto = &ppp->protos[i]; proto->dev = dev; -timer_setup (&proto->timer, ppp_timer,0 ); proto->state =CLOSED ; } ppp->protos[IDX_LCP ].pid =PID_LCP ;
@@ -639,6 +638,15 @@ static void ppp_close(struct net_device *dev)ppp_tx_flush (); } +static void ppp_timer_release (struct net_device *dev) +{ +struct ppp *ppp =get_ppp (dev); +int i; + +for (i =0 ; i <IDX_COUNT ; i++) +timer_shutdown_sync (&ppp->protos[i].timer); +} +static struct hdlc_proto proto = { .start = ppp_start, .stop = ppp_stop,
@@ -647,6 +655,7 @@ static struct hdlc_proto proto = { .ioctl = ppp_ioctl, .netif_rx = ppp_rx, .module = THIS_MODULE, + .detach = ppp_timer_release, };static const struct header_ops ppp_header_ops = {
@@ -657,7 +666,7 @@ static int ppp_ioctl(struct net_device *dev, struct if_settings *ifs) {hdlc_device *hdlc =dev_to_hdlc (dev);struct ppp *ppp; -int result; +int i, result;switch (ifs->type) {case IF_GET_PROTO :
@@ -685,6 +694,8 @@ static int ppp_ioctl(struct net_device *dev, struct if_settings *ifs)return result; ppp =get_ppp (dev); +for (i =0 ; i <IDX_COUNT ; i++) +timer_setup (&ppp->protos[i].timer, ppp_timer,0 );spin_lock_init (&ppp->lock); ppp->req_timeout =2 ; ppp->cr_retries =10 ;
drivers/net/wireless/ath/ath11k/dp.c +1 -0
@@ -1040,6 +1040,7 @@ void ath11k_dp_free(struct ath11k_base *ab)idr_destroy (&dp->tx_ring[i].txbuf_idr);spin_unlock_bh (&dp->tx_ring[i].tx_idr_lock);kfree (dp->tx_ring[i].tx_status); + dp->tx_ring[i].tx_status =NULL ; }/* Deinit any SOC level resource */
drivers/net/wireless/intel/iwlwifi/mld/agg.c +9 -0
@@ -64,6 +64,9 @@ static void iwl_mld_release_frames_from_notif(struct iwl_mld *mld, }/* pick any STA ID to find the pointer */ +if (WARN_ON_ONCE (!ba_data->sta_mask)) + goto out_unlock; + sta_id =ffs (ba_data->sta_mask) -1 ; link_sta =rcu_dereference (mld->fw_id_to_link_sta[sta_id]);if (WARN_ON_ONCE (IS_ERR_OR_NULL (link_sta) || !link_sta->sta))
@@ -166,6 +169,9 @@ void iwl_mld_del_ba(struct iwl_mld *mld, int queue, goto out_unlock;/* pick any STA ID to find the pointer */ +if (WARN_ON_ONCE (!ba_data->sta_mask)) + goto out_unlock; + sta_id =ffs (ba_data->sta_mask) -1 ; link_sta =rcu_dereference (mld->fw_id_to_link_sta[sta_id]);if (WARN_ON_ONCE (IS_ERR_OR_NULL (link_sta) || !link_sta->sta))
@@ -347,6 +353,9 @@ static void iwl_mld_rx_agg_session_expired(struct timer_list *t) }/* timer expired, pick any STA ID to find the pointer */ +if (WARN_ON_ONCE (!ba_data->sta_mask)) + goto unlock; + sta_id =ffs (ba_data->sta_mask) -1 ; link_sta =rcu_dereference (ba_data->mld->fw_id_to_link_sta[sta_id]);
drivers/net/wireless/intel/iwlwifi/mld/ptp.c +1 -1
@@ -321,10 +321,10 @@ void iwl_mld_ptp_remove(struct iwl_mld *mld) mld->ptp_data.ptp_clock_info.name, ptp_clock_index(mld->ptp_data.ptp_clock)); +cancel_delayed_work_sync (&mld->ptp_data.dwork);ptp_clock_unregister (mld->ptp_data.ptp_clock); mld->ptp_data.ptp_clock =NULL ; mld->ptp_data.last_gp2 =0 ; mld->ptp_data.wrap_counter =0 ; -cancel_delayed_work_sync (&mld->ptp_data.dwork); } }
drivers/net/wireless/intel/iwlwifi/mvm/ptp.c +1 -1
@@ -325,11 +325,11 @@ void iwl_mvm_ptp_remove(struct iwl_mvm *mvm) mvm->ptp_data.ptp_clock_info.name, ptp_clock_index(mvm->ptp_data.ptp_clock)); +cancel_delayed_work_sync (&mvm->ptp_data.dwork);ptp_clock_unregister (mvm->ptp_data.ptp_clock); mvm->ptp_data.ptp_clock =NULL ;memset (&mvm->ptp_data.ptp_clock_info,0 ,sizeof (mvm->ptp_data.ptp_clock_info)); mvm->ptp_data.last_gp2 =0 ; -cancel_delayed_work_sync (&mvm->ptp_data.dwork); } }
drivers/net/wireless/mediatek/mt76/mac80211.c +12 -3
@@ -1576,6 +1576,7 @@ mt76_sta_add(struct mt76_phy *phy, struct ieee80211_vif *vif, {struct mt76_wcid *wcid = (struct mt76_wcid *)sta->drv_priv;struct mt76_dev *dev = phy->dev; +struct mt76_wcid *published;int ret;int i;
@@ -1595,11 +1596,19 @@ mt76_sta_add(struct mt76_phy *phy, struct ieee80211_vif *vif, mtxq->wcid = wcid->idx; } -ewma_signal_init (&wcid->rssi); -rcu_assign_pointer (dev->wcid[wcid->idx], wcid); + published =rcu_dereference_protected (dev->wcid[wcid->idx], +lockdep_is_held (&dev->mutex)); +if (published != wcid) { +WARN_ON_ONCE (published); +ewma_signal_init (&wcid->rssi); +rcu_assign_pointer (dev->wcid[wcid->idx], wcid); +mt76_wcid_init (wcid, phy->band_idx); + }else { + wcid->phy_idx = phy->band_idx; + } + phy->num_sta++; -mt76_wcid_init (wcid, phy->band_idx); out:mutex_unlock (&dev->mutex);
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +1 -0
@@ -16,6 +16,7 @@ static const struct usb_device_id mt76x2u_device_table[] = { { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USBAC1200 - Alfa AWUS036ACM */ { USB_DEVICE(0x057c, 0x8503) }, /* Avm FRITZ!WLAN AC860 */ { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */ + { USB_DEVICE(0x056e, 0x400a) }, /* ELECOM WDC-867SU3S */ { USB_DEVICE(0x0e8d, 0x7632) }, /* HC-M7662BU1 */ { USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */ { USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
drivers/net/wireless/mediatek/mt76/mt7925/main.c +3 -0
@@ -1265,6 +1265,9 @@ mt7925_mac_sta_remove_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,if (vif->type ==NL80211_IFTYPE_AP )break ; +if (vif->type ==NL80211_IFTYPE_STATION && sta->tdls) +continue ; + link_sta =mt792x_sta_to_link_sta (vif, sta, link_id);if (!link_sta)continue ;
drivers/net/wireless/realtek/rtl8xxxu/8188e.c +1 -0
@@ -1866,6 +1866,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops = { .has_tx_report = 1, .init_reg_pkt_life_time = 1, .gen2_thermal_meter = 1, + .hw_feature_report = 0, .max_sec_cam_num = 32, .adda_1t_init = 0x0b1b25a0, .adda_1t_path_on = 0x0bdb25a0,
drivers/net/wireless/realtek/rtl8xxxu/8188f.c +1 -0
@@ -1745,6 +1745,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops = { .init_reg_rxfltmap = 1, .init_reg_pkt_life_time = 1, .init_reg_hmtfr = 1, + .hw_feature_report = 1, .ampdu_max_time = 0x70, .ustime_tsf_edca = 0x28, .max_aggr_num = 0x0c14,
drivers/net/wireless/realtek/rtl8xxxu/8192c.c +1 -0
@@ -723,6 +723,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops = { .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32), .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16), .supports_ap = 1, + .hw_feature_report = 0, .max_macid_num = 32, .max_sec_cam_num = 32, .adda_1t_init = 0x0b1b25a0,
drivers/net/wireless/realtek/rtl8xxxu/8192e.c +1 -0
@@ -1751,6 +1751,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops = { .has_s0s1 = 0, .gen2_thermal_meter = 1, .needs_full_init = 1, + .hw_feature_report = 0, .supports_ap = 1, .max_macid_num = 128, .max_sec_cam_num = 64,
drivers/net/wireless/realtek/rtl8xxxu/8192f.c +1 -0
@@ -2074,6 +2074,7 @@ struct rtl8xxxu_fileops rtl8192fu_fops = { .init_reg_rxfltmap = 1, .init_reg_pkt_life_time = 1, .init_reg_hmtfr = 1, + .hw_feature_report = 1, .ampdu_max_time = 0x5e, .ustime_tsf_edca = 0x50, .max_aggr_num = 0x1f1f,
drivers/net/wireless/realtek/rtl8xxxu/8710b.c +1 -0
@@ -1852,6 +1852,7 @@ struct rtl8xxxu_fileops rtl8710bu_fops = { .init_reg_rxfltmap = 1, .init_reg_pkt_life_time = 1, .init_reg_hmtfr = 1, + .hw_feature_report = 0, /* TODO, it's different */ .ampdu_max_time = 0x5e,/* * The RTL8710BU vendor driver uses 0x50 here and it works fine,
drivers/net/wireless/realtek/rtl8xxxu/8723a.c +1 -0
@@ -632,6 +632,7 @@ struct rtl8xxxu_fileops rtl8723au_fops = { .rx_agg_buf_size = 16000, .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32), .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16), + .hw_feature_report = 0, .max_sec_cam_num = 32, .adda_1t_init = 0x0b1b25a0, .adda_1t_path_on = 0x0bdb25a0,
drivers/net/wireless/realtek/rtl8xxxu/8723b.c +1 -0
@@ -1746,6 +1746,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops = { .gen2_thermal_meter = 1, .needs_full_init = 1, .init_reg_hmtfr = 1, + .hw_feature_report = 0, .ampdu_max_time = 0x5e, .ustime_tsf_edca = 0x50, .max_aggr_num = 0x0c14,
drivers/net/wireless/realtek/rtl8xxxu/core.c +59 -5
98 lines not on this page · raw message
drivers/net/wireless/realtek/rtl8xxxu/regs.h +2 -0
@@ -447,6 +447,8 @@/* 8188EU */ #define REG_32K_CTRL 0x0194#define REG_C2HEVT_MSG_NORMAL 0x01a0 +#define C2H_HW_FEATURE_REPORT 0x19 +#define C2H_HW_FEATURE_DUMP 0xfd/* 8192EU/8723BU/8812 */ #define REG_C2HEVT_CMD_ID_8723B 0x01ae#define REG_C2HEVT_CLEAR 0x01af
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +7 -0
@@ -1789,11 +1789,17 @@ struct rtl8xxxu_cfo_tracking {#define RTL8XXXU_BC_MC_MACID1 1#define RTL8XXXU_MAX_SEC_CAM_NUM 64 +struct rtl8xxxu_hw_feature { +u8 max_bw; +}; +struct rtl8xxxu_priv {struct ieee80211_hw *hw;struct usb_device *udev;struct rtl8xxxu_fileops *fops; +struct rtl8xxxu_hw_feature hw_feature; +spinlock_t tx_urb_lock;struct list_head tx_urb_free_list;int tx_urb_free_count;
@@ -2009,6 +2015,7 @@ struct rtl8xxxu_fileops { u8 init_reg_pkt_life_time:1; u8 init_reg_hmtfr:1; u8 supports_concurrent:1; + u8 hw_feature_report:1;u8 ampdu_max_time;u8 ustime_tsf_edca;u16 max_aggr_num;
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h +1 -1
@@ -291,7 +291,7 @@ static inline int get_rx_desc_paggr(__le32 *__pdesc)static inline int get_rx_status_desc_rpt_sel (__le32 *__pdesc) { -return le32_get_bits (*(__pdesc +1 ),BIT (28 )); +return le32_get_bits (*(__pdesc +2 ),BIT (28 )); }static inline int get_rx_desc_rxmcs (__le32 *__pdesc)
drivers/net/wireless/realtek/rtw88/tx.c +6 -1
@@ -196,6 +196,7 @@ void rtw_tx_report_purge_timer(struct timer_list *t)void rtw_tx_report_enqueue (struct rtw_dev *rtwdev,struct sk_buff *skb,u8 sn) {struct rtw_tx_report *tx_report = &rtwdev->tx_report; +unsigned long timeout =RTW_TX_PROBE_TIMEOUT ;unsigned long flags;u8 *drv_data;
@@ -207,7 +208,11 @@ void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn)__skb_queue_tail (&tx_report->queue, skb);spin_unlock_irqrestore (&tx_report->q_lock, flags); -mod_timer (&tx_report->purge_timer, jiffies +RTW_TX_PROBE_TIMEOUT ); +if (rtwdev->chip->id ==RTW_CHIP_TYPE_8723D && + rtwdev->hci.type ==RTW_HCI_TYPE_USB ) + timeout =msecs_to_jiffies (2500 ); + +mod_timer (&tx_report->purge_timer, jiffies + timeout); }EXPORT_SYMBOL (rtw_tx_report_enqueue);
drivers/net/wireless/realtek/rtw88/usb.c +11 -2
@@ -399,6 +399,7 @@ static bool rtw_usb_tx_agg_skb(struct rtw_usb *rtwusb, struct sk_buff_head *listint agg_num =0 ;unsigned int align_next =0 ;u8 qsel; +int ret;if (skb_queue_empty (list))return false;
@@ -456,7 +457,13 @@ static bool rtw_usb_tx_agg_skb(struct rtw_usb *rtwusb, struct sk_buff_head *list tx_desc = (struct rtw_tx_desc *)skb_head->data; qsel =le32_get_bits (tx_desc->w1,RTW_TX_DESC_W1_QSEL ); -rtw_usb_write_port (rtwdev, qsel, skb_head, rtw_usb_write_port_tx_complete, txcb); + ret =rtw_usb_write_port (rtwdev, qsel, skb_head, + rtw_usb_write_port_tx_complete, txcb); +if (ret) { +ieee80211_purge_tx_queue (rtwdev->hw, &txcb->tx_ack_queue); +kfree (txcb); +return false; + }return true; }
@@ -518,8 +525,10 @@ static int rtw_usb_write_data(struct rtw_dev *rtwdev, ret =rtw_usb_write_port (rtwdev, qsel, skb, rtw_usb_write_port_complete, skb); -if (unlikely (ret)) +if (unlikely (ret)) {rtw_err (rtwdev,"failed to do USB write, ret=%d\n" , ret); +dev_kfree_skb_any (skb); + }return ret; }
drivers/ntb/hw/epf/ntb_hw_epf.c +2 -1
@@ -646,7 +646,8 @@ static void ntb_epf_deinit_pci(struct ntb_epf_dev *ndev)struct pci_dev *pdev = ndev->ntb.pdev;pci_iounmap (pdev, ndev->ctrl_reg); -pci_iounmap (pdev, ndev->peer_spad_reg); +if (ndev->barno_map[BAR_PEER_SPAD ] != ndev->barno_map[BAR_CONFIG ]) +pci_iounmap (pdev, ndev->peer_spad_reg);pci_iounmap (pdev, ndev->db_reg);pci_release_regions (pdev);
drivers/pci/p2pdma.c +10 -0
@@ -548,6 +548,16 @@ static const struct pci_p2pdma_whitelist_entry { {PCI_VENDOR_ID_INTEL, 0x2033, 0}, {PCI_VENDOR_ID_INTEL, 0x2020, 0}, {PCI_VENDOR_ID_INTEL, 0x09a2, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_SPR0, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IAX_SPR0, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_GNRD, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_DMR, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IAA_DMR, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_4XXX, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_401XX, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_402XX, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_420XX, 0}, + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_6XXX, 0},/* Google SoCs. */ {PCI_VENDOR_ID_GOOGLE, PCI_ANY_ID, 0}, {}
drivers/power/reset/linkstation-poweroff.c +1 -1
@@ -163,10 +163,10 @@ static int __init linkstation_poweroff_init(void) dn =of_find_matching_node (NULL , ls_poweroff_of_match);if (!dn)return -ENODEV ; -of_node_put (dn); match =of_match_node (ls_poweroff_of_match, dn); cfg = match->data; +of_node_put (dn); dn =of_find_node_by_name (NULL , cfg->mdio_node_name);if (!dn)
drivers/power/sequencing/core.c +9 -5
@@ -989,8 +989,9 @@ static void *pwrseq_debugfs_seq_start(struct seq_file *seq, loff_t *pos) ctx.index = *pos;/* -* We're holding the lock for the entire printout so no need to fiddle -* with device reference count. +* Hold the lock for the entire printout to prevent device removal. +* Reference counts are managed by start()/next()/stop() as required +* by the seq_file contract. */ down_read (&pwrseq_sem);
@@ -998,7 +999,7 @@ static void *pwrseq_debugfs_seq_start(struct seq_file *seq, loff_t *pos)if (!ctx.index)return NULL ; -return ctx.dev; +return get_device (ctx.dev); } static void *pwrseq_debugfs_seq_next(struct seq_file *seq, void *data,
@@ -1008,8 +1009,9 @@ static void *pwrseq_debugfs_seq_next(struct seq_file *seq, void *data, ++*pos; - struct device *next __free(put_device) = -bus_find_next_device (&pwrseq_bus, curr); +struct device *next =bus_find_next_device (&pwrseq_bus, curr); + +put_device (curr);return next; }
@@ -1058,6 +1060,8 @@ static int pwrseq_debugfs_seq_show(struct seq_file *seq, void *data)static void pwrseq_debugfs_seq_stop (struct seq_file *seq,void *data) { +if (data) +put_device (data);up_read (&pwrseq_sem); }
drivers/rpmsg/rpmsg_char.c +13 -2
@@ -104,6 +104,9 @@ static int rpmsg_ept_cb(struct rpmsg_device *rpdev, void *buf, int len,struct rpmsg_eptdev *eptdev = priv;struct sk_buff *skb; +if (!eptdev) +return 0 ; + skb =alloc_skb (len,GFP_ATOMIC );if (!skb)return -ENOMEM ;
@@ -124,6 +127,9 @@ static int rpmsg_ept_flow_cb(struct rpmsg_device *rpdev, void *priv, bool enable {struct rpmsg_eptdev *eptdev = priv; +if (!eptdev) +return 0 ; + eptdev->remote_flow_restricted = enable; eptdev->remote_flow_updated = true;
@@ -490,6 +496,7 @@ static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev)struct rpmsg_channel_info chinfo;struct rpmsg_eptdev *eptdev;struct device *dev = &rpdev->dev; +int ret;memcpy (chinfo.name, rpdev->id.name,RPMSG_NAME_SIZE ); chinfo.src = rpdev->src;
@@ -502,13 +509,17 @@ static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev)/* Set the default_ept to the rpmsg device endpoint */ eptdev->default_ept = rpdev->ept; + ret =rpmsg_chrdev_eptdev_add (eptdev, chinfo); + +if (ret) +return ret;/* * The rpmsg_ept_cb uses *priv parameter to get its rpmsg_eptdev context. -* Storedit in default_ept *priv field. +* Stored it in default_ept *priv field. */ eptdev->default_ept->priv = eptdev; -return rpmsg_chrdev_eptdev_add (eptdev, chinfo); +return 0 ; }static void rpmsg_chrdev_remove (struct rpmsg_device *rpdev)
drivers/video/fbdev/core/fbcon.c +7 -0
@@ -2407,6 +2407,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,int resize, ret, old_width, old_height, old_charcount;font_data_t *old_fontdata = p->fontdata;const u8 *old_data = vc->vc_font.data; +unsigned short old_hi_font_mask = vc->vc_hi_font_mask;font_data_get (data);
@@ -2453,6 +2454,12 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, vc->vc_font.height = old_height; vc->vc_font.charcount = old_charcount; +/* Restore the hi_font state and screen buffer */ +if (old_hi_font_mask && !vc->vc_hi_font_mask) +set_vc_hi_font (vc, true); +else if (!old_hi_font_mask && vc->vc_hi_font_mask) +set_vc_hi_font (vc, false); +font_data_put (data);return ret;
drivers/video/fbdev/core/fbmem.c +12 -0
@@ -734,6 +734,18 @@ int fb_new_modelist(struct fb_info *info)if (list_empty (&info->modelist))return 1 ; +/* +* The new modelist may not contain the current mode (info->var), and +* fbcon_new_modelist() below only re-points consoles mapped to this +* framebuffer. Add the current mode here so info->var keeps a match +* even when fbcon is unbound. +*/ +if (!fb_match_mode (&info->var, &info->modelist)) { +fb_var_to_videomode (&mode, &info->var); +if (fb_add_videomode (&mode, &info->modelist)) +return 1 ; + } +fbcon_new_modelist (info);return 0 ;
drivers/video/fbdev/core/fbsysfs.c +9 -1
@@ -11,6 +11,7 @@#include <linux/major.h> #include "fb_internal.h" +#include "fbcon.h" static int activate (struct fb_info *fb_info,struct fb_var_screeninfo *var) {
@@ -111,8 +112,15 @@ static ssize_t store_modes(struct device *device,if (fb_new_modelist (fb_info)) {fb_destroy_modelist (&fb_info->modelist);list_splice (&old_list, &fb_info->modelist); - }else + }else { +/* +* fb_display[i].mode and fb_info->mode both point into the old +* list. Clear them before it is freed. +*/ +fbcon_delete_modelist (&old_list); + fb_info->mode =NULL ;fb_destroy_modelist (&old_list); + }unlock_fb_info (fb_info);console_unlock ();
drivers/video/fbdev/core/modedb.c +2 -3
@@ -259,7 +259,7 @@ static const struct fb_videomode modedb[] = { FB_VMODE_DOUBLE },/* 1920x1080 @ 60 Hz, 67.3 kHz hsync */ - {NULL ,60 ,1920 ,1080 ,6734 ,148 ,88 ,36 ,4 ,44 ,5 ,0 , + {NULL ,60 ,1920 ,1080 ,6734 ,148 ,88 ,36 ,4 ,44 ,5 ,FB_SYNC_HOR_HIGH_ACT |FB_SYNC_VERT_HIGH_ACT , FB_VMODE_NONINTERLACED },
@@ -626,7 +626,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,const struct fb_videomode *default_mode, unsigned int default_bpp) { - char *mode_option_buf = NULL; + char *mode_option_buf __free(kfree) = NULL;int i;/* Set up defaults */
@@ -724,7 +724,6 @@ int fb_find_mode(struct fb_var_screeninfo *var, res_specified =1 ; } done: -kfree (mode_option_buf);if (cvt) {struct fb_videomode cvt_mode;int ret;
drivers/video/fbdev/omap2/omapfb/omapfb-main.c +8 -1
@@ -1099,7 +1099,11 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) rg =omapfb_get_mem_region (ofbi->region); - start =omapfb_get_region_paddr (ofbi); +if (ofbi->rotation_type ==OMAP_DSS_ROT_VRFB ) + start = rg->vrfb.paddr[0 ]; +else + start = rg->paddr; + len = fix->smem_len; DBG("user mmap region start %lx, len %d, off %lx\n", start, len,
@@ -1109,6 +1113,8 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) vma->vm_ops = &mmap_user_ops; vma->vm_private_data = rg; +atomic_inc (&rg->map_count); + r =vm_iomap_memory (vma, start, len);if (r) goto error;
@@ -1121,6 +1127,7 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)return 0 ; error: +atomic_dec (&rg->map_count);omapfb_put_mem_region (rg);return r;
fs/crypto/fscrypt_private.h +31 -21
94 lines not on this page · raw message
fs/crypto/inline_crypt.c +1 -7
@@ -198,13 +198,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key, goto fail; } -/* -* Pairs with the smp_load_acquire() in fscrypt_is_key_prepared(). -* I.e., here we publish ->blk_key with a RELEASE barrier so that -* concurrent tasks can ACQUIRE it. Note that this concurrency is only -* possible for per-mode keys, not for per-file keys. -*/ -smp_store_release (&prep_key->blk_key, blk_key); + prep_key->blk_key = blk_key;return 0 ; fail:
fs/crypto/keyring.c +14 -9
@@ -87,14 +87,14 @@ void fscrypt_put_master_key(struct fscrypt_master_key *mk)void fscrypt_put_master_key_activeref (struct super_block *sb,struct fscrypt_master_key *mk) { -size_t i; +struct fscrypt_mode_key *node, *tmp;if (!refcount_dec_and_test (&mk->mk_active_refs))return ;/* * No active references left, so complete the full removal of this * fscrypt_master_key struct by removing it from the keyring and -* destroying any subkeys embedded in it. +* destroying any non-file-scoped subkeys. */ if (WARN_ON_ONCE (!sb->s_master_keys))
@@ -110,13 +110,16 @@ void fscrypt_put_master_key_activeref(struct super_block *sb,WARN_ON_ONCE (mk->mk_present);WARN_ON_ONCE (!list_empty (&mk->mk_decrypted_inodes)); -for (i =0 ; i <=FSCRYPT_MODE_MAX ; i++) { -fscrypt_destroy_prepared_key ( - sb, &mk->mk_direct_keys[i]); -fscrypt_destroy_prepared_key ( - sb, &mk->mk_iv_ino_lblk_64_keys[i]); -fscrypt_destroy_prepared_key ( - sb, &mk->mk_iv_ino_lblk_32_keys[i]); +/* +* Destroy any non-file-scoped subkeys. Since ->mk_active_refs == 0, +* they're no longer referenced by any inodes. Nor can key setup run +* and use them again. So they're no longer needed. (This implies no +* concurrent readers, so we don't need list_del_rcu() for example.) +*/ +list_for_each_entry_safe (node, tmp, &mk->mk_mode_keys, link) { +fscrypt_destroy_prepared_key (sb, &node->key); +list_del (&node->link); +kfree (node); }memzero_explicit (&mk->mk_ino_hash_key,sizeof (mk->mk_ino_hash_key));
@@ -445,6 +448,8 @@ static int add_new_master_key(struct super_block *sb,INIT_LIST_HEAD (&mk->mk_decrypted_inodes);spin_lock_init (&mk->mk_decrypted_inodes_lock); +INIT_LIST_HEAD (&mk->mk_mode_keys); +if (mk_spec->type ==FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER ) { err =allocate_master_key_users_keyring (mk);if (err)
fs/crypto/keysetup.c +74 -44
176 lines not on this page · raw message
fs/exfat/dir.c +3 -1
@@ -1027,12 +1027,12 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,continue ; } -brelse (bh);if (entry_type ==TYPE_EXTEND ) {unsigned short entry_uniname[16 ], unichar;if (step !=DIRENT_STEP_NAME || name_len >=MAX_NAME_LENGTH ) { +brelse (bh); step =DIRENT_STEP_FILE ;continue ; }
@@ -1043,6 +1043,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, uniname +=EXFAT_FILE_NAME_LEN ; len =exfat_extract_uni_name (ep, entry_uniname); +brelse (bh); name_len += len; unichar = *(uniname+len);
@@ -1061,6 +1062,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,continue ; } +brelse (bh);if (entry_type & (TYPE_CRITICAL_SEC |TYPE_BENIGN_SEC )) {if (step ==DIRENT_STEP_SECD ) {
fs/f2fs/acl.c +16 -2
@@ -47,6 +47,7 @@ static inline int f2fs_acl_count(size_t size)static struct posix_acl *f2fs_acl_from_disk (const char *value,size_t size) {int i, count; +int err = -EINVAL ;struct posix_acl *acl;struct f2fs_acl_header *hdr = (struct f2fs_acl_header *)value;struct f2fs_acl_entry *entry = (struct f2fs_acl_entry *)(hdr +1 );
@@ -70,8 +71,11 @@ static struct posix_acl *f2fs_acl_from_disk(const char *value, size_t size)for (i =0 ; i < count; i++) { -if ((char *)entry > end) +if (unlikely ((char *)entry + +sizeof (struct f2fs_acl_entry_short ) > end)) { + err = -EFSCORRUPTED ; goto fail; + } acl->a_entries[i].e_tag =le16_to_cpu (entry->e_tag); acl->a_entries[i].e_perm =le16_to_cpu (entry->e_perm);
@@ -86,6 +90,11 @@ static struct posix_acl *f2fs_acl_from_disk(const char *value, size_t size)break ;case ACL_USER : +if (unlikely ((char *)entry + +sizeof (struct f2fs_acl_entry ) > end)) { + err = -EFSCORRUPTED ; + goto fail; + } acl->a_entries[i].e_uid =make_kuid (&init_user_ns,le32_to_cpu (entry->e_id));
@@ -93,6 +102,11 @@ static struct posix_acl *f2fs_acl_from_disk(const char *value, size_t size) sizeof(struct f2fs_acl_entry));break ;case ACL_GROUP : +if (unlikely ((char *)entry + +sizeof (struct f2fs_acl_entry ) > end)) { + err = -EFSCORRUPTED ; + goto fail; + } acl->a_entries[i].e_gid =make_kgid (&init_user_ns,le32_to_cpu (entry->e_id));
@@ -108,7 +122,7 @@ static struct posix_acl *f2fs_acl_from_disk(const char *value, size_t size)return acl; fail:posix_acl_release (acl); -return ERR_PTR (-EINVAL ); +return ERR_PTR (err); } static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
fs/f2fs/checkpoint.c +13 -1
@@ -943,6 +943,7 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)for (i =0 ; i < orphan_blocks; i++) {struct folio *folio;struct f2fs_orphan_block *orphan_blk; +unsigned int entry_count; folio =f2fs_get_meta_folio (sbi, start_blk + i);if (IS_ERR (folio)) {
@@ -951,7 +952,18 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi) } orphan_blk =folio_address (folio); -for (j =0 ; j <le32_to_cpu (orphan_blk->entry_count); j++) { + entry_count =le32_to_cpu (orphan_blk->entry_count); +if (entry_count >F2FS_ORPHANS_PER_BLOCK ) { +f2fs_err (sbi,"invalid orphan inode entry count %u" , + entry_count); +set_sbi_flag (sbi,SBI_NEED_FSCK ); +f2fs_handle_error (sbi,ERROR_INCONSISTENT_ORPHAN ); + err = -EFSCORRUPTED ; +f2fs_folio_put (folio, true); + goto out; + } + +for (j =0 ; j < entry_count; j++) {nid_t ino =le32_to_cpu (orphan_blk->ino[j]); err =recover_orphan_inode (sbi, ino);
fs/f2fs/data.c +30 -19
112 lines not on this page · raw message
fs/f2fs/extent_cache.c +7 -12
@@ -119,10 +119,9 @@ static bool __may_extent_tree(struct inode *inode, enum extent_type type)if (!__init_may_extent_tree (inode, type))return false; -if (is_inode_flag_set (inode,FI_NO_EXTENT )) -return false; -if (type ==EX_READ ) { +if (is_inode_flag_set (inode,FI_NO_EXTENT )) +return false;if (is_inode_flag_set (inode,FI_COMPRESSED_FILE ) && !f2fs_sb_has_readonly (F2FS_I_SB (inode)))return false;
@@ -645,14 +644,10 @@ static unsigned int __destroy_extent_node(struct inode *inode,while (atomic_read (&et->node_cnt)) {write_lock (&et->lock); -if (!is_inode_flag_set (inode,FI_NO_EXTENT )) -set_inode_flag (inode,FI_NO_EXTENT ); node_cnt +=__free_extent_tree (sbi, et, nr_shrink);write_unlock (&et->lock); } -f2fs_bug_on (sbi,atomic_read (&et->node_cnt)); -return node_cnt; }
@@ -691,12 +686,12 @@ static void __update_extent_tree_range(struct inode *inode,write_lock (&et->lock); -if (is_inode_flag_set (inode,FI_NO_EXTENT )) { -write_unlock (&et->lock); -return ; - } -if (type ==EX_READ ) { +if (is_inode_flag_set (inode,FI_NO_EXTENT )) { +write_unlock (&et->lock); +return ; + } + prev = et->largest; dei.len =0 ;
fs/f2fs/f2fs.h +1 -0
@@ -1583,6 +1583,7 @@ enum node_type {NODE_TYPE_INODE ,NODE_TYPE_XATTR ,NODE_TYPE_NON_INODE , + NODE_TYPE_NON_IXNODE, /* non inode and xnode */ };/* a threshold of maximum elapsed time in critical region to print tracepoint */
fs/f2fs/file.c +10 -1
@@ -1098,6 +1098,8 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return -EPERM ;if ((attr->ia_valid &ATTR_SIZE )) { +if (mapping_large_folio_support (inode->i_mapping)) +return -EOPNOTSUPP ;if (!f2fs_is_compress_backend_ready (inode) ||IS_DEVICE_ALIASING (inode))return -EOPNOTSUPP ;
@@ -1914,8 +1916,15 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset,if (f2fs_is_pinned_file (inode)) {block_t sec_blks =CAP_BLKS_PER_SEC (sbi); -block_t sec_len =roundup (map.m_len, sec_blks); +block_t sec_len; +if (map.m_lblk % sec_blks) { + map.m_lblk =rounddown (map.m_lblk, sec_blks); + map.m_len = pg_end - map.m_lblk; +if (off_end) + map.m_len++; + } + sec_len =roundup (map.m_len, sec_blks); map.m_len = sec_blks; next_alloc:f2fs_down_write (&sbi->pin_sem);
fs/f2fs/gc.c +43 -13
100 lines not on this page · raw message
fs/f2fs/inode.c +18 -8
@@ -324,9 +324,9 @@ static bool sanity_check_inode(struct inode *inode, struct folio *node_folio) }if (f2fs_sb_has_flexible_inline_xattr (sbi) && -f2fs_has_inline_xattr (inode) && - (fi->i_inline_xattr_size <MIN_INLINE_XATTR_SIZE || - fi->i_inline_xattr_size >MAX_INLINE_XATTR_SIZE )) { + (fi->i_inline_xattr_size >MAX_INLINE_XATTR_SIZE || + (f2fs_has_inline_xattr (inode) && + fi->i_inline_xattr_size <MIN_INLINE_XATTR_SIZE ))) {f2fs_warn (sbi,"%s: inode (ino=%llx) has corrupted i_inline_xattr_size: %d, min: %zu, max: %lu" , __func__, inode->i_ino, fi->i_inline_xattr_size,MIN_INLINE_XATTR_SIZE ,MAX_INLINE_XATTR_SIZE );
@@ -561,8 +561,13 @@ static int do_read_inode(struct inode *inode)static bool is_meta_ino (struct f2fs_sb_info *sbi,unsigned int ino) { -return ino ==F2FS_NODE_INO (sbi) || ino ==F2FS_META_INO (sbi) || - ino ==F2FS_COMPRESS_INO (sbi); +if (ino ==F2FS_NODE_INO (sbi) || ino ==F2FS_META_INO (sbi)) +return true; +#ifdef CONFIG_F2FS_FS_COMPRESSION +if (test_opt (sbi,COMPRESS_CACHE ) && ino ==F2FS_COMPRESS_INO (sbi)) +return true; +#endif +return false; }struct inode *f2fs_iget (struct super_block *sb,unsigned long ino)
@@ -858,10 +863,15 @@ void f2fs_evict_inode(struct inode *inode)f2fs_abort_atomic_write (inode, true);if (fi->cow_inode &&f2fs_is_cow_file (fi->cow_inode)) { -clear_inode_flag (fi->cow_inode,FI_COW_FILE ); -F2FS_I (fi->cow_inode)->atomic_inode =NULL ; -iput (fi->cow_inode); +struct inode *cow_inode = fi->cow_inode; + +f2fs_down_write (&F2FS_I (cow_inode)->i_sem); +clear_inode_flag (cow_inode,FI_COW_FILE ); +F2FS_I (cow_inode)->atomic_inode =NULL ; fi->cow_inode =NULL ; +f2fs_up_write (&F2FS_I (cow_inode)->i_sem); + +iput (cow_inode); }trace_f2fs_evict_inode (inode);
fs/f2fs/node.c +6 -2
@@ -1541,6 +1541,10 @@ int f2fs_sanity_check_node_footer(struct f2fs_sb_info *sbi,if (is_inode) goto out_err;break ; +case NODE_TYPE_NON_IXNODE : +if (is_inode || is_xnode) + goto out_err; +break ;default :break ; }
@@ -1634,7 +1638,7 @@ static struct folio *f2fs_get_node_folio_ra(struct folio *parent, int start)struct f2fs_sb_info *sbi =F2FS_F_SB (parent);nid_t nid =get_nid (parent, start, false); -return __get_node_folio (sbi, nid, parent, start,NODE_TYPE_REGULAR ); +return __get_node_folio (sbi, nid, parent, start,NODE_TYPE_NON_IXNODE ); }static void flush_inline_data (struct f2fs_sb_info *sbi,nid_t ino)
@@ -1875,7 +1879,7 @@ int f2fs_write_single_node_folio(struct folio *node_folio, int sync_mode, }if (!__write_node_folio (node_folio, false, false,NULL , - &wbc, false,FS_GC_NODE_IO ,NULL )) + &wbc, false, io_type,NULL )) err = -EAGAIN ; goto release_folio; out_folio:
fs/gfs2/super.c +1 -0
@@ -643,6 +643,7 @@ static void gfs2_put_super(struct super_block *sb)gfs2_delete_debugfs_file (sdp);gfs2_sys_fs_del (sdp); +rcu_barrier ();free_sbd (sdp); }
fs/nfs/client.c +1 -0
@@ -1074,6 +1074,7 @@ struct nfs_server *nfs_alloc_server(void) server->io_stats =nfs_alloc_iostats ();if (!server->io_stats) { +ida_free (&s_sysfs_ids, server->s_sysfs_id);kfree (server);return NULL ; }
fs/nfs/flexfilelayout/flexfilelayout.c +4 -0
@@ -551,6 +551,10 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,if (!p) goto out_err_free; fh_count =be32_to_cpup (p); +if (fh_count ==0 ) { + rc = -EINVAL ; + goto out_err_free; + } dss_info->fh_versions = kzalloc_objs(struct nfs_fh, fh_count, gfp_flags);
fs/nfs/nfs4proc.c +2 -3
@@ -5302,10 +5302,9 @@ static struct dentry *nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,do { alias =_nfs4_proc_mkdir (dir, dentry, sattr, label, &err);trace_nfs4_mkdir (dir, &dentry->d_name, err); + err =nfs4_handle_exception (NFS_SERVER (dir), err, &exception);if (err) - alias =ERR_PTR (nfs4_handle_exception (NFS_SERVER (dir), - err, - &exception)); + alias =ERR_PTR (err); }while (exception.retry);nfs4_label_release_security (label);
fs/nfs/pnfs.c +1 -1
@@ -2229,11 +2229,11 @@ pnfs_update_layout(struct inode *ino,dprintk ("%s wait for layoutreturn\n" , __func__); lseg =ERR_PTR (pnfs_prepare_to_retry_layoutget (lo));if (!IS_ERR (lseg)) { -pnfs_put_layout_hdr (lo);dprintk ("%s retrying\n" , __func__);trace_pnfs_update_layout (ino, pos, count, iomode, lo, lseg,PNFS_UPDATE_LAYOUT_RETRY ); +pnfs_put_layout_hdr (lo); goto lookup_again; } trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg,
fs/nfs/pnfs_nfs.c +2 -2
@@ -1075,14 +1075,14 @@ nfs4_decode_mp_ds_addr(struct net *net, struct xdr_stream *xdr, gfp_t gfp_flags)/* r_netid */ nlen =xdr_stream_decode_string_dup (xdr, &netid,XDR_MAX_NETOBJ , gfp_flags); -if (unlikely (nlen <0 )) +if (unlikely (nlen <=0 )) goto out_err;/* r_addr: ip/ip6addr with port in dec octets - see RFC 5665 */ /* port is ".ABC.DEF", 8 chars max */ rlen =xdr_stream_decode_string_dup (xdr, &buf,INET6_ADDRSTRLEN +IPV6_SCOPE_ID_LEN +8 , gfp_flags); -if (unlikely (rlen <0 )) +if (unlikely (rlen <=0 )) goto out_free_netid;/* replace port '.' with '-' */
fs/nfsd/nfs2acl.c +12 -5
@@ -131,10 +131,7 @@ static __be32 nfsacld_proc_setacl(struct svc_rqst *rqstp) resp->status =fh_getattr (fh, &resp->stat); out: -/* argp->acl_{access,default} may have been allocated in -nfssvc_decode_setaclargs. */ -posix_acl_release (argp->acl_access); -posix_acl_release (argp->acl_default); +/* argp->acl_{access,default} are released in nfsaclsvc_release_setacl. */ return rpc_success; out_drop_lock:
@@ -310,6 +307,16 @@ static void nfsaclsvc_release_access(struct svc_rqst *rqstp)fh_put (&resp->fh); } +static void nfsaclsvc_release_setacl (struct svc_rqst *rqstp) +{ +struct nfsd3_setaclargs *argp = rqstp->rq_argp; +struct nfsd_attrstat *resp = rqstp->rq_resp; + +fh_put (&resp->fh); +posix_acl_release (argp->acl_access); +posix_acl_release (argp->acl_default); +} +#define ST 1/* status*/ #define AT 21/* attributes */ #define pAT (1+AT)/* post attributes - conditional */
@@ -343,7 +350,7 @@ static const struct svc_procedure nfsd_acl_procedures2[5] = { .pc_func = nfsacld_proc_setacl, .pc_decode = nfsaclsvc_decode_setaclargs, .pc_encode = nfssvc_encode_attrstatres, - .pc_release = nfssvc_release_attrstat, + .pc_release = nfsaclsvc_release_setacl, .pc_argsize = sizeof(struct nfsd3_setaclargs), .pc_argzero = sizeof(struct nfsd3_setaclargs), .pc_ressize = sizeof(struct nfsd_attrstat),
fs/nfsd/nfs3acl.c +12 -5
@@ -118,10 +118,7 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp) out_errno: resp->status =nfserrno (error); out: -/* argp->acl_{access,default} may have been allocated in -nfs3svc_decode_setaclargs. */ -posix_acl_release (argp->acl_access); -posix_acl_release (argp->acl_default); +/* argp->acl_{access,default} are released in nfs3svc_release_setacl. */ return rpc_success; }
@@ -223,6 +220,16 @@ static void nfs3svc_release_getacl(struct svc_rqst *rqstp)posix_acl_release (resp->acl_default); } +static void nfs3svc_release_setacl (struct svc_rqst *rqstp) +{ +struct nfsd3_setaclargs *argp = rqstp->rq_argp; +struct nfsd3_attrstat *resp = rqstp->rq_resp; + +fh_put (&resp->fh); +posix_acl_release (argp->acl_access); +posix_acl_release (argp->acl_default); +} +#define ST 1/* status*/ #define AT 21/* attributes */ #define pAT (1+AT)/* post attributes - conditional */
@@ -256,7 +263,7 @@ static const struct svc_procedure nfsd_acl_procedures3[3] = { .pc_func = nfsd3_proc_setacl, .pc_decode = nfs3svc_decode_setaclargs, .pc_encode = nfs3svc_encode_setaclres, - .pc_release = nfs3svc_release_fhandle, + .pc_release = nfs3svc_release_setacl, .pc_argsize = sizeof(struct nfsd3_setaclargs), .pc_argzero = sizeof(struct nfsd3_setaclargs), .pc_ressize = sizeof(struct nfsd3_attrstat),
fs/nfsd/nfs4layouts.c +5 -7
@@ -264,10 +264,12 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate, ls->ls_file =find_any_file (fp);BUG_ON (!ls->ls_file); + ls->ls_fenced = false; + ls->ls_fence_delay =0 ; +INIT_DELAYED_WORK (&ls->ls_fence_work, nfsd4_layout_fence_worker); +if (nfsd4_layout_setlease (ls)) { -nfsd_file_put (ls->ls_file); -put_nfs4_file (fp); -kmem_cache_free (nfs4_layout_stateid_cache, ls); +nfs4_put_stid (stp);return NULL ; }
@@ -280,10 +282,6 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,list_add (&ls->ls_perfile, &fp->fi_lo_states);spin_unlock (&fp->fi_lock); - ls->ls_fenced = false; - ls->ls_fence_delay =0 ; -INIT_DELAYED_WORK (&ls->ls_fence_work, nfsd4_layout_fence_worker); -trace_nfsd_layoutstate_alloc (&ls->ls_stid.sc_stateid);return ls; }
fs/nfsd/nfs4proc.c +11 -8
@@ -253,7 +253,7 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, .na_iattr = iap, .na_seclabel = &open->op_label, }; -struct dentry *parent, *child; +struct dentry *parent, *child =ERR_PTR (-EINVAL );__u32 v_mtime, v_atime;struct inode *inode;__be32 status;
@@ -277,10 +277,14 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp,if (open->op_acl) {if (open->op_dpacl || open->op_pacl) { status = nfserr_inval; - goto out_write; + goto out; + } +if (is_create_with_attrs (open)) { + status =nfsd4_acl_to_attr (NF4REG , open->op_acl, + &attrs); +if (status) + goto out; } -if (is_create_with_attrs (open)) -nfsd4_acl_to_attr (NF4REG , open->op_acl, &attrs); }else if (is_create_with_attrs (open)) {/* The dpacl and pacl will get released by nfsd_attrs_free(). */ attrs.na_dpacl = open->op_dpacl;
@@ -293,7 +297,7 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, &QSTR_LEN(open->op_fname, open->op_fnamelen));if (IS_ERR (child)) { status =nfserrno (PTR_ERR (child)); - goto out_write; + goto out; }if (d_really_is_negative (child)) {
@@ -407,7 +411,6 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, out:end_creating (child);nfsd_attrs_free (&attrs); -out_write:fh_drop_write (fhp);return status; }
@@ -837,7 +840,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, goto out_aftermask;if (create->cr_acl) { -if (create->cr_dpacl || create->cr_pacl) { +if (attrs.na_dpacl || attrs.na_pacl) { status = nfserr_inval; goto out_aftermask; }
@@ -1470,7 +1473,7 @@ void nfsd4_async_copy_reaper(struct nfsd_net *nn)list_for_each_safe (pos, next, &clp->async_copies) { copy = list_entry(pos, struct nfsd4_copy, copies);if (test_bit (NFSD4_COPY_F_OFFLOAD_DONE , ©->cp_flags)) { -if (--copy->cp_ttl) { +if (!--copy->cp_ttl) {list_del_init (©->copies);list_add (©->copies, &reaplist); }
fs/nfsd/nfs4recover.c +2 -1
@@ -718,7 +718,8 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,return PTR_ERR (namecopy); name.data = namecopy; name.len = namelen; -get_user (princhashlen, &ci->cc_princhash.cp_len); +if (get_user (princhashlen, &ci->cc_princhash.cp_len)) +return -EFAULT ;if (princhashlen >0 ) { princhashcopy = memdup_user( &ci->cc_princhash.cp_data,
fs/nfsd/nfs4state.c +1 -0
@@ -5169,6 +5169,7 @@ find_or_alloc_open_stateowner(unsigned int strhashval, struct nfsd4_open *open,/* Replace unconfirmed owners without checking for replay. */ release_openowner (oo); oo =NULL ; + goto retry; }if (oo) {if (new)
fs/nfsd/nfs4xdr.c +2 -1
@@ -2008,10 +2008,11 @@ static __be32 nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u) {struct nfsd4_secinfo_no_name *sin = &u->secinfo_no_name; + + sin->sin_exp =NULL ;if (xdr_stream_decode_u32 (argp->xdr, &sin->sin_style) <0 )return nfserr_bad_xdr; - sin->sin_exp =NULL ;return nfs_ok; }
fs/nfsd/vfs.c +5 -1
@@ -1508,8 +1508,10 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,nfsd_stats_io_write_add (nn, exp, *cnt);fsnotify_modify (file); host_err =filemap_check_wb_err (file->f_mapping, since); -if (host_err <0 ) +if (host_err <0 ) { +commit_reset_write_verifier (nn, rqstp, host_err); goto out_nfserr; + }if (stable && fhp->fh_use_wgather) { host_err =wait_for_concurrent_writes (file);
@@ -1689,6 +1691,8 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,nfsd_copy_write_verifier (verf, nn); err2 =filemap_check_wb_err (nf->nf_file->f_mapping, since); +if (err2 <0 ) +commit_reset_write_verifier (nn, rqstp, err2); err =nfserrno (err2);break ;case -EINVAL :
fs/ntfs/file.c +13 -4
@@ -707,12 +707,21 @@ static int ntfs_ioctl_get_volume_label(struct file *filp, unsigned long arg) {struct ntfs_volume *vol =NTFS_SB (file_inode (filp)->i_sb);char __user *buf = (char __user *)arg; +char label[FSLABEL_MAX ]; +ssize_t len; +mutex_lock (&vol->volume_label_lock);if (!vol->volume_label) { -if (copy_to_user (buf,"" ,1 )) -return -EFAULT ; - }else if (copy_to_user (buf, vol->volume_label, -MIN (FSLABEL_MAX ,strlen (vol->volume_label) +1 ))) + label[0 ] ='\0' ; + len =0 ; + }else { + len =strscpy (label, vol->volume_label,sizeof (label)); +if (len == -E2BIG ) + len =FSLABEL_MAX -1 ; + } +mutex_unlock (&vol->volume_label_lock); + +if (copy_to_user (buf, label, len +1 ))return -EFAULT ;return 0 ; }
fs/ntfs/super.c +13 -6
@@ -460,17 +460,23 @@ int ntfs_write_volume_label(struct ntfs_volume *vol, char *label) ret =ntfs_resident_attr_record_add (vol_ni,AT_VOLUME_NAME ,AT_UNNAMED ,0 , (u8 *)uname, uname_len *sizeof (__le16),0 ); out: -mutex_unlock (&vol_ni->mrec_lock); -kvfree (uname); -if (ret >=0 ) { -kfree (vol->volume_label); +char *old_label; + +mutex_lock (&vol->volume_label_lock); + old_label = vol->volume_label; vol->volume_label = new_label; +mutex_unlock (&vol->volume_label_lock); + +kfree (old_label);mark_inode_dirty_sync (vol->vol_ino); ret =0 ; - }else { -kfree (new_label); } +mutex_unlock (&vol_ni->mrec_lock); +kvfree (uname); + +if (ret <0 ) +kfree (new_label);return ret; }
@@ -2631,6 +2637,7 @@ static int ntfs_init_fs_context(struct fs_context *fc)NVolSetCaseSensitive (vol);init_rwsem (&vol->mftbmp_lock);init_rwsem (&vol->lcnbmp_lock); +mutex_init (&vol->volume_label_lock); fc->s_fs_info = vol; fc->ops = &ntfs_context_ops;
fs/ntfs/volume.h +2 -0
@@ -72,6 +72,7 @@* @vol_flags: Volume flags. * @major_ver: Ntfs major version of volume. * @minor_ver: Ntfs minor version of volume. +* @volume_label_lock: protects @volume_label. * @volume_label: volume label. * @root_ino: The VFS inode of the root directory. * @secure_ino: The VFS inode of $Secure (NTFS3.0+ only, otherwise NULL).
@@ -133,6 +134,7 @@ struct ntfs_volume {struct inode *logfile_ino;struct inode *lcnbmp_ino;struct rw_semaphore lcnbmp_lock; +struct mutex volume_label_lock;struct inode *vol_ino;__le16 vol_flags;u8 major_ver;
fs/ntfs3/xattr.c +12 -0
@@ -851,6 +851,12 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de,return err; } +static bool ntfs_is_reserved_lxattr (const char *name) +{ +return !strcmp (name,"$LXUID" ) || !strcmp (name,"$LXGID" ) || + !strcmp (name,"$LXMOD" ) || !strcmp (name,"$LXDEV" ); +} +/* * ntfs_setxattr - inode_operations::setxattr */
@@ -955,6 +961,12 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, goto out; } +/* Do not allow non privileged users to change $LXUID/$LXGID... */ +if (ntfs_is_reserved_lxattr (name) && !capable (CAP_SYS_ADMIN )) { + err = -EPERM ; + goto out; + } +/* Deal with NTFS extended attribute. */ err =ntfs_set_ea (inode, name,strlen (name), value, size, flags,0 ,NULL );
fs/ocfs2/suballoc.c +22 -0
@@ -231,8 +231,16 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, int resize) {unsigned int max_bits; +unsigned int max_bitmap_bits; +unsigned int max_bitmap_size; +int suballocator;struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; + suballocator =le64_to_cpu (di->i_blkno) !=OCFS2_SB (sb)->bitmap_blkno; + max_bitmap_size =ocfs2_group_bitmap_size (sb, suballocator, +OCFS2_SB (sb)->s_feature_incompat); + max_bitmap_bits = max_bitmap_size *8 ; +if (di->i_blkno != gd->bg_parent_dinode) { do_error("Group descriptor #%llu has bad parent pointer (%llu, expected %llu)\n", (unsigned long long)bh->b_blocknr,
@@ -240,6 +248,20 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, (unsigned long long)le64_to_cpu(di->i_blkno)); } +if (le16_to_cpu (gd->bg_size) > max_bitmap_size) { +do_error ("Group descriptor #%llu has bitmap size %u but physical max of %u\n" , + (unsigned long long )bh->b_blocknr, +le16_to_cpu (gd->bg_size), + max_bitmap_size); + } + +if (le16_to_cpu (gd->bg_bits) > max_bitmap_bits) { +do_error ("Group descriptor #%llu has bit count %u but physical max of %u\n" , + (unsigned long long )bh->b_blocknr, +le16_to_cpu (gd->bg_bits), + max_bitmap_bits); + } + max_bits =le16_to_cpu (di->id2.i_chain.cl_cpg) *le16_to_cpu (di->id2.i_chain.cl_bpc);if (le16_to_cpu (gd->bg_bits) > max_bits) { do_error("Group descriptor #%llu has bit count of %u\n",
fs/smb/server/smbacl.c +3 -1
@@ -1477,7 +1477,9 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,break ; aces_size -= ace_size; -if (ace->sid.num_subauth >SID_MAX_SUB_AUTHORITIES ) +if (ace->sid.num_subauth >SID_MAX_SUB_AUTHORITIES || + ace_size < offsetof(struct smb_ace , sid) +CIFS_SID_BASE_SIZE + +sizeof (__le32) * ace->sid.num_subauth)break ; if (!compare_sids(&sid, &ace->sid) ||
fs/userfaultfd.c +2 -0
@@ -786,6 +786,8 @@ void mremap_userfaultfd_fail(struct vm_userfaultfd_ctx *vm_ctx)if (!ctx)return ; +atomic_dec (&ctx->mmap_changing); +VM_WARN_ON_ONCE (atomic_read (&ctx->mmap_changing) <0 );userfaultfd_ctx_put (ctx); }
include/keys/request_key_auth-type.h +2 -0
@@ -9,12 +9,14 @@#define _KEYS_REQUEST_KEY_AUTH_TYPE_H#include <linux/key.h> +#include <linux/refcount.h> /* * Authorisation record for request_key(). */ struct request_key_auth {struct rcu_head rcu; +refcount_t usage;struct key *target_key;struct key *dest_keyring;const struct cred *cred;
include/linux/blkdev.h +6 -10
@@ -1214,16 +1214,12 @@ static inline void blk_flush_plug(struct blk_plug *plug, bool async)__blk_flush_plug (plug, async); } -/* -* tsk == current here -*/ -static inline void blk_plug_invalidate_ts (struct task_struct *tsk) +static __always_inline void blk_plug_invalidate_ts(void) { -struct blk_plug *plug = tsk->plug; - -if (plug) - plug->cur_ktime =0 ; - current->flags &= ~PF_BLOCK_TS ; +if (unlikely (current->flags &PF_BLOCK_TS )) { + current->plug->cur_ktime =0 ; + current->flags &= ~PF_BLOCK_TS ; + } }int blkdev_issue_flush (struct block_device *bdev);
@@ -1249,7 +1245,7 @@ static inline void blk_flush_plug(struct blk_plug *plug, bool async) { } -static inline void blk_plug_invalidate_ts (struct task_struct *tsk) +static inline void blk_plug_invalidate_ts (void ) { }
include/linux/err.h +6 -6
@@ -36,7 +36,7 @@* * Return: A pointer with @error encoded within its value. */ -static inline void *__must_check ERR_PTR (long error) +static __always_inline void * __must_check ERR_PTR(long error) {return (void *) error; }
@@ -60,7 +60,7 @@ static inline void * __must_check ERR_PTR(long error)* @ptr: An error pointer. * Return: The error code within @ptr. */ -static inline long __must_check PTR_ERR (__force const void *ptr) +static __always_inline long __must_check PTR_ERR (__force const void *ptr) {return (long ) ptr; }
@@ -73,7 +73,7 @@ static inline long __must_check PTR_ERR(__force const void *ptr)* @ptr: The pointer to check. * Return: true if @ptr is an error pointer, false otherwise. */ -static inline bool __must_check IS_ERR (__force const void *ptr) +static __always_inline bool __must_check IS_ERR(__force const void *ptr) {return IS_ERR_VALUE ((unsigned long )ptr); }
@@ -87,7 +87,7 @@ static inline bool __must_check IS_ERR(__force const void *ptr)* * Like IS_ERR(), but also returns true for a null pointer. */ -static inline bool __must_check IS_ERR_OR_NULL (__force const void *ptr) +static __always_inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) {return unlikely (!ptr) ||IS_ERR_VALUE ((unsigned long )ptr); }
@@ -99,7 +99,7 @@ static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)* Explicitly cast an error-valued pointer to another pointer type in such a * way as to make it clear that's what's going on. */ -static inline void *__must_check ERR_CAST (__force const void *ptr) +static __always_inline void * __must_check ERR_CAST(__force const void *ptr) {/* cast away the const */ return (void *) ptr;
@@ -122,7 +122,7 @@ static inline void * __must_check ERR_CAST(__force const void *ptr)* * Return: The error code within @ptr if it is an error pointer; 0 otherwise. */ -static inline int __must_check PTR_ERR_OR_ZERO (__force const void *ptr) +static __always_inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) {if (IS_ERR (ptr))return PTR_ERR (ptr);
include/linux/f2fs_fs.h +1 -0
@@ -107,6 +107,7 @@ enum f2fs_error {ERROR_CORRUPTED_XATTR ,ERROR_INVALID_NODE_REFERENCE ,ERROR_INCONSISTENT_NAT , +ERROR_INCONSISTENT_ORPHAN , ERROR_MAX, };
include/linux/kvm_host.h +6 -1
@@ -1815,6 +1815,11 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, struct kvm_irq_ack_notifier *kian);bool kvm_arch_irqfd_allowed (struct kvm *kvm,struct kvm_irqfd *args); +static inline bool is_gfn_in_memslot (const struct kvm_memory_slot *slot,gfn_t gfn) +{ +return gfn >= slot->base_gfn && gfn < slot->base_gfn + slot->npages; +} +/* * Returns a pointer to the memslot if it contains gfn. * Otherwise returns NULL.
@@ -1825,7 +1830,7 @@ try_get_memslot(struct kvm_memory_slot *slot, gfn_t gfn)if (!slot)return NULL ; -if (gfn >= slot->base_gfn && gfn < slot->base_gfn + slot->npages) +if (is_gfn_in_memslot (slot, gfn))return slot;else return NULL ;
include/linux/mm.h +39 -0
@@ -496,6 +496,21 @@ enum {#else #define VM_UFFD_MINOR VM_NONE#endif + +/* +* vma_flags_t masks for the userfaultfd VMA flags. VMA_UFFD_MINOR is gated on +* the same config as VM_UFFD_MINOR -- which implies 64BIT, where the bit fits +* -- so an out-of-range bit is never fed to mk_vma_flags() on a build whose +* bitmap cannot hold it. +*/ +#define VMA_UFFD_MISSING mk_vma_flags(VMA_UFFD_MISSING_BIT) +#define VMA_UFFD_WP mk_vma_flags(VMA_UFFD_WP_BIT) +#ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR +#define VMA_UFFD_MINOR mk_vma_flags(VMA_UFFD_MINOR_BIT) +#else +#define VMA_UFFD_MINOR EMPTY_VMA_FLAGS +#endif +#ifdef CONFIG_64BIT #define VM_ALLOW_ANY_UNCACHED INIT_VM_FLAG(ALLOW_ANY_UNCACHED)#define VM_SEALED INIT_VM_FLAG(SEALED)
@@ -1238,6 +1253,30 @@ static __always_inline void vma_flags_set_mask(vma_flags_t *flags,#define vma_flags_set (flags, ...) \ vma_flags_set_mask(flags, mk_vma_flags(__VA_ARGS__)) +static __always_inline vma_flags_t __mk_vma_flags_from_masks(size_t count, +const vma_flags_t *masks) +{ +vma_flags_t flags =EMPTY_VMA_FLAGS ; +size_t i; + +for (i =0 ; i < count; i++) +vma_flags_set_mask (&flags, masks[i]); +return flags; +} + +/* +* Combine pre-computed vma_flags_t masks into one value, e.g.: +* +* vma_flags_t flags = mk_vma_flags_from_masks(VMA_UFFD_WP, VMA_UFFD_MINOR); +* +* Unlike mk_vma_flags(), which takes bit numbers, this takes whole masks -- +* each of which may be EMPTY_VMA_FLAGS when its feature is unavailable -- so a +* bit that does not exist on the current build is never materialised. +*/ +#define mk_vma_flags_from_masks (...) \ + __mk_vma_flags_from_masks(COUNT_ARGS(__VA_ARGS__), \ + (const vma_flags_t []){__VA_ARGS__}) +/* Clear all of the to-clear flags in flags, non-atomically. */ static __always_inline void vma_flags_clear_mask(vma_flags_t *flags,vma_flags_t to_clear)
include/linux/pci_ids.h +8 -0
@@ -2732,6 +2732,9 @@#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132#define PCI_DEVICE_ID_INTEL_SST_TNG 0x119a +#define PCI_DEVICE_ID_INTEL_DSA_GNRD 0x11fb +#define PCI_DEVICE_ID_INTEL_DSA_DMR 0x1212 +#define PCI_DEVICE_ID_INTEL_IAA_DMR 0x1216#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221#define PCI_DEVICE_ID_INTEL_82437 0x122d#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
@@ -3052,6 +3055,11 @@#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036#define PCI_DEVICE_ID_INTEL_HDA_TGL_H 0x43c8#define PCI_DEVICE_ID_INTEL_HDA_DG1 0x490d +#define PCI_DEVICE_ID_INTEL_QAT_4XXX 0x4940 +#define PCI_DEVICE_ID_INTEL_QAT_401XX 0x4942 +#define PCI_DEVICE_ID_INTEL_QAT_402XX 0x4944 +#define PCI_DEVICE_ID_INTEL_QAT_420XX 0x4946 +#define PCI_DEVICE_ID_INTEL_QAT_6XXX 0x4948#define PCI_DEVICE_ID_INTEL_HDA_EHL_0 0x4b55#define PCI_DEVICE_ID_INTEL_HDA_EHL_3 0x4b58#define PCI_DEVICE_ID_INTEL_HDA_WCL 0x4d28
include/linux/skmsg.h +11 -4
@@ -4,6 +4,7 @@#ifndef _LINUX_SKMSG_H#define _LINUX_SKMSG_H +#include <linux/bitops.h> #include <linux/bpf.h> #include <linux/filter.h> #include <linux/scatterlist.h>
@@ -199,11 +200,14 @@ static inline void sk_msg_xfer(struct sk_msg *dst, struct sk_msg *src, int which, u32 size) { dst->sg.data[which] = src->sg.data[which]; +__assign_bit (which, dst->sg.copy,test_bit (which, src->sg.copy)); dst->sg.data[which].length = size; dst->sg.size += size; src->sg.size -= size; src->sg.data[which].length -= size; src->sg.data[which].offset += size; +if (!src->sg.data[which].length) +__clear_bit (which, src->sg.copy); }static inline void sk_msg_xfer_full (struct sk_msg *dst,struct sk_msg *src)
@@ -273,16 +277,19 @@ static inline void sk_msg_page_add(struct sk_msg *msg, struct page *page,static inline void sk_msg_sg_copy (struct sk_msg *msg,u32 i,bool copy_state) {do { -if (copy_state) -__set_bit (i, msg->sg.copy); -else -__clear_bit (i, msg->sg.copy); +__assign_bit (i, msg->sg.copy, copy_state);sk_msg_iter_var_next (i);if (i == msg->sg.end)break ; }while (1 ); } +static inline void sk_msg_sg_copy_assign (struct sk_msg *dst,u32 dst_i, +const struct sk_msg *src,u32 src_i) +{ +__assign_bit (dst_i, dst->sg.copy,test_bit (src_i, src->sg.copy)); +} +static inline void sk_msg_sg_copy_set (struct sk_msg *msg,u32 start) {sk_msg_sg_copy (msg, start, true);
include/linux/userfaultfd_k.h +2 -2
@@ -23,8 +23,8 @@/* The set of all possible UFFD-related VM flags. */ #define __VM_UFFD_FLAGS (VM_UFFD_MISSING | VM_UFFD_WP | VM_UFFD_MINOR) -#define __VMA_UFFD_FLAGS mk_vma_flags(VMA_UFFD_MISSING_BIT, VMA_UFFD_WP_BIT, \ - VMA_UFFD_MINOR_BIT) +#define __VMA_UFFD_FLAGS mk_vma_flags_from_masks(VMA_UFFD_MISSING, VMA_UFFD_WP, \ + VMA_UFFD_MINOR)/* * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
include/net/rtnetlink.h +2 -0
@@ -256,6 +256,8 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm,int rtnl_nla_parse_ifinfomsg (struct nlattr **tb,const struct nlattr *nla_peer,struct netlink_ext_ack *exterr);struct net *rtnl_get_net_ns_capable (struct sock *sk,int netnsid); +bool rtnl_dev_link_net_capable (const struct net_device *dev, +const struct net *link_net);#define MODULE_ALIAS_RTNL_LINK (kind) MODULE_ALIAS("rtnl-link-" kind)
kernel/bpf/cgroup.c +1 -1
@@ -1936,7 +1936,7 @@ int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,kfree (ctx.cur_val);if (ret ==1 && ctx.new_updated) { -kfree (*buf); +kvfree (*buf); *buf = ctx.new_val; *pcount = ctx.new_len; }else {
kernel/fork.c +1 -0
@@ -2314,6 +2314,7 @@ __latent_entropy struct task_struct *copy_process(#ifdef CONFIG_BLOCK p->plug =NULL ; + p->flags &= ~PF_BLOCK_TS ;#endif futex_init_task (p);
kernel/sched/core.c +21 -6
@@ -5252,6 +5252,12 @@ static struct rq *finish_task_switch(struct task_struct *prev)*/ kmap_local_sched_in (); +/* +* Any cached block-layer timestamp (plug->cur_ktime) is stale now, +* invalidate it. +*/ +blk_plug_invalidate_ts (); +fire_sched_in_preempt_notifiers (current);/* * When switching through a kernel thread, the loop in
@@ -7251,12 +7257,10 @@ static inline void sched_submit_work(struct task_struct *tsk)static void sched_update_worker (struct task_struct *tsk) { -if (tsk->flags & (PF_WQ_WORKER |PF_IO_WORKER |PF_BLOCK_TS )) { -if (tsk->flags &PF_BLOCK_TS ) -blk_plug_invalidate_ts (tsk); +if (tsk->flags & (PF_WQ_WORKER |PF_IO_WORKER )) {if (tsk->flags &PF_WQ_WORKER )wq_worker_running (tsk); -else if (tsk->flags &PF_IO_WORKER ) +else io_wq_worker_running (tsk); } }
@@ -10876,8 +10880,19 @@ static void mm_cid_fixup_cpus_to_tasks(struct mm_struct *mm) }else if (rq->curr->mm == mm && rq->curr->mm_cid.active) {unsigned int cid = rq->curr->mm_cid.cid; -/* Ensure it has the transition bit set */ -if (!cid_in_transit (cid)) { +/* +* Set the transition bit only on a genuine task-owned +* CID. A running active task can legitimately have +* MM_CID_UNSET here: in per-CPU mode CIDs are assigned +* lazily on schedule-in, so the fork()/execve() window +* leaves the task active with no owned CID. Setting the +* transition bit on MM_CID_UNSET would later feed +* clear_bit() an out-of-bounds bit number via +* mm_cid_schedout(), so exclude it. A CPU-owned +* (MM_CID_ONCPU) CID is handled by the cid_on_cpu() +* branch above and never reaches here. +*/ +if (cid !=MM_CID_UNSET && !cid_in_transit (cid)) { cid =cid_to_transit_cid (cid); rq->curr->mm_cid.cid = cid; pcp->cid = cid;
net/9p/client.c +2 -1
@@ -1092,7 +1092,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, clunk_fid:kfree (wqids); -p9_fid_put (fid); +if (fid != oldfid) +p9_fid_put (fid); fid =NULL ; error:
net/batman-adv/bat_iv_ogm.c +10 -1
@@ -311,14 +311,23 @@ batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len, const struct batadv_ogm_packet *ogm_packet) {int next_buff_pos =0 ; +u16 tvlv_len;/* check if there is enough space for the header */ next_buff_pos += buff_pos +sizeof (*ogm_packet);if (next_buff_pos > packet_len)return false; + tvlv_len =ntohs (ogm_packet->tvlv_len); + +/* the fields of an aggregated OGM are accessed assuming (at least) +* 2-byte alignment, so a following OGM must start at an even offset. +*/ +if (tvlv_len &1 ) +return false; +/* check if there is enough space for the optional TVLV */ - next_buff_pos +=ntohs (ogm_packet->tvlv_len); + next_buff_pos += tvlv_len;return next_buff_pos <= packet_len; }
net/batman-adv/bat_v.c +1 -0
@@ -817,6 +817,7 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface) hard_iface->bat_v.aggr_len =0 ;skb_queue_head_init (&hard_iface->bat_v.aggr_list); + hard_iface->bat_v.aggr_list_enabled = false;INIT_DELAYED_WORK (&hard_iface->bat_v.aggr_wq, batadv_v_ogm_aggr_work); }
net/batman-adv/bat_v_ogm.c +22 -1
@@ -252,11 +252,18 @@ static void batadv_v_ogm_queue_on_if(struct batadv_priv *bat_priv, }spin_lock_bh (&hard_iface->bat_v.aggr_list.lock); +if (!hard_iface->bat_v.aggr_list_enabled) { +kfree_skb (skb); + goto unlock; + } +if (!batadv_v_ogm_queue_left (skb, hard_iface))batadv_v_ogm_aggr_send (bat_priv, hard_iface); hard_iface->bat_v.aggr_len +=batadv_v_ogm_len (skb);__skb_queue_tail (&hard_iface->bat_v.aggr_list, skb); + +unlock:spin_unlock_bh (&hard_iface->bat_v.aggr_list.lock); }
@@ -417,6 +424,10 @@ int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface) {struct batadv_priv *bat_priv =netdev_priv (hard_iface->mesh_iface); +spin_lock_bh (&hard_iface->bat_v.aggr_list.lock); + hard_iface->bat_v.aggr_list_enabled = true; +spin_unlock_bh (&hard_iface->bat_v.aggr_list.lock); +batadv_v_ogm_start_queue_timer (hard_iface);batadv_v_ogm_start_timer (bat_priv);
@@ -432,6 +443,7 @@ void batadv_v_ogm_iface_disable(struct batadv_hard_iface *hard_iface)cancel_delayed_work_sync (&hard_iface->bat_v.aggr_wq);spin_lock_bh (&hard_iface->bat_v.aggr_list.lock); + hard_iface->bat_v.aggr_list_enabled = false;batadv_v_ogm_aggr_list_free (hard_iface);spin_unlock_bh (&hard_iface->bat_v.aggr_list.lock); }
@@ -837,14 +849,23 @@ batadv_v_ogm_aggr_packet(int buff_pos, int packet_len, const struct batadv_ogm2_packet *ogm2_packet) {int next_buff_pos =0 ; +u16 tvlv_len;/* check if there is enough space for the header */ next_buff_pos += buff_pos +sizeof (*ogm2_packet);if (next_buff_pos > packet_len)return false; + tvlv_len =ntohs (ogm2_packet->tvlv_len); + +/* the fields of an aggregated OGMv2 are accessed assuming (at least) +* 2-byte alignment, so a following OGMv2 must start at an even offset. +*/ +if (tvlv_len &1 ) +return false; +/* check if there is enough space for the optional TVLV */ - next_buff_pos +=ntohs (ogm2_packet->tvlv_len); + next_buff_pos += tvlv_len;return next_buff_pos <= packet_len; }
net/batman-adv/bridge_loop_avoidance.c +14 -14
@@ -512,7 +512,7 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, const u8 *orig,return NULL ; entry->vid = vid; - entry->lasttime = jiffies; +WRITE_ONCE (entry->lasttime, jiffies); entry->crc =BATADV_BLA_CRC_INIT ; entry->bat_priv = bat_priv;spin_lock_init (&entry->crc_lock);
@@ -580,7 +580,7 @@ batadv_bla_update_own_backbone_gw(struct batadv_priv *bat_priv,if (unlikely (!backbone_gw))return ; - backbone_gw->lasttime = jiffies; +WRITE_ONCE (backbone_gw->lasttime, jiffies);batadv_backbone_gw_put (backbone_gw); }
@@ -714,7 +714,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,ether_addr_copy (claim->addr, mac);spin_lock_init (&claim->backbone_lock); claim->vid = vid; - claim->lasttime = jiffies; +WRITE_ONCE (claim->lasttime, jiffies);kref_get (&backbone_gw->refcount); claim->backbone_gw = backbone_gw;kref_init (&claim->refcount);
@@ -736,7 +736,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,return ; } }else { - claim->lasttime = jiffies; +WRITE_ONCE (claim->lasttime, jiffies);if (claim->backbone_gw == backbone_gw)/* no need to register a new backbone */ goto claim_free_ref;
@@ -769,7 +769,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,spin_lock_bh (&backbone_gw->crc_lock); backbone_gw->crc ^=crc16 (0 , claim->addr,ETH_ALEN );spin_unlock_bh (&backbone_gw->crc_lock); - backbone_gw->lasttime = jiffies; +WRITE_ONCE (backbone_gw->lasttime, jiffies); claim_free_ref:batadv_claim_put (claim);
@@ -858,7 +858,7 @@ static bool batadv_handle_announce(struct batadv_priv *bat_priv, u8 *an_addr,return true;/* handle as ANNOUNCE frame */ - backbone_gw->lasttime = jiffies; +WRITE_ONCE (backbone_gw->lasttime, jiffies); crc =ntohs (*((__force __be16 *)(&an_addr[4 ]))); batadv_dbg(BATADV_DBG_BLA, bat_priv,
@@ -1253,7 +1253,7 @@ static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now) head, hash_entry) {if (now) goto purge_now; -if (!batadv_has_timed_out (backbone_gw->lasttime, +if (!batadv_has_timed_out (READ_ONCE (backbone_gw->lasttime),BATADV_BLA_BACKBONE_TIMEOUT ))continue ;
@@ -1334,7 +1334,7 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv, primary_if->net_dev->dev_addr)) goto skip; -if (!batadv_has_timed_out (claim->lasttime, +if (!batadv_has_timed_out (READ_ONCE (claim->lasttime),BATADV_BLA_CLAIM_TIMEOUT )) goto skip;
@@ -1494,7 +1494,7 @@ static void batadv_bla_periodic_work(struct work_struct *work)eth_random_addr (bat_priv->bla.loopdetect_addr); bat_priv->bla.loopdetect_addr[0 ] =0xba ; bat_priv->bla.loopdetect_addr[1 ] =0xbe ; - bat_priv->bla.loopdetect_lasttime = jiffies; +WRITE_ONCE (bat_priv->bla.loopdetect_lasttime, jiffies);atomic_set (&bat_priv->bla.loopdetect_next,BATADV_BLA_LOOPDETECT_PERIODS );
@@ -1515,7 +1515,7 @@ static void batadv_bla_periodic_work(struct work_struct *work) primary_if->net_dev->dev_addr))continue ; - backbone_gw->lasttime = jiffies; +WRITE_ONCE (backbone_gw->lasttime, jiffies);batadv_bla_send_announce (bat_priv, backbone_gw);if (send_loopdetect)
@@ -1899,7 +1899,7 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb,/* If the packet came too late, don't forward it on the mesh * but don't consider that as loop. It might be a coincidence. */ -if (batadv_has_timed_out (bat_priv->bla.loopdetect_lasttime, +if (batadv_has_timed_out (READ_ONCE (bat_priv->bla.loopdetect_lasttime),BATADV_BLA_LOOPDETECT_TIMEOUT ))return true;
@@ -2014,7 +2014,7 @@ bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,if (own_claim) {/* ... allow it in any case */ - claim->lasttime = jiffies; +WRITE_ONCE (claim->lasttime, jiffies); goto allow; }
@@ -2116,7 +2116,7 @@ bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,/* if yes, the client has roamed and we have * to unclaim it. */ -if (batadv_has_timed_out (claim->lasttime,100 )) { +if (batadv_has_timed_out (READ_ONCE (claim->lasttime),100 )) {/* only unclaim if the last claim entry is * older than 100 ms to make sure we really * have a roaming client here.
@@ -2361,7 +2361,7 @@ batadv_bla_backbone_dump_entry(struct sk_buff *msg, u32 portid, backbone_crc = backbone_gw->crc;spin_unlock_bh (&backbone_gw->crc_lock); - msecs =jiffies_to_msecs (jiffies - backbone_gw->lasttime); + msecs =jiffies_to_msecs (jiffies -READ_ONCE (backbone_gw->lasttime));if (is_own)if (nla_put_flag (msg,BATADV_ATTR_BLA_OWN )) {
net/batman-adv/distributed-arp-table.c +9 -3
@@ -214,10 +214,13 @@ static void batadv_dat_purge(struct work_struct *work)*/ static bool batadv_compare_dat (const struct hlist_node *node,const void *data2) { - const void *data1 = container_of(node, struct batadv_dat_entry, - hash_entry); +const struct batadv_dat_entry *entry1; +const struct batadv_dat_entry *entry2; -return memcmp (data1, data2,sizeof (__be32)) ==0 ; + entry1 = container_of(node, struct batadv_dat_entry, hash_entry); + entry2 = data2; + +return entry1->ip == entry2->ip && entry1->vid == entry2->vid; }/**
@@ -344,6 +347,9 @@ batadv_dat_entry_hash_find(struct batadv_priv *bat_priv, __be32 ip,if (dat_entry->ip != ip)continue ; +if (dat_entry->vid != vid) +continue ; +if (!kref_get_unless_zero (&dat_entry->refcount))continue ;
net/batman-adv/fragmentation.c +21 -1
@@ -384,6 +384,8 @@ bool batadv_frag_skb_buffer(struct sk_buff **skb,* @skb: skb to forward * @recv_if: interface that the skb is received on * @orig_node_src: originator that the skb is received from +* @rx_result: set to NET_RX_SUCCESS when the fragment was forwarded and +* NET_RX_DROP when it was dropped; only valid when true is returned * * Look up the next-hop of the fragments payload and check if the merged packet * will exceed the MTU towards the next-hop. If so, the fragment is forwarded
@@ -393,7 +395,8 @@ bool batadv_frag_skb_buffer(struct sk_buff **skb,*/ bool batadv_frag_skb_fwd (struct sk_buff *skb,struct batadv_hard_iface *recv_if, -struct batadv_orig_node *orig_node_src) +struct batadv_orig_node *orig_node_src, +int *rx_result) {struct batadv_priv *bat_priv =netdev_priv (recv_if->mesh_iface);struct batadv_neigh_node *neigh_node =NULL ;
@@ -412,12 +415,29 @@ bool batadv_frag_skb_fwd(struct sk_buff *skb,*/ total_size =ntohs (packet->total_size);if (total_size > neigh_node->if_incoming->net_dev->mtu) { +if (packet->ttl <2 ) { +kfree_skb (skb); + *rx_result =NET_RX_DROP ; + ret = true; + goto out; + } + +if (skb_cow (skb,ETH_HLEN ) <0 ) { +kfree_skb (skb); + *rx_result =NET_RX_DROP ; + ret = true; + goto out; + } + + packet = (struct batadv_frag_packet *)skb->data; +batadv_inc_counter (bat_priv,BATADV_CNT_FRAG_FWD );batadv_add_counter (bat_priv,BATADV_CNT_FRAG_FWD_BYTES , skb->len +ETH_HLEN ); packet->ttl--;batadv_send_unicast_skb (skb, neigh_node); + *rx_result =NET_RX_SUCCESS ; ret = true; }
net/batman-adv/fragmentation.h +2 -1
@@ -19,7 +19,8 @@ void batadv_frag_purge_orig(struct batadv_orig_node *orig, bool (*check_cb)(struct batadv_frag_table_entry *));bool batadv_frag_skb_fwd (struct sk_buff *skb,struct batadv_hard_iface *recv_if, -struct batadv_orig_node *orig_node_src); +struct batadv_orig_node *orig_node_src, +int *rx_result);bool batadv_frag_skb_buffer (struct sk_buff **skb,struct batadv_orig_node *orig_node); int batadv_frag_send_packet(struct sk_buff *skb,
net/batman-adv/hard-interface.c +2 -26
@@ -786,30 +786,6 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,return ret; } -/** -* batadv_hardif_cnt() - get number of interfaces enslaved to mesh interface -* @mesh_iface: mesh interface to check -* -* This function is only using RCU for locking - the result can therefore be -* off when another function is modifying the list at the same time. The -* caller can use the rtnl_lock to make sure that the count is accurate. -* -* Return: number of connected/enslaved hard interfaces -*/ -static size_t batadv_hardif_cnt (struct net_device *mesh_iface) -{ -struct batadv_hard_iface *hard_iface; -struct list_head *iter; -size_t count =0 ; - -rcu_read_lock (); -netdev_for_each_lower_private_rcu (mesh_iface, hard_iface, iter) - count++; -rcu_read_unlock (); - -return count; -} -/** * batadv_hardif_disable_interface() - Remove hard interface from mesh interface * @hard_iface: hard interface to be removed
@@ -850,8 +826,8 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface)netdev_upper_dev_unlink (hard_iface->net_dev, hard_iface->mesh_iface);batadv_hardif_recalc_extra_skbroom (hard_iface->mesh_iface); -/* nobody uses this interface anymore */ -if (batadv_hardif_cnt (hard_iface->mesh_iface) <=1 ) +/* nobody uses this mesh interface anymore */ +if (list_empty (&hard_iface->mesh_iface->adj_list.lower))batadv_gw_check_client_stop (bat_priv); hard_iface->mesh_iface =NULL ;
net/batman-adv/netlink.c +7 -1
@@ -917,9 +917,15 @@ static int batadv_netlink_set_hardif(struct sk_buff *skb,#ifdef CONFIG_BATMAN_ADV_BATMAN_V if (info->attrs[BATADV_ATTR_ELP_INTERVAL ]) { +u32 elp_interval; + attr = info->attrs[BATADV_ATTR_ELP_INTERVAL ]; + elp_interval =nla_get_u32 (attr); + + elp_interval =min_t (u32, elp_interval,INT_MAX ); + elp_interval =max_t (u32, elp_interval,BATADV_JITTER ); -atomic_set (&hard_iface->bat_v.elp_interval,nla_get_u32 (attr)); +atomic_set (&hard_iface->bat_v.elp_interval, elp_interval); }if (info->attrs[BATADV_ATTR_THROUGHPUT_OVERRIDE ]) {
net/batman-adv/routing.c +69 -4
111 lines not on this page · raw message
net/batman-adv/tp_meter.c +75 -38
18 lines not on this page · raw message
net/batman-adv/tvlv.c +63 -6
69 lines not on this page · raw message
security/apparmor/include/policy_unpack.h +19 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.