Linux 4.14.181
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.181 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 | 23 +- arch/arm/boot/dts/dra7.dtsi | 4 arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts | 4 arch/arm/boot/dts/r8a73a4.dtsi | 9 arch/arm/boot/dts/r8a7740.dtsi | 2 arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 2 arch/arm64/boot/dts/rockchip/rk3328-rock64.dts | 2 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 4 arch/x86/entry/calling.h | 38 ++-- arch/x86/entry/entry_64.S | 5 arch/x86/include/asm/bitops.h | 29 +-- arch/x86/include/asm/percpu.h | 2 arch/x86/include/asm/stackprotector.h | 7 arch/x86/kernel/smpboot.c | 8 arch/x86/kernel/unwind_orc.c | 20 +- arch/x86/kvm/x86.c | 2 arch/x86/xen/smp_pv.c | 1 crypto/lrw.c | 4 crypto/xts.c | 4 drivers/block/virtio_blk.c | 86 ++++++++- drivers/char/ipmi/ipmi_ssif.c | 4 drivers/clk/rockchip/clk-rk3228.c | 17 - drivers/cpufreq/intel_pstate.c | 2 drivers/dma/mmp_tdma.c | 2 drivers/dma/pch_dma.c | 2 drivers/gpu/drm/qxl/qxl_image.c | 3 drivers/hid/usbhid/hid-core.c | 37 +++ drivers/hid/usbhid/usbhid.h | 1 drivers/hid/wacom_sys.c | 4 drivers/hwmon/da9052-hwmon.c | 4 drivers/infiniband/core/addr.c | 7 drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 drivers/infiniband/hw/mlx4/qp.c | 14 + drivers/infiniband/sw/rxe/rxe_net.c | 8 drivers/net/dsa/dsa_loop.c | 1 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 18 + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 9 drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 16 + drivers/net/ethernet/huawei/hinic/hinic_main.c | 16 - drivers/net/ethernet/mellanox/mlx4/main.c | 4 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 6 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 11 - drivers/net/ethernet/moxa/moxart_ether.c | 2 drivers/net/ethernet/natsemi/jazzsonic.c | 6 drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 31 +-- drivers/net/geneve.c | 20 +- drivers/net/macsec.c | 3 drivers/net/phy/dp83640.c | 2 drivers/net/phy/micrel.c | 4 drivers/net/phy/phy.c | 8 drivers/net/usb/qmi_wwan.c | 1 drivers/net/vxlan.c | 8 drivers/pinctrl/intel/pinctrl-baytrail.c | 1 drivers/pinctrl/intel/pinctrl-cherryview.c | 4 drivers/scsi/sg.c | 4 drivers/usb/core/hub.c | 6 drivers/usb/gadget/configfs.c | 3 drivers/usb/gadget/legacy/audio.c | 4 drivers/usb/gadget/legacy/cdc2.c | 4 drivers/usb/gadget/legacy/ncm.c | 4 drivers/usb/gadget/udc/net2272.c | 2 drivers/usb/host/xhci-plat.c | 4 drivers/usb/host/xhci-ring.c | 4 drivers/usb/serial/garmin_gps.c | 4 drivers/usb/serial/qcserial.c | 1 drivers/usb/storage/unusual_uas.h | 7 fs/coredump.c | 8 fs/exec.c | 4 fs/f2fs/xattr.c | 176 +++++++++++------- fs/f2fs/xattr.h | 2 include/linux/blkdev.h | 2 include/linux/blktrace_api.h | 18 + include/linux/compiler.h | 6 include/linux/fs.h | 2 include/linux/pnp.h | 29 --- include/linux/tty.h | 2 include/linux/virtio_net.h | 24 ++ include/net/addrconf.h | 6 include/net/ipv6.h | 2 include/net/netfilter/nf_conntrack.h | 2 include/sound/rawmidi.h | 1 init/main.c | 2 ipc/util.c | 12 - kernel/trace/blktrace.c | 177 ++++++++++++++----- kernel/trace/trace.c | 13 + kernel/umh.c | 5 mm/page_alloc.c | 1 mm/shmem.c | 7 net/batman-adv/bat_v_ogm.c | 2 net/batman-adv/network-coding.c | 9 net/batman-adv/sysfs.c | 3 net/core/dev.c | 4 net/core/drop_monitor.c | 11 - net/core/netprio_cgroup.c | 2 net/dccp/ipv6.c | 6 net/ipv4/cipso_ipv4.c | 6 net/ipv4/route.c | 2 net/ipv4/tcp.c | 6 net/ipv6/addrconf_core.c | 11 - net/ipv6/af_inet6.c | 10 - net/ipv6/calipso.c | 3 net/ipv6/datagram.c | 2 net/ipv6/inet6_connection_sock.c | 4 net/ipv6/ip6_output.c | 8 net/ipv6/raw.c | 2 net/ipv6/route.c | 6 net/ipv6/syncookies.c | 2 net/ipv6/tcp_ipv6.c | 4 net/l2tp/l2tp_ip6.c | 2 net/mpls/af_mpls.c | 7 net/netfilter/nf_conntrack_core.c | 4 net/netfilter/nf_nat_proto_udp.c | 5 net/netlabel/netlabel_kapi.c | 6 net/sched/sch_choke.c | 3 net/sched/sch_fq_codel.c | 2 net/sched/sch_sfq.c | 9 net/sctp/ipv6.c | 4 net/tipc/udp_media.c | 9 scripts/decodecode | 2 sound/core/rawmidi.c | 35 +++ sound/pci/hda/patch_hdmi.c | 2 sound/pci/hda/patch_realtek.c | 28 ++- sound/usb/quirks.c | 9 tools/objtool/check.c | 2 virt/kvm/arm/vgic/vgic-mmio.c | 4 128 files changed, 891 insertions(+), 442 deletions(-)
Alan Stern (1):
HID: usbhid: Fix race between usbhid_close() and usbhid_stop()
Andy Shevchenko (1):
pinctrl: baytrail: Enable pin configuration setting for GPIO chip
Arnd Bergmann (2):
drop_monitor: work around gcc-10 stringop-overflow warning
netfilter: conntrack: avoid gcc-10 zero-length-bounds warning
Borislav Petkov (1):
x86: Fix early boot crash on gcc-10, third try
Cengiz Can (1):
blktrace: fix dereference after null check
Chao Yu (2):
f2fs: introduce read_inline_xattr
f2fs: introduce read_xattr_block
Chen-Yu Tsai (2):
arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 boards
arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy
Chris Wilson (1):
cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once
Christophe JAILLET (4):
net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()'
net: moxa: Fix a potential double 'free_irq()'
usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'
usb: gadget: audio: Fix a missing error return value in audio_bind()
Cong Wang (1):
net: fix a potential recursive NETDEV_FEAT_CHANGE
Dan Carpenter (1):
i40iw: Fix error handling in i40iw_manage_arp_cache()
David Hildenbrand (1):
mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous()
Eric Dumazet (3):
fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
sch_choke: avoid potential panic in choke_reset()
sch_sfq: validate silly quantum values
Eric W. Biederman (1):
exec: Move would_dump into flush_old_exec
Eugeniu Rosca (1):
usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B
Fabio Estevam (1):
ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries
Florian Fainelli (2):
net: phy: micrel: Use strlcpy() for ethtool::get_strings
net: dsa: loop: Add module soft dependency
Geert Uytterhoeven (2):
ARM: dts: r8a73a4: Add missing CMT1 interrupts
ARM: dts: r8a7740: Add missing extal2 to CPG node
George Spelvin (1):
batman-adv: fix batadv_nc_random_weight_tq
Grace Kao (1):
pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler
Greg Kroah-Hartman (1):
Linux 4.14.181
Guillaume Nault (1):
netfilter: nat: never update the UDP checksum when it's 0
Gustavo A. R. Silva (1):
ipmi: Fix NULL pointer dereference in ssif_probe
Hangbin Liu (1):
geneve: only configure or fill UDP_ZERO_CSUM6_RX/TX info when CONFIG_IPV6
Heiner Kallweit (1):
net: phy: fix aneg restart in phy_ethtool_set_eee
Hugh Dickins (1):
shmem: fix possible deadlocks on shmlock_user_lock
Ivan Delalande (1):
scripts/decodecode: fix trapping instruction formatting
Jack Morgenstein (1):
IB/mlx4: Test return value of calls to ib_get_cached_pkey
Jaegeuk Kim (1):
f2fs: sanity check of xattr entry size
Jan Beulich (1):
x86/asm: Add instruction suffixes to bitops
Jan Kara (1):
blktrace: Protect q->blk_trace with RCU
Jann Horn (1):
x86/entry/64: Fix unwind hints in rewind_stack_do_exit()
Jason Gerecke (1):
HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices
Jason Gunthorpe (1):
pnp: Use list_for_each_entry() instead of open coding
Jens Axboe (2):
blktrace: fix unlocked access to init/start-stop/teardown
blktrace: fix trace mutex deadlock
Jesus Ramos (1):
ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset
Jim Mattson (1):
KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce
Josh Poimboeuf (6):
x86/entry/64: Fix unwind hints in kernel exit path x86/unwind/orc: Prevent unwinding before ORC initialization x86/unwind/orc: Fix error path for bad ORC entry type
objtool: Fix stack offset tracking for indirect CFAs x86/entry/64: Fix unwind hints in register clearing code x86/unwind/orc: Fix error handling in __unwind_start()
Julia Lawall (1):
dp83640: reverse arguments to list_add_tail
Justin Swartz (1):
clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks
Kai Vehmanen (1):
ALSA: hda/hdmi: fix race in monitor detection during probe
Kai-Heng Feng (2):
ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
Kelly Littlepage (1):
net: tcp: fix rx timestamp behavior for tcp_recvmsg
Kishon Vijay Abraham I (1):
ARM: dts: dra7: Fix bus_dma_limit for PCIe
Kyungtae Kim (1):
USB: gadget: fix illegal array access in binding with UDC
Li Jun (1):
usb: host: xhci-plat: keep runtime active when removing host
Linus Torvalds (7):
gcc-10 warnings: fix low-hanging fruit
Stop the ad-hoc games with -Wno-maybe-initialized
gcc-10: disable 'zero-length-bounds' warning for now
gcc-10: disable 'array-bounds' warning for now
gcc-10: disable 'stringop-overflow' warning for now
gcc-10: disable 'restrict' warning for now
gcc-10: avoid shadowing standard library 'free()' in crypto
Lubomir Rintel (1):
dmaengine: mmp_tdma: Reset channel error on release
Luis Chamberlain (1):
coredump: fix crash when umh is disabled
Luo bin (1):
hinic: fix a bug of ndo_stop
Maciej Żenczykowski (1):
Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu"
Madhuparna Bhowmik (1):
dmaengine: pch_dma.c: Avoid data race between probe and irq handler
Marc Zyngier (1):
KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER
Masahiro Yamada (1):
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
Matt Jolly (2):
USB: serial: qcserial: Add DW5816e support
net: usb: qmi_wwan: add support for DW5816e
Michael Chan (3):
bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features().
bnxt_en: Improve AER slot reset.
bnxt_en: Fix VF anti-spoof filter setup.
Miroslav Benes (1):
x86/unwind/orc: Don't skip the first frame for inactive tasks
Moshe Shemesh (2):
net/mlx5: Fix forced completion access non initialized command entry net/mlx5: Fix command entry leak in Internal Error State
Oliver Neukum (2):
USB: uas: add quirk for LaCie 2Big Quadra
USB: serial: garmin_gps: add sanity checking for data length
Paolo Abeni (2):
netlabel: cope with NULL catmap
net: ipv4: really enforce backoff for redirects
Randall Huang (2):
f2fs: fix to avoid accessing xattr across the boundary
f2fs: fix to avoid memory leakage in f2fs_listxattr
Sabrina Dubroca (3):
ipv6: fix cleanup ordering for ip6_mr failure
net: ipv6: add net argument to ip6_dst_lookup_flow
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
Samu Nuutamo (1):
hwmon: (da9052) Synchronize access with mfd
Scott Dial (1):
net: macsec: preserve ingress frame ordering
Sergei Trofimovich (1):
Makefile: disallow data races on gcc-10 as well
Sriharsha Allenki (1):
usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list
Stefan Hajnoczi (1):
virtio-blk: handle block_device_operations callbacks after hot unplug
Steven Rostedt (VMware) (1):
tracing: Add a vmalloc_sync_mappings() for safe measure
Takashi Iwai (3):
ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
ALSA: rawmidi: Initialize allocated buffers
ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
Tariq Toukan (1):
net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc()
Thierry Reding (1):
net: stmmac: Use mutex instead of spinlock
Vasily Averin (2):
drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
Wei Yongjun (2):
usb: gadget: legacy: fix error return code in gncm_bind()
usb: gadget: legacy: fix error return code in cdc_bind()
Willem de Bruijn (1):
net: stricter validation of untrusted gso packets
Wu Bo (1):
scsi: sg: add sg_remove_request in sg_write
Xiyu Yang (3):
batman-adv: Fix refcnt leak in batadv_show_throughput_override
batman-adv: Fix refcnt leak in batadv_store_throughput_override
batman-adv: Fix refcnt leak in batadv_v_ogm_process
Zefan Li (1):
netprio_cgroup: Fix unlimited memory leak of v2 cgroups
Greg Kroah-Hartman
maintainerMakefile +14 -9
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 180 +SUBLEVEL = 181 EXTRAVERSION = NAME = Petit Gorille
@@ -656,20 +656,14 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) -else -ifdef CONFIG_PROFILE_ALL_BRANCHES -KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += -Os else KBUILD_CFLAGS += -O2 endif -endif - -KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ - $(call cc-disable-warning,maybe-uninitialized,)) # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) +KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races) # check for 'asm goto' ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
@@ -807,6 +801,17 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) # disable stringop warnings in gcc 8+ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) +# We'll want to enable this eventually, but it's not going away for 5.7 at least +KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds) +KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds) +KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) + +# Another good warning that we'll want to enable eventually +KBUILD_CFLAGS += $(call cc-disable-warning, restrict) + +# Enabled with W=2, disabled by default as noisy +KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
arch/arm/boot/dts/dra7.dtsi +2 -2
@@ -289,6 +289,7 @@ #address-cells = <1>; ranges = <0x51000000 0x51000000 0x3000 0x0 0x20000000 0x10000000>; + dma-ranges; /** * To enable PCI endpoint mode, disable the pcie1_rc * node and enable pcie1_ep mode.
@@ -303,7 +304,6 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x03000 0 0x00010000 0x82000000 0 0x20013000 0x13000 0 0xffed000>; - dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; bus-range = <0x00 0xff>; #interrupt-cells = <1>; num-lanes = <1>;
@@ -347,6 +347,7 @@ #address-cells = <1>; ranges = <0x51800000 0x51800000 0x3000 0x0 0x30000000 0x10000000>; + dma-ranges; status = "disabled"; pcie@51800000 { compatible = "ti,dra7-pcie";
@@ -358,7 +359,6 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x03000 0 0x00010000 0x82000000 0 0x30013000 0x13000 0 0xffed000>; - dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; bus-range = <0x00 0xff>; #interrupt-cells = <1>; num-lanes = <1>;
arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts +2 -2
@@ -81,8 +81,8 @@ imx27-phycard-s-rdk { pinctrl_i2c1: i2c1grp { fsl,pins = < - MX27_PAD_I2C2_SDA__I2C2_SDA 0x0 - MX27_PAD_I2C2_SCL__I2C2_SCL 0x0 + MX27_PAD_I2C_DATA__I2C_DATA 0x0 + MX27_PAD_I2C_CLK__I2C_CLK 0x0 >; };
arch/arm/boot/dts/r8a73a4.dtsi +8 -1
@@ -133,7 +133,14 @@ cmt1: timer@e6130000 { compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2"; reg = <0 0xe6130000 0 0x1004>; - interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A73A4_CLK_CMT1>; clock-names = "fck"; power-domains = <&pd_c5>;
arch/arm/boot/dts/r8a7740.dtsi +1 -1
@@ -467,7 +467,7 @@ cpg_clocks: cpg_clocks@e6150000 { compatible = "renesas,r8a7740-cpg-clocks"; reg = <0xe6150000 0x10000>; - clocks = <&extal1_clk>, <&extalr_clk>; + clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>; #clock-cells = <1>; clock-output-names = "system", "pllc0", "pllc1", "pllc2", "r",
arch/arm64/boot/dts/rockchip/rk3328-evb.dts +1 -1
@@ -91,7 +91,7 @@ &i2c1 { status = "okay"; - rk805: rk805@18 { + rk805: pmic@18 { compatible = "rockchip,rk805"; reg = <0x18>; interrupt-parent = <&gpio2>;
arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +1 -1
@@ -149,7 +149,7 @@ &i2c1 { status = "okay"; - rk805: rk805@18 { + rk805: pmic@18 { compatible = "rockchip,rk805"; reg = <0x18>; interrupt-parent = <&gpio2>;
arch/arm64/boot/dts/rockchip/rk3399.dtsi +2 -2
@@ -402,7 +402,7 @@ "bus_clk", "grf_clk"; status = "disabled"; - usbdrd_dwc3_0: dwc3 { + usbdrd_dwc3_0: usb@fe800000 { compatible = "snps,dwc3"; reg = <0x0 0xfe800000 0x0 0x100000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -430,7 +430,7 @@ "bus_clk", "grf_clk"; status = "disabled"; - usbdrd_dwc3_1: dwc3 { + usbdrd_dwc3_1: usb@fe900000 { compatible = "snps,dwc3"; reg = <0x0 0xfe900000 0x0 0x100000>; interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
arch/x86/entry/calling.h +21 -17
@@ -98,13 +98,6 @@ For 32-bit we have the following conventions - kernel is built with#define SIZEOF_PTREGS 21*8 .macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0 -/* -* Push registers and sanitize registers of values that a -* speculation attack might otherwise want to exploit. The -* lower registers are likely clobbered well before they -* could be put to use in a speculative execution gadget. -* Interleave XOR with PUSH for better uop scheduling: -*/ .if \save_ret pushq %rsi /* pt_regs->si */ movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */
@@ -117,29 +110,40 @@ For 32-bit we have the following conventions - kernel is built with pushq %rcx/* pt_regs->cx */ pushq \rax /* pt_regs->ax */ pushq %r8 /* pt_regs->r8 */ - xorl %r8d, %r8d /* nospec r8 */ pushq %r9 /* pt_regs->r9 */ - xorl %r9d, %r9d /* nospec r9 */ pushq %r10 /* pt_regs->r10 */ - xorl %r10d, %r10d /* nospec r10 */ pushq %r11 /* pt_regs->r11 */ - xorl %r11d, %r11d /* nospec r11*/ pushq %rbx /* pt_regs->rbx */ - xorl %ebx, %ebx /* nospec rbx*/ pushq %rbp /* pt_regs->rbp */ - xorl %ebp, %ebp /* nospec rbp*/ pushq %r12 /* pt_regs->r12 */ - xorl %r12d, %r12d /* nospec r12*/ pushq %r13 /* pt_regs->r13 */ - xorl %r13d, %r13d /* nospec r13*/ pushq %r14 /* pt_regs->r14 */ - xorl %r14d, %r14d /* nospec r14*/ pushq %r15 /* pt_regs->r15 */ - xorl %r15d, %r15d /* nospec r15*/UNWIND_HINT_REGS + .if \save_ret pushq %rsi /* return address on top of stack */ .endif + +/* +* Sanitize registers of values that a speculation attack might +* otherwise want to exploit. The lower registers are likely clobbered +* well before they could be put to use in a speculative execution +* gadget. +*/ + xorl %edx, %edx /* nospec dx */ + xorl %ecx, %ecx /* nospec cx */ + xorl %r8d, %r8d /* nospec r8 */ + xorl %r9d, %r9d /* nospec r9 */ + xorl %r10d, %r10d /* nospec r10 */ + xorl %r11d, %r11d /* nospec r11 */ + xorl %ebx, %ebx /* nospec rbx */ + xorl %ebp, %ebp /* nospec rbp */ + xorl %r12d, %r12d /* nospec r12 */ + xorl %r13d, %r13d /* nospec r13 */ + xorl %r14d, %r14d /* nospec r14 */ + xorl %r15d, %r15d /* nospec r15 */ + .endm .macro POP_REGS pop_rdi=1 skip_r11rcx=0
arch/x86/entry/entry_64.S +3 -2
@@ -302,7 +302,6 @@ GLOBAL(entry_SYSCALL_64_after_hwframe) */ syscall_return_via_sysret: /* rcx and r11 are already restored (see code above) */ - UNWIND_HINT_EMPTY POP_REGS pop_rdi=0 skip_r11rcx=1 /*
@@ -311,6 +310,7 @@ syscall_return_via_sysret: */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp + UNWIND_HINT_EMPTY pushq RSP-RDI(%rdi) /* RSP */ pushq (%rdi) /* RDI */
@@ -606,6 +606,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode) */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp + UNWIND_HINT_EMPTY /* Copy the IRET frame to the trampoline stack. */ pushq 6*8(%rdi) /* SS */
@@ -1648,7 +1649,7 @@ ENTRY(rewind_stack_do_exit) movq PER_CPU_VAR(cpu_current_top_of_stack), %rax leaq -PTREGS_SIZE(%rax), %rsp - UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE + UNWIND_HINT_REGS call do_exit END(rewind_stack_do_exit)
arch/x86/include/asm/bitops.h +16 -13
@@ -78,7 +78,7 @@ set_bit(long nr, volatile unsigned long *addr) : "iq" ((u8)CONST_MASK(nr)) : "memory"); } else { - asm volatile(LOCK_PREFIX "bts %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); } }
@@ -94,7 +94,7 @@ set_bit(long nr, volatile unsigned long *addr)*/ static __always_inline void __set_bit(long nr, volatile unsigned long *addr) { - asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); + asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory"); }/**
@@ -115,7 +115,7 @@ clear_bit(long nr, volatile unsigned long *addr) : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)~CONST_MASK(nr))); }else { - asm volatile(LOCK_PREFIX "btr %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); }
@@ -137,7 +137,7 @@ static __always_inline void clear_bit_unlock(long nr, volatile unsigned long *ad static __always_inline void __clear_bit(long nr, volatile unsigned long *addr) { - asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); + asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr)); } static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
@@ -182,7 +182,7 @@ static __always_inline void __clear_bit_unlock(long nr, volatile unsigned long **/ static __always_inline void __change_bit(long nr, volatile unsigned long *addr) { - asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); + asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr)); }/**
@@ -201,7 +201,7 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr) : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)CONST_MASK(nr))); }else { - asm volatile(LOCK_PREFIX "btc %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); }
@@ -217,7 +217,8 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr)*/ static __always_inline bool test_and_set_bit(long nr, volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "bts" , *addr,"Ir" , nr,"%0" , c); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts), + *addr, "Ir", nr, "%0", c); }/**
@@ -246,7 +247,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long * {bool oldbit; - asm("bts %2,%1" + asm(__ASM_SIZE(bts) " %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr));
@@ -263,7 +264,8 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long **/ static __always_inline bool test_and_clear_bit(long nr, volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "btr" , *addr,"Ir" , nr,"%0" , c); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btr), + *addr, "Ir", nr, "%0", c); }/**
@@ -286,7 +288,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long {bool oldbit; - asm volatile("btr %2,%1" + asm volatile(__ASM_SIZE(btr) " %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr));
@@ -298,7 +300,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon {bool oldbit; - asm volatile("btc %2,%1" + asm volatile(__ASM_SIZE(btc) " %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr) : "memory");
@@ -316,7 +318,8 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon*/ static __always_inline bool test_and_change_bit(long nr, volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "btc" , *addr,"Ir" , nr,"%0" , c); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc), + *addr, "Ir", nr, "%0", c); } static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
@@ -329,7 +332,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l {bool oldbit; - asm volatile("bt %2,%1" + asm volatile(__ASM_SIZE(bt) " %2,%1" CC_SET(c) : CC_OUT(c) (oldbit) : "m" (*(unsigned long *)addr), "Ir" (nr));
arch/x86/include/asm/percpu.h +1 -1
@@ -526,7 +526,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr, {bool oldbit; - asm volatile("bt "__percpu_arg(2)",%1" + asm volatile("btl "__percpu_arg(2)",%1" CC_SET(c) : CC_OUT(c) (oldbit) : "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
arch/x86/include/asm/stackprotector.h +6 -1
@@ -55,8 +55,13 @@/* * Initialize the stackprotector canary value. * -* NOTE: this must only be called from functions that never return, +* NOTE: this must only be called from functions that never return * and it must always be inlined. +* +* In addition, it should be called from a compilation unit for which +* stack protector is disabled. Alternatively, the caller should not end +* with a function call which gets tail-call optimized as that would +* lead to checking a modified canary value. */ static __always_inline void boot_init_stack_canary(void) {
arch/x86/kernel/smpboot.c +8 -0
@@ -270,6 +270,14 @@ static void notrace start_secondary(void *unused)wmb ();cpu_startup_entry (CPUHP_AP_ONLINE_IDLE ); + +/* +* Prevent tail call to cpu_startup_entry() because the stack protector +* guard has been changed a couple of function calls up, in +* boot_init_stack_canary() and must not be checked before tail calling +* another function. +*/ +prevent_tail_call_optimization (); }/**
arch/x86/kernel/unwind_orc.c +11 -9
@@ -90,9 +90,6 @@ static struct orc_entry null_orc_entry = {static struct orc_entry *orc_find (unsigned long ip) { -if (!orc_init) -return NULL ; -if (ip ==0 )return &null_orc_entry;
@@ -460,7 +457,7 @@ bool unwind_next_frame(struct unwind_state *state)default :orc_warn ("unknown .orc_unwind entry type %d for ip %pB\n" , orc->type, (void *)orig_ip); -break ; + goto done; }/* Find BP: */
@@ -511,17 +508,20 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,memset (state,0 ,sizeof (*state)); state->task = task; +if (!orc_init) + goto err; +/* * Refuse to unwind the stack of a task while it's executing on another * CPU. This check is racy, but that's ok: the unwinder has other * checks to prevent it from going off the rails. */ if (task_on_another_cpu (task)) - goto done; + goto err;if (regs) {if (user_mode (regs)) - goto done; + goto the_end; state->ip = regs->ip; state->sp =kernel_stack_pointer (regs);
@@ -554,6 +554,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,* generate some kind of backtrace if this happens. */ void *next_page = (void *)PAGE_ALIGN ((unsigned long )state->sp); + state->error = true;if (get_stack_info (next_page, state->task, &state->stack_info, &state->stack_mask))return ;
@@ -574,13 +575,14 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,/* Otherwise, skip ahead to the user-specified starting frame: */ while (!unwind_done (state) && (!on_stack (&state->stack_info, first_frame,sizeof (long )) || - state->sp <= (unsigned long )first_frame)) + state->sp < (unsigned long )first_frame))unwind_next_frame (state);return ; -done: +err: + state->error = true; +the_end: state->stack_info.type =STACK_TYPE_UNKNOWN ; -return ; }EXPORT_SYMBOL_GPL (__unwind_start);
arch/x86/kvm/x86.c +1 -1
@@ -3214,7 +3214,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,unsigned bank_num = mcg_cap &0xff , bank; r = -EINVAL ; -if (!bank_num || bank_num >=KVM_MAX_MCE_BANKS ) +if (!bank_num || bank_num >KVM_MAX_MCE_BANKS ) goto out;if (mcg_cap & ~(kvm_mce_cap_supported |0xff |0xff0000 )) goto out;
arch/x86/xen/smp_pv.c +1 -0
@@ -89,6 +89,7 @@ asmlinkage __visible void cpu_bringup_and_idle(void) {cpu_bringup ();cpu_startup_entry (CPUHP_AP_ONLINE_IDLE ); +prevent_tail_call_optimization (); }void xen_smp_intr_free_pv (unsigned int cpu)
crypto/lrw.c +2 -2
@@ -531,7 +531,7 @@ static void exit_tfm(struct crypto_skcipher *tfm)crypto_free_skcipher (ctx->child); } -static void free (struct skcipher_instance *inst) +static void free_inst (struct skcipher_instance *inst) {crypto_drop_skcipher (skcipher_instance_ctx (inst));kfree (inst);
@@ -642,7 +642,7 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb) inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; - inst->free = free; + inst->free = free_inst; err =skcipher_register_instance (tmpl, inst);if (err)
crypto/xts.c +2 -2
@@ -469,7 +469,7 @@ static void exit_tfm(struct crypto_skcipher *tfm)crypto_free_cipher (ctx->tweak); } -static void free (struct skcipher_instance *inst) +static void free_inst (struct skcipher_instance *inst) {crypto_drop_skcipher (skcipher_instance_ctx (inst));kfree (inst);
@@ -580,7 +580,7 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb) inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; - inst->free = free; + inst->free = free_inst; err =skcipher_register_instance (tmpl, inst);if (err)
drivers/block/virtio_blk.c +78 -8
144 lines not on this page · raw message
drivers/char/ipmi/ipmi_ssif.c +3 -1
@@ -1731,7 +1731,9 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id) out:if (rv) { - addr_info->client =NULL ; +if (addr_info) + addr_info->client =NULL ; +dev_err (&client->dev,"Unable to start IPMI SSIF: %d\n" , rv);kfree (ssif_info); }
drivers/clk/rockchip/clk-rk3228.c +4 -13
@@ -163,8 +163,6 @@ PNAME(mux_i2s_out_p) = { "i2s1_pre", "xin12m" };PNAME (mux_i2s2_p) = {"i2s2_src" ,"i2s2_frac" ,"xin12m" };PNAME (mux_sclk_spdif_p) = {"sclk_spdif_src" ,"spdif_frac" ,"xin12m" }; -PNAME (mux_aclk_gpu_pre_p) = {"cpll_gpu" ,"gpll_gpu" ,"hdmiphy_gpu" ,"usb480m_gpu" }; -PNAME (mux_uart0_p) = {"uart0_src" ,"uart0_frac" ,"xin24m" };PNAME (mux_uart1_p) = {"uart1_src" ,"uart1_frac" ,"xin24m" };PNAME (mux_uart2_p) = {"uart2_src" ,"uart2_frac" ,"xin24m" };
@@ -475,16 +473,9 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = { RK2928_CLKSEL_CON(24), 6, 10, DFLAGS, RK2928_CLKGATE_CON(2), 8, GFLAGS), -GATE (0 ,"cpll_gpu" ,"cpll" ,0 , -RK2928_CLKGATE_CON (3 ),13 ,GFLAGS ), -GATE (0 ,"gpll_gpu" ,"gpll" ,0 , -RK2928_CLKGATE_CON (3 ),13 ,GFLAGS ), -GATE (0 ,"hdmiphy_gpu" ,"hdmiphy" ,0 , -RK2928_CLKGATE_CON (3 ),13 ,GFLAGS ), -GATE (0 ,"usb480m_gpu" ,"usb480m" ,0 , +COMPOSITE (0 ,"aclk_gpu_pre" , mux_pll_src_4plls_p,0 , +RK2928_CLKSEL_CON (34 ),5 ,2 ,MFLAGS ,0 ,5 ,DFLAGS ,RK2928_CLKGATE_CON (3 ),13 ,GFLAGS ), -COMPOSITE_NOGATE (0 ,"aclk_gpu_pre" , mux_aclk_gpu_pre_p,0 , -RK2928_CLKSEL_CON (34 ),5 ,2 ,MFLAGS ,0 ,5 ,DFLAGS ), COMPOSITE(SCLK_SPI0, "sclk_spi0", mux_pll_src_2plls_p, 0, RK2928_CLKSEL_CON(25), 8, 1, MFLAGS, 0, 7, DFLAGS,
@@ -589,8 +580,8 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {GATE (0 ,"pclk_peri_noc" ,"pclk_peri" ,CLK_IGNORE_UNUSED ,RK2928_CLKGATE_CON (12 ),2 ,GFLAGS ),/* PD_GPU */ -GATE (ACLK_GPU ,"aclk_gpu" ,"aclk_gpu_pre" ,0 ,RK2928_CLKGATE_CON (13 ),14 ,GFLAGS ), -GATE (0 ,"aclk_gpu_noc" ,"aclk_gpu_pre" ,0 ,RK2928_CLKGATE_CON (13 ),15 ,GFLAGS ), +GATE (ACLK_GPU ,"aclk_gpu" ,"aclk_gpu_pre" ,0 ,RK2928_CLKGATE_CON (7 ),14 ,GFLAGS ), +GATE (0 ,"aclk_gpu_noc" ,"aclk_gpu_pre" ,0 ,RK2928_CLKGATE_CON (7 ),15 ,GFLAGS ),/* PD_BUS */ GATE(0, "sclk_initmem_mbist", "aclk_cpu", 0, RK2928_CLKGATE_CON(8), 1, GFLAGS),
drivers/cpufreq/intel_pstate.c +1 -1
@@ -935,7 +935,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,update_turbo_state ();if (global.turbo_disabled) { -pr_warn ("Turbo disabled by BIOS or unavailable on processor\n" ); +pr_notice_once ("Turbo disabled by BIOS or unavailable on processor\n" );mutex_unlock (&intel_pstate_limits_lock);mutex_unlock (&intel_pstate_driver_lock);return -EPERM ;
drivers/dma/mmp_tdma.c +2 -0
@@ -362,6 +362,8 @@ static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac)gen_pool_free (gpool, (unsigned long )tdmac->desc_arr, size); tdmac->desc_arr =NULL ; +if (tdmac->status ==DMA_ERROR ) + tdmac->status =DMA_COMPLETE ;return ; }
drivers/dma/pch_dma.c +1 -1
@@ -873,6 +873,7 @@ static int pch_dma_probe(struct pci_dev *pdev, }pci_set_master (pdev); + pd->dma.dev = &pdev->dev; err =request_irq (pdev->irq, pd_irq,IRQF_SHARED ,DRV_NAME , pd);if (err) {
@@ -888,7 +889,6 @@ static int pch_dma_probe(struct pci_dev *pdev, goto err_free_irq; } - pd->dma.dev = &pdev->dev;INIT_LIST_HEAD (&pd->dma.channels);
drivers/gpu/drm/qxl/qxl_image.c +2 -1
@@ -210,7 +210,8 @@ qxl_image_init_helper(struct qxl_device *qdev,break ;default :DRM_ERROR ("unsupported image bit depth\n" ); -return -EINVAL ;/* TODO: cleanup */ +qxl_bo_kunmap_atomic_page (qdev, image_bo, ptr); +return -EINVAL ; } image->u.bitmap.flags =QXL_BITMAP_TOP_DOWN ; image->u.bitmap.x = width;
drivers/hid/usbhid/hid-core.c +29 -8
@@ -680,16 +680,21 @@ static int usbhid_open(struct hid_device *hid)struct usbhid_device *usbhid = hid->driver_data;int res; +mutex_lock (&usbhid->mutex); +set_bit (HID_OPENED , &usbhid->iofl); -if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) -return 0 ; +if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) { + res =0 ; + goto Done; + } res =usb_autopm_get_interface (usbhid->intf);/* the device must be awake to reliably request remote wakeup */ if (res <0 ) {clear_bit (HID_OPENED , &usbhid->iofl); -return -EIO ; + res = -EIO ; + goto Done; } usbhid->intf->needs_remote_wakeup =1 ;
@@ -723,6 +728,9 @@ static int usbhid_open(struct hid_device *hid)msleep (50 );clear_bit (HID_RESUME_RUNNING , &usbhid->iofl); + + Done: +mutex_unlock (&usbhid->mutex);return res; }
@@ -730,6 +738,8 @@ static void usbhid_close(struct hid_device *hid) {struct usbhid_device *usbhid = hid->driver_data; +mutex_lock (&usbhid->mutex); +/* * Make sure we don't restart data acquisition due to * a resumption we no longer care about by avoiding racing
@@ -741,12 +751,13 @@ static void usbhid_close(struct hid_device *hid)clear_bit (HID_IN_POLLING , &usbhid->iofl);spin_unlock_irq (&usbhid->lock); -if (hid->quirks &HID_QUIRK_ALWAYS_POLL ) -return ; +if (!(hid->quirks &HID_QUIRK_ALWAYS_POLL )) { +hid_cancel_delayed_stuff (usbhid); +usb_kill_urb (usbhid->urbin); + usbhid->intf->needs_remote_wakeup =0 ; + } -hid_cancel_delayed_stuff (usbhid); -usb_kill_urb (usbhid->urbin); - usbhid->intf->needs_remote_wakeup =0 ; +mutex_unlock (&usbhid->mutex); }/*
@@ -1056,6 +1067,8 @@ static int usbhid_start(struct hid_device *hid)unsigned int n, insize =0 ;int ret; +mutex_lock (&usbhid->mutex); +clear_bit (HID_DISCONNECTED , &usbhid->iofl); usbhid->bufsize =HID_MIN_BUFFER_SIZE ;
@@ -1170,6 +1183,8 @@ static int usbhid_start(struct hid_device *hid)usbhid_set_leds (hid);device_set_wakeup_enable (&dev->dev,1 ); } + +mutex_unlock (&usbhid->mutex);return 0 ; fail:
@@ -1180,6 +1195,7 @@ static int usbhid_start(struct hid_device *hid) usbhid->urbout =NULL ; usbhid->urbctrl =NULL ;hid_free_buffers (dev, hid); +mutex_unlock (&usbhid->mutex);return ret; }
@@ -1195,6 +1211,8 @@ static void usbhid_stop(struct hid_device *hid) usbhid->intf->needs_remote_wakeup =0 ; } +mutex_lock (&usbhid->mutex); +clear_bit (HID_STARTED , &usbhid->iofl);spin_lock_irq (&usbhid->lock);/* Sync with error and led handlers */ set_bit (HID_DISCONNECTED , &usbhid->iofl);
@@ -1215,6 +1233,8 @@ static void usbhid_stop(struct hid_device *hid) usbhid->urbout =NULL ;hid_free_buffers (hid_to_usb_dev (hid), hid); + +mutex_unlock (&usbhid->mutex); }static int usbhid_power (struct hid_device *hid,int lvl)
@@ -1375,6 +1395,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *INIT_WORK (&usbhid->reset_work, hid_reset);setup_timer (&usbhid->io_retry, hid_retry_timeout, (unsigned long ) hid);spin_lock_init (&usbhid->lock); +mutex_init (&usbhid->mutex); ret =hid_add_device (hid);if (ret) {
drivers/hid/usbhid/usbhid.h +1 -0
@@ -93,6 +93,7 @@ struct usbhid_device {dma_addr_t outbuf_dma;/* Output buffer dma */ unsigned long last_out;/* record of last output for timeouts */ +struct mutex mutex;/* start/stop/open/close */ spinlock_t lock;/* fifo spinlock */ unsigned long iofl;/* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ struct timer_list io_retry;/* Retry timer */
drivers/hid/wacom_sys.c +3 -1
@@ -132,9 +132,11 @@ static void wacom_feature_mapping(struct hid_device *hdev, data[0 ] = field->report->id; ret =wacom_get_report (hdev,HID_FEATURE_REPORT , data, n,WAC_CMD_RETRIES ); -if (ret == n) { +if (ret == n && features->type ==HID_GENERIC ) { ret =hid_report_raw_event (hdev,HID_FEATURE_REPORT , data, n,0 ); + }else if (ret ==2 && features->type !=HID_GENERIC ) { + features->touch_max = data[1 ]; }else { features->touch_max =16 ; hid_warn(hdev, "wacom_feature_mapping: "
drivers/hwmon/da9052-hwmon.c +2 -2
@@ -250,9 +250,9 @@ static ssize_t da9052_read_tsi(struct device *dev,int channel =to_sensor_dev_attr (devattr)->index;int ret; -mutex_lock (&hwmon->hwmon_lock); +mutex_lock (&hwmon->da9052->auxadc_lock); ret =__da9052_read_tsi (dev, channel); -mutex_unlock (&hwmon->hwmon_lock); +mutex_unlock (&hwmon->da9052->auxadc_lock);if (ret <0 )return ret;
drivers/infiniband/core/addr.c +3 -4
@@ -450,16 +450,15 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,struct flowi6 fl6;struct dst_entry *dst;struct rt6_info *rt; -int ret;memset (&fl6,0 ,sizeof fl6); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr; fl6.flowi6_oif = addr->bound_dev_if; - ret = ipv6_stub->ipv6_dst_lookup (addr->net,NULL , &dst, &fl6); -if (ret <0 ) -return ret; + dst = ipv6_stub->ipv6_dst_lookup_flow (addr->net,NULL , &fl6,NULL ); +if (IS_ERR (dst)) +return PTR_ERR (dst); rt = (struct rt6_info *)dst;if (ipv6_addr_any (&src_in->sin6_addr)) {
drivers/infiniband/hw/i40iw/i40iw_hw.c +1 -1
@@ -483,7 +483,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,int arp_index; arp_index =i40iw_arp_table (iwdev, ip_addr, ipv4, mac_addr, action); -if (arp_index ==-1 ) +if (arp_index <0 )return ; cqp_request =i40iw_get_cqp_request (&iwdev->cqp, false);if (!cqp_request)
drivers/infiniband/hw/mlx4/qp.c +11 -3
@@ -2917,6 +2917,7 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,int send_size;int header_size;int spc; +int err;int i;if (wr->wr.opcode !=IB_WR_SEND )
@@ -2951,7 +2952,9 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp, sqp->ud_header.lrh.virtual_lane =0 ; sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags &IB_SEND_SOLICITED ); -ib_get_cached_pkey (ib_dev, sqp->qp.port,0 , &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port,0 , &pkey); +if (err) +return err; sqp->ud_header.bth.pkey =cpu_to_be16 (pkey);if (sqp->qp.mlx4_ib_qp_type ==MLX4_IB_QPT_TUN_SMI_OWNER ) sqp->ud_header.bth.destination_qpn =cpu_to_be32 (wr->remote_qpn);
@@ -3240,9 +3243,14 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr, } sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags &IB_SEND_SOLICITED );if (!sqp->qp.ibqp.qp_num) -ib_get_cached_pkey (ib_dev, sqp->qp.port, sqp->pkey_index, &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port, sqp->pkey_index, + &pkey);else -ib_get_cached_pkey (ib_dev, sqp->qp.port, wr->pkey_index, &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port, wr->pkey_index, + &pkey); +if (err) +return err; + sqp->ud_header.bth.pkey =cpu_to_be16 (pkey); sqp->ud_header.bth.destination_qpn =cpu_to_be32 (wr->remote_qpn); sqp->ud_header.bth.psn =cpu_to_be32 ((sqp->send_psn++) & ((1 <<24 ) -1 ));
drivers/infiniband/sw/rxe/rxe_net.c +5 -3
@@ -154,10 +154,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,memcpy (&fl6.daddr, daddr,sizeof (*daddr)); fl6.flowi6_proto =IPPROTO_UDP ; -if (unlikely (ipv6_stub->ipv6_dst_lookup (sock_net (recv_sockets.sk6->sk), - recv_sockets.sk6->sk, &ndst, &fl6))) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (sock_net (recv_sockets.sk6->sk), + recv_sockets.sk6->sk, &fl6, +NULL ); +if (unlikely (IS_ERR (ndst))) {pr_err_ratelimited ("no route to %pI6\n" , daddr); - goto put; +return NULL ; }if (unlikely (ndst->error)) {
drivers/net/dsa/dsa_loop.c +1 -0
@@ -357,6 +357,7 @@ static void __exit dsa_loop_exit(void) }module_exit (dsa_loop_exit); +MODULE_SOFTDEP ("pre: dsa_loop_bdinfo" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Florian Fainelli" );MODULE_DESCRIPTION ("DSA loopback driver" );
drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 -6
@@ -6827,6 +6827,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, netdev_features_t features) {struct bnxt *bp =netdev_priv (dev); +netdev_features_t vlan_features;if ((features &NETIF_F_NTUPLE ) && !bnxt_rfs_capable (bp)) features &= ~NETIF_F_NTUPLE ;
@@ -6834,12 +6835,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,/* Both CTAG and STAG VLAN accelaration on the RX side have to be * turned on or off together. */ -if ((features & (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) != - (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) { + vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX ); +if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX )) {if (dev->features &NETIF_F_HW_VLAN_CTAG_RX ) features &= ~(NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ); -else +else if (vlan_features) features |=NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ; }
@@ -8420,8 +8423,11 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) } } -if (result !=PCI_ERS_RESULT_RECOVERED &&netif_running (netdev)) -dev_close (netdev); +if (result !=PCI_ERS_RESULT_RECOVERED ) { +if (netif_running (netdev)) +dev_close (netdev); +pci_disable_device (pdev); + }rtnl_unlock ();
@@ -8432,7 +8438,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) err); /* non-fatal, continue */ } -return PCI_ERS_RESULT_RECOVERED ; +return result; }/**
drivers/net/ethernet/broadcom/bnxt/bnxt.h +0 -1
@@ -774,7 +774,6 @@ struct bnxt_vf_info {#define BNXT_VF_SPOOFCHK 0x2#define BNXT_VF_LINK_FORCED 0x4#define BNXT_VF_LINK_UP 0x8 -u32 func_flags;/* func cfg flags */ u32 min_tx_rate;u32 max_tx_rate;void *hwrm_cmd_req_addr;
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +2 -7
@@ -99,11 +99,10 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)if (old_setting == setting)return 0 ; - func_flags = vf->func_flags;if (setting) - func_flags |=FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE ; + func_flags =FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE ;else - func_flags |=FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE ; + func_flags =FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE ;/*TODO: if the driver supports VLAN filter on guest VLAN, * the spoof check should also include vlan anti-spoofing */
@@ -112,7 +111,6 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting) req.flags =cpu_to_le32 (func_flags); rc =hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );if (!rc) { - vf->func_flags = func_flags;if (setting) vf->flags |=BNXT_VF_SPOOFCHK ;else
@@ -176,7 +174,6 @@ int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac)memcpy (vf->mac_addr, mac,ETH_ALEN );bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR );memcpy (req.dflt_mac_addr, mac,ETH_ALEN );return hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );
@@ -214,7 +211,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.dflt_vlan =cpu_to_le16 (vlan_tag); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_DFLT_VLAN ); rc =hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );
@@ -253,7 +249,6 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,return 0 ;bnxt_hwrm_cmd_hdr_init (bp, &req,HWRM_FUNC_CFG ,-1 ,-1 ); req.fid =cpu_to_le16 (vf->fw_fid); - req.flags =cpu_to_le32 (vf->func_flags); req.enables =cpu_to_le32 (FUNC_CFG_REQ_ENABLES_MAX_BW ); req.max_bw =cpu_to_le32 (max_tx_rate); req.enables |=cpu_to_le32 (FUNC_CFG_REQ_ENABLES_MIN_BW );
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +12 -4
@@ -54,6 +54,8 @@#define MGMT_MSG_TIMEOUT 5000 +#define SET_FUNC_PORT_MGMT_TIMEOUT 25000 +#define mgmt_to_pfhwdev (pf_mgmt) \ container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
@@ -247,12 +249,13 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt, u8 *buf_in, u16 in_size, u8 *buf_out, u16 *out_size, enum mgmt_direction_type direction, - u16 resp_msg_id) + u16 resp_msg_id, u32 timeout) { struct hinic_hwif *hwif = pf_to_mgmt->hwif;struct pci_dev *pdev = hwif->pdev;struct hinic_recv_msg *recv_msg;struct completion *recv_done; +unsigned long timeo;u16 msg_id;int err;
@@ -276,8 +279,9 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt, goto unlock_sync_msg; } -if (!wait_for_completion_timeout (recv_done, -msecs_to_jiffies (MGMT_MSG_TIMEOUT ))) { + timeo =msecs_to_jiffies (timeout ? timeout :MGMT_MSG_TIMEOUT ); + +if (!wait_for_completion_timeout (recv_done, timeo)) {dev_err (&pdev->dev,"MGMT timeout, MSG id = %d\n" , msg_id); err = -ETIMEDOUT ; goto unlock_sync_msg;
@@ -351,6 +355,7 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt, {struct hinic_hwif *hwif = pf_to_mgmt->hwif;struct pci_dev *pdev = hwif->pdev; +u32 timeout =0 ;if (sync !=HINIC_MGMT_MSG_SYNC ) {dev_err (&pdev->dev,"Invalid MGMT msg type\n" );
@@ -362,9 +367,12 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,return -EINVAL ; } +if (cmd ==HINIC_PORT_CMD_SET_FUNC_STATE ) + timeout =SET_FUNC_PORT_MGMT_TIMEOUT ; +return msg_to_mgmt_sync (pf_to_mgmt, mod, cmd, buf_in, in_size, buf_out, out_size,MGMT_DIRECT_SEND , -MSG_NOT_RESP ); +MSG_NOT_RESP , timeout); }/**
drivers/net/ethernet/huawei/hinic/hinic_main.c +2 -14
@@ -473,7 +473,6 @@ static int hinic_close(struct net_device *netdev) {struct hinic_dev *nic_dev =netdev_priv (netdev);unsigned int flags; -int err;down (&nic_dev->mgmt_lock);
@@ -487,20 +486,9 @@ static int hinic_close(struct net_device *netdev)up (&nic_dev->mgmt_lock); - err =hinic_port_set_func_state (nic_dev,HINIC_FUNC_PORT_DISABLE ); -if (err) { -netif_err (nic_dev, drv, netdev, -"Failed to set func port state\n" ); - nic_dev->flags |= (flags &HINIC_INTF_UP ); -return err; - } +hinic_port_set_state (nic_dev,HINIC_PORT_DISABLE ); - err =hinic_port_set_state (nic_dev,HINIC_PORT_DISABLE ); -if (err) { -netif_err (nic_dev, drv, netdev,"Failed to set port state\n" ); - nic_dev->flags |= (flags &HINIC_INTF_UP ); -return err; - } +hinic_port_set_func_state (nic_dev,HINIC_FUNC_PORT_DISABLE );free_rxqs (nic_dev);free_txqs (nic_dev);
drivers/net/ethernet/mellanox/mlx4/main.c +3 -1
@@ -2503,6 +2503,7 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev)if (!err || err == -ENOSPC ) { priv->def_counter[port] = idx; + err =0 ; }else if (err == -ENOENT ) { err =0 ;continue ;
@@ -2553,7 +2554,8 @@ int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx, u8 usage) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);if (!err) *idx =get_param_l (&out_param); - +if (WARN_ON (err == -ENOSPC )) + err = -EINVAL ;return err; }return __mlx4_counter_alloc (dev, idx);
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +5 -1
@@ -831,7 +831,6 @@ static void cmd_work_handler(struct work_struct *work) } cmd->ent_arr[ent->idx] = ent; -set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state); lay =get_inst (cmd, ent->idx); ent->lay = lay;memset (lay,0 ,sizeof (*lay));
@@ -853,6 +852,7 @@ static void cmd_work_handler(struct work_struct *work)if (ent->callback)schedule_delayed_work (&ent->cb_timeout_work, cb_timeout); +set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state);/* Skip sending command to fw if internal error */ if (pci_channel_offline(dev->pdev) ||
@@ -865,6 +865,10 @@ static void cmd_work_handler(struct work_struct *work)MLX5_SET (mbox_out, ent->out, syndrome, drv_synd);mlx5_cmd_comp_handler (dev,1UL << ent->idx, true); +/* no doorbell, no need to keep the entry */ +free_ent (cmd, ent->idx); +if (ent->callback) +free_cmd (ent);return ; }
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +5 -6
@@ -1550,12 +1550,11 @@ static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,#if IS_ENABLED (CONFIG_INET ) &&IS_ENABLED (CONFIG_IPV6 )struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; -int ret; - ret = ipv6_stub->ipv6_dst_lookup (dev_net (mirred_dev),NULL , &dst, - fl6); -if (ret <0 ) -return ret; + dst = ipv6_stub->ipv6_dst_lookup_flow (dev_net (mirred_dev),NULL , fl6, +NULL ); +if (IS_ERR (dst)) +return PTR_ERR (dst); *out_ttl =ip6_dst_hoplimit (dst);
@@ -1754,7 +1753,7 @@ static int mlx5e_create_encap_header_ipv6(struct mlx5e_priv *priv,int max_encap_size =MLX5_CAP_ESW (priv->mdev, max_encap_header_size);int ipv6_encap_size =ETH_HLEN +sizeof (struct ipv6hdr ) +VXLAN_HLEN ;struct ip_tunnel_key *tun_key = &e->tun_info.key; -struct net_device *out_dev; +struct net_device *out_dev =NULL ;struct neighbour *n =NULL ;struct flowi6 fl6 = {};char *encap_header;
drivers/net/ethernet/moxa/moxart_ether.c +1 -1
@@ -561,7 +561,7 @@ static int moxart_remove(struct platform_device *pdev)struct net_device *ndev =platform_get_drvdata (pdev);unregister_netdev (ndev); -free_irq (ndev->irq, ndev); +devm_free_irq (&pdev->dev, ndev->irq, ndev);moxart_mac_free_memory (ndev);free_netdev (ndev);
drivers/net/ethernet/natsemi/jazzsonic.c +4 -2
@@ -247,13 +247,15 @@ static int jazz_sonic_probe(struct platform_device *pdev) goto out; err =register_netdev (dev);if (err) - goto out1; + goto undo_probe1;printk ("%s: MAC %pM IRQ %d\n" , dev->name, dev->dev_addr, dev->irq);return 0 ; -out1: +undo_probe1: +dma_free_coherent (lp->device,SIZEOF_SONIC_DESC *SONIC_BUS_SCALE (lp->dma_bitmode), + lp->descriptors, lp->descriptors_laddr);release_mem_region (dev->base_addr,SONIC_MEM_SIZE ); out:free_netdev (dev);
drivers/net/ethernet/stmicro/stmmac/stmmac.h +1 -1
@@ -96,7 +96,7 @@ struct stmmac_priv {struct net_device *dev;struct device *device;struct mac_device_info *hw; -spinlock_t lock; +struct mutex lock;/* RX Queue */ struct stmmac_rx_queue rx_queue[MTL_MAX_RX_QUEUES ];
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +6 -6
@@ -392,13 +392,13 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev, ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full); -spin_lock (&priv->lock); +mutex_lock (&priv->lock);if (priv->hw->mac->pcs_ctrl_ane) priv->hw->mac->pcs_ctrl_ane (priv->ioaddr,1 , priv->hw->ps,0 ); -spin_unlock (&priv->lock); +mutex_unlock (&priv->lock);return 0 ; }
@@ -615,12 +615,12 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) {struct stmmac_priv *priv =netdev_priv (dev); -spin_lock_irq (&priv->lock); +mutex_lock (&priv->lock);if (device_can_wakeup (priv->device)) { wol->supported =WAKE_MAGIC |WAKE_UCAST ; wol->wolopts = priv->wolopts; } -spin_unlock_irq (&priv->lock); +mutex_unlock (&priv->lock); }static int stmmac_set_wol (struct net_device *dev,struct ethtool_wolinfo *wol)
@@ -649,9 +649,9 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)disable_irq_wake (priv->wol_irq); } -spin_lock_irq (&priv->lock); +mutex_lock (&priv->lock); priv->wolopts = wol->wolopts; -spin_unlock_irq (&priv->lock); +mutex_unlock (&priv->lock);return 0 ; }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +14 -17
@@ -365,7 +365,6 @@ bool stmmac_eee_init(struct stmmac_priv *priv) {struct net_device *ndev = priv->dev;int interface = priv->plat->interface; -unsigned long flags;bool ret = false; if ((interface != PHY_INTERFACE_MODE_MII) &&
@@ -392,7 +391,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)* changed). * In that case the driver disable own timers. */ -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock);if (priv->eee_active) {netdev_dbg (priv->dev,"disable EEE\n" );del_timer_sync (&priv->eee_ctrl_timer);
@@ -400,11 +399,11 @@ bool stmmac_eee_init(struct stmmac_priv *priv) tx_lpi_timer); } priv->eee_active =0 ; -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock); goto out; }/* Activate the EEE and start timers */ -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock);if (!priv->eee_active) { priv->eee_active =1 ; setup_timer(&priv->eee_ctrl_timer,
@@ -421,7 +420,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv) priv->hw->mac->set_eee_pls (priv->hw, ndev->phydev->link); ret = true; -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock);netdev_dbg (priv->dev,"Energy-Efficient Ethernet initialized\n" ); }
@@ -799,13 +798,12 @@ static void stmmac_adjust_link(struct net_device *dev) {struct stmmac_priv *priv =netdev_priv (dev);struct phy_device *phydev = dev->phydev; -unsigned long flags;bool new_state = false;if (!phydev)return ; -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock);if (phydev->link) {u32 ctrl =readl (priv->ioaddr +MAC_CTRL_REG );
@@ -864,7 +862,7 @@ static void stmmac_adjust_link(struct net_device *dev)if (new_state &&netif_msg_link (priv))phy_print_status (phydev); -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock);if (phydev->is_pseudo_fixed_link)/* Stop PHY layer to call the hook to adjust the link in case
@@ -4284,7 +4282,7 @@ int stmmac_dvr_probe(struct device *device, (8 * priv->plat->rx_queues_to_use)); } -spin_lock_init (&priv->lock); +mutex_init (&priv->lock);/* If a specific clk_csr value is passed from the platform * this means that the CSR Clock Range selection cannot be
@@ -4375,6 +4373,7 @@ int stmmac_dvr_remove(struct device *dev) priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI)stmmac_mdio_unregister (ndev); +mutex_destroy (&priv->lock);free_netdev (ndev);return 0 ;
@@ -4392,7 +4391,6 @@ int stmmac_suspend(struct device *dev) {struct net_device *ndev =dev_get_drvdata (dev);struct stmmac_priv *priv =netdev_priv (ndev); -unsigned long flags;if (!ndev || !netif_running (ndev))return 0 ;
@@ -4400,7 +4398,7 @@ int stmmac_suspend(struct device *dev)if (ndev->phydev)phy_stop (ndev->phydev); -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock);netif_device_detach (ndev);stmmac_stop_all_queues (priv);
@@ -4423,7 +4421,7 @@ int stmmac_suspend(struct device *dev)clk_disable_unprepare (priv->plat->pclk);clk_disable_unprepare (priv->plat->stmmac_clk); } -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock); priv->oldlink = false; priv->speed =SPEED_UNKNOWN ;
@@ -4467,7 +4465,6 @@ int stmmac_resume(struct device *dev) {struct net_device *ndev =dev_get_drvdata (dev);struct stmmac_priv *priv =netdev_priv (ndev); -unsigned long flags;if (!netif_running (ndev))return 0 ;
@@ -4479,9 +4476,9 @@ int stmmac_resume(struct device *dev)* from another devices (e.g. serial console). */ if (device_may_wakeup (priv->device)) { -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock); priv->hw->mac->pmt (priv->hw,0 ); -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock); priv->irq_wake =0 ; }else {pinctrl_pm_select_default_state (priv->device);
@@ -4497,7 +4494,7 @@ int stmmac_resume(struct device *dev)netif_device_attach (ndev); -spin_lock_irqsave (&priv->lock, flags); +mutex_lock (&priv->lock);stmmac_reset_queues_param (priv);
@@ -4516,7 +4513,7 @@ int stmmac_resume(struct device *dev)stmmac_start_all_queues (priv); -spin_unlock_irqrestore (&priv->lock, flags); +mutex_unlock (&priv->lock);if (ndev->phydev)phy_start (ndev->phydev);
drivers/net/geneve.c +18 -2
@@ -796,7 +796,9 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,if (dst)return dst; } -if (ipv6_stub->ipv6_dst_lookup (geneve->net, gs6->sock->sk, &dst, fl6)) { + dst = ipv6_stub->ipv6_dst_lookup_flow (geneve->net, gs6->sock->sk, fl6, +NULL ); +if (IS_ERR (dst)) {netdev_dbg (dev,"no route to %pI6\n" , &fl6->daddr);return ERR_PTR (-ENETUNREACH ); }
@@ -1369,21 +1371,33 @@ static int geneve_nl2info(struct nlattr *tb[], struct nlattr *data[], }if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX ]) { +#if IS_ENABLED (CONFIG_IPV6 )if (changelink) { attrtype =IFLA_GENEVE_UDP_ZERO_CSUM6_TX ; goto change_notsup; }if (nla_get_u8 (data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX ])) info->key.tun_flags &= ~TUNNEL_CSUM ; +#else +NL_SET_ERR_MSG_ATTR (extack, data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX ], +"IPv6 support not enabled in the kernel" ); +return -EPFNOSUPPORT ; +#endif }if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX ]) { +#if IS_ENABLED (CONFIG_IPV6 )if (changelink) { attrtype =IFLA_GENEVE_UDP_ZERO_CSUM6_RX ; goto change_notsup; }if (nla_get_u8 (data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX ])) *use_udp6_rx_checksums = false; +#else +NL_SET_ERR_MSG_ATTR (extack, data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX ], +"IPv6 support not enabled in the kernel" ); +return -EPFNOSUPPORT ; +#endif }return 0 ;
@@ -1559,11 +1573,13 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev) goto nla_put_failure;if (metadata &&nla_put_flag (skb,IFLA_GENEVE_COLLECT_METADATA )) - goto nla_put_failure; + goto nla_put_failure; +#if IS_ENABLED (CONFIG_IPV6 )if (nla_put_u8 (skb,IFLA_GENEVE_UDP_ZERO_CSUM6_RX , !geneve->use_udp6_rx_checksums)) goto nla_put_failure; +#endif return 0 ;
drivers/net/macsec.c +2 -1
@@ -1309,7 +1309,8 @@ static struct crypto_aead *macsec_alloc_tfm(char *key, int key_len, int icv_len)struct crypto_aead *tfm;int ret; - tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,0 ); +/* Pick a sync gcm(aes) cipher to ensure order is preserved. */ + tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR (tfm))return tfm;
drivers/net/phy/dp83640.c +1 -1
@@ -1110,7 +1110,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) goto out; }dp83640_clock_init (clock, bus); -list_add_tail (&phyter_clocks, &clock->list); +list_add_tail (&clock->list, &phyter_clocks); out:mutex_unlock (&phyter_clocks_lock);
drivers/net/phy/micrel.c +2 -2
@@ -674,8 +674,8 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)int i;for (i =0 ; i <ARRAY_SIZE (kszphy_hw_stats); i++) { -memcpy (data + i *ETH_GSTRING_LEN , - kszphy_hw_stats[i].string,ETH_GSTRING_LEN ); +strlcpy (data + i *ETH_GSTRING_LEN , + kszphy_hw_stats[i].string,ETH_GSTRING_LEN ); } }
drivers/net/phy/phy.c +5 -3
@@ -1257,9 +1257,11 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)/* Restart autonegotiation so the new modes get sent to the * link partner. */ - ret =phy_restart_aneg (phydev); -if (ret <0 ) -return ret; +if (phydev->autoneg ==AUTONEG_ENABLE ) { + ret =phy_restart_aneg (phydev); +if (ret <0 ) +return ret; + } }return 0 ;
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1283,6 +1283,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ + {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
drivers/net/vxlan.c +3 -5
@@ -1962,7 +1962,6 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,bool use_cache =ip_tunnel_dst_cache_usable (skb, info);struct dst_entry *ndst;struct flowi6 fl6; -int err;if (!sock6)return ERR_PTR (-EIO );
@@ -1985,10 +1984,9 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan, fl6.fl6_dport = dport; fl6.fl6_sport = sport; - err = ipv6_stub->ipv6_dst_lookup (vxlan->net, - sock6->sock->sk, - &ndst, &fl6); -if (unlikely (err <0 )) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (vxlan->net, sock6->sock->sk, + &fl6,NULL ); +if (unlikely (IS_ERR (ndst))) {netdev_dbg (dev,"no route to %pI6\n" , daddr);return ERR_PTR (-ENETUNREACH ); }
drivers/pinctrl/intel/pinctrl-baytrail.c +1 -0
@@ -1503,6 +1503,7 @@ static const struct gpio_chip byt_gpio_chip = { .direction_output = byt_gpio_direction_output, .get = byt_gpio_get, .set = byt_gpio_set, + .set_config = gpiochip_generic_config, .dbg_show = byt_gpio_dbg_show, };
drivers/pinctrl/intel/pinctrl-cherryview.c +4 -0
@@ -1514,11 +1514,15 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)struct chv_pinctrl *pctrl =gpiochip_get_data (gc);struct irq_chip *chip =irq_desc_get_chip (desc);unsigned long pending; +unsigned long flags;u32 intr_line;chained_irq_enter (chip, desc); +raw_spin_lock_irqsave (&chv_lock, flags); pending =readl (pctrl->regs +CHV_INTSTAT ); +raw_spin_unlock_irqrestore (&chv_lock, flags); +for_each_set_bit (intr_line, &pending, pctrl->community->nirqs) {unsigned irq, offset;
drivers/scsi/sg.c +3 -1
@@ -695,8 +695,10 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) hp->flags = input_size;/* structure abuse ... */ hp->pack_id = old_hdr.pack_id; hp->usr_ptr =NULL ; -if (__copy_from_user (cmnd, buf, cmd_size)) +if (__copy_from_user (cmnd, buf, cmd_size)) { +sg_remove_request (sfp, srp);return -EFAULT ; + }/* * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV, * but is is possible that the app intended SG_DXFER_TO_DEV, because there
drivers/usb/core/hub.c +5 -1
@@ -37,6 +37,7 @@#define USB_VENDOR_GENESYS_LOGIC 0x05e3#define USB_VENDOR_SMSC 0x0424 +#define USB_PRODUCT_USB5534B 0x5534#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01#define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02
@@ -5317,8 +5318,11 @@ static void hub_event(struct work_struct *work) }static const struct usb_device_id hub_id_table[] = { - { .match_flags =USB_DEVICE_ID_MATCH_VENDOR |USB_DEVICE_ID_MATCH_INT_CLASS , + { .match_flags =USB_DEVICE_ID_MATCH_VENDOR + |USB_DEVICE_ID_MATCH_PRODUCT + |USB_DEVICE_ID_MATCH_INT_CLASS , .idVendor =USB_VENDOR_SMSC , + .idProduct =USB_PRODUCT_USB5534B , .bInterfaceClass =USB_CLASS_HUB , .driver_info =HUB_QUIRK_DISABLE_AUTOSUSPEND }, { .match_flags =USB_DEVICE_ID_MATCH_VENDOR
drivers/usb/gadget/configfs.c +3 -0
@@ -259,6 +259,9 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,char *name;int ret; +if (strlen (page) < len) +return -EOVERFLOW ; + name =kstrdup (page,GFP_KERNEL );if (!name)return -ENOMEM ;
drivers/usb/gadget/legacy/audio.c +3 -1
@@ -303,8 +303,10 @@ static int audio_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (cdev->gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail; + }usb_otg_descriptor_init (cdev->gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/legacy/cdc2.c +3 -1
@@ -183,8 +183,10 @@ static int cdc_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail1; + }usb_otg_descriptor_init (gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/legacy/ncm.c +3 -1
@@ -162,8 +162,10 @@ static int gncm_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail; + }usb_otg_descriptor_init (gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/udc/net2272.c +2 -0
@@ -2666,6 +2666,8 @@ net2272_plat_probe(struct platform_device *pdev) err_req:release_mem_region (base, len); err: +kfree (dev); +return ret; }
drivers/usb/host/xhci-plat.c +3 -1
@@ -334,6 +334,7 @@ static int xhci_plat_remove(struct platform_device *dev)struct clk *clk = xhci->clk;struct usb_hcd *shared_hcd = xhci->shared_hcd; +pm_runtime_get_sync (&dev->dev); xhci->xhc_state |=XHCI_STATE_REMOVING ;usb_remove_hcd (shared_hcd);
@@ -347,8 +348,9 @@ static int xhci_plat_remove(struct platform_device *dev)clk_disable_unprepare (clk);usb_put_hcd (hcd); -pm_runtime_set_suspended (&dev->dev);pm_runtime_disable (&dev->dev); +pm_runtime_put_noidle (&dev->dev); +pm_runtime_set_suspended (&dev->dev);return 0 ; }
drivers/usb/host/xhci-ring.c +2 -2
@@ -3403,8 +3403,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,/* New sg entry */ --num_sgs; sent_len -= block_len; -if (num_sgs !=0 ) { - sg =sg_next (sg); + sg =sg_next (sg); +if (num_sgs !=0 && sg) { block_len =sg_dma_len (sg); addr = (u64 )sg_dma_address (sg); addr += sent_len;
drivers/usb/serial/garmin_gps.c +2 -2
@@ -1161,8 +1161,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,send it directly to the tty port */ if (garmin_data_p->flags &FLAGS_QUEUING ) {pkt_add (garmin_data_p, data, data_length); - }else if (bulk_data || -getLayerId (data) ==GARMIN_LAYERID_APPL ) { + }else if (bulk_data || (data_length >=sizeof (u32) && +getLayerId (data) ==GARMIN_LAYERID_APPL )) {spin_lock_irqsave (&garmin_data_p->lock, flags); garmin_data_p->flags |=APP_RESP_SEEN ;
drivers/usb/serial/qcserial.c +1 -0
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ + {DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */ {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
drivers/usb/storage/unusual_uas.h +7 -0
@@ -41,6 +41,13 @@* and don't forget to CC: the USB development list <[email protected]> */ +/* Reported-by: Julian Groß <[email protected]> */ +UNUSUAL_DEV (0x059f ,0x105f ,0x0000 ,0x9999 , +"LaCie" , +"2Big Quadra USB3" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , + US_FL_NO_REPORT_OPCODES), +/* * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI * commands in UAS mode. Observed with the 1.28 firmware; are there others?
fs/coredump.c +8 -0
@@ -758,6 +758,14 @@ void do_coredump(const siginfo_t *siginfo)if (displaced)put_files_struct (displaced);if (!dump_interrupted ()) { +/* +* umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would +* have this set to NULL. +*/ +if (!cprm.file) { +pr_info ("Core dump to |%s disabled\n" , cn.corename); + goto close_fail; + }file_start_write (cprm.file); core_dumped = binfmt->core_dump (&cprm);file_end_write (cprm.file);
fs/exec.c +2 -2
@@ -1264,6 +1264,8 @@ int flush_old_exec(struct linux_binprm * bprm)*/ set_mm_exe_file (bprm->mm, bprm->file); +would_dump (bprm, bprm->file); +/* * Release all of the old mmap stuff */
@@ -1797,8 +1799,6 @@ static int do_execveat_common(int fd, struct filename *filename,if (retval <0 ) goto out; -would_dump (bprm, bprm->file); - retval =exec_binprm (bprm);if (retval <0 ) goto out;
fs/f2fs/xattr.c +106 -70
289 lines not on this page · raw message
fs/f2fs/xattr.h +2 -0
@@ -74,6 +74,8 @@ struct f2fs_xattr_entry { entry = XATTR_NEXT_ENTRY(entry))#define VALID_XATTR_BLOCK_SIZE (PAGE_SIZE - sizeof(struct node_footer))#define XATTR_PADDING_SIZE (sizeof(__u32)) +#define XATTR_SIZE (x,i) (((x) ? VALID_XATTR_BLOCK_SIZE : 0) + \ + (inline_xattr_size(i)))#define MIN_OFFSET (i) XATTR_ALIGN(inline_xattr_size(i) + \ VALID_XATTR_BLOCK_SIZE)
include/linux/blkdev.h +1 -1
@@ -568,7 +568,7 @@ struct request_queue {unsigned int sg_reserved_size;int node;#ifdef CONFIG_BLK_DEV_IO_TRACE -struct blk_trace *blk_trace; +struct blk_trace __rcu *blk_trace;struct mutex blk_trace_mutex;#endif /*
include/linux/blktrace_api.h +13 -5
@@ -51,9 +51,13 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *f**/ #define blk_add_cgroup_trace_msg (q, cg, fmt, ...) \ do { \ - struct blk_trace *bt = (q)->blk_trace; \ + struct blk_trace *bt; \ + \ + rcu_read_lock(); \ + bt = rcu_dereference((q)->blk_trace); \ if (unlikely(bt)) \ __trace_note_message(bt, cg, fmt, ##__VA_ARGS__);\ + rcu_read_unlock(); \ } while (0)#define blk_add_trace_msg (q, fmt, ...) \ blk_add_cgroup_trace_msg(q, NULL, fmt, ##__VA_ARGS__)
@@ -61,10 +65,14 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *fstatic inline bool blk_trace_note_message_enabled (struct request_queue *q) { -struct blk_trace *bt = q->blk_trace; -if (likely (!bt)) -return false; -return bt->act_mask &BLK_TC_NOTIFY ; +struct blk_trace *bt; +bool ret; + +rcu_read_lock (); + bt =rcu_dereference (q->blk_trace); + ret = bt && (bt->act_mask &BLK_TC_NOTIFY ); +rcu_read_unlock (); +return ret; } extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
include/linux/compiler.h +6 -0
@@ -382,4 +382,10 @@ unsigned long read_word_at_a_time(const void *addr) (_________p1); \ }) +/* +* This is needed in functions which generate the stack canary, see +* arch/x86/kernel/smpboot.c::start_secondary() for an example. +*/ +#define prevent_tail_call_optimization () mb() +#endif /* __LINUX_COMPILER_H */
include/linux/fs.h +1 -1
@@ -900,7 +900,7 @@ struct file_handle {__u32 handle_bytes;int handle_type;/* file identifier */ -unsigned char f_handle[0 ]; +unsigned char f_handle[]; };static inline struct file *get_file (struct file *f)
include/linux/pnp.h +9 -20
@@ -220,10 +220,8 @@ struct pnp_card {#define global_to_pnp_card (n) list_entry(n, struct pnp_card, global_list)#define protocol_to_pnp_card (n) list_entry(n, struct pnp_card, protocol_list)#define to_pnp_card (n) container_of(n, struct pnp_card, dev) -#define pnp_for_each_card (card) \ - for((card) = global_to_pnp_card(pnp_cards.next); \ - (card) != global_to_pnp_card(&pnp_cards); \ - (card) = global_to_pnp_card((card)->global_list.next)) +#define pnp_for_each_card (card) \ + list_for_each_entry(card, &pnp_cards, global_list)struct pnp_card_link {struct pnp_card *card;
@@ -276,14 +274,9 @@ struct pnp_dev {#define card_to_pnp_dev (n) list_entry(n, struct pnp_dev, card_list)#define protocol_to_pnp_dev (n) list_entry(n, struct pnp_dev, protocol_list)#define to_pnp_dev (n) container_of(n, struct pnp_dev, dev) -#define pnp_for_each_dev (dev) \ - for((dev) = global_to_pnp_dev(pnp_global.next); \ - (dev) != global_to_pnp_dev(&pnp_global); \ - (dev) = global_to_pnp_dev((dev)->global_list.next)) -#define card_for_each_dev (card,dev) \ - for((dev) = card_to_pnp_dev((card)->devices.next); \ - (dev) != card_to_pnp_dev(&(card)->devices); \ - (dev) = card_to_pnp_dev((dev)->card_list.next)) +#define pnp_for_each_dev (dev) list_for_each_entry(dev, &pnp_global, global_list) +#define card_for_each_dev (card, dev) \ + list_for_each_entry(dev, &(card)->devices, card_list)#define pnp_dev_name (dev) (dev)->namestatic inline void *pnp_get_drvdata (struct pnp_dev *pdev)
@@ -437,14 +430,10 @@ struct pnp_protocol { };#define to_pnp_protocol (n) list_entry(n, struct pnp_protocol, protocol_list) -#define protocol_for_each_card (protocol,card) \ - for((card) = protocol_to_pnp_card((protocol)->cards.next); \ - (card) != protocol_to_pnp_card(&(protocol)->cards); \ - (card) = protocol_to_pnp_card((card)->protocol_list.next)) -#define protocol_for_each_dev (protocol,dev) \ - for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \ - (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ - (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) +#define protocol_for_each_card (protocol, card) \ + list_for_each_entry(card, &(protocol)->cards, protocol_list) +#define protocol_for_each_dev (protocol, dev) \ + list_for_each_entry(dev, &(protocol)->devices, protocol_list)extern struct bus_type pnp_bus_type;
include/linux/tty.h +1 -1
@@ -65,7 +65,7 @@ struct tty_buffer {int read;int flags;/* Data points here */ -unsigned long data[0 ]; +unsigned long data[]; };/* Values for .flags field of tty_buffer */
include/linux/virtio_net.h +22 -2
@@ -3,6 +3,8 @@#define _LINUX_VIRTIO_NET_H#include <linux/if_vlan.h> +#include <uapi/linux/tcp.h> +#include <uapi/linux/udp.h> #include <uapi/linux/virtio_net.h> static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
@@ -28,17 +30,25 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, bool little_endian) {unsigned int gso_type =0 ; +unsigned int thlen =0 ; +unsigned int ip_proto;if (hdr->gso_type !=VIRTIO_NET_HDR_GSO_NONE ) {switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN ) {case VIRTIO_NET_HDR_GSO_TCPV4 : gso_type =SKB_GSO_TCPV4 ; + ip_proto =IPPROTO_TCP ; + thlen =sizeof (struct tcphdr );break ;case VIRTIO_NET_HDR_GSO_TCPV6 : gso_type =SKB_GSO_TCPV6 ; + ip_proto =IPPROTO_TCP ; + thlen =sizeof (struct tcphdr );break ;case VIRTIO_NET_HDR_GSO_UDP : gso_type =SKB_GSO_UDP ; + ip_proto =IPPROTO_UDP ; + thlen =sizeof (struct udphdr );break ;default :return -EINVAL ;
@@ -57,16 +67,20 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,if (!skb_partial_csum_set (skb, start, off))return -EINVAL ; + +if (skb_transport_offset (skb) + thlen >skb_headlen (skb)) +return -EINVAL ; }else {/* gso packets without NEEDS_CSUM do not set transport_offset. * probe and drop if does not match one of the above types. */ if (gso_type && skb->network_header) { +struct flow_keys keys; +if (!skb->protocol)virtio_net_hdr_set_proto (skb, hdr); retry: -skb_probe_transport_header (skb,-1 ); -if (!skb_transport_header_was_set (skb)) { +if (!skb_flow_dissect_flow_keys (skb, &keys,0 )) {/* UFO does not specify ipv4 or 6: try both */ if (gso_type &SKB_GSO_UDP && skb->protocol ==htons (ETH_P_IP )) {
@@ -75,6 +89,12 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, }return -EINVAL ; } + +if (keys.control.thoff + thlen >skb_headlen (skb) || + keys.basic.ip_proto != ip_proto) +return -EINVAL ; + +skb_set_transport_header (skb, keys.control.thoff); } }
include/net/addrconf.h +4 -2
@@ -223,8 +223,10 @@ struct ipv6_stub { const struct in6_addr *addr);int (*ipv6_sock_mc_drop)(struct sock *sk,int ifindex,const struct in6_addr *addr); -int (*ipv6_dst_lookup)(struct net *net,struct sock *sk, -struct dst_entry **dst,struct flowi6 *fl6); +struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst);void (*udpv6_encap_enable)(void ); void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr, const struct in6_addr *solicited_addr,
include/net/ipv6.h +1 -1
@@ -862,7 +862,7 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)int ip6_dst_lookup (struct net *net,struct sock *sk,struct dst_entry **dst,struct flowi6 *fl6); -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst);struct dst_entry *ip6_sk_dst_lookup_flow (struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst);
include/net/netfilter/nf_conntrack.h +1 -1
@@ -80,7 +80,7 @@ struct nf_conn {struct hlist_node nat_bysource;#endif /* all members below initialized via memset */ -u8 __nfct_init_offset[0 ]; +struct { } __nfct_init_offset;/* If we were expected by an expectation, this will be it */ struct nf_conn *master;
include/sound/rawmidi.h +1 -0
@@ -76,6 +76,7 @@ struct snd_rawmidi_runtime {size_t avail_min;/* min avail for wakeup */ size_t avail;/* max used buffer for wakeup */ size_t xruns;/* over/underruns counter */ +int buffer_ref;/* buffer reference count */ /* misc */ spinlock_t lock;wait_queue_head_t sleep;
init/main.c +2 -0
@@ -706,6 +706,8 @@ asmlinkage __visible void __init start_kernel(void)/* Do the rest non-__init'ed, we're now alive */ rest_init (); + +prevent_tail_call_optimization (); }/* Call all constructor functions linked into the kernel. */
ipc/util.c +6 -6
@@ -750,21 +750,21 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos, total++; } - *new_pos = pos +1 ; + ipc =NULL ;if (total >= ids->in_use) -return NULL ; + goto out;for (; pos <IPCMNI ; pos++) { ipc =idr_find (&ids->ipcs_idr, pos);if (ipc !=NULL ) {rcu_read_lock ();ipc_lock_object (ipc); -return ipc; +break ; } } - -/* Out of range - return NULL to terminate iteration */ -return NULL ; +out: + *new_pos = pos +1 ; +return ipc; }static void *sysvipc_proc_next (struct seq_file *s,void *it,loff_t *pos)
kernel/trace/blktrace.c +135 -42
431 lines not on this page · raw message
kernel/trace/trace.c +13 -0
@@ -7666,6 +7666,19 @@ static int allocate_trace_buffers(struct trace_array *tr, int size)*/ allocate_snapshot = false;#endif + +/* +* Because of some magic with the way alloc_percpu() works on +* x86_64, we need to synchronize the pgd of all the tables, +* otherwise the trace events that happen in x86_64 page fault +* handlers can't cope with accessing the chance that a +* alloc_percpu()'d memory might be touched in the page fault trace +* event. Oh, and we need to audit all other alloc_percpu() and vmalloc() +* calls in tracing, because something might get triggered within a +* page fault trace event! +*/ +vmalloc_sync_mappings (); +return 0 ; }
kernel/umh.c +5 -0
@@ -404,6 +404,11 @@ EXPORT_SYMBOL(call_usermodehelper_setup);* Runs a user-space application. The application is started * asynchronously if wait is not set, and runs as a child of system workqueues. * (ie. it runs with full root capabilities and optimized affinity). +* +* Note: successful return value does not guarantee the helper was called at +* all. You can't rely on sub_info->{init,cleanup} being called even for +* UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers +* into a successful no-op. */ int call_usermodehelper_exec (struct subprocess_info *sub_info,int wait) {
mm/page_alloc.c +1 -0
@@ -1405,6 +1405,7 @@ void set_zone_contiguous(struct zone *zone)if (!__pageblock_pfn_to_page (block_start_pfn, block_end_pfn, zone))return ; +cond_resched (); }/* We confirm that there is no hole */
mm/shmem.c +5 -2
@@ -2129,7 +2129,11 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)struct shmem_inode_info *info =SHMEM_I (inode);int retval = -ENOMEM ; -spin_lock_irq (&info->lock); +/* +* What serializes the accesses to info->flags? +* ipc_lock_object() when called from shmctl_do_lock(), +* no serialization needed when called from shm_destroy(). +*/ if (lock && !(info->flags &VM_LOCKED )) {if (!user_shm_lock (inode->i_size, user)) goto out_nomem;
@@ -2144,7 +2148,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) retval =0 ; out_nomem: -spin_unlock_irq (&info->lock);return retval; }
net/batman-adv/bat_v_ogm.c +1 -1
@@ -734,7 +734,7 @@ static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset, orig_node =batadv_v_ogm_orig_get (bat_priv, ogm_packet->orig);if (!orig_node) -return ; + goto out; neigh_node =batadv_neigh_node_get_or_create (orig_node, if_incoming, ethhdr->h_source);
net/batman-adv/network-coding.c +1 -8
@@ -1017,15 +1017,8 @@ static struct batadv_nc_path *batadv_nc_get_path(struct batadv_priv *bat_priv,*/ static u8 batadv_nc_random_weight_tq (u8 tq) { -u8 rand_val, rand_tq; - -get_random_bytes (&rand_val,sizeof (rand_val)); -/* randomize the estimated packet loss (max TQ - estimated TQ) */ - rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq); - -/* normalize the randomized packet loss */ - rand_tq /=BATADV_TQ_MAX_VALUE ; +u8 rand_tq =prandom_u32_max (BATADV_TQ_MAX_VALUE +1 - tq);/* convert to (randomized) estimated tq again */ return BATADV_TQ_MAX_VALUE - rand_tq;
net/batman-adv/sysfs.c +2 -1
@@ -1081,7 +1081,7 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj, ret =batadv_parse_throughput (net_dev, buff,"throughput_override" , &tp_override);if (!ret) -return count; + goto out; old_tp_override =atomic_read (&hard_iface->bat_v.throughput_override);if (old_tp_override == tp_override)
@@ -1114,6 +1114,7 @@ static ssize_t batadv_show_throughput_override(struct kobject *kobj, tp_override =atomic_read (&hard_iface->bat_v.throughput_override); +batadv_hardif_put (hard_iface);return sprintf (buff,"%u.%u MBit\n" , tp_override /10 , tp_override %10 ); }
net/core/dev.c +3 -1
@@ -7282,11 +7282,13 @@ static void netdev_sync_lower_features(struct net_device *upper,netdev_dbg (upper,"Disabling feature %pNF on lower dev %s.\n" , &feature, lower->name); lower->wanted_features &= ~feature; -netdev_update_features (lower); +__netdev_update_features (lower);if (unlikely (lower->features & feature))netdev_WARN (upper,"failed to disable %pNF on %s!\n" , &feature, lower->name); +else +netdev_features_change (lower); } } }
net/core/drop_monitor.c +7 -4
@@ -154,6 +154,7 @@ static void sched_send_work(unsigned long _data)static void trace_drop_common (struct sk_buff *skb,void *location) {struct net_dm_alert_msg *msg; +struct net_dm_drop_point *point;struct nlmsghdr *nlh;struct nlattr *nla;int i;
@@ -172,11 +173,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location) nlh = (struct nlmsghdr *)dskb->data; nla =genlmsg_data (nlmsg_data (nlh)); msg =nla_data (nla); + point = msg->points;for (i =0 ; i < msg->entries; i++) { -if (!memcmp (&location, msg->points[i].pc,sizeof (void *))) { - msg->points[i].count++; +if (!memcmp (&location, &point->pc,sizeof (void *))) { + point->count++; goto out; } + point++; }if (msg->entries == dm_hit_limit) goto out;
@@ -185,8 +188,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)*/ __nla_reserve_nohdr (dskb,sizeof (struct net_dm_drop_point )); nla->nla_len +=NLA_ALIGN (sizeof (struct net_dm_drop_point )); -memcpy (msg->points[msg->entries].pc, &location,sizeof (void *)); - msg->points[msg->entries].count =1 ; +memcpy (point->pc, &location,sizeof (void *)); + point->count =1 ; msg->entries++;if (!timer_pending (&data->send_timer)) {
net/core/netprio_cgroup.c +2 -0
@@ -241,6 +241,8 @@ static void net_prio_attach(struct cgroup_taskset *tset)struct task_struct *p;struct cgroup_subsys_state *css; +cgroup_sk_alloc_disable (); +cgroup_taskset_for_each (p, css, tset) {void *v = (void *)(unsigned long )css->cgroup->id;
net/dccp/ipv6.c +3 -3
@@ -211,7 +211,7 @@ static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req final_p =fl6_update_dst (&fl6,rcu_dereference (np->opt), &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); dst =NULL ;
@@ -282,7 +282,7 @@ static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb)security_skb_classify_flow (rxskb,flowi6_to_flowi (&fl6));/* sk = NULL, but it is safe for now. RST socket required. */ - dst =ip6_dst_lookup_flow (ctl_sk, &fl6,NULL ); + dst =ip6_dst_lookup_flow (sock_net (ctl_sk), ctl_sk, &fl6,NULL );if (!IS_ERR (dst)) {skb_dst_set (skb, dst);ip6_xmit (ctl_sk, skb, &fl6,0 ,NULL ,0 );
@@ -912,7 +912,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, opt =rcu_dereference_protected (np->opt,lockdep_sock_is_held (sk)); final_p =fl6_update_dst (&fl6, opt, &final); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto failure;
net/ipv4/cipso_ipv4.c +4 -2
@@ -1272,7 +1272,8 @@ static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def,return ret_val; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; }return 0 ;
@@ -1453,7 +1454,8 @@ static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def,return ret_val; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; }return 0 ;
net/ipv4/route.c +1 -1
@@ -921,7 +921,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)/* Check for load limit; set rate_last to the latest sent * redirect. */ -if (peer->rate_tokens ==0 || +if (peer->n_redirects ==0 ||time_after (jiffies, (peer->rate_last + (ip_rt_redirect_load << peer->n_redirects)))) {
net/ipv4/tcp.c +4 -2
@@ -1977,13 +1977,15 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, tp->urg_data =0 ;tcp_fast_path_check (sk); } -if (used + offset < skb->len) -continue ;if (TCP_SKB_CB (skb)->has_rxtstamp) {tcp_update_recv_tstamps (skb, &tss); has_tss = true; } + +if (used + offset < skb->len) +continue ; +if (TCP_SKB_CB (skb)->tcp_flags &TCPHDR_FIN ) goto found_fin_ok;if (!(flags &MSG_PEEK ))
net/ipv6/addrconf_core.c +6 -5
@@ -126,15 +126,16 @@ int inet6addr_validator_notifier_call_chain(unsigned long val, void *v) }EXPORT_SYMBOL (inet6addr_validator_notifier_call_chain); -static int eafnosupport_ipv6_dst_lookup (struct net *net,struct sock *u1, -struct dst_entry **u2, -struct flowi6 *u3) +static struct dst_entry *eafnosupport_ipv6_dst_lookup_flow (struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst) { -return -EAFNOSUPPORT ; +return ERR_PTR (-EAFNOSUPPORT ); }const struct ipv6_stub *ipv6_stub__read_mostly = &(struct ipv6_stub ) { - .ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup, + .ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow, };EXPORT_SYMBOL_GPL (ipv6_stub);
net/ipv6/af_inet6.c +5 -5
@@ -716,7 +716,7 @@ int inet6_sk_rebuild_header(struct sock *sk) &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { sk->sk_route_caps =0 ; sk->sk_err_soft = -PTR_ERR (dst);
@@ -874,7 +874,7 @@ static struct pernet_operations inet6_net_ops = {static const struct ipv6_stub ipv6_stub_impl = { .ipv6_sock_mc_join = ipv6_sock_mc_join, .ipv6_sock_mc_drop = ipv6_sock_mc_drop, - .ipv6_dst_lookup = ip6_dst_lookup, + .ipv6_dst_lookup_flow = ip6_dst_lookup_flow, .udpv6_encap_enable = udpv6_encap_enable, .ndisc_send_na = ndisc_send_na, .nd_tbl = &nd_tbl,
@@ -1088,11 +1088,11 @@ static int __init inet6_init(void) igmp_fail:ndisc_cleanup (); ndisc_fail: -ip6_mr_cleanup (); +icmpv6_cleanup (); icmp_fail: -unregister_pernet_subsys (&inet6_net_ops); +ip6_mr_cleanup (); ipmr_fail: -icmpv6_cleanup (); +unregister_pernet_subsys (&inet6_net_ops); register_pernet_fail:sock_unregister (PF_INET6 );rtnl_unregister_all (PF_INET6 );
net/ipv6/calipso.c +2 -1
@@ -1061,7 +1061,8 @@ static int calipso_opt_getattr(const unsigned char *calipso, goto getattr_return; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; } secattr->type =NETLBL_NLTYPE_CALIPSO ;
net/ipv6/datagram.c +1 -1
@@ -88,7 +88,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) final_p =fl6_update_dst (&fl6, opt, &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/ipv6/inet6_connection_sock.c +2 -2
@@ -52,7 +52,7 @@ struct dst_entry *inet6_csk_route_req(const struct sock *sk, fl6->flowi6_uid = sk->sk_uid;security_req_classify_flow (req,flowi6_to_flowi (fl6)); - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (IS_ERR (dst))return NULL ;
@@ -107,7 +107,7 @@ static struct dst_entry *inet6_csk_route_socket(struct sock *sk, dst =__inet6_csk_dst_check (sk, np->dst_cookie);if (!dst) { - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (!IS_ERR (dst))ip6_dst_store (sk, dst,NULL ,NULL );
net/ipv6/ip6_output.c +4 -4
@@ -1089,19 +1089,19 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup);* It returns a valid dst pointer on success, or a pointer encoded * error code. */ -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst) {struct dst_entry *dst =NULL ;int err; - err =ip6_dst_lookup_tail (sock_net (sk), sk, &dst, fl6); + err =ip6_dst_lookup_tail (net, sk, &dst, fl6);if (err)return ERR_PTR (err);if (final_dst) fl6->daddr = *final_dst; -return xfrm_lookup_route (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); +return xfrm_lookup_route (net, dst,flowi6_to_flowi (fl6), sk,0 ); }EXPORT_SYMBOL_GPL (ip6_dst_lookup_flow);
@@ -1126,7 +1126,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, dst =ip6_sk_dst_check (sk, dst, fl6);if (!dst) - dst =ip6_dst_lookup_flow (sk, fl6, final_dst); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_dst);return dst; }
net/ipv6/raw.c +1 -1
@@ -929,7 +929,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.