Linux 5.8.18
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.8.18 kernel.
All users of the 5.8 kernel series must upgrade.
NOTE, this is the LAST 5.8.y release to be made, this branch is now end-of-life. Please move to the 5.9.y kernel branch at this point in time.
The updated 5.8.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.8.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 | 2 arch/arm64/Makefile | 4 arch/arm64/kernel/cpu_errata.c | 15 arch/openrisc/include/asm/uaccess.h | 35 - arch/powerpc/Kconfig | 2 arch/powerpc/include/asm/string.h | 2 arch/powerpc/include/asm/uaccess.h | 40 - arch/powerpc/lib/Makefile | 2 arch/powerpc/lib/copy_mc_64.S | 242 +++++++ arch/powerpc/lib/memcpy_mcsafe_64.S | 242 ------- arch/x86/Kconfig | 2 arch/x86/Kconfig.debug | 2 arch/x86/events/amd/ibs.c | 15 arch/x86/include/asm/copy_mc_test.h | 75 ++ arch/x86/include/asm/mce.h | 9 arch/x86/include/asm/mcsafe_test.h | 75 -- arch/x86/include/asm/string_64.h | 32 arch/x86/include/asm/uaccess.h | 9 arch/x86/include/asm/uaccess_64.h | 20 arch/x86/kernel/cpu/mce/core.c | 8 arch/x86/kernel/quirks.c | 10 arch/x86/kernel/traps.c | 2 arch/x86/lib/Makefile | 1 arch/x86/lib/copy_mc.c | 96 ++ arch/x86/lib/copy_mc_64.S | 163 ++++ arch/x86/lib/memcpy_64.S | 115 --- arch/x86/lib/usercopy_64.c | 21 arch/x86/pci/intel_mid_pci.c | 1 arch/x86/xen/enlighten_pv.c | 9 drivers/ata/ahci.h | 2 drivers/ata/ahci_mvebu.c | 2 drivers/ata/libahci_platform.c | 2 drivers/ata/sata_rcar.c | 2 drivers/base/firmware_loader/fallback_platform.c | 2 drivers/crypto/chelsio/chtls/chtls_cm.c | 29 drivers/crypto/chelsio/chtls/chtls_io.c | 7 drivers/firmware/efi/libstub/arm64-stub.c | 8 drivers/firmware/efi/libstub/fdt.c | 4 drivers/gpu/drm/i915/i915_debugfs.c | 2 drivers/infiniband/core/addr.c | 11 drivers/md/dm-writecache.c | 15 drivers/misc/cardreader/rtsx_pcr.c | 4 drivers/misc/cxl/pci.c | 4 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 49 - drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 56 - drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h | 4 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 drivers/net/ethernet/ibm/ibmveth.c | 6 drivers/net/ethernet/ibm/ibmvnic.c | 8 drivers/net/ethernet/mellanox/mlxsw/core.c | 2 drivers/net/ethernet/realtek/r8169_main.c | 4 drivers/net/ethernet/renesas/ravb_main.c | 10 drivers/net/gtp.c | 16 drivers/net/ipa/gsi_trans.c | 21 drivers/net/wireless/intersil/p54/p54pci.c | 4 drivers/nvdimm/claim.c | 2 drivers/nvdimm/pmem.c | 6 drivers/pci/controller/pci-aardvark.c | 4 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 drivers/tty/serial/amba-pl011.c | 11 drivers/tty/serial/qcom_geni_serial.c | 2 drivers/xen/gntdev.c | 17 fs/efivarfs/super.c | 3 fs/erofs/xattr.c | 2 fs/exec.c | 6 fs/file.c | 2 fs/fuse/dev.c | 28 fs/io-wq.c | 172 ++--- fs/io-wq.h | 1 fs/io_uring.c | 475 ++++++++++---- include/linux/fs.h | 1 include/linux/io_uring.h | 53 + include/linux/mtd/pfow.h | 2 include/linux/pm.h | 2 include/linux/qcom-geni-se.h | 3 include/linux/sched.h | 5 include/linux/string.h | 9 include/linux/uaccess.h | 13 include/linux/uio.h | 10 include/net/netfilter/nf_tables.h | 6 include/uapi/linux/bpf.h | 4 init/init_task.c | 3 kernel/fork.c | 6 lib/Kconfig | 7 lib/iov_iter.c | 48 - net/ipv4/tcp.c | 2 net/ipv4/tcp_input.c | 3 net/netfilter/nf_tables_api.c | 6 net/netfilter/nf_tables_offload.c | 4 net/sched/act_mpls.c | 1 net/sched/cls_api.c | 4 net/sched/sch_netem.c | 9 net/tipc/msg.c | 5 scripts/setlocalversion | 21 security/integrity/evm/evm_main.c | 6 tools/arch/x86/include/asm/mcsafe_test.h | 13 tools/arch/x86/lib/memcpy_64.S | 115 --- tools/include/uapi/linux/bpf.h | 4 tools/objtool/check.c | 5 tools/perf/bench/Build | 1 tools/perf/bench/mem-memcpy-x86-64-lib.c | 24 tools/testing/nvdimm/test/nfit.c | 49 - tools/testing/selftests/powerpc/copyloops/.gitignore | 2 tools/testing/selftests/powerpc/copyloops/Makefile | 6 tools/testing/selftests/powerpc/copyloops/copy_mc_64.S | 242 +++++++ 107 files changed, 1834 insertions(+), 1147 deletions(-)
Aleksandr Nogikh (1):
netem: fix zero division in tabledist
Alex Elder (1):
net: ipa: command payloads already mapped
Andrew Gabbasov (1):
ravb: Fix bit fields checking in ravb_hwtstamp_get()
Ard Biesheuvel (1):
efi/arm64: libstub: Deal gracefully with EFI_RNG_PROTOCOL failure
Arjun Roy (1):
tcp: Prevent low rmem stalls with SO_RCVLOWAT.
Chris Wilson (1):
drm/i915/gem: Serialise debugfs i915_gem_objects with ctx->mutex
Dan Williams (2):
x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}() x86/copy_mc: Introduce copy_mc_enhanced_fast_string()
Frederic Barrat (1):
cxl: Rework error message for incompatible slots
Gao Xiang (1):
erofs: avoid duplicated permission check for "trusted." xattrs
Geert Uytterhoeven (1):
ata: sata_rcar: Fix DMA boundary mask
Greg Kroah-Hartman (1):
Linux 5.8.18
Grygorii Strashko (1):
PM: runtime: Fix timer_expires data type on 32-bit arches
Guillaume Nault (1):
net/sched: act_mpls: Add softdep on mpls_gso.ko
Gustavo A. R. Silva (1):
mtd: lpddr: Fix bad logic in print_drs_error
Heiner Kallweit (1):
r8169: fix issue with forced threading in combination with shared interrupts
Hillf Danton (1):
io-wq: fix use-after-free in io_wq_worker_running
Ido Schimmel (1):
mlxsw: core: Fix memory leak on module removal
Jason Gunthorpe (1):
RDMA/addr: Fix race with netevent_callback()/rdma_addr_cancel()
Jens Axboe (10):
io_uring: don't run task work on an exiting task
io_uring: allow timeout/poll/files killing to take task into account
io_uring: move dropping of files into separate helper
io_uring: stash ctx task reference for SQPOLL
io_uring: unconditionally grab req->task
io_uring: return cancelation status from poll/timeout/files handlers
io_uring: enable task/files specific overflow flushing
io_uring: don't rely on weak ->files references
io_uring: reference ->nsproxy for file table commands
io_uring: no need to call xa_destroy() on empty xarray
Jia-Ju Bai (1):
p54: avoid accessing the data mapped to streaming DMA
Juergen Gross (1):
x86/xen: disable Firmware First mode for correctable memory errors
Kees Cook (1):
fs/kernel_read_file: Remove FIRMWARE_EFI_EMBEDDED enum
Kim Phillips (1):
arch/x86/amd/ibs: Fix re-arming IBS Fetch
Leon Romanovsky (1):
net: protect tcf_block_unbind with block lock
Lijun Pan (1):
ibmvnic: fix ibmvnic_set_mac
Marc Zyngier (2):
arm64: Run ARCH_WORKAROUND_1 enabling code on all CPUs
arm64: Run ARCH_WORKAROUND_2 enabling code on all CPUs
Masahiro Fujiwara (1):
gtp: fix an use-before-init in gtp_newlink()
Matthew Wilcox (Oracle) (3):
io_uring: Fix use of XArray in __io_uring_files_cancel
io_uring: Fix XArray usage in io_uring_add_task_file
io_uring: Convert advanced XArray uses to the normal API
Michael Chan (1):
bnxt_en: Check abort error state in bnxt_open_nic().
Michael Schaller (1):
efivarfs: Replace invalid slashes with exclamation marks in dentries.
Miklos Szeredi (1):
fuse: fix page dereference after free
Nick Desaulniers (1):
arm64: link with -z norelro regardless of CONFIG_RELOCATABLE
Pali Rohár (3):
PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
ata: ahci: mvebu: Make SATA PHY optional for Armada 3720
phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
Paras Sharma (1):
serial: qcom_geni_serial: To correct QUP Version detection logic
Peter Zijlstra (1):
serial: pl011: Fix lockdep splat when handling magic-sysrq interrupt
Raju Rangoju (1):
cxgb4: set up filter action after rewrites
Randy Dunlap (1):
x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled
Rasmus Villemoes (1):
scripts/setlocalversion: make git describe output more reliable
Ricky Wu (1):
misc: rtsx: do not setting OC_POWER_DOWN reg in rtsx_pci_init_ocp()
Roberto Sassu (1):
evm: Check size of security.evm before using it
Saeed Mirzamohammadi (1):
netfilter: nftables_offload: KASAN slab-out-of-bounds Read in nft_flow_rule_create
Sebastian Andrzej Siewior (1):
io_wq: Make io_wqe::lock a raw_spinlock_t
Song Liu (1):
bpf: Fix comment for helper bpf_current_task_under_cgroup()
Souptick Joarder (1):
xen/gntdev.c: Mark pages as dirty
Stafford Horne (1):
openrisc: Fix issue with get_user for 64-bit values
Thomas Bogendoerfer (1):
ibmveth: Fix use of ibmveth in a bridge.
Thomas Gleixner (1):
x86/traps: Fix #DE Oops message regression
Tung Nguyen (1):
tipc: fix memory leak caused by tipc_buf_append()
Vasundhara Volam (4):
bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one().
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.
bnxt_en: Re-write PCI BARs after PCI fatal error.
bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally.
Vinay Kumar Yadav (3):
chelsio/chtls: fix deadlock issue chelsio/chtls: fix memory leaks in CPL handlers chelsio/chtls: fix tls record info to user
Zenghui Yu (1):
net: hns3: Clear the CMDQ registers before unmapping BAR region
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 8 -SUBLEVEL = 17 +SUBLEVEL = 18 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm64/Makefile +2 -2
@@ -10,14 +10,14 @@ # # Copyright (C) 1995-2001 by Russell King -LDFLAGS_vmlinux :=--no-undefined -X +LDFLAGS_vmlinux :=--no-undefined -X -z norelro CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) ifeq ($(CONFIG_RELOCATABLE), y) # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour # for relative relocs, since this leads to better Image compression # with the relocation offsets always being zero. -LDFLAGS_vmlinux += -shared -Bsymbolic -z notext -z norelro \ +LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \ $(call ld-option, --no-apply-dynamic-relocs) endif
arch/arm64/kernel/cpu_errata.c +15 -0
@@ -457,6 +457,12 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,return required; } +static void cpu_enable_ssbd_mitigation (const struct arm64_cpu_capabilities *cap) +{ +if (ssbd_state !=ARM64_SSBD_FORCE_DISABLE ) + cap->matches (cap,SCOPE_LOCAL_CPU ); +} +/* known invulnerable cores */ static const struct midr_range arm64_ssb_cpus[] = {MIDR_ALL_VERSIONS (MIDR_CORTEX_A35 ),
@@ -599,6 +605,12 @@ check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope)return (need_wa >0 ); } +static void +cpu_enable_branch_predictor_hardening (const struct arm64_cpu_capabilities *cap) +{ + cap->matches (cap,SCOPE_LOCAL_CPU ); +} +static const __maybe_unused struct midr_range tx2_family_cpus[] = {MIDR_ALL_VERSIONS (MIDR_BRCM_VULCAN ),MIDR_ALL_VERSIONS (MIDR_CAVIUM_THUNDERX2 ),
@@ -890,9 +902,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = { },#endif { + .desc = "Branch predictor hardening", .capability = ARM64_HARDEN_BRANCH_PREDICTOR, .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = check_branch_predictor, + .cpu_enable = cpu_enable_branch_predictor_hardening, }, #ifdef CONFIG_HARDEN_EL2_VECTORS {
@@ -906,6 +920,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { .capability = ARM64_SSBD, .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = has_ssbd_mitigation, + .cpu_enable = cpu_enable_ssbd_mitigation, .midr_range_list = arm64_ssb_cpus, },#ifdef CONFIG_ARM64_ERRATUM_1418040
arch/openrisc/include/asm/uaccess.h +22 -13
@@ -164,19 +164,19 @@ struct __large_struct {#define __get_user_nocheck (x, ptr, size) \ ({ \ - long __gu_err, __gu_val; \ - __get_user_size(__gu_val, (ptr), (size), __gu_err); \ - (x) = (__force __typeof__(*(ptr)))__gu_val; \ + long __gu_err; \ + __get_user_size((x), (ptr), (size), __gu_err); \ __gu_err; \ })#define __get_user_check (x, ptr, size) \ ({ \ - long __gu_err = -EFAULT, __gu_val = 0; \ - const __typeof__(*(ptr)) * __gu_addr = (ptr); \ - if (access_ok(__gu_addr, size)) \ - __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ - (x) = (__force __typeof__(*(ptr)))__gu_val; \ + long __gu_err = -EFAULT; \ + const __typeof__(*(ptr)) *__gu_addr = (ptr); \ + if (access_ok(__gu_addr, size)) \ + __get_user_size((x), __gu_addr, (size), __gu_err); \ + else \ + (x) = (__typeof__(*(ptr))) 0; \ __gu_err; \ })
@@ -190,11 +190,13 @@ do { \case 2 :__get_user_asm (x, ptr, retval,"l.lhz" );break ; \case 4 :__get_user_asm (x, ptr, retval,"l.lwz" );break ; \case 8 :__get_user_asm2 (x, ptr, retval);break ; \ -default : (x) =__get_user_bad (); \ +default : (x) = (__typeof__ (*(ptr )))__get_user_bad (); \ } \ } while (0)#define __get_user_asm (x, addr, err, op) \ +{ \ + unsigned long __gu_tmp; \ __asm__ __volatile__( \ "1: "op" %1,0(%2)\n" \ "2:\n" \
@@ -208,10 +210,14 @@ do { \ " .align 2\n" \ " .long 1b,3b\n" \ ".previous" \ - : "=r"(err), "=r"(x) \ - : "r"(addr), "i"(-EFAULT), "0"(err)) + : "=r"(err), "=r"(__gu_tmp) \ + : "r"(addr), "i"(-EFAULT), "0"(err)); \ + (x) = (__typeof__ (*(addr )))__gu_tmp; \ +}#define __get_user_asm2 (x, addr, err) \ +{ \ + unsigned long long __gu_tmp; \ __asm__ __volatile__( \ "1: l.lwz %1,0(%2)\n" \ "2: l.lwz %H1,4(%2)\n" \
@@ -228,8 +234,11 @@ do { \ " .long 1b,4b\n" \ " .long 2b,4b\n" \ ".previous" \ - : "=r"(err), "=&r"(x) \ - : "r"(addr), "i"(-EFAULT), "0"(err)) + : "=r"(err), "=&r"(__gu_tmp) \ + : "r"(addr), "i"(-EFAULT), "0"(err)); \ + (x) = (__typeof__ (*(addr )))( \ + (__typeof__((x)-(x)))__gu_tmp); \ +}/* more complex routines */
arch/powerpc/Kconfig +1 -1
@@ -135,7 +135,7 @@ config PPC select ARCH_HAS_STRICT_KERNEL_RWX if (PPC32 && !HIBERNATION) select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_UACCESS_FLUSHCACHE - select ARCH_HAS_UACCESS_MCSAFE if PPC64 + select ARCH_HAS_COPY_MC if PPC64 select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_KEEP_MEMBLOCK
arch/powerpc/include/asm/string.h +0 -2
@@ -53,9 +53,7 @@ void *__memmove(void *to, const void *from, __kernel_size_t n);#ifndef CONFIG_KASAN #define __HAVE_ARCH_MEMSET32#define __HAVE_ARCH_MEMSET64 -#define __HAVE_ARCH_MEMCPY_MCSAFE -extern int memcpy_mcsafe (void *dst,const void *src,__kernel_size_t sz);extern void *__memset16 (uint16_t *,uint16_t v,__kernel_size_t );extern void *__memset32 (uint32_t *,uint32_t v,__kernel_size_t );extern void *__memset64 (uint64_t *,uint64_t v,__kernel_size_t );
arch/powerpc/include/asm/uaccess.h +26 -14
@@ -436,6 +436,32 @@ do { \extern unsigned long __copy_tofrom_user (void __user *to,const void __user *from,unsigned long size); +#ifdef CONFIG_ARCH_HAS_COPY_MC +unsigned long __must_check +copy_mc_generic (void *to,const void *from,unsigned long size); + +static inline unsigned long __must_check +copy_mc_to_kernel (void *to,const void *from,unsigned long size) +{ +return copy_mc_generic (to, from, size); +} +#define copy_mc_to_kernel copy_mc_to_kernel + +static inline unsigned long __must_check +copy_mc_to_user (void __user *to,const void *from,unsigned long n) +{ +if (likely (check_copy_size (from, n, true))) { +if (access_ok (to, n)) { +allow_write_to_user (to, n); + n =copy_mc_generic ((void *)to, from, n); +prevent_write_to_user (to, n); + } + } + +return n; +} +#endif +#ifdef __powerpc64__static inline unsigned long raw_copy_in_user (void __user *to,const void __user *from,unsigned long n)
@@ -524,20 +550,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)return ret; } -static __always_inline unsigned long __must_check -copy_to_user_mcsafe (void __user *to,const void *from,unsigned long n) -{ -if (likely (check_copy_size (from, n, true))) { -if (access_ok (to, n)) { -allow_write_to_user (to, n); - n =memcpy_mcsafe ((void *)to, from, n); -prevent_write_to_user (to, n); - } - } - -return n; -} -unsigned long __arch_clear_user (void __user *addr,unsigned long size);static inline unsigned long clear_user (void __user *addr,unsigned long size)
arch/powerpc/lib/Makefile +1 -1
@@ -39,7 +39,7 @@ obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \ memcpy_power7.o obj64-y += copypage_64.o copyuser_64.o mem_64.o hweight_64.o \ - memcpy_64.o memcpy_mcsafe_64.o + memcpy_64.o copy_mc_64.o obj64-$(CONFIG_SMP) += locks.o obj64-$(CONFIG_ALTIVEC) += vmx-helper.o
arch/powerpc/lib/copy_mc_64.S new file +242 -0
242 lines not on this page · raw message
arch/powerpc/lib/memcpy_mcsafe_64.S deleted +0 -242
242 lines not on this page · raw message
arch/x86/Kconfig +1 -1
@@ -75,7 +75,7 @@ config X86 select ARCH_HAS_PTE_DEVMAP if X86_64 select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_UACCESS_FLUSHCACHE if X86_64 - select ARCH_HAS_UACCESS_MCSAFE if X86_64 && X86_MCE + select ARCH_HAS_COPY_MC if X86_64 select ARCH_HAS_SET_MEMORY select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_STRICT_KERNEL_RWX
arch/x86/Kconfig.debug +1 -1
@@ -59,7 +59,7 @@ config EARLY_PRINTK_USB_XDBC You should normally say N here, unless you want to debug early crashes or need a very simple printk logging facility. -config MCSAFE_TEST +config COPY_MC_TEST def_bool n config EFI_PGT_DUMP
arch/x86/events/amd/ibs.c +14 -1
@@ -89,6 +89,7 @@ struct perf_ibs {u64 max_period;unsigned long offset_mask[1 ];int offset_max; + unsigned int fetch_count_reset_broken : 1;struct cpu_perf_ibs __percpu *pcpu;struct attribute **format_attrs;
@@ -363,7 +364,12 @@ perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event,static inline void perf_ibs_enable_event (struct perf_ibs *perf_ibs,struct hw_perf_event *hwc,u64 config) { -wrmsrl (hwc->config_base, hwc->config | config | perf_ibs->enable_mask); +u64 tmp = hwc->config | config; + +if (perf_ibs->fetch_count_reset_broken) +wrmsrl (hwc->config_base, tmp & ~perf_ibs->enable_mask); + +wrmsrl (hwc->config_base, tmp | perf_ibs->enable_mask); }/*
@@ -733,6 +739,13 @@ static __init void perf_event_ibs_init(void) {struct attribute **attr = ibs_op_format_attrs; +/* +* Some chips fail to reset the fetch count when it is written; instead +* they need a 0-1 transition of IbsFetchEn. +*/ +if (boot_cpu_data.x86 >=0x16 && boot_cpu_data.x86 <=0x18 ) + perf_ibs_fetch.fetch_count_reset_broken =1 ; +perf_ibs_pmu_init (&perf_ibs_fetch,"ibs_fetch" );if (ibs_caps &IBS_CAPS_OPCNT ) {
arch/x86/include/asm/copy_mc_test.h new file +75 -0
75 lines not on this page · raw message
arch/x86/include/asm/mce.h +9 -0
@@ -174,6 +174,15 @@ extern void mce_unregister_decode_chain(struct notifier_block *nb);extern int mce_p5_enabled; +#ifdef CONFIG_ARCH_HAS_COPY_MC +extern void enable_copy_mc_fragile (void ); +unsigned long __must_check copy_mc_fragile (void *dst,const void *src,unsigned cnt); +#else +static inline void enable_copy_mc_fragile (void ) +{ +} +#endif +#ifdef CONFIG_X86_MCE int mcheck_init (void );void mcheck_cpu_init (struct cpuinfo_x86 *c);
arch/x86/include/asm/mcsafe_test.h deleted +0 -75
75 lines not on this page · raw message
arch/x86/include/asm/string_64.h +0 -32
@@ -82,38 +82,6 @@ int strcmp(const char *cs, const char *ct);#endif -#define __HAVE_ARCH_MEMCPY_MCSAFE 1 -__must_check unsigned long __memcpy_mcsafe (void *dst,const void *src, -size_t cnt); -DECLARE_STATIC_KEY_FALSE (mcsafe_key); - -/** -* memcpy_mcsafe - copy memory with indication if a machine check happened -* -* @dst: destination address -* @src: source address -* @cnt: number of bytes to copy -* -* Low level memory copy function that catches machine checks -* We only call into the "safe" function on systems that can -* actually do machine check recovery. Everyone else can just -* use memcpy(). -* -* Return 0 for success, or number of bytes not copied if there was an -* exception. -*/ -static __always_inline __must_check unsigned long -memcpy_mcsafe (void *dst,const void *src,size_t cnt) -{ -#ifdef CONFIG_X86_MCE -if (static_branch_unlikely (&mcsafe_key)) -return __memcpy_mcsafe (dst, src, cnt); - else -#endif -memcpy (dst, src, cnt); -return 0 ; -} -#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE #define __HAVE_ARCH_MEMCPY_FLUSHCACHE 1void __memcpy_flushcache (void *dst,const void *src,size_t cnt);
arch/x86/include/asm/uaccess.h +9 -0
@@ -455,6 +455,15 @@ extern __must_check long strnlen_user(const char __user *str, long n);unsigned long __must_check clear_user (void __user *mem,unsigned long len);unsigned long __must_check __clear_user (void __user *mem,unsigned long len); +#ifdef CONFIG_ARCH_HAS_COPY_MC +unsigned long __must_check +copy_mc_to_kernel (void *to,const void *from,unsigned len); +#define copy_mc_to_kernel copy_mc_to_kernel + +unsigned long __must_check +copy_mc_to_user (void *to,const void *from,unsigned len); +#endif +/* * movsl can be slow when source and dest are not both 8-byte aligned */
arch/x86/include/asm/uaccess_64.h +0 -20
@@ -46,22 +46,6 @@ copy_user_generic(void *to, const void *from, unsigned len)return ret; } -static __always_inline __must_check unsigned long -copy_to_user_mcsafe (void *to,const void *from,unsigned len) -{ -unsigned long ret; - -__uaccess_begin (); -/* -* Note, __memcpy_mcsafe() is explicitly used since it can -* handle exceptions / faults. memcpy_mcsafe() may fall back to -* memcpy() which lacks this handling. -*/ - ret =__memcpy_mcsafe (to, from, len); -__uaccess_end (); -return ret; -} -static __always_inline __must_check unsigned long raw_copy_from_user (void *dst,const void __user *src,unsigned long size) {
@@ -102,8 +86,4 @@ __copy_from_user_flushcache(void *dst, const void __user *src, unsigned size)kasan_check_write (dst, size); return __copy_user_flushcache(dst, src, size); } - -unsigned long -mcsafe_handle_tail (char *to,char *from,unsigned len); -#endif /* _ASM_X86_UACCESS_64_H */
arch/x86/kernel/cpu/mce/core.c +2 -6
@@ -40,7 +40,6 @@#include <linux/debugfs.h> #include <linux/irq_work.h> #include <linux/export.h> -#include <linux/jump_label.h> #include <linux/set_memory.h> #include <linux/task_work.h> #include <linux/hardirq.h>
@@ -2122,7 +2121,7 @@ void mce_disable_bank(int bank)and older. * mce=nobootlog Don't log MCEs from before booting. * mce=bios_cmci_threshold Don't program the CMCI threshold -* mce=recovery force enable memcpy_mcsafe() +* mce=recovery force enable copy_mc_fragile() */ static int __init mcheck_enable (char *str) {
@@ -2730,13 +2729,10 @@ static void __init mcheck_debugfs_init(void)static void __init mcheck_debugfs_init (void ) { }#endif -DEFINE_STATIC_KEY_FALSE (mcsafe_key); -EXPORT_SYMBOL_GPL (mcsafe_key); -static int __init mcheck_late_init (void ) {if (mca_cfg.recovery) -static_branch_inc (&mcsafe_key); +enable_copy_mc_fragile ();mcheck_debugfs_init ();
arch/x86/kernel/quirks.c +3 -7
@@ -8,6 +8,7 @@#include <asm/hpet.h> #include <asm/setup.h> +#include <asm/mce.h> #if defined(CONFIG_X86_IO_APIC ) && defined(CONFIG_SMP ) && defined(CONFIG_PCI )
@@ -624,10 +625,6 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev)DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_16H_NB_F3 , amd_disable_seq_and_redirect_scrub); -#if defined(CONFIG_X86_64 ) && defined(CONFIG_X86_MCE ) -#include <linux/jump_label.h> -#include <asm/string_64.h> -/* Ivy Bridge, Haswell, Broadwell */ static void quirk_intel_brickland_xeon_ras_cap (struct pci_dev *pdev) {
@@ -636,7 +633,7 @@ static void quirk_intel_brickland_xeon_ras_cap(struct pci_dev *pdev)pci_read_config_dword (pdev,0x84 , &capid0);if (capid0 &0x10 ) -static_branch_inc (&mcsafe_key); +enable_copy_mc_fragile (); }/* Skylake */
@@ -653,7 +650,7 @@ static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev)* enabled, so memory machine check recovery is also enabled. */ if ((capid0 &0xc0 ) ==0xc0 || (capid5 &0x1e0 )) -static_branch_inc (&mcsafe_key); +enable_copy_mc_fragile (); }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x0ec3 , quirk_intel_brickland_xeon_ras_cap);
@@ -661,7 +658,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x6fc0 , quirk_intel_brickland_xeon_ras_cap);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x2083 , quirk_intel_purley_xeon_ras_cap);#endif -#endif bool x86_apple_machine;EXPORT_SYMBOL (x86_apple_machine);
arch/x86/kernel/traps.c +1 -1
@@ -196,7 +196,7 @@ static __always_inline void __user *error_get_trap_addr(struct pt_regs *regs)DEFINE_IDTENTRY (exc_divide_error) { -do_error_trap (regs,0 ,"divide_error" ,X86_TRAP_DE ,SIGFPE , +do_error_trap (regs,0 ,"divide error" ,X86_TRAP_DE ,SIGFPE ,FPE_INTDIV ,error_get_trap_addr (regs)); }
arch/x86/lib/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o lib-y := delay.o misc.o cmdline.o cpu.o lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o lib-y += memcpy_$(BITS).o +lib-$(CONFIG_ARCH_HAS_COPY_MC) += copy_mc.o copy_mc_64.o lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
arch/x86/lib/copy_mc.c new file +96 -0
96 lines not on this page · raw message
arch/x86/lib/copy_mc_64.S new file +163 -0
163 lines not on this page · raw message
arch/x86/lib/memcpy_64.S +0 -115
124 lines not on this page · raw message
arch/x86/lib/usercopy_64.c +0 -21
@@ -56,27 +56,6 @@ unsigned long clear_user(void __user *to, unsigned long n) }EXPORT_SYMBOL (clear_user); -/* -* Similar to copy_user_handle_tail, probe for the write fault point, -* but reuse __memcpy_mcsafe in case a new read error is encountered. -* clac() is handled in _copy_to_iter_mcsafe(). -*/ -__visible notrace unsigned long -mcsafe_handle_tail (char *to,char *from,unsigned len) -{ -for (; len; --len, to++, from++) { -/* -* Call the assembly routine back directly since -* memcpy_mcsafe() may silently fallback to memcpy. -*/ -unsigned long rem =__memcpy_mcsafe (to, from,1 ); - -if (rem) -break ; - } -return len; -} -#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE /** * clean_cache_range - write back a cache range with CLWB
arch/x86/pci/intel_mid_pci.c +1 -0
@@ -33,6 +33,7 @@#include <asm/hw_irq.h> #include <asm/io_apic.h> #include <asm/intel-mid.h> +#include <asm/acpi.h> #define PCIE_CAP_OFFSET 0x100
arch/x86/xen/enlighten_pv.c +9 -0
@@ -1438,6 +1438,15 @@ asmlinkage __visible void __init xen_start_kernel(void) x86_init.mpparse.get_smp_config = x86_init_uint_noop;xen_boot_params_init_edd (); + +#ifdef CONFIG_ACPI +/* +* Disable selecting "Firmware First mode" for correctable +* memory errors, as this is the duty of the hypervisor to +* decide. +*/ + acpi_disable_cmcff =1 ; +#endif }if (!boot_params.screen_info.orig_video_isVGA)
drivers/ata/ahci.h +2 -0
@@ -240,6 +240,8 @@ enum {as default lpm_policy */ AHCI_HFLAG_SUSPEND_PHYS = (1 <<26 ),/* handle PHYs during suspend/resume */ + AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP +from phy_power_on() */ /* ap->flags bits */
drivers/ata/ahci_mvebu.c +1 -1
@@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = {static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { .plat_config = ahci_mvebu_armada_3700_config, - .flags =AHCI_HFLAG_SUSPEND_PHYS , + .flags =AHCI_HFLAG_SUSPEND_PHYS |AHCI_HFLAG_IGN_NOTSUPP_POWER_ON , };static const struct of_device_id ahci_mvebu_of_match[] = {
drivers/ata/libahci_platform.c +1 -1
@@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahci_host_priv *hpriv) } rc =phy_power_on (hpriv->phys[i]); -if (rc) { +if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags &AHCI_HFLAG_IGN_NOTSUPP_POWER_ON ))) {phy_exit (hpriv->phys[i]); goto disable_phys; }
drivers/ata/sata_rcar.c +1 -1
@@ -120,7 +120,7 @@/* Descriptor table word 0 bit (when DTA32M = 1) */ #define SATA_RCAR_DTEND BIT(0) -#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFEUL +#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFFUL/* Gen2 Physical Layer Control Registers */ #define RCAR_GEN2_PHY_CTL1_REG 0x1704
drivers/base/firmware_loader/fallback_platform.c +1 -1
@@ -17,7 +17,7 @@ int firmware_fallback_platform(struct fw_priv *fw_priv, u32 opt_flags)if (!(opt_flags &FW_OPT_FALLBACK_PLATFORM ))return -ENOENT ; - rc =security_kernel_load_data (LOADING_FIRMWARE_EFI_EMBEDDED ); + rc =security_kernel_load_data (LOADING_FIRMWARE );if (rc)return rc;
drivers/crypto/chelsio/chtls/chtls_cm.c +12 -17
@@ -772,14 +772,13 @@ static int chtls_pass_open_rpl(struct chtls_dev *cdev, struct sk_buff *skb)if (rpl->status !=CPL_ERR_NONE ) {pr_info ("Unexpected PASS_OPEN_RPL status %u for STID %u\n" , rpl->status, stid); -return CPL_RET_BUF_DONE ; + }else { +cxgb4_free_stid (cdev->tids, stid, listen_ctx->lsk->sk_family); +sock_put (listen_ctx->lsk); +kfree (listen_ctx); +module_put (THIS_MODULE ); } -cxgb4_free_stid (cdev->tids, stid, listen_ctx->lsk->sk_family); -sock_put (listen_ctx->lsk); -kfree (listen_ctx); -module_put (THIS_MODULE ); - -return 0 ; +return CPL_RET_BUF_DONE ; }static int chtls_close_listsrv_rpl (struct chtls_dev *cdev,struct sk_buff *skb)
@@ -796,15 +795,13 @@ static int chtls_close_listsrv_rpl(struct chtls_dev *cdev, struct sk_buff *skb)if (rpl->status !=CPL_ERR_NONE ) {pr_info ("Unexpected CLOSE_LISTSRV_RPL status %u for STID %u\n" , rpl->status, stid); -return CPL_RET_BUF_DONE ; + }else { +cxgb4_free_stid (cdev->tids, stid, listen_ctx->lsk->sk_family); +sock_put (listen_ctx->lsk); +kfree (listen_ctx); +module_put (THIS_MODULE ); } - -cxgb4_free_stid (cdev->tids, stid, listen_ctx->lsk->sk_family); -sock_put (listen_ctx->lsk); -kfree (listen_ctx); -module_put (THIS_MODULE ); - -return 0 ; +return CPL_RET_BUF_DONE ; }static void chtls_purge_wr_queue (struct sock *sk)
@@ -1513,7 +1510,6 @@ static void add_to_reap_list(struct sock *sk)struct chtls_sock *csk = sk->sk_user_data;local_bh_disable (); -bh_lock_sock (sk);release_tcp_port (sk);/* release the port immediately */ spin_lock (&reap_list_lock);
@@ -1522,7 +1518,6 @@ static void add_to_reap_list(struct sock *sk)if (!csk->passive_reap_next)schedule_work (&reap_task);spin_unlock (&reap_list_lock); -bh_unlock_sock (sk);local_bh_enable (); }
drivers/crypto/chelsio/chtls/chtls_io.c +5 -2
@@ -1585,6 +1585,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, tp->urg_data =0 ;if ((avail + offset) >= skb->len) { +struct sk_buff *next_skb;if (ULP_SKB_CB (skb)->flags &ULPCB_FLAG_TLS_HDR ) { tp->copied_seq += skb->len; hws->rcvpld = skb->hdr_len;
@@ -1595,8 +1596,10 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,chtls_free_skb (sk, skb); buffers_freed++; hws->copied_seq =0 ; -if (copied >= target && - !skb_peek (&sk->sk_receive_queue)) + next_skb =skb_peek (&sk->sk_receive_queue); +if (copied >= target && !next_skb) +break ; +if (ULP_SKB_CB (next_skb)->flags &ULPCB_FLAG_TLS_HDR )break ; } }while (len >0 );
drivers/firmware/efi/libstub/arm64-stub.c +5 -3
@@ -62,10 +62,12 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, status =efi_get_random_bytes (sizeof (phys_seed), (u8 *)&phys_seed);if (status ==EFI_NOT_FOUND ) { -efi_info ("EFI_RNG_PROTOCOL unavailable, no randomness supplied\n" ); +efi_info ("EFI_RNG_PROTOCOL unavailable, KASLR will be disabled\n" ); + efi_nokaslr = true; }else if (status !=EFI_SUCCESS ) { -efi_err ("efi_get_random_bytes() failed\n" ); -return status; +efi_err ("efi_get_random_bytes() failed (0x%lx), KASLR will be disabled\n" , + status); + efi_nokaslr = true; } }else {efi_info ("KASLR disabled on kernel command line\n" );
drivers/firmware/efi/libstub/fdt.c +1 -3
@@ -136,7 +136,7 @@ static efi_status_t update_fdt(void *orig_fdt, unsigned long orig_fdt_size,if (status) goto fdt_set_fail; -if (IS_ENABLED (CONFIG_RANDOMIZE_BASE )) { +if (IS_ENABLED (CONFIG_RANDOMIZE_BASE ) && !efi_nokaslr) {efi_status_t efi_status; efi_status = efi_get_random_bytes(sizeof(fdt_val64),
@@ -145,8 +145,6 @@ static efi_status_t update_fdt(void *orig_fdt, unsigned long orig_fdt_size, status =fdt_setprop_var (fdt, node,"kaslr-seed" , fdt_val64);if (status) goto fdt_set_fail; - }else if (efi_status !=EFI_NOT_FOUND ) { -return efi_status; } }
drivers/gpu/drm/i915/i915_debugfs.c +2 -0
@@ -323,6 +323,7 @@ static void print_context_stats(struct seq_file *m, }i915_gem_context_unlock_engines (ctx); +mutex_lock (&ctx->mutex);if (!IS_ERR_OR_NULL (ctx->file_priv)) {struct file_stats stats = { .vm =rcu_access_pointer (ctx->vm),
@@ -343,6 +344,7 @@ static void print_context_stats(struct seq_file *m,print_file_stats (m, name, stats); } +mutex_unlock (&ctx->mutex);spin_lock (&i915->gem.contexts.lock);list_safe_reset_next (ctx, cn, link);
drivers/infiniband/core/addr.c +5 -6
@@ -647,13 +647,12 @@ static void process_one_req(struct work_struct *_work) req->callback =NULL ;spin_lock_bh (&lock); +/* +* Although the work will normally have been canceled by the workqueue, +* it can still be requeued as long as it is on the req_list. +*/ +cancel_delayed_work (&req->work);if (!list_empty (&req->list)) { -/* -* Although the work will normally have been canceled by the -* workqueue, it can still be requeued as long as it is on the -* req_list. -*/ -cancel_delayed_work (&req->work);list_del_init (&req->list);kfree (req); }
drivers/md/dm-writecache.c +9 -6
@@ -49,7 +49,7 @@ do { \#define pmem_assign (dest, src) ((dest) = (src))#endif -#if defined(__HAVE_ARCH_MEMCPY_MCSAFE) && defined(DM_WRITECACHE_HAS_PMEM ) +#if IS_ENABLED (CONFIG_ARCH_HAS_COPY_MC ) && defined(DM_WRITECACHE_HAS_PMEM )#define DM_WRITECACHE_HANDLE_HARDWARE_ERRORS #endif
@@ -992,7 +992,8 @@ static void writecache_resume(struct dm_target *ti) } wc->freelist_size =0 ; - r =memcpy_mcsafe (&sb_seq_count, &sb (wc)->seq_count,sizeof (uint64_t )); + r =copy_mc_to_kernel (&sb_seq_count, &sb (wc)->seq_count, +sizeof (uint64_t ));if (r) {writecache_error (wc, r,"hardware memory error when reading superblock: %d" , r); sb_seq_count =cpu_to_le64 (0 );
@@ -1008,7 +1009,8 @@ static void writecache_resume(struct dm_target *ti) e->seq_count =-1 ;continue ; } - r =memcpy_mcsafe (&wme,memory_entry (wc, e),sizeof (struct wc_memory_entry )); + r =copy_mc_to_kernel (&wme,memory_entry (wc, e), +sizeof (struct wc_memory_entry ));if (r) {writecache_error (wc, r,"hardware memory error when reading metadata entry %lu: %d" , (unsigned long )b, r);
@@ -1206,7 +1208,7 @@ static void bio_copy_block(struct dm_writecache *wc, struct bio *bio, void *dataif (rw ==READ ) {int r; - r =memcpy_mcsafe (buf, data, size); + r =copy_mc_to_kernel (buf, data, size);flush_dcache_page (bio_page (bio));if (unlikely (r)) {writecache_error (wc, r,"hardware memory error when reading data: %d" , r);
@@ -2349,7 +2351,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) } } - r =memcpy_mcsafe (&s,sb (wc),sizeof (struct wc_memory_superblock )); + r =copy_mc_to_kernel (&s,sb (wc),sizeof (struct wc_memory_superblock ));if (r) { ti->error ="Hardware memory error when reading superblock" ; goto bad;
@@ -2360,7 +2362,8 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) ti->error ="Unable to initialize device" ; goto bad; } - r =memcpy_mcsafe (&s,sb (wc),sizeof (struct wc_memory_superblock )); + r =copy_mc_to_kernel (&s,sb (wc), +sizeof (struct wc_memory_superblock ));if (r) { ti->error ="Hardware memory error when reading superblock" ; goto bad;
drivers/misc/cardreader/rtsx_pcr.c +0 -4
@@ -1172,10 +1172,6 @@ void rtsx_pci_init_ocp(struct rtsx_pcr *pcr)rtsx_pci_write_register (pcr,REG_OCPGLITCH ,SD_OCP_GLITCH_MASK , pcr->hw_param.ocp_glitch);rtsx_pci_enable_ocp (pcr); - }else { -/* OC power down */ -rtsx_pci_write_register (pcr,FPDCTL ,OC_POWER_DOWN , -OC_POWER_DOWN ); } } }
drivers/misc/cxl/pci.c +2 -2
@@ -393,8 +393,8 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid, *capp_unit_id =get_capp_unit_id (np, *phb_index);of_node_put (np);if (!*capp_unit_id) { -pr_err ("cxl: invalid capp unit id (phb_index: %d)\n" , - *phb_index); +pr_err ("cxl: No capp unit found for PHB[%lld,%d]. Make sure the adapter is on a capi-compatible slot\n" , + *chipid, *phb_index);return -ENODEV ; }
drivers/net/ethernet/broadcom/bnxt/bnxt.c +31 -18
95 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -0
@@ -1672,6 +1672,7 @@ struct bnxt {#define BNXT_STATE_ABORT_ERR 5#define BNXT_STATE_FW_FATAL_COND 6#define BNXT_STATE_DRV_REGISTERED 7 +#define BNXT_STATE_PCI_CHANNEL_IO_FROZEN 8#define BNXT_NO_FW_ACCESS (bp) \ (test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +27 -29
103 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h +4 -0
@@ -50,6 +50,10 @@#define TCB_T_FLAGS_M 0xffffffffffffffffULL#define TCB_T_FLAGS_V (x) ((__u64)(x) << TCB_T_FLAGS_S) +#define TF_DROP_S 22 +#define TF_DIRECT_STEER_S 23 +#define TF_LPBK_S 59 +#define TF_CCTRL_ECE_S 60#define TF_CCTRL_CWR_S 61#define TF_CCTRL_RFR_S 62
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +1 -1
@@ -3146,8 +3146,8 @@ static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev)hclgevf_uninit_msi (hdev); } -hclgevf_pci_uninit (hdev);hclgevf_cmd_uninit (hdev); +hclgevf_pci_uninit (hdev);hclgevf_uninit_mac_list (hdev); }
drivers/net/ethernet/ibm/ibmveth.c +0 -6
@@ -1031,12 +1031,6 @@ static int ibmveth_is_packet_unsupported(struct sk_buff *skb, ret = -EOPNOTSUPP ; } -if (!ether_addr_equal (ether_header->h_source, netdev->dev_addr)) { -netdev_dbg (netdev,"source packet MAC address does not match veth device's, dropping packet.\n" ); - netdev->stats.tx_dropped++; - ret = -EOPNOTSUPP ; - } -return ret; }
drivers/net/ethernet/ibm/ibmvnic.c +6 -2
@@ -1828,9 +1828,13 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p)int rc; rc =0 ; -ether_addr_copy (adapter->mac_addr, addr->sa_data); -if (adapter->state !=VNIC_PROBED ) +if (!is_valid_ether_addr (addr->sa_data)) +return -EADDRNOTAVAIL ; + +if (adapter->state !=VNIC_PROBED ) { +ether_addr_copy (adapter->mac_addr, addr->sa_data); rc =__ibmvnic_set_mac (netdev, addr->sa_data); + }return rc; }
drivers/net/ethernet/mellanox/mlxsw/core.c +2 -0
@@ -1483,6 +1483,8 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,if (!reload)devlink_resources_unregister (devlink,NULL ); mlxsw_core->bus->fini (mlxsw_core->bus_priv); +if (!reload) +devlink_free (devlink);return ;
drivers/net/ethernet/realtek/r8169_main.c +2 -2
@@ -4559,7 +4559,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) }rtl_irq_disable (tp); -napi_schedule_irqoff (&tp->napi); +napi_schedule (&tp->napi); out:rtl_ack_events (tp, status);
@@ -4727,7 +4727,7 @@ static int rtl_open(struct net_device *dev)rtl_request_firmware (tp); retval =request_irq (pci_irq_vector (pdev,0 ), rtl8169_interrupt, -IRQF_NO_THREAD |IRQF_SHARED , dev->name, tp); +IRQF_SHARED , dev->name, tp);if (retval <0 ) goto err_release_fw_2;
drivers/net/ethernet/renesas/ravb_main.c +7 -3
@@ -1747,12 +1747,16 @@ static int ravb_hwtstamp_get(struct net_device *ndev, struct ifreq *req) config.flags =0 ; config.tx_type = priv->tstamp_tx_ctrl ?HWTSTAMP_TX_ON :HWTSTAMP_TX_OFF ; -if (priv->tstamp_rx_ctrl &RAVB_RXTSTAMP_TYPE_V2_L2_EVENT ) +switch (priv->tstamp_rx_ctrl &RAVB_RXTSTAMP_TYPE ) { +case RAVB_RXTSTAMP_TYPE_V2_L2_EVENT : config.rx_filter =HWTSTAMP_FILTER_PTP_V2_L2_EVENT ; -else if (priv->tstamp_rx_ctrl &RAVB_RXTSTAMP_TYPE_ALL ) +break ; +case RAVB_RXTSTAMP_TYPE_ALL : config.rx_filter =HWTSTAMP_FILTER_ALL ; -else +break ; +default : config.rx_filter =HWTSTAMP_FILTER_NONE ; + }return copy_to_user (req->ifr_data, &config,sizeof (config)) ? -EFAULT :0 ;
drivers/net/gtp.c +8 -8
@@ -663,10 +663,6 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, gtp =netdev_priv (dev); - err =gtp_encap_enable (gtp, data); -if (err <0 ) -return err; -if (!data[IFLA_GTP_PDP_HASHSIZE ]) { hashsize =1024 ; }else {
@@ -677,12 +673,16 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, err =gtp_hashtable_new (gtp, hashsize);if (err <0 ) - goto out_encap; +return err; + + err =gtp_encap_enable (gtp, data); +if (err <0 ) + goto out_hashtable; err =register_netdevice (dev);if (err <0 ) {netdev_dbg (dev,"failed to register new netdev %d\n" , err); - goto out_hashtable; + goto out_encap; } gn =net_generic (dev_net (dev), gtp_net_id);
@@ -693,11 +693,11 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,return 0 ; +out_encap: +gtp_encap_disable (gtp); out_hashtable:kfree (gtp->addr_hash);kfree (gtp->tid_hash); -out_encap: -gtp_encap_disable (gtp);return err; }
drivers/net/ipa/gsi_trans.c +15 -6
@@ -398,15 +398,24 @@ void gsi_trans_cmd_add(struct gsi_trans *trans, void *buf, u32 size,/* assert(which < trans->tre_count); */ -/* Set the page information for the buffer. We also need to fill in -* the DMA address and length for the buffer (something dma_map_sg() -* normally does). +/* Commands are quite different from data transfer requests. +* Their payloads come from a pool whose memory is allocated +* using dma_alloc_coherent(). We therefore do *not* map them +* for DMA (unlike what we do for pages and skbs). +* +* When a transaction completes, the SGL is normally unmapped. +* A command transaction has direction DMA_NONE, which tells +* gsi_trans_complete() to skip the unmapping step. +* +* The only things we use directly in a command scatter/gather +* entry are the DMA address and length. We still need the SG +* table flags to be maintained though, so assign a NULL page +* pointer for that purpose. */ sg = &trans->sgl[which]; - -sg_set_buf (sg, buf, size); +sg_assign_page (sg,NULL );sg_dma_address (sg) = addr; -sg_dma_len (sg) = sg->length; +sg_dma_len (sg) = size; info = &trans->info[which]; info->opcode = opcode;
drivers/net/wireless/intersil/p54/p54pci.c +3 -1
@@ -329,10 +329,12 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb)struct p54p_desc *desc;dma_addr_t mapping;u32 idx, i; +__le32 device_addr;spin_lock_irqsave (&priv->lock, flags); idx =le32_to_cpu (ring_control->host_idx[1 ]); i = idx %ARRAY_SIZE (ring_control->tx_data); + device_addr = ((struct p54_hdr *)skb->data)->req_id; mapping =pci_map_single (priv->pdev, skb->data, skb->len,PCI_DMA_TODEVICE );
@@ -346,7 +348,7 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) desc = &ring_control->tx_data[i]; desc->host_addr =cpu_to_le32 (mapping); - desc->device_addr = ((struct p54_hdr *)skb->data)->req_id; + desc->device_addr = device_addr; desc->len =cpu_to_le16 (skb->len); desc->flags =0 ;
drivers/nvdimm/claim.c +1 -1
@@ -268,7 +268,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,if (rw ==READ ) {if (unlikely (is_bad_pmem (&nsio->bb, sector, sz_align)))return -EIO ; -if (memcpy_mcsafe (buf, nsio->addr + offset, size) !=0 ) +if (copy_mc_to_kernel (buf, nsio->addr + offset, size) !=0 )return -EIO ;return 0 ; }
drivers/nvdimm/pmem.c +3 -3
@@ -125,7 +125,7 @@ static blk_status_t read_pmem(struct page *page, unsigned int off,while (len) { mem =kmap_atomic (page); chunk = min_t(unsigned int, len, PAGE_SIZE - off); - rem =memcpy_mcsafe (mem + off, pmem_addr, chunk); + rem =copy_mc_to_kernel (mem + off, pmem_addr, chunk);kunmap_atomic (mem);if (rem)return BLK_STS_IOERR ;
@@ -305,7 +305,7 @@ static long pmem_dax_direct_access(struct dax_device *dax_dev,/* * Use the 'no check' versions of copy_from_iter_flushcache() and -* copy_to_iter_mcsafe() to bypass HARDENED_USERCOPY overhead. Bounds +* copy_mc_to_iter() to bypass HARDENED_USERCOPY overhead. Bounds * checking, both file offset and device offset, is handled by * dax_iomap_actor() */
@@ -318,7 +318,7 @@ static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,static size_t pmem_copy_to_iter (struct dax_device *dax_dev,pgoff_t pgoff,void *addr,size_t bytes,struct iov_iter *i) { -return _copy_to_iter_mcsafe (addr, bytes, i); +return _copy_mc_to_iter (addr, bytes, i); }static const struct dax_operations pmem_dax_ops = {
drivers/pci/controller/pci-aardvark.c +3 -1
@@ -1068,7 +1068,9 @@ static int advk_pcie_enable_phy(struct advk_pcie *pcie) } ret =phy_power_on (pcie->phy); -if (ret) { +if (ret == -EOPNOTSUPP ) { +dev_warn (&pcie->pdev->dev,"PHY unsupported by firmware\n" ); + }else if (ret) {phy_exit (pcie->phy);return ret; }
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +11 -3
@@ -26,7 +26,6 @@#define COMPHY_SIP_POWER_ON 0x82000001#define COMPHY_SIP_POWER_OFF 0x82000002#define COMPHY_SIP_PLL_LOCK 0x82000003 -#define COMPHY_FW_NOT_SUPPORTED (-1)#define COMPHY_FW_MODE_SATA 0x1#define COMPHY_FW_MODE_SGMII 0x2
@@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane, unsigned long mode) {struct arm_smccc_res res; +s32 ret;arm_smccc_smc (function, lane, mode,0 ,0 ,0 ,0 ,0 , &res); + ret = res.a0; -return res.a0; +switch (ret) { +case SMCCC_RET_SUCCESS : +return 0 ; +case SMCCC_RET_NOT_SUPPORTED : +return -EOPNOTSUPP ; +default : +return -EINVAL ; + } } static int mvebu_a3700_comphy_get_fw_mode(int lane, int port,
@@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) } ret =mvebu_a3700_comphy_smc (COMPHY_SIP_POWER_ON , lane->id, fw_param); -if (ret ==COMPHY_FW_NOT_SUPPORTED ) +if (ret == -EOPNOTSUPP )dev_err (lane->dev,"unsupported SMC call, try updating your firmware\n" );
drivers/phy/marvell/phy-mvebu-cp110-comphy.c +11 -3
@@ -123,7 +123,6 @@#define COMPHY_SIP_POWER_ON 0x82000001#define COMPHY_SIP_POWER_OFF 0x82000002 -#define COMPHY_FW_NOT_SUPPORTED (-1)/* * A lane is described by the following bitfields:
@@ -273,10 +272,19 @@ static int mvebu_comphy_smc(unsigned long function, unsigned long phys, unsigned long lane, unsigned long mode) {struct arm_smccc_res res; +s32 ret;arm_smccc_smc (function, phys, lane, mode,0 ,0 ,0 ,0 , &res); + ret = res.a0; -return res.a0; +switch (ret) { +case SMCCC_RET_SUCCESS : +return 0 ; +case SMCCC_RET_NOT_SUPPORTED : +return -EOPNOTSUPP ; +default : +return -EINVAL ; + } } static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port,
@@ -819,7 +827,7 @@ static int mvebu_comphy_power_on(struct phy *phy)if (!ret)return ret; -if (ret ==COMPHY_FW_NOT_SUPPORTED ) +if (ret == -EOPNOTSUPP )dev_err (priv->dev,"unsupported SMC call, try updating your firmware\n" );
drivers/tty/serial/amba-pl011.c +7 -4
@@ -308,8 +308,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap,*/ static int pl011_fifo_to_tty (struct uart_amba_port *uap) { -u16 status;unsigned int ch, flag, fifotaken; +int sysrq; +u16 status;for (fifotaken =0 ; fifotaken !=256 ; fifotaken++) { status =pl011_read (uap,REG_FR );
@@ -344,10 +345,12 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) flag =TTY_FRAME ; } -if (uart_handle_sysrq_char (&uap->port, ch &255 )) -continue ; +spin_unlock (&uap->port.lock); + sysrq =uart_handle_sysrq_char (&uap->port, ch &255 ); +spin_lock (&uap->port.lock); -uart_insert_char (&uap->port, ch,UART011_DR_OE , ch, flag); +if (!sysrq) +uart_insert_char (&uap->port, ch,UART011_DR_OE , ch, flag); }return fifotaken;
drivers/tty/serial/qcom_geni_serial.c +1 -1
@@ -954,7 +954,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, sampling_rate =UART_OVERSAMPLING ;/* Sampling rate is halved for IP versions >= 2.5 */ ver =geni_se_get_qup_hw_version (&port->se); -if (GENI_SE_VERSION_MAJOR (ver) >=2 &&GENI_SE_VERSION_MINOR (ver) >=5 ) +if (ver >=QUP_SE_VERSION_2_5 ) sampling_rate /=2 ; clk_rate =get_clk_div_rate (baud, sampling_rate, &clk_div);
drivers/xen/gntdev.c +12 -5
@@ -720,17 +720,18 @@ struct gntdev_copy_batch {s16 __user *status[GNTDEV_COPY_BATCH ];unsigned int nr_ops;unsigned int nr_pages; +bool writeable; };static int gntdev_get_page (struct gntdev_copy_batch *batch,void __user *virt, -bool writeable,unsigned long *gfn) +unsigned long *gfn) {unsigned long addr = (unsigned long )virt;struct page *page;unsigned long xen_pfn;int ret; - ret =get_user_pages_fast (addr,1 , writeable ?FOLL_WRITE :0 , &page); + ret =get_user_pages_fast (addr,1 , batch->writeable ?FOLL_WRITE :0 , &page);if (ret <0 )return ret;
@@ -746,9 +747,13 @@ static void gntdev_put_pages(struct gntdev_copy_batch *batch) {unsigned int i; -for (i =0 ; i < batch->nr_pages; i++) +for (i =0 ; i < batch->nr_pages; i++) { +if (batch->writeable && !PageDirty (batch->pages[i])) +set_page_dirty_lock (batch->pages[i]);put_page (batch->pages[i]); + } batch->nr_pages =0 ; + batch->writeable = false; }static int gntdev_copy (struct gntdev_copy_batch *batch)
@@ -837,8 +842,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, virt = seg->source.virt + copied; off = (unsigned long )virt & ~XEN_PAGE_MASK ; len =min (len, (size_t )XEN_PAGE_SIZE - off); + batch->writeable = false; - ret =gntdev_get_page (batch, virt, false, &gfn); + ret =gntdev_get_page (batch, virt, &gfn);if (ret <0 )return ret;
@@ -856,8 +862,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, virt = seg->dest.virt + copied; off = (unsigned long )virt & ~XEN_PAGE_MASK ; len =min (len, (size_t )XEN_PAGE_SIZE - off); + batch->writeable = true; - ret =gntdev_get_page (batch, virt, true, &gfn); + ret =gntdev_get_page (batch, virt, &gfn);if (ret <0 )return ret;
fs/efivarfs/super.c +3 -0
@@ -141,6 +141,9 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor, name[len +EFI_VARIABLE_GUID_LEN +1 ] ='\0' ; +/* replace invalid slashes like kobject_set_name_vargs does for /sys/firmware/efi/vars. */ +strreplace (name,'/' ,'!' ); + inode =efivarfs_get_inode (sb,d_inode (root),S_IFREG |0644 ,0 , is_removable);if (!inode)
fs/erofs/xattr.c +0 -2
@@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler,return -EOPNOTSUPP ;break ;case EROFS_XATTR_INDEX_TRUSTED : -if (!capable (CAP_SYS_ADMIN )) -return -EPERM ;break ;case EROFS_XATTR_INDEX_SECURITY :break ;
fs/exec.c +6 -0
@@ -62,6 +62,7 @@#include <linux/oom.h> #include <linux/compat.h> #include <linux/vmalloc.h> +#include <linux/io_uring.h> #include <linux/uaccess.h> #include <asm/mmu_context.h>
@@ -1847,6 +1848,11 @@ static int __do_execve_file(int fd, struct filename *filename,* further execve() calls fail. */ current->flags &= ~PF_NPROC_EXCEEDED ; +/* +* Cancel any io_uring activity across execve +*/ +io_uring_task_cancel (); + retval =unshare_files (&displaced);if (retval) goto out_ret;
fs/file.c +2 -0
@@ -18,6 +18,7 @@#include <linux/bitops.h> #include <linux/spinlock.h> #include <linux/rcupdate.h> +#include <linux/io_uring.h> unsigned int sysctl_nr_open__read_mostly =1024 *1024 ;unsigned int sysctl_nr_open_min =BITS_PER_LONG ;
@@ -439,6 +440,7 @@ void exit_files(struct task_struct *tsk)struct files_struct * files = tsk->files;if (files) { +io_uring_files_cancel (files);task_lock (tsk); tsk->files =NULL ;task_unlock (tsk);
fs/fuse/dev.c +18 -10
@@ -785,15 +785,16 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep)struct page *newpage;struct pipe_buffer *buf = cs->pipebufs; +get_page (oldpage); err =unlock_request (cs->req);if (err) -return err; + goto out_put_old;fuse_copy_finish (cs); err =pipe_buf_confirm (cs->pipe, buf);if (err) -return err; + goto out_put_old;BUG_ON (!cs->nr_segs); cs->currbuf = buf;
@@ -833,7 +834,7 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) err =replace_page_cache_page (oldpage, newpage,GFP_KERNEL );if (err) {unlock_page (newpage); -return err; + goto out_put_old; }get_page (newpage);
@@ -852,14 +853,19 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep)if (err) {unlock_page (newpage);put_page (newpage); -return err; + goto out_put_old; }unlock_page (oldpage); +/* Drop ref for ap->pages[] array */ put_page (oldpage); cs->len =0 ; -return 0 ; + err =0 ; +out_put_old: +/* Drop ref obtained in this function */ +put_page (oldpage); +return err; out_fallback_unlock:unlock_page (newpage);
@@ -868,10 +874,10 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) cs->offset = buf->offset; err =lock_request (cs->req); -if (err) -return err; +if (!err) + err =1 ; -return 1 ; + goto out_put_old; } static int fuse_ref_page(struct fuse_copy_state *cs, struct page *page,
@@ -883,14 +889,16 @@ static int fuse_ref_page(struct fuse_copy_state *cs, struct page *page,if (cs->nr_segs >= cs->pipe->max_usage)return -EIO ; +get_page (page); err =unlock_request (cs->req); -if (err) +if (err) { +put_page (page);return err; + }fuse_copy_finish (cs); buf = cs->pipebufs; -get_page (page); buf->page = page; buf->offset = offset; buf->len = count;
fs/io-wq.c +88 -84
381 lines not on this page · raw message
fs/io-wq.h +1 -0
@@ -88,6 +88,7 @@ struct io_wq_work {struct files_struct *files;struct mm_struct *mm;const struct cred *creds; +struct nsproxy *nsproxy;struct fs_struct *fs;unsigned flags; };
fs/io_uring.c +370 -105
143 lines not on this page · raw message
include/linux/io_uring.h new file +53 -0
53 lines not on this page · raw message
lib/iov_iter.c +23 -25
48 lines not on this page · raw message
tools/arch/x86/include/asm/mcsafe_test.h deleted +0 -13
Lines of this file are not shown. View the raw message.
tools/arch/x86/lib/memcpy_64.S +0 -115
115 lines not on this page · raw message
tools/perf/bench/mem-memcpy-x86-64-lib.c deleted +0 -24
Lines of this file are not shown. View the raw message.
tools/testing/nvdimm/test/nfit.c +25 -24
49 lines not on this page · raw message
tools/testing/selftests/powerpc/copyloops/.gitignore +1 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/powerpc/copyloops/Makefile +3 -3
Lines of this file are not shown. View the raw message.
tools/testing/selftests/powerpc/copyloops/copy_mc_64.S new file +242 -0
242 lines not on this page · 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.