Linux 4.14.301
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.301 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.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/arm/boot/dts/am335x-pcm-953.dtsi | 28 +++---- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 9 ++ arch/arm/mach-mxs/mach-mxs.c | 4 - arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 2 arch/arm64/kernel/cpu_errata.c | 24 ++++-- arch/mips/include/asm/fw/fw.h | 2 arch/mips/pic32/pic32mzda/early_console.c | 13 +-- arch/mips/pic32/pic32mzda/init.c | 2 arch/nios2/boot/Makefile | 2 arch/s390/kernel/crash_dump.c | 2 arch/x86/include/asm/cpufeatures.h | 1 arch/x86/include/asm/nospec-branch.h | 26 +++++- arch/x86/kernel/cpu/bugs.c | 21 +++-- arch/x86/kernel/cpu/tsx.c | 33 +++----- arch/x86/kernel/process.c | 2 arch/x86/mm/ioremap.c | 8 +- arch/x86/power/cpu.c | 23 ++++-- drivers/bus/sunxi-rsb.c | 29 +++++-- drivers/firmware/efi/efi.c | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 -- drivers/hwmon/coretemp.c | 9 ++ drivers/hwmon/i5500_temp.c | 2 drivers/hwmon/ibmpex.c | 1 drivers/iio/health/afe4403.c | 5 - drivers/iio/health/afe4404.c | 12 +-- drivers/iio/industrialio-sw-trigger.c | 6 + drivers/iio/light/Kconfig | 2 drivers/iio/light/apds9960.c | 12 +-- drivers/input/mouse/synaptics.c | 1 drivers/iommu/dmar.c | 1 drivers/mmc/host/sdhci.c | 71 +++++++++++++++---- drivers/mmc/host/sdhci.h | 12 +-- drivers/net/can/cc770/cc770_isa.c | 10 +- drivers/net/can/sja1000/sja1000_isa.c | 10 +- drivers/net/dsa/lan9303-core.c | 2 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 4 - drivers/net/ethernet/mellanox/mlx4/qp.c | 3 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 - drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 1 drivers/net/ethernet/qlogic/qla3xxx.c | 1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 4 - drivers/net/ethernet/renesas/ravb_main.c | 1 drivers/net/ntb_netdev.c | 9 ++ drivers/net/phy/phy_device.c | 1 drivers/net/usb/qmi_wwan.c | 1 drivers/net/wireless/mac80211_hwsim.c | 5 + drivers/nfc/st-nci/se.c | 6 + drivers/nvme/host/core.c | 6 + drivers/of/property.c | 4 - drivers/pinctrl/pinctrl-single.c | 2 drivers/platform/x86/acer-wmi.c | 9 ++ drivers/platform/x86/asus-wmi.c | 2 drivers/platform/x86/hp-wmi.c | 3 drivers/s390/block/dasd_eckd.c | 6 - drivers/spi/spi-stm32.c | 2 drivers/tty/serial/8250/8250_omap.c | 7 + drivers/xen/platform-pci.c | 7 + fs/btrfs/qgroup.c | 9 -- fs/nilfs2/dat.c | 7 + fs/nilfs2/sufile.c | 8 ++ include/linux/perf_event.h | 2 include/uapi/linux/audit.h | 2 ipc/sem.c | 3 kernel/events/core.c | 17 ++-- kernel/sysctl.c | 30 ++++---- mm/frame_vector.c | 31 +------- net/9p/trans_fd.c | 6 + net/bluetooth/l2cap_core.c | 13 +++ net/dccp/ipv4.c | 2 net/dccp/ipv6.c | 2 net/hsr/hsr_forward.c | 5 - net/ipv4/Kconfig | 10 ++ net/ipv4/inet_hashtables.c | 10 +- net/ipv4/tcp_ipv4.c | 2 net/ipv6/ipv6_sockglue.c | 7 + net/ipv6/tcp_ipv6.c | 2 net/ipv6/xfrm6_policy.c | 6 + net/key/af_key.c | 32 +++++--- net/mac80211/mesh_pathtbl.c | 2 net/nfc/nci/core.c | 2 net/nfc/nci/data.c | 4 - net/packet/af_packet.c | 6 - scripts/kconfig/symbol.c | 8 +- sound/soc/soc-ops.c | 2 tools/vm/slabinfo-gnuplot.sh | 4 - 86 files changed, 479 insertions(+), 242 deletions(-)
Adrian Hunter (1):
mmc: sdhci: Fix voltage switch delay
Alejandro Concepción Rodríguez (1):
iio: light: apds9960: fix wrong register for gesture gain
Aman Dhoot (1):
Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode
Ben Hutchings (2):
efi: random: Properly limit the size of the random seed Revert "x86/speculation: Change FILL_RETURN_BUFFER to work with objtool"
Chen Zhongjin (3):
xfrm: Fix ignored return value in xfrm6_init()
iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails
nilfs2: fix nilfs_sufile_mark_dirty() not set segment usage as dirty
ChenXiaoSong (1):
btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit()
Christian König (1):
drm/amdgpu: always register an MMU notifier for userptr
Dominik Haller (1):
ARM: dts: am335x-pcm-953: Define fixed regulators in root node
Duoming Zhou (1):
qlcnic: fix sleep-in-atomic-context bugs caused by msleep
Enrico Sau (1):
net: usb: qmi_wwan: add Telit 0x103a composition
Gaosheng Cui (2):
audit: fix undefined behavior in bit shift for AUDIT_BIT
hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails
Gleb Mazovetskiy (1):
tcp: configurable source port perturb table size
Greg Kroah-Hartman (1):
Linux 4.14.301
Hans de Goede (1):
platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017)
Heiko Carstens (1):
s390/crashdump: fix TOD programmable field size
Herbert Xu (1):
af_key: Fix send_acquire race with pfkey_register
Jakob Unterwurzacher (1):
arm64: dts: rockchip: lower rk3399-puma-haikou SD controller clock frequency
James Morse (2):
arm64: Fix panic() when Spectre-v2 causes Spectre-BHB to re-allocate KVM vectors
arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72
Jann Horn (1):
ipc/sem: Fix dangling sem_array access in semtimedop race
Jason A. Donenfeld (1):
MIPS: pic32: treat port as signed integer
Jerry Ray (1):
dsa: lan9303: Correct stat name
Jonas Jelonek (1):
wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support
Kai-Heng Feng (1):
platform/x86: hp-wmi: Ignore Smart Experience App event
Kan Liang (1):
perf: Add sample_flags to indicate the PMU-filled sample data
Keith Busch (1):
nvme: restrict management ioctls to admin
Kuniyuki Iwashima (2):
dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). tcp/udp: Fix memory leak in ipv6_renew_options().
Lin Ma (1):
nfc/nci: fix race with opening and closing
Linus Torvalds (3):
proc: avoid integer type confusion in get_proc_long
proc: proc_skip_spaces() shouldn't think it is working on C strings
v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails
Liu Shixin (1):
NFC: nci: fix memory leak in nci_rx_data_packet()
Luiz Augusto von Dentz (1):
Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM
Lukas Wunner (1):
serial: 8250: 8250_omap: Avoid RS485 RTS glitch on ->set_termios()
Mark Brown (1):
ASoC: ops: Fix bounds check for _sx controls
Martin Faltesek (2):
nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION
nfc: st-nci: fix memory leaks in EVT_TRANSACTION
Masahiro Yamada (2):
kconfig: display recursive dependency resolution hint just once
mmc: sdhci: use FIELD_GET for preset value bit masks
Maxim Korotkov (1):
pinctrl: single: Fix potential division by zero
Michael Grzeschik (1):
ARM: dts: at91: sam9g20ek: enable udc vbus gpio pinctrl
Michael Kelley (1):
x86/ioremap: Fix page aligned size calculation in __ioremap_caller()
Nicolas Cavallari (1):
wifi: mac80211: Fix ack frame idr leak when mesh has no route
Paul Gazzillo (1):
iio: light: rpr0521: add missing Kconfig dependencies
Pawan Gupta (3):
x86/bugs: Make sure MSR_SPEC_CTRL is updated properly upon resume from S3 x86/tsx: Add a feature bit for TSX control MSR support x86/pm: Add enumeration check before spec MSRs save/restore setup
Peter Kosyh (1):
net/mlx4: Check retval of mlx4_bitmap_init
Peter Zijlstra (1):
x86/nospec: Fix i386 RSB stuffing
Phil Auld (1):
hwmon: (coretemp) Check for null before removing sysfs attrs
Randy Dunlap (1):
nios2: add FORCE for vmlinuz.gz
Samuel Holland (1):
bus: sunxi-rsb: Support atomic transfers
Sean Nyekjaer (1):
spi: stm32: fix stm32_spi_prepare_mbr() that halves spi clk for every run
Stefan Haberland (1):
s390/dasd: fix no record found for raw_track_access
Tiezhu Yang (1):
tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep"
Wang Hai (2):
net: pch_gbe: fix potential memleak in pch_gbe_tx_queue() net/9p: Fix a potential socket leak in p9_socket_open
Wei Yongjun (2):
iio: health: afe4403: Fix oob read in afe4403_read_raw
iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw
Willem de Bruijn (1):
packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE
Xiongfeng Wang (2):
platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()
Yang Yingliang (4):
hwmon: (i5500_temp) fix missing pci_disable_device()
of: property: decrement node refcount in of_fwnode_get_reference_args()
net: phy: fix null-ptr-deref while probe() failed
hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new()
Yoshihiro Shimoda (1):
net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed
Yu Liao (1):
net: thunderx: Fix the ACPI memory leak
Yuan Can (1):
net: net_netdev: Fix error handling in ntb_netdev_init_module()
YueHaibing (2):
net/mlx5: Fix uninitialized variable bug in outlen_write()
net: hsr: Fix potential use-after-free
Zhang Changzhong (3):
net/qla3xxx: fix potential memleak in ql3xxx_send()
can: sja1000_isa: sja1000_isa_probe(): add missing free_sja1000dev()
can: cc770: cc770_isa_probe(): add missing free_cc770dev()ZhangPeng (1):
nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry()
Zheng Yongjun (1):
ARM: mxs: fix memory leak in mxs_machine_init()
Zhengchao Shao (1):
9p/fd: fix issue of list_del corruption in p9_fd_cancel()
ruanjinjie (1):
xen/platform-pci: add missing free_irq() in error path
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 300 +SUBLEVEL = 301 EXTRAVERSION = NAME = Petit Gorille
arch/arm/boot/dts/am335x-pcm-953.dtsi +13 -15
@@ -15,22 +15,20 @@ compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", "ti,am33xx"; /* Power */ - regulators { - vcc3v3: fixedregulator@1 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - }; + vcc3v3: fixedregulator1 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; - vcc1v8: fixedregulator@2 { - compatible = "regulator-fixed"; - regulator-name = "vcc1v8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - }; + vcc1v8: fixedregulator2 { + compatible = "regulator-fixed"; + regulator-name = "vcc1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; }; /* User IO */
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +9 -0
@@ -39,6 +39,13 @@ }; + usb1 { + pinctrl_usb1_vbus_gpio: usb1_vbus_gpio { + atmel,pins = + <AT91_PIOC 5 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PC5 GPIO */ + }; + }; + mmc0_slot1 { pinctrl_board_mmc0_slot1: mmc0_slot1-board { atmel,pins =
@@ -72,6 +79,8 @@ }; usb1: gadget@fffa4000 { + pinctrl-0 = <&pinctrl_usb1_vbus_gpio>; + pinctrl-names = "default"; atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>; status = "okay"; };
arch/arm/mach-mxs/mach-mxs.c +3 -1
@@ -393,8 +393,10 @@ static void __init mxs_machine_init(void) root =of_find_node_by_path ("/" ); ret =of_property_read_string (root,"model" , &soc_dev_attr->machine); -if (ret) +if (ret) { +kfree (soc_dev_attr);return ; + } soc_dev_attr->family ="Freescale MXS Family" ; soc_dev_attr->soc_id =mxs_get_soc_id ();
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +1 -1
@@ -180,7 +180,7 @@ cap-sd-highspeed; cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; disable-wp; - max-frequency = <150000000>; + max-frequency = <40000000>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vcc3v3_baseboard>;
arch/arm64/kernel/cpu_errata.c +18 -6
@@ -135,9 +135,12 @@ static void install_bp_hardening_cb(bp_hardening_cb_t fn, __copy_hyp_vect_bpi(slot, hyp_vecs_start, hyp_vecs_end); } -__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); -__this_cpu_write (bp_hardening_data.fn, fn); -__this_cpu_write (bp_hardening_data.template_start, hyp_vecs_start); +if (fn !=__this_cpu_read (bp_hardening_data.fn)) { +__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); +__this_cpu_write (bp_hardening_data.fn, fn); +__this_cpu_write (bp_hardening_data.template_start, + hyp_vecs_start); + }spin_unlock (&bp_lock); }#else
@@ -1061,8 +1064,11 @@ static void kvm_setup_bhb_slot(const char *hyp_vecs_start) __copy_hyp_vect_bpi(slot, hyp_vecs_start, hyp_vecs_end); } -__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); -__this_cpu_write (bp_hardening_data.template_start, hyp_vecs_start); +if (hyp_vecs_start !=__this_cpu_read (bp_hardening_data.template_start)) { +__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); +__this_cpu_write (bp_hardening_data.template_start, + hyp_vecs_start); + }spin_unlock (&bp_lock); }#else
@@ -1098,7 +1104,13 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry) }else if (spectre_bhb_loop_affected (SCOPE_LOCAL_CPU )) {switch (spectre_bhb_loop_affected (SCOPE_SYSTEM )) {case 8 : -kvm_setup_bhb_slot (__spectre_bhb_loop_k8_start); +/* +* A57/A72-r0 will already have selected the +* spectre-indirect vector, which is sufficient +* for BHB too. +*/ +if (!__this_cpu_read (bp_hardening_data.fn)) +kvm_setup_bhb_slot (__spectre_bhb_loop_k8_start);break ;case 24 :kvm_setup_bhb_slot (__spectre_bhb_loop_k24_start);
arch/mips/include/asm/fw/fw.h +1 -1
@@ -26,6 +26,6 @@ extern char *fw_getcmdline(void);extern void fw_meminit (void );extern char *fw_getenv (char *name);extern unsigned long fw_getenvl (char *name); -extern void fw_init_early_console (char port); +extern void fw_init_early_console (void );#endif /* __ASM_FW_H_ */
arch/mips/pic32/pic32mzda/early_console.c +6 -7
@@ -34,7 +34,7 @@#define U_BRG (x) (UART_BASE(x) + 0x40)static void __iomem *uart_base; -static char console_port =-1 ; +static int console_port =-1 ;static int __init configure_uart_pins (int port) {
@@ -54,7 +54,7 @@ static int __init configure_uart_pins(int port)return 0 ; } -static void __init configure_uart (char port,int baud) +static void __init configure_uart (int port,int baud) {u32 pbclk;
@@ -67,7 +67,7 @@ static void __init configure_uart(char port, int baud) uart_base + PIC32_SET(U_STA(port))); } -static void __init setup_early_console (char port,int baud) +static void __init setup_early_console (int port,int baud) {if (configure_uart_pins (port))return ;
@@ -137,16 +137,15 @@ static int __init get_baud_from_cmdline(char *arch_cmdline)return baud; } -void __init fw_init_early_console (char port) +void __init fw_init_early_console (void ) {char *arch_cmdline =pic32_getcmdline (); -int baud =-1 ; +int baud, port; uart_base =ioremap_nocache (PIC32_BASE_UART ,0xc00 ); baud =get_baud_from_cmdline (arch_cmdline); -if (port ==-1 ) - port =get_port_from_cmdline (arch_cmdline); + port =get_port_from_cmdline (arch_cmdline);if (port ==-1 ) port =EARLY_CONSOLE_PORT ;
arch/mips/pic32/pic32mzda/init.c +1 -1
@@ -68,7 +68,7 @@ void __init plat_mem_setup(void)strlcpy (arcs_cmdline, boot_command_line,COMMAND_LINE_SIZE );#ifdef CONFIG_EARLY_PRINTK -fw_init_early_console (-1 ); +fw_init_early_console ();#endif pic32_config_init (); }
arch/nios2/boot/Makefile +1 -1
@@ -20,7 +20,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE $(call if_changed,gzip) -$(obj)/vmImage: $(obj)/vmlinux.gz +$(obj)/vmImage: $(obj)/vmlinux.gz FORCE $(call if_changed,uimage) @$(kecho) 'Kernel: $@ is ready'
arch/s390/kernel/crash_dump.c +1 -1
@@ -45,7 +45,7 @@ struct save_area {u64 fprs[16 ];u32 fpc;u32 prefix; -u64 todpreg; +u32 todpreg;u64 timer;u64 todcmp;u64 vxrs_low[16 ];
arch/x86/include/asm/cpufeatures.h +1 -0
@@ -292,6 +292,7 @@#define X86_FEATURE_RETPOLINE (11*32+12)/* "" Generic Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_RETPOLINE_LFENCE (11*32+13)/* "" Use LFENCE for Spectre variant 2 */ #define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17)/* "" Fill RSB on VM exit when EIBRS is enabled */ +#define X86_FEATURE_MSR_TSX_CTRL (11*32+18)/* "" MSR IA32_TSX_CTRL (Intel) implemented */ /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */ #define X86_FEATURE_CLZERO (13*32+ 0)/* CLZERO instruction */
arch/x86/include/asm/nospec-branch.h +20 -6
@@ -4,13 +4,11 @@#define _ASM_X86_NOSPEC_BRANCH_H_#include <linux/static_key.h> -#include <linux/frame.h> #include <asm/alternative.h> #include <asm/alternative-asm.h> #include <asm/cpufeatures.h> #include <asm/msr-index.h> -#include <asm/unwind_hints.h> #include <asm/percpu.h> /*
@@ -38,6 +36,7 @@* the optimal version — two calls, each with their own speculation * trap should their return address end up getting used, in a loop. */ +#ifdef CONFIG_X86_64 #define __FILL_RETURN_BUFFER (reg, nr, sp) \ mov $(nr/2), reg; \ 771: \
@@ -53,11 +52,24 @@lfence ; \ jmp 775b; \ 774: \ - add $(BITS_PER_LONG/8) * 2, sp; \dec reg; \ jnz 771b; \ + add $(BITS_PER_LONG/8) * nr, sp; \/* barrier for jnz misprediction */ \ lfence; +#else +/* +* i386 doesn't unconditionally have LFENCE, as such it can't +* do a loop. +*/ +#define __FILL_RETURN_BUFFER (reg, nr, sp) \ + .rept nr; \ + call 772f; \ + int3; \ +772:; \ + .endr; \ + add $(BITS_PER_LONG/8) * nr, sp; +#endif #define ISSUE_UNBALANCED_RET_GUARD (sp) \ call 992f; \
@@ -153,8 +165,10 @@* monstrosity above, manually. */ .macro FILL_RETURN_BUFFER reg:req nr:req ftr:req - ALTERNATIVE "jmp .Lskip_rsb_\@", "", \ftr - __FILL_RETURN_BUFFER(\reg,\nr,%_ASM_SP) + ANNOTATE_NOSPEC_ALTERNATIVE +ALTERNATIVE "jmp .Lskip_rsb_\@" , \ + __stringify(__FILL_RETURN_BUFFER(\reg,\nr,%_ASM_SP)) \ + \ftr .Lskip_rsb_\@: .endm
@@ -301,7 +315,7 @@ static inline void indirect_branch_prediction_barrier(void)/* The Intel SPEC CTRL MSR base value cache */ extern u64 x86_spec_ctrl_base;DECLARE_PER_CPU (u64, x86_spec_ctrl_current); -extern void write_spec_ctrl_current (u64 val,bool force); +extern void update_spec_ctrl_cond (u64 val);extern u64 spec_ctrl_current (void );/*
arch/x86/kernel/cpu/bugs.c +14 -7
@@ -58,11 +58,18 @@ EXPORT_SYMBOL_GPL(x86_spec_ctrl_current);static DEFINE_MUTEX (spec_ctrl_mutex); +/* Update SPEC_CTRL MSR and its cached copy unconditionally */ +static void update_spec_ctrl (u64 val) +{ +this_cpu_write (x86_spec_ctrl_current, val); +wrmsrl (MSR_IA32_SPEC_CTRL , val); +} +/* * Keep track of the SPEC_CTRL MSR value for the current task, which may differ * from x86_spec_ctrl_base due to STIBP/SSB in __speculation_ctrl_update(). */ -void write_spec_ctrl_current (u64 val,bool force) +void update_spec_ctrl_cond (u64 val) {if (this_cpu_read (x86_spec_ctrl_current) == val)return ;
@@ -73,7 +80,7 @@ void write_spec_ctrl_current(u64 val, bool force)* When KERNEL_IBRS this MSR is written on return-to-user, unless * forced the update can be delayed until that time. */ -if (force || !cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS )) +if (!cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS ))wrmsrl (MSR_IA32_SPEC_CTRL , val); }
@@ -1192,7 +1199,7 @@ static void __init spec_ctrl_disable_kernel_rrsba(void)if (ia32_cap &ARCH_CAP_RRSBA ) { x86_spec_ctrl_base |=SPEC_CTRL_RRSBA_DIS_S ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); } }
@@ -1314,7 +1321,7 @@ static void __init spectre_v2_select_mitigation(void)if (spectre_v2_in_ibrs_mode (mode)) { x86_spec_ctrl_base |=SPEC_CTRL_IBRS ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); }switch (mode) {
@@ -1418,7 +1425,7 @@ static void __init spectre_v2_select_mitigation(void)static void update_stibp_msr (void * __unused) {u64 val =spec_ctrl_current () | (x86_spec_ctrl_base &SPEC_CTRL_STIBP ); -write_spec_ctrl_current (val, true); +update_spec_ctrl (val); }/* Update x86_spec_ctrl_base in case SMT state changed. */
@@ -1651,7 +1658,7 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void)x86_amd_ssb_disable (); }else { x86_spec_ctrl_base |=SPEC_CTRL_SSBD ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); } }
@@ -1856,7 +1863,7 @@ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which)void x86_spec_ctrl_setup_ap (void ) {if (boot_cpu_has (X86_FEATURE_MSR_SPEC_CTRL )) -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base);if (ssb_mode ==SPEC_STORE_BYPASS_DISABLE )x86_amd_ssb_disable ();
arch/x86/kernel/cpu/tsx.c +14 -19
@@ -55,24 +55,6 @@ void tsx_enable(void)wrmsrl (MSR_IA32_TSX_CTRL , tsx); } -static bool __init tsx_ctrl_is_supported (void ) -{ -u64 ia32_cap =x86_read_arch_cap_msr (); - -/* -* TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this -* MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES. -* -* TSX control (aka MSR_IA32_TSX_CTRL) is only available after a -* microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES -* bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get -* MSR_IA32_TSX_CTRL support even after a microcode update. Thus, -* tsx= cmdline requests will do nothing on CPUs without -* MSR_IA32_TSX_CTRL support. -*/ -return !!(ia32_cap &ARCH_CAP_TSX_CTRL_MSR ); -} -static enum tsx_ctrl_states x86_get_tsx_auto_mode (void ) {if (boot_cpu_has_bug (X86_BUG_TAA ))
@@ -86,9 +68,22 @@ void __init tsx_init(void)char arg[5 ] = {};int ret; -if (!tsx_ctrl_is_supported ()) +/* +* TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this +* MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES. +* +* TSX control (aka MSR_IA32_TSX_CTRL) is only available after a +* microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES +* bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get +* MSR_IA32_TSX_CTRL support even after a microcode update. Thus, +* tsx= cmdline requests will do nothing on CPUs without +* MSR_IA32_TSX_CTRL support. +*/ +if (!(x86_read_arch_cap_msr () &ARCH_CAP_TSX_CTRL_MSR ))return ; +setup_force_cpu_cap (X86_FEATURE_MSR_TSX_CTRL ); + ret =cmdline_find_option (boot_command_line,"tsx" , arg,sizeof (arg));if (ret >=0 ) {if (!strcmp (arg,"on" )) {
arch/x86/kernel/process.c +1 -1
@@ -435,7 +435,7 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp, }if (updmsr) -write_spec_ctrl_current (msr, false); +update_spec_ctrl_cond (msr); }static unsigned long speculation_ctrl_update_tif (struct task_struct *tsk)
arch/x86/mm/ioremap.c +7 -1
@@ -124,9 +124,15 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,* Mappings have to be page-aligned */ offset = phys_addr & ~PAGE_MASK ; - phys_addr &=PHYSICAL_PAGE_MASK ; + phys_addr &=PAGE_MASK ; size =PAGE_ALIGN (last_addr+1 ) - phys_addr; +/* +* Mask out any bits not part of the actual physical +* address, like memory encryption bits. +*/ + phys_addr &=PHYSICAL_PAGE_MASK ; + retval =reserve_memtype (phys_addr, (u64 )phys_addr + size, pcm, &new_pcm);if (retval) {
arch/x86/power/cpu.c +15 -8
@@ -527,16 +527,23 @@ static int pm_cpu_check(const struct x86_cpu_id *c)static void pm_save_spec_msr (void ) { -u32 spec_msr_id[] = { -MSR_IA32_SPEC_CTRL , -MSR_IA32_TSX_CTRL , -MSR_TSX_FORCE_ABORT , -MSR_IA32_MCU_OPT_CTRL , -MSR_AMD64_LS_CFG , -MSR_AMD64_DE_CFG , +struct msr_enumeration { +u32 msr_no; +u32 feature; + } msr_enum[] = { + {MSR_IA32_SPEC_CTRL ,X86_FEATURE_MSR_SPEC_CTRL }, + {MSR_IA32_TSX_CTRL ,X86_FEATURE_MSR_TSX_CTRL }, + {MSR_TSX_FORCE_ABORT ,X86_FEATURE_TSX_FORCE_ABORT }, + {MSR_IA32_MCU_OPT_CTRL ,X86_FEATURE_SRBDS_CTRL }, + {MSR_AMD64_LS_CFG ,X86_FEATURE_LS_CFG_SSBD }, + {MSR_AMD64_DE_CFG ,X86_FEATURE_LFENCE_RDTSC }, }; +int i; -msr_build_context (spec_msr_id,ARRAY_SIZE (spec_msr_id)); +for (i =0 ; i <ARRAY_SIZE (msr_enum); i++) { +if (boot_cpu_has (msr_enum[i].feature)) +msr_build_context (&msr_enum[i].msr_no,1 ); + } }static int pm_check_save_msr (void )
drivers/bus/sunxi-rsb.c +21 -8
@@ -268,6 +268,9 @@ EXPORT_SYMBOL_GPL(sunxi_rsb_driver_register);/* common code that starts a transfer */ static int _sunxi_rsb_run_xfer (struct sunxi_rsb *rsb) { +u32 int_mask, status; +bool timeout; +if (readl (rsb->regs +RSB_CTRL ) &RSB_CTRL_START_TRANS ) {dev_dbg (rsb->dev,"RSB transfer still in progress\n" );return -EBUSY ;
@@ -275,13 +278,23 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)reinit_completion (&rsb->complete); -writel (RSB_INTS_LOAD_BSY |RSB_INTS_TRANS_ERR |RSB_INTS_TRANS_OVER , - rsb->regs +RSB_INTE ); + int_mask =RSB_INTS_LOAD_BSY |RSB_INTS_TRANS_ERR |RSB_INTS_TRANS_OVER ; +writel (int_mask, rsb->regs +RSB_INTE );writel (RSB_CTRL_START_TRANS |RSB_CTRL_GLOBAL_INT_ENB , rsb->regs +RSB_CTRL ); -if (!wait_for_completion_io_timeout (&rsb->complete, -msecs_to_jiffies (100 ))) { +if (irqs_disabled ()) { + timeout =readl_poll_timeout_atomic (rsb->regs +RSB_INTS , + status, (status & int_mask), +10 ,100000 ); +writel (status, rsb->regs +RSB_INTS ); + }else { + timeout = !wait_for_completion_io_timeout (&rsb->complete, +msecs_to_jiffies (100 )); + status = rsb->status; + } + +if (timeout) {dev_dbg (rsb->dev,"RSB timeout\n" );/* abort the transfer */
@@ -293,18 +306,18 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)return -ETIMEDOUT ; } -if (rsb->status &RSB_INTS_LOAD_BSY ) { +if (status &RSB_INTS_LOAD_BSY ) {dev_dbg (rsb->dev,"RSB busy\n" );return -EBUSY ; } -if (rsb->status &RSB_INTS_TRANS_ERR ) { -if (rsb->status &RSB_INTS_TRANS_ERR_ACK ) { +if (status &RSB_INTS_TRANS_ERR ) { +if (status &RSB_INTS_TRANS_ERR_ACK ) {dev_dbg (rsb->dev,"RSB slave nack\n" );return -EINVAL ; } -if (rsb->status &RSB_INTS_TRANS_ERR_DATA ) { +if (status &RSB_INTS_TRANS_ERR_DATA ) {dev_dbg (rsb->dev,"RSB transfer data error\n" );return -EIO ; }
drivers/firmware/efi/efi.c +1 -1
@@ -541,7 +541,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, seed =early_memremap (efi.rng_seed,sizeof (*seed) + size);if (seed !=NULL ) { -add_device_randomness (seed->bits, seed->size); +add_device_randomness (seed->bits, size);early_memunmap (seed,sizeof (*seed) + size);pr_notice ("seeding entropy pool\n" ); }else {
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -5
@@ -308,11 +308,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,if (r) goto release_object; -if (args->flags &AMDGPU_GEM_USERPTR_REGISTER ) { - r =amdgpu_mn_register (bo, args->addr); -if (r) - goto release_object; - } + r =amdgpu_mn_register (bo, args->addr); +if (r) + goto release_object;if (args->flags &AMDGPU_GEM_USERPTR_VALIDATE ) {down_read (¤t->mm->mmap_sem);
drivers/hwmon/coretemp.c +8 -1
@@ -255,10 +255,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)*/ if (host_bridge && host_bridge->vendor ==PCI_VENDOR_ID_INTEL ) {for (i =0 ; i <ARRAY_SIZE (tjmax_pci_table); i++) { -if (host_bridge->device == tjmax_pci_table[i].device) +if (host_bridge->device == tjmax_pci_table[i].device) { +pci_dev_put (host_bridge);return tjmax_pci_table[i].tjmax; + } } } +pci_dev_put (host_bridge);for (i =0 ; i <ARRAY_SIZE (tjmax_table); i++) {if (strstr (c->x86_model_id, tjmax_table[i].id))
@@ -531,6 +534,10 @@ static void coretemp_remove_core(struct platform_data *pdata, int indx) {struct temp_data *tdata = pdata->core_data[indx]; +/* if we errored on add then this is already gone */ +if (!tdata) +return ; +/* Remove the sysfs attributes */ sysfs_remove_group (&pdata->hwmon_dev->kobj, &tdata->attr_group);
drivers/hwmon/i5500_temp.c +1 -1
@@ -117,7 +117,7 @@ static int i5500_temp_probe(struct pci_dev *pdev,u32 tstimer;s8 tsfsc; - err =pci_enable_device (pdev); + err =pcim_enable_device (pdev);if (err) {dev_err (&pdev->dev,"Failed to enable device\n" );return err;
drivers/hwmon/ibmpex.c +1 -0
@@ -517,6 +517,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev)return ; out_register: +list_del (&data->list);hwmon_device_unregister (data->hwmon_dev); out_user:ipmi_destroy_user (data->user);
drivers/iio/health/afe4403.c +3 -2
@@ -253,14 +253,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct afe4403_data *afe = iio_priv(indio_dev); -unsigned int reg = afe4403_channel_values[chan->address]; -unsigned int field = afe4403_channel_leds[chan->address]; +unsigned int reg, field;int ret;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_RAW : + reg = afe4403_channel_values[chan->address]; ret =afe4403_read (afe, reg, val);if (ret)return ret;
@@ -270,6 +270,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev,case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + field = afe4403_channel_leds[chan->address]; ret =regmap_field_read (afe->fields[field], val);if (ret)return ret;
drivers/iio/health/afe4404.c +7 -5
@@ -258,20 +258,20 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct afe4404_data *afe = iio_priv(indio_dev); -unsigned int value_reg = afe4404_channel_values[chan->address]; -unsigned int led_field = afe4404_channel_leds[chan->address]; -unsigned int offdac_field = afe4404_channel_offdacs[chan->address]; +unsigned int value_reg, led_field, offdac_field;int ret;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_RAW : + value_reg = afe4404_channel_values[chan->address]; ret =regmap_read (afe->regmap, value_reg, val);if (ret)return ret;return IIO_VAL_INT ;case IIO_CHAN_INFO_OFFSET : + offdac_field = afe4404_channel_offdacs[chan->address]; ret =regmap_field_read (afe->fields[offdac_field], val);if (ret)return ret;
@@ -281,6 +281,7 @@ static int afe4404_read_raw(struct iio_dev *indio_dev,case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + led_field = afe4404_channel_leds[chan->address]; ret =regmap_field_read (afe->fields[led_field], val);if (ret)return ret;
@@ -303,19 +304,20 @@ static int afe4404_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { struct afe4404_data *afe = iio_priv(indio_dev); -unsigned int led_field = afe4404_channel_leds[chan->address]; -unsigned int offdac_field = afe4404_channel_offdacs[chan->address]; +unsigned int led_field, offdac_field;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_OFFSET : + offdac_field = afe4404_channel_offdacs[chan->address];return regmap_field_write (afe->fields[offdac_field], val); }break ;case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + led_field = afe4404_channel_leds[chan->address];return regmap_field_write (afe->fields[led_field], val); }break ;
drivers/iio/industrialio-sw-trigger.c +5 -1
@@ -61,8 +61,12 @@ int iio_register_sw_trigger_type(struct iio_sw_trigger_type *t) t->group =configfs_register_default_group (iio_triggers_group, t->name, &iio_trigger_type_group_type); -if (IS_ERR (t->group)) +if (IS_ERR (t->group)) { +mutex_lock (&iio_trigger_types_lock); +list_del (&t->list); +mutex_unlock (&iio_trigger_types_lock); ret =PTR_ERR (t->group); + }return ret; }
drivers/iio/light/Kconfig +2 -0
@@ -237,6 +237,8 @@ config RPR0521 tristate "ROHM RPR0521 ALS and proximity sensor driver" depends on I2C select REGMAP_I2C + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER help Say Y here if you want to build support for ROHM's RPR0521 ambient light and proximity sensor device.
drivers/iio/light/apds9960.c +6 -6
@@ -63,9 +63,6 @@#define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2#define APDS9960_REG_CONFIG_2 0x90 -#define APDS9960_REG_CONFIG_2_GGAIN_MASK 0x60 -#define APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT 5 -#define APDS9960_REG_ID 0x92#define APDS9960_REG_STATUS 0x93
@@ -86,6 +83,9 @@#define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT 6#define APDS9960_REG_GCONF_2 0xa3 +#define APDS9960_REG_GCONF_2_GGAIN_MASK 0x60 +#define APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT 5 +#define APDS9960_REG_GOFFSET_U 0xa4#define APDS9960_REG_GOFFSET_D 0xa5#define APDS9960_REG_GPULSE 0xa6
@@ -404,9 +404,9 @@ static int apds9960_set_pxs_gain(struct apds9960_data *data, int val) } ret =regmap_update_bits (data->regmap, -APDS9960_REG_CONFIG_2 , -APDS9960_REG_CONFIG_2_GGAIN_MASK , - idx <<APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT ); +APDS9960_REG_GCONF_2 , +APDS9960_REG_GCONF_2_GGAIN_MASK , + idx <<APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT );if (!ret) data->pxs_gain = idx;mutex_unlock (&data->lock);
drivers/input/mouse/synaptics.c +1 -0
@@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids[] = {"SYN3221" ,/* HP 15-ay000 */ "SYN323d" ,/* HP Spectre X360 13-w013dx */ "SYN3257" ,/* HP Envy 13-ad105ng */ +"SYN3286" ,/* HP Laptop 15-da3001TU */ NULL };
drivers/iommu/dmar.c +1 -0
@@ -804,6 +804,7 @@ int __init dmar_dev_scope_init(void) info =dmar_alloc_pci_notify_info (dev,BUS_NOTIFY_ADD_DEVICE );if (!info) { +pci_dev_put (dev);return dmar_dev_scope_status; }else {dmar_pci_bus_add_dev (info);
drivers/mmc/host/sdhci.c +59 -12
141 lines not on this page · raw message
drivers/mmc/host/sdhci.h +6 -6
@@ -13,6 +13,7 @@#ifndef __SDHCI_HW_H#define __SDHCI_HW_H +#include <linux/bits.h> #include <linux/scatterlist.h> #include <linux/compiler.h> #include <linux/types.h>
@@ -259,12 +260,9 @@#define SDHCI_PRESET_FOR_SDR104 0x6C#define SDHCI_PRESET_FOR_DDR50 0x6E#define SDHCI_PRESET_FOR_HS400 0x74/* Non-standard */ -#define SDHCI_PRESET_DRV_MASK 0xC000 -#define SDHCI_PRESET_DRV_SHIFT 14 -#define SDHCI_PRESET_CLKGEN_SEL_MASK 0x400 -#define SDHCI_PRESET_CLKGEN_SEL_SHIFT 10 -#define SDHCI_PRESET_SDCLK_FREQ_MASK 0x3FF -#define SDHCI_PRESET_SDCLK_FREQ_SHIFT 0 +#define SDHCI_PRESET_DRV_MASK GENMASK(15, 14) +#define SDHCI_PRESET_CLKGEN_SEL BIT(10) +#define SDHCI_PRESET_SDCLK_FREQ_MASK GENMASK(9, 0)#define SDHCI_SLOT_INT_STATUS 0xFC
@@ -488,6 +486,8 @@ struct sdhci_host {unsigned int clock;/* Current clock (MHz) */ u8 pwr;/* Current voltage */ +u8 drv_type;/* Current UHS-I driver type */ +bool reinit_uhs;/* Force UHS-related re-initialization */ bool runtime_suspended;/* Host is runtime suspended */ bool bus_on;/* Bus power prevents runtime suspend */
drivers/net/can/cc770/cc770_isa.c +6 -4
@@ -272,22 +272,24 @@ static int cc770_isa_probe(struct platform_device *pdev)if (err) {dev_err (&pdev->dev,"couldn't register device (err=%d)\n" , err); - goto exit_unmap; + goto exit_free; }dev_info (&pdev->dev,"device registered (reg_base=0x%p, irq=%d)\n" , priv->reg_base, dev->irq);return 0 ; - exit_unmap: +exit_free: +free_cc770dev (dev); +exit_unmap:if (mem[idx])iounmap (base); - exit_release: +exit_release:if (mem[idx])release_mem_region (mem[idx], iosize);else release_region (port[idx], iosize); - exit: +exit:return err; }
drivers/net/can/sja1000/sja1000_isa.c +6 -4
@@ -213,22 +213,24 @@ static int sja1000_isa_probe(struct platform_device *pdev)if (err) {dev_err (&pdev->dev,"registering %s failed (err=%d)\n" ,DRV_NAME , err); - goto exit_unmap; + goto exit_free; }dev_info (&pdev->dev,"%s device registered (reg_base=0x%p, irq=%d)\n" ,DRV_NAME , priv->reg_base, dev->irq);return 0 ; - exit_unmap: +exit_free: +free_sja1000dev (dev); +exit_unmap:if (mem[idx])iounmap (base); - exit_release: +exit_release:if (mem[idx])release_mem_region (mem[idx], iosize);else release_region (port[idx], iosize); - exit: +exit:return err; }
drivers/net/dsa/lan9303-core.c +1 -1
@@ -681,7 +681,7 @@ static const struct lan9303_mib_desc lan9303_mib[] = { { .offset = LAN9303_MAC_TX_BRDCST_CNT_0, .name = "TxBroad", }, { .offset = LAN9303_MAC_TX_PAUSE_CNT_0, .name = "TxPause", }, { .offset = LAN9303_MAC_TX_MULCST_CNT_0, .name = "TxMulti", }, - { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "TxUnderRun", }, + { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "RxShort", }, { .offset = LAN9303_MAC_TX_64_CNT_0, .name = "Tx64Byte", }, { .offset = LAN9303_MAC_TX_127_CNT_0, .name = "Tx128Byte", }, { .offset = LAN9303_MAC_TX_255_CNT_0, .name = "Tx256Byte", },
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +3 -1
@@ -1243,8 +1243,10 @@ static acpi_status bgx_acpi_match_id(acpi_handle handle, u32 lvl,return AE_OK ; } -if (strncmp (string.pointer, bgx_sel,4 )) +if (strncmp (string.pointer, bgx_sel,4 )) { +kfree (string.pointer);return AE_OK ; + }acpi_walk_namespace (ACPI_TYPE_DEVICE , handle,1 , bgx_acpi_register_phy,NULL , bgx,NULL );
drivers/net/ethernet/mellanox/mlx4/qp.c +2 -1
@@ -697,7 +697,8 @@ static int mlx4_create_zones(struct mlx4_dev *dev, err =mlx4_bitmap_init (*bitmap + k,1 ,MLX4_QP_TABLE_RAW_ETH_SIZE -1 ,0 ,0 ); -mlx4_bitmap_alloc_range (*bitmap + k,1 ,1 ,0 ); +if (!err) +mlx4_bitmap_alloc_range (*bitmap + k,1 ,1 ,0 ); }if (err)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +2 -2
@@ -1309,8 +1309,8 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,return -EFAULT ; err =sscanf (outlen_str,"%d" , &outlen); -if (err <0 ) -return err; +if (err !=1 ) +return -EINVAL ; ptr =kzalloc (outlen,GFP_KERNEL );if (!ptr)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +1 -0
@@ -1221,6 +1221,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, buffer_info->dma =0 ; buffer_info->time_stamp =0 ; tx_ring->next_to_use = ring_num; +dev_kfree_skb_any (skb);return ; } buffer_info->mapped = true;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -0
@@ -2476,6 +2476,7 @@ static netdev_tx_t ql3xxx_send(struct sk_buff *skb, skb_shinfo(skb)->nr_frags);if (tx_cb->seg_count ==-1 ) {netdev_err (ndev,"%s: invalid segment count!\n" , __func__); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +2 -2
@@ -2992,7 +2992,7 @@ static void qlcnic_83xx_recover_driver_lock(struct qlcnic_adapter *adapter)QLCWRX (adapter->ahw,QLC_83XX_RECOVER_DRV_LOCK , val);dev_info (&adapter->pdev->dev,"%s: lock recovery initiated\n" , __func__); -msleep (QLC_83XX_DRV_LOCK_RECOVERY_DELAY ); +mdelay (QLC_83XX_DRV_LOCK_RECOVERY_DELAY ); val =QLCRDX (adapter->ahw,QLC_83XX_RECOVER_DRV_LOCK ); id = ((val >>2 ) &0xF );if (id == adapter->portnum) {
@@ -3028,7 +3028,7 @@ int qlcnic_83xx_lock_driver(struct qlcnic_adapter *adapter)if (status)break ; -msleep (QLC_83XX_DRV_LOCK_WAIT_DELAY ); +mdelay (QLC_83XX_DRV_LOCK_WAIT_DELAY ); i++;if (i ==1 )
drivers/net/ethernet/renesas/ravb_main.c +1 -0
@@ -2335,6 +2335,7 @@ static int __maybe_unused ravb_resume(struct device *dev) ret =ravb_open (ndev);if (ret <0 )return ret; +ravb_set_rx_mode (ndev);netif_device_attach (ndev); }
drivers/net/ntb_netdev.c +8 -1
@@ -506,7 +506,14 @@ static int __init ntb_netdev_init_module(void) rc =ntb_transport_register_client_dev (KBUILD_MODNAME );if (rc)return rc; -return ntb_transport_register_client (&ntb_netdev_client); + + rc =ntb_transport_register_client (&ntb_netdev_client); +if (rc) { +ntb_transport_unregister_client_dev (KBUILD_MODNAME ); +return rc; + } + +return 0 ; }module_init (ntb_netdev_init_module);
drivers/net/phy/phy_device.c +1 -0
@@ -1050,6 +1050,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, error_module_put:module_put (d->driver->owner); + d->driver =NULL ; error_put_device:put_device (d);if (ndev_owner != bus->owner)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1306,6 +1306,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ + {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
drivers/net/wireless/mac80211_hwsim.c +5 -0
@@ -670,6 +670,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,struct hwsim_vif_priv *vp = (void *)vif->drv_priv;struct sk_buff *skb;struct ieee80211_hdr *hdr; +struct ieee80211_tx_info *cb;if (!vp->assoc)return ;
@@ -690,6 +691,10 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,memcpy (hdr->addr2, mac,ETH_ALEN );memcpy (hdr->addr3, vp->bssid,ETH_ALEN ); + cb =IEEE80211_SKB_CB (skb); + cb->control.rates[0 ].count =1 ; + cb->control.rates[1 ].idx =-1 ; +rcu_read_lock ();mac80211_hwsim_tx_frame (data->hw, skb,rcu_dereference (vif->chanctx_conf)->def.chan);
drivers/nfc/st-nci/se.c +4 -2
@@ -338,7 +338,7 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,* AID 81 5 to 16 * PARAMETERS 82 0 to 255 */ -if (skb->len <NFC_MIN_AID_LENGTH +2 && +if (skb->len <NFC_MIN_AID_LENGTH +2 || skb->data[0 ] !=NFC_EVT_TRANSACTION_AID_TAG )return -EPROTO ;
@@ -352,8 +352,10 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,/* Check next byte is PARAMETERS tag (82) */ if (skb->data[transaction->aid_len +2 ] != -NFC_EVT_TRANSACTION_PARAMS_TAG ) +NFC_EVT_TRANSACTION_PARAMS_TAG ) { +devm_kfree (dev, transaction);return -EPROTO ; + } transaction->params_len = skb->data[transaction->aid_len +3 ]; memcpy(transaction->params, skb->data +
drivers/nvme/host/core.c +6 -0
@@ -2022,11 +2022,17 @@ static long nvme_dev_ioctl(struct file *file, unsigned int cmd,case NVME_IOCTL_IO_CMD :return nvme_dev_user_cmd (ctrl, argp);case NVME_IOCTL_RESET : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;dev_warn (ctrl->device,"resetting controller\n" );return nvme_reset_ctrl_sync (ctrl);case NVME_IOCTL_SUBSYS_RESET : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;return nvme_reset_subsystem (ctrl);case NVME_IOCTL_RESCAN : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;nvme_queue_scan (ctrl);return 0 ;default :
drivers/of/property.c +3 -1
@@ -922,8 +922,10 @@ of_fwnode_get_reference_args(const struct fwnode_handle *fwnode, nargs, index, &of_args);if (ret <0 )return ret; -if (!args) +if (!args) { +of_node_put (of_args.np);return 0 ; + } args->nargs = of_args.args_count; args->fwnode =of_fwnode_handle (of_args.np);
drivers/pinctrl/pinctrl-single.c +1 -1
@@ -681,7 +681,7 @@ static int pcs_allocate_pin_table(struct pcs_device *pcs) mux_bytes = pcs->width /BITS_PER_BYTE ; -if (pcs->bits_per_mux) { +if (pcs->bits_per_mux && pcs->fmask) { pcs->bits_per_pin =fls (pcs->fmask); nr_pins = (pcs->size *BITS_PER_BYTE ) / pcs->bits_per_pin; num_pins_in_register = pcs->width / pcs->bits_per_pin;
drivers/platform/x86/acer-wmi.c +9 -0
@@ -549,6 +549,15 @@ static const struct dmi_system_id acer_quirks[] __initconst = { }, .driver_data = (void *)ACER_CAP_KBD_DOCK, }, + { + .callback = set_force_caps, + .ident = "Acer Aspire Switch V 10 SW5-017", + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), + }, + .driver_data = (void *)ACER_CAP_KBD_DOCK, + }, { .callback = set_force_caps, .ident = "Acer One 10 (S1003)",
drivers/platform/x86/asus-wmi.c +2 -0
@@ -1107,6 +1107,8 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)pci_write_config_dword (xhci_pdev,USB_INTEL_XUSB2PR ,cpu_to_le32 (ports_available)); +pci_dev_put (xhci_pdev); +pr_info ("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n" , orig_ports_available, ports_available); }
drivers/platform/x86/hp-wmi.c +3 -0
@@ -76,6 +76,7 @@ enum hp_wmi_event_ids {HPWMI_PEAKSHIFT_PERIOD =0x0F ,HPWMI_BATTERY_CHARGE_PERIOD =0x10 ,HPWMI_SANITIZATION_MODE =0x17 , + HPWMI_SMART_EXPERIENCE_APP = 0x21, }; struct bios_args {
@@ -634,6 +635,8 @@ static void hp_wmi_notify(u32 value, void *context)break ;case HPWMI_SANITIZATION_MODE :break ; +case HPWMI_SMART_EXPERIENCE_APP : +break ;default :pr_info ("Unknown event_id - %d - 0x%x\n" , event_id, event_data);break ;
drivers/s390/block/dasd_eckd.c +2 -4
@@ -3783,7 +3783,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,struct dasd_device *basedev;struct req_iterator iter;struct dasd_ccw_req *cqr; -unsigned int first_offs;unsigned int trkcount;unsigned long *idaws;unsigned int size;
@@ -3817,7 +3816,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev, last_trk = (blk_rq_pos (req) +blk_rq_sectors (req) -1 ) /DASD_RAW_SECTORS_PER_TRACK ; trkcount = last_trk - first_trk +1 ; - first_offs =0 ;if (rq_data_dir (req) ==READ ) cmd =DASD_ECKD_CCW_READ_TRACK ;
@@ -3861,13 +3859,13 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,if (use_prefix) {prefix_LRE (ccw++, data, first_trk, last_trk, cmd, basedev, - startdev,1 , first_offs +1 , trkcount,0 ,0 ); + startdev,1 ,0 , trkcount,0 ,0 ); }else {define_extent (ccw++, data, first_trk, last_trk, cmd, basedev,0 ); ccw[-1 ].flags |=CCW_FLAG_CC ; data +=sizeof (struct DE_eckd_data ); -locate_record_ext (ccw++, data, first_trk, first_offs +1 , +locate_record_ext (ccw++, data, first_trk,0 , trkcount, cmd, basedev,0 ,0 ); }
drivers/spi/spi-stm32.c +1 -1
@@ -255,7 +255,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)u32 div, mbrdiv;/* Ensure spi->clk_rate is even */ - div =DIV_ROUND_UP (spi->clk_rate & ~0x1 , speed_hz); + div =DIV_ROUND_CLOSEST (spi->clk_rate & ~0x1 , speed_hz);/* * SPI framework set xfer->speed_hz to master->max_speed_hz if
drivers/tty/serial/8250/8250_omap.c +4 -3
@@ -242,6 +242,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) {struct omap8250_priv *priv = up->port.private_data;struct uart_8250_dma *dma = up->dma; +u8 mcr =serial8250_in_MCR (up);if (dma && dma->tx_running) {/*
@@ -258,7 +259,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up)serial_out (up,UART_EFR ,UART_EFR_ECB );serial_out (up,UART_LCR ,UART_LCR_CONF_MODE_A ); -serial8250_out_MCR (up,UART_MCR_TCRTLR ); +serial8250_out_MCR (up, mcr |UART_MCR_TCRTLR );serial_out (up,UART_FCR , up->fcr);omap8250_update_scr (up, priv);
@@ -274,7 +275,8 @@ static void omap8250_restore_regs(struct uart_8250_port *up)serial_out (up,UART_LCR ,0 );/* drop TCR + TLR access, we setup XON/XOFF later */ -serial8250_out_MCR (up, up->mcr); +serial8250_out_MCR (up, mcr); +serial_out (up,UART_IER , up->ier);serial_out (up,UART_LCR ,UART_LCR_CONF_MODE_B );
@@ -583,7 +585,6 @@ static int omap_8250_startup(struct uart_port *port)pm_runtime_get_sync (port->dev); - up->mcr =0 ;serial_out (up,UART_FCR ,UART_FCR_CLEAR_RCVR |UART_FCR_CLEAR_XMIT );serial_out (up,UART_LCR ,UART_LCR_WLEN8 );
drivers/xen/platform-pci.c +5 -2
@@ -150,7 +150,7 @@ static int platform_pci_probe(struct pci_dev *pdev,if (ret) {dev_warn (&pdev->dev,"Unable to set the evtchn callback " "err=%d\n" , ret); - goto out; + goto irq_out; } }
@@ -158,13 +158,16 @@ static int platform_pci_probe(struct pci_dev *pdev, grant_frames =alloc_xen_mmio (PAGE_SIZE * max_nr_gframes); ret =gnttab_setup_auto_xlat_frames (grant_frames);if (ret) - goto out; + goto irq_out; ret =gnttab_init ();if (ret) goto grant_out;return 0 ; grant_out:gnttab_free_auto_xlat_frames (); +irq_out: +if (!xen_have_vector_callback) +free_irq (pdev->irq, pdev); out:pci_release_region (pdev,0 ); mem_out:
fs/btrfs/qgroup.c +1 -8
@@ -2239,14 +2239,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, dstgroup->rsv_rfer = inherit->lim.rsv_rfer; dstgroup->rsv_excl = inherit->lim.rsv_excl; - ret =update_qgroup_limit_item (trans, quota_root, dstgroup); -if (ret) { - fs_info->qgroup_flags |=BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT ; -btrfs_info (fs_info, -"unable to update quota limit for %llu" , - dstgroup->qgroupid); - goto unlock; - } +qgroup_dirty (fs_info, dstgroup); }if (srcid) {
fs/nilfs2/dat.c +7 -0
@@ -120,6 +120,13 @@ static void nilfs_dat_commit_free(struct inode *dat,kunmap_atomic (kaddr);nilfs_dat_commit_entry (dat, req); + +if (unlikely (req->pr_desc_bh ==NULL || req->pr_bitmap_bh ==NULL )) { +nilfs_error (dat->i_sb, +"state inconsistency probably due to duplicate use of vblocknr = %llu" , + (unsigned long long )req->pr_entry_nr); +return ; + }nilfs_palloc_commit_free_entry (dat, req); }
fs/nilfs2/sufile.c +8 -0
@@ -507,14 +507,22 @@ void nilfs_sufile_do_free(struct inode *sufile, __u64 segnum,int nilfs_sufile_mark_dirty (struct inode *sufile,__u64 segnum) {struct buffer_head *bh; +void *kaddr; +struct nilfs_segment_usage *su;int ret; +down_write (&NILFS_MDT (sufile)->mi_sem); ret =nilfs_sufile_get_segment_usage_block (sufile, segnum,0 , &bh);if (!ret) {mark_buffer_dirty (bh);nilfs_mdt_mark_dirty (sufile); + kaddr =kmap_atomic (bh->b_page); + su =nilfs_sufile_block_get_segment_usage (sufile, segnum, bh, kaddr); +nilfs_segment_usage_set_dirty (su); +kunmap_atomic (kaddr);brelse (bh); } +up_write (&NILFS_MDT (sufile)->mi_sem);return ret; }
include/linux/perf_event.h +2 -0
@@ -899,6 +899,7 @@ struct perf_sample_data {* Fields set by perf_sample_data_init(), group so as to * minimize the cachelines touched. */ +u64 sample_flags;u64 addr;struct perf_raw_record *raw;struct perf_branch_stack *br_stack;
@@ -950,6 +951,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, u64 addr, u64 period) {/* remaining struct members initialized in perf_prepare_sample() */ + data->sample_flags =0 ; data->addr = addr; data->raw =NULL ; data->br_stack =NULL ;
include/uapi/linux/audit.h +1 -1
@@ -172,7 +172,7 @@#define AUDIT_MAX_KEY_LEN 256#define AUDIT_BITMASK_SIZE 64#define AUDIT_WORD (nr) ((__u32)((nr)/32)) -#define AUDIT_BIT (nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) +#define AUDIT_BIT (nr) (1U << ((nr) - AUDIT_WORD(nr)*32))#define AUDIT_SYSCALL_CLASSES 16#define AUDIT_CLASS_DIR_WRITE 0
ipc/sem.c +2 -1
@@ -2064,6 +2064,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,* scenarios where we were awakened externally, during the * window between wake_q_add() and wake_up_q(). */ +rcu_read_lock (); error =READ_ONCE (queue.status);if (error != -EINTR ) {/*
@@ -2073,10 +2074,10 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,* overwritten by the previous owner of the semaphore. */ smp_mb (); +rcu_read_unlock (); goto out_free; } -rcu_read_lock (); locknum =sem_lock (sma, sops, nsops);if (!ipc_valid_object (&sma->sem_perm))
kernel/events/core.c +11 -6
@@ -5767,11 +5767,10 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,static void __perf_event_header__init_id (struct perf_event_header *header,struct perf_sample_data *data, -struct perf_event *event) +struct perf_event *event, +u64 sample_type) { -u64 sample_type = event->attr.sample_type; - - data->type = sample_type; + data->type = event->attr.sample_type; header->size += event->id_header_size;if (sample_type &PERF_SAMPLE_TID ) {
@@ -5800,7 +5799,7 @@ void perf_event_header__init_id(struct perf_event_header *header, struct perf_event *event) {if (event->attr.sample_id_all) -__perf_event_header__init_id (header, data, event); +__perf_event_header__init_id (header, data, event, event->attr.sample_type); } static void __perf_event__output_id_sample(struct perf_output_handle *handle,
@@ -6148,6 +6147,7 @@ void perf_prepare_sample(struct perf_event_header *header, struct pt_regs *regs) {u64 sample_type = event->attr.sample_type; +u64 filtered_sample_type; header->type =PERF_RECORD_SAMPLE ; header->size =sizeof (*header) + event->header_size;
@@ -6155,7 +6155,12 @@ void perf_prepare_sample(struct perf_event_header *header, header->misc =0 ; header->misc |=perf_misc_flags (regs); -__perf_event_header__init_id (header, data, event); +/* +* Clear the sample flags that have already been done by the +* PMU driver. +*/ + filtered_sample_type = sample_type & ~data->sample_flags; +__perf_event_header__init_id (header, data, event, filtered_sample_type);if (sample_type &PERF_SAMPLE_IP ) data->ip =perf_instruction_pointer (regs);
kernel/sysctl.c +15 -15
@@ -2066,13 +2066,14 @@ int proc_dostring(struct ctl_table *table, int write, (char __user *)buffer, lenp, ppos); } -static size_t proc_skip_spaces (char **buf) +static void proc_skip_spaces (char **buf,size_t *size) { -size_t ret; -char *tmp =skip_spaces (*buf); - ret = tmp - *buf; - *buf = tmp; -return ret; +while (*size) { +if (!isspace (**buf)) +break ; + (*size)--; + (*buf)++; + } }static void proc_skip_char (char **buf,size_t *size,const char v)
@@ -2106,13 +2107,12 @@ static int proc_get_long(char **buf, size_t *size, unsigned long *val, bool *neg, const char *perm_tr, unsigned perm_tr_len, char *tr) { - int len; char *p, tmp[TMPBUFLEN]; +ssize_t len = *size; -if (!*size) +if (len <=0 )return -EINVAL ; - len = *size;if (len >TMPBUFLEN -1 ) len =TMPBUFLEN -1 ;
@@ -2274,7 +2274,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,bool neg;if (write) { - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left)break ;
@@ -2305,7 +2305,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,if (!write && !first && left && !err) err =proc_put_char (&buffer, &left,'\n' );if (write && !err && left) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (write) {kfree (kbuf);if (first)
@@ -2354,7 +2354,7 @@ static int do_proc_douintvec_w(unsigned int *tbl_data,if (IS_ERR (kbuf))return -EINVAL ; - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left) { err = -EINVAL ; goto out_free;
@@ -2374,7 +2374,7 @@ static int do_proc_douintvec_w(unsigned int *tbl_data, }if (!err && left) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left); out_free:kfree (kbuf);
@@ -2749,7 +2749,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, intif (write) {bool neg; - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left)break ;
@@ -2782,7 +2782,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, intif (!write && !first && left && !err) err =proc_put_char (&buffer, &left,'\n' );if (write && !err) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (write) {kfree (kbuf);if (first)
mm/frame_vector.c +6 -25
@@ -37,7 +37,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,struct mm_struct *mm = current->mm;struct vm_area_struct *vma;int ret =0 ; -int err;int locked;if (nr_frames ==0 )
@@ -72,32 +71,14 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, vec->is_pfns = false; ret =get_user_pages_locked (start, nr_frames, gup_flags, (struct page **)(vec->ptrs), &locked); - goto out; +if (likely (ret >0 )) + goto out; } - vec->got_ref = false; - vec->is_pfns = true; -do { -unsigned long *nums =frame_vector_pfns (vec); - -while (ret < nr_frames && start +PAGE_SIZE <= vma->vm_end) { - err =follow_pfn (vma, start, &nums[ret]); -if (err) { -if (ret ==0 ) - ret = err; - goto out; - } - start +=PAGE_SIZE ; - ret++; - } -/* -* We stop if we have enough pages or if VMA doesn't completely -* cover the tail page. -*/ -if (ret >= nr_frames || start < vma->vm_end) -break ; - vma =find_vma_intersection (mm, start, start +1 ); - }while (vma && vma->vm_flags & (VM_IO |VM_PFNMAP )); +/* This used to (racily) return non-refcounted pfns. Let people know */ +WARN_ONCE (1 ,"get_vaddr_frames() cannot follow VM_IO mapping" ); + vec->nr_frames =0 ; + out:if (locked)up_read (&mm->mmap_sem);
net/9p/trans_fd.c +5 -1
@@ -214,9 +214,11 @@ static void p9_conn_cancel(struct p9_conn *m, int err)list_for_each_entry_safe (req, rtmp, &m->req_list, req_list) {list_move (&req->req_list, &cancel_list); + req->status =REQ_STATUS_ERROR ; }list_for_each_entry_safe (req, rtmp, &m->unsent_req_list, req_list) {list_move (&req->req_list, &cancel_list); + req->status =REQ_STATUS_ERROR ; }spin_unlock (&m->client->lock);
@@ -863,8 +865,10 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)struct file *file; p =kzalloc (sizeof (struct p9_trans_fd ),GFP_KERNEL ); -if (!p) +if (!p) { +sock_release (csocket);return -ENOMEM ; + } csocket->sk->sk_allocation =GFP_NOIO ; file =sock_alloc_file (csocket,0 ,NULL );
net/bluetooth/l2cap_core.c +13 -0
@@ -5553,6 +5553,19 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,BT_DBG ("psm 0x%2.2x scid 0x%4.4x mtu %u mps %u" ,__le16_to_cpu (psm), scid, mtu, mps); +/* BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part A +* page 1059: +* +* Valid range: 0x0001-0x00ff +* +* Table 4.15: L2CAP_LE_CREDIT_BASED_CONNECTION_REQ SPSM ranges +*/ +if (!psm ||__le16_to_cpu (psm) >L2CAP_PSM_LE_DYN_END ) { + result =L2CAP_CR_BAD_PSM ; + chan =NULL ; + goto response; + } +/* Check if we have socket listening on psm */ pchan =l2cap_global_chan_by_psm (BT_LISTEN , psm, &conn->hcon->src, &conn->hcon->dst,LE_LINK );
net/dccp/ipv4.c +2 -0
@@ -134,6 +134,8 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)* This unhashes the socket and releases the local port, if necessary. */ dccp_set_state (sk,DCCP_CLOSED ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);ip_rt_put (rt); sk->sk_route_caps =0 ; inet->inet_dport =0 ;
net/dccp/ipv6.c +2 -0
@@ -957,6 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, late_failure:dccp_set_state (sk,DCCP_CLOSED ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);__sk_dst_reset (sk); failure: inet->inet_dport =0 ;
net/hsr/hsr_forward.c +3 -2
@@ -207,17 +207,18 @@ static void hsr_deliver_master(struct sk_buff *skb, struct net_device *dev, struct hsr_node *node_src) {bool was_multicast_frame; -int res; +int res, recv_len; was_multicast_frame = (skb->pkt_type ==PACKET_MULTICAST );hsr_addr_subst_source (node_src, skb);skb_pull (skb,ETH_HLEN ); + recv_len = skb->len; res =netif_rx (skb);if (res ==NET_RX_DROP ) { dev->stats.rx_dropped++; }else { dev->stats.rx_packets++; - dev->stats.rx_bytes += skb->len; + dev->stats.rx_bytes += recv_len;if (was_multicast_frame) dev->stats.multicast++; }
net/ipv4/Kconfig +10 -0
@@ -383,6 +383,16 @@ config INET_IPCOMP If unsure, say Y. +config INET_TABLE_PERTURB_ORDER + int "INET: Source port perturbation table size (as power of 2)" if EXPERT + default 16 + help + Source port perturbation table size (as power of 2) for + RFC 6056 3.3.4. Algorithm 4: Double-Hash Port Selection Algorithm. + + The default is almost always what you want. + Only change this if you know what you are doing. + config INET_XFRM_TUNNEL tristate select INET_TUNNEL
net/ipv4/inet_hashtables.c +5 -5
@@ -591,13 +591,13 @@ EXPORT_SYMBOL_GPL(inet_unhash);* Note that we use 32bit integers (vs RFC 'short integers') * because 2^16 is not a multiple of num_ephemeral and this * property might be used by clever attacker. +* * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, though -* attacks were since demonstrated, thus we use 65536 instead to really -* give more isolation and privacy, at the expense of 256kB of kernel -* memory. +* attacks were since demonstrated, thus we use 65536 by default instead +* to really give more isolation and privacy, at the expense of 256kB +* of kernel memory. */ -#define INET_TABLE_PERTURB_SHIFT 16 -#define INET_TABLE_PERTURB_SIZE (1 << INET_TABLE_PERTURB_SHIFT) +#define INET_TABLE_PERTURB_SIZE (1 << CONFIG_INET_TABLE_PERTURB_ORDER)static u32 *table_perturb; int __inet_hash_connect(struct inet_timewait_death_row *death_row,
net/ipv4/tcp_ipv4.c +2 -0
@@ -265,6 +265,8 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)* if necessary. */ tcp_set_state (sk,TCP_CLOSE ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);ip_rt_put (rt); sk->sk_route_caps =0 ; inet->inet_dport =0 ;
net/ipv6/ipv6_sockglue.c +7 -0
@@ -166,6 +166,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,rtnl_lock ();lock_sock (sk); +/* Another thread has converted the socket into IPv4 with +* IPV6_ADDRFORM concurrently. +*/ +if (unlikely (sk->sk_family !=AF_INET6 )) + goto unlock; +switch (optname) {case IPV6_ADDRFORM :
@@ -905,6 +911,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,break ; } +unlock:release_sock (sk);if (needs_rtnl)rtnl_unlock ();
net/ipv6/tcp_ipv6.c +2 -0
@@ -310,6 +310,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, late_failure:tcp_set_state (sk,TCP_CLOSE ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk); failure: inet->inet_dport =0 ; sk->sk_route_caps =0 ;
net/ipv6/xfrm6_policy.c +5 -1
@@ -412,9 +412,13 @@ int __init xfrm6_init(void)if (ret) goto out_state; -register_pernet_subsys (&xfrm6_net_ops); + ret =register_pernet_subsys (&xfrm6_net_ops); +if (ret) + goto out_protocol; out:return ret; +out_protocol: +xfrm6_protocol_fini (); out_state:xfrm6_state_fini (); out_policy:
net/key/af_key.c +22 -10
@@ -2913,7 +2913,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)break ;if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); }return sz +sizeof (struct sadb_prop );
@@ -2931,7 +2931,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!ealg->pfkey_supported)continue ; -if (!(ealg_tmpl_set (t, ealg) && ealg->available)) +if (!(ealg_tmpl_set (t, ealg)))continue ;for (k =1 ; ; k++) {
@@ -2942,16 +2942,17 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); } }return sz +sizeof (struct sadb_prop ); } -static void dump_ah_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) +static int dump_ah_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) {struct sadb_prop *p; +int sz =0 ;int i; p =skb_put (skb,sizeof (struct sadb_prop ));
@@ -2979,13 +2980,17 @@ static void dump_ah_combs(struct sk_buff *skb, const struct xfrm_tmpl *t) c->sadb_comb_soft_addtime =20 *60 *60 ; c->sadb_comb_hard_usetime =8 *60 *60 ; c->sadb_comb_soft_usetime =7 *60 *60 ; + sz +=sizeof (*c); } } + +return sz +sizeof (*p); } -static void dump_esp_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) +static int dump_esp_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) {struct sadb_prop *p; +int sz =0 ;int i, k; p =skb_put (skb,sizeof (struct sadb_prop ));
@@ -3027,8 +3032,11 @@ static void dump_esp_combs(struct sk_buff *skb, const struct xfrm_tmpl *t) c->sadb_comb_soft_addtime =20 *60 *60 ; c->sadb_comb_hard_usetime =8 *60 *60 ; c->sadb_comb_soft_usetime =7 *60 *60 ; + sz +=sizeof (*c); } } + +return sz +sizeof (*p); }static int key_notify_policy_expire (struct xfrm_policy *xp,const struct km_event *c)
@@ -3158,6 +3166,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, structstruct sadb_x_sec_ctx *sec_ctx;struct xfrm_sec_ctx *xfrm_ctx;int ctx_size =0 ; +int alg_size =0 ; sockaddr_size =pfkey_sockaddr_size (x->props.family);if (!sockaddr_size)
@@ -3169,16 +3178,16 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, structsizeof (struct sadb_x_policy );if (x->id.proto ==IPPROTO_AH ) - size +=count_ah_combs (t); + alg_size =count_ah_combs (t);else if (x->id.proto ==IPPROTO_ESP ) - size +=count_esp_combs (t); + alg_size =count_esp_combs (t);if ((xfrm_ctx = x->security)) { ctx_size =PFKEY_ALIGN8 (xfrm_ctx->ctx_len); size +=sizeof (struct sadb_x_sec_ctx ) + ctx_size; } - skb =alloc_skb (size +16 ,GFP_ATOMIC ); + skb =alloc_skb (size + alg_size +16 ,GFP_ATOMIC );if (skb ==NULL )return -ENOMEM ;
@@ -3232,10 +3241,13 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct pol->sadb_x_policy_priority = xp->priority;/* Set sadb_comb's. */ + alg_size =0 ;if (x->id.proto ==IPPROTO_AH ) -dump_ah_combs (skb, t); + alg_size =dump_ah_combs (skb, t);else if (x->id.proto ==IPPROTO_ESP ) -dump_esp_combs (skb, t); + alg_size =dump_esp_combs (skb, t); + + hdr->sadb_msg_len += alg_size /8 ;/* security context */ if (xfrm_ctx) {
net/mac80211/mesh_pathtbl.c +1 -1
@@ -793,7 +793,7 @@ int mesh_path_send_to_gates(struct mesh_path *mpath)void mesh_path_discard_frame (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb) { -kfree_skb (skb); +ieee80211_free_txskb (&sdata->local->hw, skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; }
net/nfc/nci/core.c +1 -1
@@ -542,7 +542,7 @@ static int nci_open_device(struct nci_dev *ndev)skb_queue_purge (&ndev->tx_q); ndev->ops->close (ndev); - ndev->flags =0 ; + ndev->flags &=BIT (NCI_UNREG ); } done:
net/nfc/nci/data.c +3 -1
@@ -291,8 +291,10 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb) nci_plen(skb->data)); conn_info =nci_get_conn_info_by_conn_id (ndev,nci_conn_id (skb->data)); -if (!conn_info) +if (!conn_info) { +kfree_skb (skb);return ; + }/* strip the nci data header */ skb_pull (skb,NCI_DATA_HDR_SIZE );
net/packet/af_packet.c +2 -4
@@ -2248,8 +2248,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,if (skb->ip_summed ==CHECKSUM_PARTIAL ) status |=TP_STATUS_CSUMNOTREADY ;else if (skb->pkt_type !=PACKET_OUTGOING && - (skb->ip_summed ==CHECKSUM_COMPLETE || -skb_csum_unnecessary (skb))) +skb_csum_unnecessary (skb)) status |=TP_STATUS_CSUM_VALID ;if (snaplen > res)
@@ -3488,8 +3487,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,if (skb->ip_summed ==CHECKSUM_PARTIAL ) aux.tp_status |=TP_STATUS_CSUMNOTREADY ;else if (skb->pkt_type !=PACKET_OUTGOING && - (skb->ip_summed ==CHECKSUM_COMPLETE || -skb_csum_unnecessary (skb))) +skb_csum_unnecessary (skb)) aux.tp_status |=TP_STATUS_CSUM_VALID ; aux.tp_len = origlen;
scripts/kconfig/symbol.c +6 -2
@@ -1150,8 +1150,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)if (stack->sym == last_sym)fprintf (stderr,"%s:%d:error: recursive dependency detected!\n" , prop->file->name, prop->lineno); -fprintf (stderr,"For a resolution refer to Documentation/kbuild/kconfig-language.txt\n" ); -fprintf (stderr,"subsection \"Kconfig recursive dependency limitations\"\n" ); +if (stack->expr) { fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", prop->file->name, prop->lineno,
@@ -1181,6 +1180,11 @@ static void sym_check_print_recursive(struct symbol *last_sym) } } +fprintf (stderr, +"For a resolution refer to Documentation/kbuild/kconfig-language.txt\n" +"subsection \"Kconfig recursive dependency limitations\"\n" +"\n" ); +if (check_top == &cv_stack)dep_stack_remove (); }
sound/soc/soc-ops.c +1 -1
@@ -450,7 +450,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, val = ucontrol->value.integer.value[0 ];if (mc->platform_max && val > mc->platform_max)return -EINVAL ; -if (val > max - min) +if (val > max)return -EINVAL ;if (val <0 )return -EINVAL ;
tools/vm/slabinfo-gnuplot.sh +2 -2
@@ -157,7 +157,7 @@ do_preprocess() let lines=3 out=`basename "$in"`"-slabs-by-loss" `cat "$in" | grep -A "$lines" 'Slabs sorted by loss' |\ - egrep -iv '\-\-|Name|Slabs'\ + grep -E -iv '\-\-|Name|Slabs'\ | awk '{print $1" "$4+$2*$3" "$4}' > "$out"` if [ $? -eq 0 ]; then do_slabs_plotting "$out"
@@ -166,7 +166,7 @@ do_preprocess() let lines=3 out=`basename "$in"`"-slabs-by-size" `cat "$in" | grep -A "$lines" 'Slabs sorted by size' |\ - egrep -iv '\-\-|Name|Slabs'\ + grep -E -iv '\-\-|Name|Slabs'\ | awk '{print $1" "$4" "$4-$2*$3}' > "$out"` if [ $? -eq 0 ]; then do_slabs_plotting "$out"