Linux 4.14.68
Greg KH
maintainerI'm announcing the release of the 4.14.68 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:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 6 arch/Kconfig | 3 arch/arc/Kconfig | 3 arch/arc/include/asm/cache.h | 4 arch/arc/include/asm/delay.h | 3 arch/arc/mm/cache.c | 7 - arch/arc/plat-eznps/include/plat/ctop.h | 10 + arch/arc/plat-eznps/mtm.c | 6 arch/arm/probes/kprobes/core.c | 4 arch/arm/probes/kprobes/test-core.c | 1 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 arch/arm64/kernel/probes/kprobes.c | 2 arch/arm64/mm/init.c | 6 arch/mips/Makefile | 12 - arch/mips/bcm47xx/setup.c | 6 arch/mips/include/asm/mipsregs.h | 3 arch/mips/include/asm/processor.h | 15 ++ arch/mips/kernel/ptrace.c | 2 arch/mips/kernel/ptrace32.c | 2 arch/mips/lib/multi3.c | 6 arch/powerpc/net/bpf_jit_comp64.c | 29 ---- arch/s390/include/asm/qdio.h | 1 arch/s390/mm/fault.c | 2 arch/s390/mm/page-states.c | 2 arch/s390/net/bpf_jit_comp.c | 2 arch/s390/numa/numa.c | 16 -- arch/s390/pci/pci.c | 2 arch/sparc/include/asm/Kbuild | 1 arch/sparc/kernel/time_64.c | 2 arch/x86/Kconfig | 1 arch/x86/boot/compressed/Makefile | 8 - arch/x86/entry/vdso/Makefile | 6 arch/x86/events/amd/ibs.c | 6 arch/x86/events/core.c | 2 arch/x86/include/asm/irqflags.h | 3 arch/x86/include/asm/processor.h | 6 arch/x86/include/asm/tlbflush.h | 40 +++++ arch/x86/include/asm/vgtod.h | 2 arch/x86/kernel/cpu/bugs.c | 50 ++++++- arch/x86/kernel/cpu/common.c | 1 arch/x86/kernel/cpu/intel.c | 3 arch/x86/kernel/dumpstack.c | 4 arch/x86/kernel/process_64.c | 1 arch/x86/kvm/svm.c | 8 - arch/x86/kvm/vmx.c | 18 +- arch/x86/lib/usercopy.c | 5 arch/x86/mm/init.c | 4 arch/x86/mm/mmap.c | 2 arch/x86/mm/tlb.c | 7 + drivers/base/power/clock_ops.c | 2 drivers/block/nbd.c | 96 +++++++++++--- drivers/cdrom/cdrom.c | 2 drivers/char/tpm/tpm-interface.c | 2 drivers/clk/rockchip/clk-rk3399.c | 2 drivers/crypto/vmx/aes_ctr.c | 31 ++-- drivers/gpio/gpiolib-acpi.c | 56 ++++++++ drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 + drivers/gpu/drm/imx/imx-ldb.c | 9 - drivers/gpu/drm/udl/udl_drv.h | 2 drivers/gpu/drm/udl/udl_fb.c | 17 +- drivers/gpu/drm/udl/udl_main.c | 35 ++--- drivers/gpu/drm/udl/udl_transfer.c | 39 ++--- drivers/hwmon/nct6775.c | 2 drivers/i2c/busses/i2c-davinci.c | 8 - drivers/i2c/i2c-core-base.c | 2 drivers/i2c/i2c-mux.c | 4 drivers/iommu/arm-smmu.c | 16 +- drivers/misc/mei/main.c | 1 drivers/net/can/m_can/m_can.c | 7 - drivers/net/can/mscan/mpc5xxx_can.c | 5 drivers/net/ethernet/3com/Kconfig | 2 drivers/net/ethernet/amd/Kconfig | 4 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 1 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 13 + drivers/net/ethernet/cirrus/Kconfig | 1 drivers/net/ethernet/cisco/enic/enic_main.c | 80 ++++------- drivers/net/ethernet/huawei/hinic/hinic_main.c | 1 drivers/net/ethernet/netronome/nfp/flower/main.c | 4 drivers/net/ethernet/qlogic/qed/qed_l2.c | 15 +- drivers/net/ethernet/qlogic/qed/qed_l2.h | 2 drivers/net/ethernet/qlogic/qed/qed_mcp.c | 13 + drivers/net/ethernet/qlogic/qed/qed_sriov.c | 2 drivers/net/ethernet/qlogic/qed/qed_vf.c | 4 drivers/net/ethernet/qlogic/qed/qed_vf.h | 7 - drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 1 drivers/net/usb/qmi_wwan.c | 2 drivers/net/wan/lmc/lmc_main.c | 2 drivers/net/wireless/broadcom/b43/leds.c | 2 drivers/net/wireless/broadcom/b43legacy/leds.c | 2 drivers/nvme/host/pci.c | 8 + drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2 drivers/platform/x86/ideapad-laptop.c | 4 drivers/power/supply/generic-adc-battery.c | 25 ++- drivers/s390/cio/qdio_main.c | 5 drivers/scsi/fcoe/fcoe_ctlr.c | 6 drivers/scsi/libfc/fc_rport.c | 1 drivers/scsi/libiscsi.c | 12 - drivers/scsi/mpt3sas/mpt3sas_transport.c | 5 drivers/scsi/scsi_sysfs.c | 20 ++ drivers/scsi/vmw_pvscsi.c | 11 + drivers/staging/media/omap4iss/iss_video.c | 3 drivers/target/iscsi/cxgbit/cxgbit_target.c | 16 +- drivers/target/iscsi/iscsi_target_login.c | 35 +++-- drivers/usb/gadget/function/f_uac2.c | 24 +-- drivers/usb/gadget/function/u_audio.c | 88 ++++-------- drivers/usb/gadget/udc/r8a66597-udc.c | 6 drivers/usb/phy/phy-fsl-usb.c | 4 fs/btrfs/disk-io.c | 10 - fs/btrfs/extent-tree.c | 2 fs/btrfs/inode.c | 26 --- fs/btrfs/super.c | 1 fs/cachefiles/namei.c | 1 fs/cachefiles/rdwr.c | 17 +- fs/cifs/cifs_debug.c | 30 +++- fs/cifs/cifsfs.c | 18 +- fs/cifs/inode.c | 2 fs/cifs/link.c | 4 fs/cifs/sess.c | 6 fs/cifs/smb2inode.c | 2 fs/cifs/smb2ops.c | 36 ++++- fs/cifs/smb2pdu.c | 8 + fs/cifs/smb2pdu.h | 11 + fs/ext4/mmp.c | 7 - fs/ext4/namei.c | 1 fs/ext4/super.c | 2 fs/ext4/sysfs.c | 13 + fs/ext4/xattr.c | 2 fs/fscache/operation.c | 6 fs/fuse/dev.c | 39 ++++- fs/fuse/dir.c | 10 - fs/fuse/file.c | 1 fs/fuse/fuse_i.h | 5 fs/fuse/inode.c | 37 +++-- fs/squashfs/file.c | 50 ++++--- fs/squashfs/file_cache.c | 4 fs/squashfs/file_direct.c | 24 +-- fs/squashfs/squashfs.h | 3 fs/sysfs/file.c | 44 ++++++ include/linux/printk.h | 4 include/linux/rtmutex.h | 7 + include/linux/sysfs.h | 14 ++ ipc/sem.c | 2 kernel/kprobes.c | 4 kernel/locking/rtmutex.c | 29 +++- kernel/printk/internal.h | 9 + kernel/printk/printk.c | 57 +++++--- kernel/printk/printk_safe.c | 58 +++++--- kernel/sched/rt.c | 2 kernel/stop_machine.c | 43 +++--- kernel/trace/trace.c | 4 kernel/watchdog.c | 4 kernel/watchdog_hld.c | 2 kernel/workqueue.c | 2 lib/nmi_backtrace.c | 3 mm/memcontrol.c | 15 +- mm/memory.c | 33 +++- mm/zswap.c | 9 + net/caif/caif_dev.c | 4 net/core/lwt_bpf.c | 2 net/ipv6/esp6.c | 4 net/ipv6/ip6_vti.c | 11 - net/mac80211/util.c | 3 net/netfilter/nf_tables_api.c | 59 +++++--- net/netfilter/nft_set_hash.c | 1 net/wireless/nl80211.c | 1 net/xfrm/xfrm_policy.c | 3 net/xfrm/xfrm_user.c | 10 - scripts/gcc-plugins/gcc-common.h | 4 scripts/gcc-plugins/latent_entropy_plugin.c | 17 -- scripts/gcc-plugins/randomize_layout_plugin.c | 75 +++------- scripts/gcc-plugins/structleak_plugin.c | 19 +- sound/soc/sirf/sirf-usp.c | 7 - sound/soc/soc-pcm.c | 8 + sound/soc/zte/zx-tdm.c | 4 tools/power/x86/turbostat/turbostat.c | 8 - tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc | 28 ++++ tools/usb/ffs-test.c | 19 ++ virt/kvm/arm/mmu.c | 42 ++++-- 178 files changed, 1396 insertions(+), 776 deletions(-)
Alberto Panizzo (1):
clk: rockchip: fix clk_i2sout parent selection bits on rk3399
Aleksander Morgado (1):
qmi_wwan: fix interface number for DW5821e production firmware
Alexander Sverdlin (1):
i2c: davinci: Avoid zero value of CLKH
Alexander Usyskin (1):
mei: don't update offset in write
Andi Kleen (2):
x86/spectre: Add missing family 6 check to microcode check x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+
Andrey Ryabinin (1):
fuse: Don't access pipe->buffers without pipe_lock()
Andy Lutomirski (2):
x86/vdso: Fix vDSO build if a retpoline is emitted x86/nmi: Fix NMI uaccess race against CR3 switching
Arnd Bergmann (1):
ext4: sysfs: print ext4_super_block fields as little-endian
Bart Van Assche (3):
scsi: mpt3sas: Fix _transport_smp_handler() error path
scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
Benjamin Tissoires (1):
gpiolib-acpi: make sure we trigger edge events at least once on boot
Bernd Edlinger (1):
nl80211: Add a missing break in parse_station_flags
Calvin Walton (1):
tools/power turbostat: Read extended processor family from CPUID
Claudio Imbrenda (1):
s390/kvm: fix deadlock when killed by oom
Colin Ian King (1):
drivers: net: lmc: fix case value for target abort error
Dan Carpenter (2):
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() PM / clk: signedness bug in of_pm_clk_add_clks()
Daniel Borkmann (1):
bpf, ppc64: fix unexpected r0=0 exit path inside bpf_xadd
Davidlohr Bueso (1):
ipc/sem.c: prevent queue.status tearing in semop
Eric Sandeen (1):
ext4: reset error code in ext4_find_entry in fallback
Ethan Lien (1):
btrfs: use correct compare function of dirty_metadata_bytes
Eugeniu Rosca (3):
usb: gadget: f_uac2: fix error handling in afunc_bind (again)
usb: gadget: u_audio: fix pcm/card naming in g_audio_setup()
usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'
Eugeniy Paltsev (1):
ARC: dma [non-IOC] setup SMP_CACHE_BYTES and cache_line_size
Eyal Birger (1):
vti6: fix PMTU caching and reporting on xmit
Faiz Abbas (1):
can: m_can: Move accessing of message ram to after clocks are enabled
Florian Westphal (4):
xfrm: free skb if nlsk pointer is NULL
netfilter: nf_tables: fix memory leaks on chain rename
netfilter: nf_tables: don't allow to rename to already-pending name
atl1c: reserve min skb headroom
Gerald Schaefer (1):
s390/mm: fix addressing exception after suspend/resume
Govindarajulu Varadarajan (2):
enic: handle mtu change for vf properly
enic: do not call enic_change_mtu in enic_probe
Greg Hackmann (1):
arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()
Greg Kroah-Hartman (1):
Linux 4.14.68
Guenter Roeck (1):
media: staging: omap4iss: Include asm/cacheflush.h after generic includes
Gustavo A. R. Silva (2):
ASoC: sirf: Fix potential NULL pointer dereference
hwmon: (nct6775) Fix potential Spectre v1
H. Nikolaus Schaller (2):
power: generic-adc-battery: fix out-of-bounds write when copying channel properties
power: generic-adc-battery: check for duplicate properties copied from iio channels
Hailong Liu (1):
sched/rt: Restore rt_runtime after disabling RT_RUNTIME_SHARE
Huacai Chen (1):
MIPS: Change definition of cpu_relax() for Loongson-3
Hugh Dickins (1):
mm: delete historical BUG from zap_pmd_range()
Huibin Hong (1):
arm64: dts: rockchip: corrected uart1 clock-names for rk3328
Jann Horn (1):
x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit()
Jerome Brunet (1):
ASoC: dpcm: don't merge format from invalid codec dai
Jia-Ju Bai (2):
usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller()
usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue()
Jim Gill (1):
scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED
Johannes Thumshirn (3):
scsi: fcoe: fix use-after-free in fcoe_ctlr_els_send
scsi: fcoe: drop frames in ELS LOGO error path
scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO
John Hurley (1):
nfp: flower: fix port metadata conversion bug
Josef Bacik (4):
nbd: don't requeue the same request twice.
nbd: handle unexpected replies better
btrfs: don't leak ret from do_chunk_alloc
Btrfs: fix btrfs_write_inode vs delayed iput deadlock
Josh Poimboeuf (1):
x86/kvm/vmx: Remove duplicate l1d flush definitions
Joshua Frkuska (1):
usb: gadget: u_audio: update hw_ptr in iso_complete after data copied
Julian Wiedmann (1):
s390/qdio: reset old sbal_state flags
Kees Cook (2):
x86/boot: Fix if_changed build flip/flop bug
gcc-plugins: Use dynamic initializers
Kiran Kumar Modukuri (3):
fscache: Allow cancelled operations to be enqueued
cachefiles: Fix refcounting bug in backing-file read monitoring
cachefiles: Wait rather than BUG'ing on "Unexpected object collision"
Kirill Tkhai (2):
memcg: remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() failure
fuse: Add missed unlock_page() to fuse_readpages_fill()
Len Brown (1):
tools/power turbostat: fix -S on UP systems
Li Wang (1):
zswap: re-check zswap_is_full() after do zswap_shrink()
Linus Torvalds (1):
squashfs metadata 2: electric boogaloo
Lucas Stach (2):
drm/imx: imx-ldb: disable LDB on driver bind
drm/imx: imx-ldb: check if channel is enabled before printing warning
Maciej W. Rozycki (1):
MIPS: Correct the 64-bit DSP accumulator register size
Martin Schwidefsky (2):
s390: fix br_r1_trampoline for machines without exrl s390/numa: move initial setup of node_to_cpumask_map
Masami Hiramatsu (4):
selftests/ftrace: Add snapshot and tracing_on test case kprobes/arm64: Fix %p uses in error messages kprobes/arm: Fix %p uses in error messages
kprobes: Make list and blacklist root user read only
Michael Buesch (2):
b43legacy/leds: Ensure NUL-termination of LED name string b43/leds: Ensure NUL-termination of LED name string
Michal Wnukowski (1):
nvme-pci: add a memory barrier to nvme_dbbuf_update_and_check_event
Mike Christie (1):
iscsi target: fix session creation failure handling
Miklos Szeredi (5):
fuse: fix initial parallel dirops
fuse: fix double request_end()
fuse: fix unlocked access to processing queue
fuse: umount should wait for all requests
fuse: Fix oops at process_init_reply()
Mikulas Patocka (4):
udl-kms: change down_interruptible to down
udl-kms: handle allocation failure
udl-kms: fix crash due to uninitialized memory
udl-kms: avoid division
Nicholas Mc Guire (2):
can: mpc5xxx_can: check of_iomap return before use
cifs: check kmalloc before use
Nicholas Piggin (1):
mm: move tlb_table_flush to tlb_flush_mmu_free
Nick Desaulniers (1):
x86/irqflags: Mark native_restore_fl extern inline
Ofer Levi (1):
ARC: [plat-eznps] Add missing struct nps_host_reg_aux_dpc
Paul Burton (2):
MIPS: Always use -march=<arch>, not -<arch> shortcuts
MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
Paulo Flabiano Smorigo (1):
crypto: vmx - Use skcipher for ctr fallback
Peter Rosin (2):
locking/rtmutex: Allow specifying a subclass for nested locking i2c/mux, locking/core: Annotate the nested rt_mutex usage
Peter Senna Tschudin (1):
tools: usb: ffs-test: Fix build on big endian systems
Peter Zijlstra (2):
stop_machine: Reflow cpu_stop_queue_two_works() mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE
Petr Mladek (3):
printk: Split the code for storing a message into the log buffer
printk: Create helper function to queue deferred console handling printk/nmi: Prevent deadlock when accessing the main log buffer in NMI
Phillip Lougher (1):
Squashfs: Compute expected length from inode size rather than block length
Prasad Sodagudi (1):
stop_machine: Atomically queue and wake stopper threads
Punit Agrawal (2):
KVM: arm/arm64: Skip updating PMD entry if no change
KVM: arm/arm64: Skip updating PTE entry if no change
Rafał Miłecki (1):
Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"
Randy Dunlap (6):
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
net: prevent ISA drivers from building on PPC32
arc: [plat-eznps] fix data type errors in platform headers
arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c
arc: fix build errors in arc/include/asm/delay.h
arc: fix type warnings in arc/mm/cache.c
Rian Hunter (1):
x86/process: Re-export start_thread()
Ricardo Schwarzmeier (1):
tpm: Return the actual size when receiving an unsupported command
Samuel Neves (1):
x86/vdso: Fix lsl operand order
Scott Bauer (1):
cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
Sean Christopherson (1):
KVM: vmx: use local variable for current_vmptr when emulating VMPTRST
Sean Paul (1):
drm/bridge: adv7511: Reset registers on hotplug
Sebastian Ott (1):
s390/pci: fix out of bounds access during irq setup
Shubhrajyoti Datta (1):
net: axienet: Fix double deregister of mdio
Steve French (5):
cifs: add missing debug entries for kconfig options
smb3: enumerating snapshots was leaving part of the data off end
smb3: Do not send SMB3 SET_INFO if nothing changed
smb3: don't request leases in symlink creation and query
smb3: fill in statfs fsid and correct namelen
Steven Rostedt (VMware) (1):
sparc/time: Add missing __init to init_tick_ops()
Sudarsana Reddy Kalluru (4):
qed: Fix link flap issue due to mismatching EEE capabilities.
qed: Fix possible race for the link state value.
qed: Correct Multicast API to reflect existence of 256 approximate buckets.
bnx2x: Fix invalid memory access in rss hash config path.
Taehee Yoo (2):
netfilter: nft_set_hash: add rcu_barrier() in the nft_rhash_destroy()
bpf: use GFP_ATOMIC instead of GFP_KERNEL in bpf_parse_prog()
Takashi Iwai (2):
platform/x86: ideapad-laptop: Apply no_hw_rfkill to Y20-15IKBM, too
ASoC: zte: Fix incorrect PCM format bit usages
Theodore Ts'o (2):
ext4: clear mmp sequence number when remounting read-only
ext4: check for NUL characters in extended attribute's name
Thomas Gleixner (2):
perf/x86/amd/ibs: Don't access non-started event
KVM: x86: SVM: Call x86_spec_ctrl_set_guest/host() with interrupts disabled
Thomas Petazzoni (1):
sparc: use asm-generic version of msi.h
Tommi Rantala (1):
xfrm: fix missing dst_release() after policy blocking lbcast and multicast
Valdis Kletnieks (1):
gcc-plugins: Add include required by GCC release 8
Varun Prakash (2):
scsi: target: iscsi: cxgbit: fix max iso npdu calculation
scsi: libiscsi: fix possible NULL pointer dereference in case of TMF
Vincent Whitchurch (1):
watchdog: Mark watchdog touch functions as notrace
Vivek Gautam (1):
iommu/arm-smmu: Error out only if not enough context interrupts
Vladimir Zapolskiy (3):
usb: gadget: u_audio: remove caching of stream buffer parameters
usb: gadget: u_audio: remove cached period bytes value
usb: gadget: u_audio: protect stream runtime fields with stream spinlock
Vlastimil Babka (3):
x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM x86/speculation/l1tf: Suggest what to do on systems with too much RAM
YueHaibing (1):
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
Zhen Lei (1):
esp6: fix memleak on error path in esp6_input
dann frazier (1):
hinic: Link the logical network device to the pci device in sysfs
jie@[email protected] (1):
mm/memory.c: check return value of ioremap_prot
[email protected] (1):
mac80211: add stations tied to AP_VLANs during hw reconfig
Greg KH
maintainerMakefile +5 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 67 +SUBLEVEL = 68 EXTRAVERSION = NAME = Petit Gorille
@@ -490,9 +490,13 @@ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) endif RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register +RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk +RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) +RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG))) export RETPOLINE_CFLAGS +export RETPOLINE_VDSO_CFLAGS ifeq ($(config-targets),1) # ===========================================================================
arch/Kconfig +3 -0
@@ -336,6 +336,9 @@ config HAVE_ARCH_JUMP_LABEL config HAVE_RCU_TABLE_FREE bool +config HAVE_RCU_TABLE_INVALIDATE + bool + config ARCH_HAVE_NMI_SAFE_CMPXCHG bool
arch/arc/Kconfig +3 -0
@@ -45,6 +45,9 @@ config ARC select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZMA +config ARCH_HAS_CACHE_LINE_SIZE + def_bool y + config MIGHT_HAVE_PCI bool
arch/arc/include/asm/cache.h +3 -1
@@ -48,7 +48,9 @@ })/* Largest line length for either L1 or L2 is 128 bytes */ -#define ARCH_DMA_MINALIGN 128 +#define SMP_CACHE_BYTES 128 +#define cache_line_size () SMP_CACHE_BYTES +#define ARCH_DMA_MINALIGN SMP_CACHE_BYTESextern void arc_cache_init (void );extern char *arc_cache_mumbojumbo (int cpu_id,char *buf,int len);
arch/arc/include/asm/delay.h +3 -0
@@ -17,8 +17,11 @@#ifndef __ASM_ARC_UDELAY_H#define __ASM_ARC_UDELAY_H +#include <asm-generic/types.h> #include <asm/param.h> /* HZ */ +extern unsigned long loops_per_jiffy; +static inline void __delay (unsigned long loops) { __asm__ __volatile__(
arch/arc/mm/cache.c +4 -3
@@ -1035,7 +1035,7 @@ void flush_cache_mm(struct mm_struct *mm)void flush_cache_page (struct vm_area_struct *vma,unsigned long u_vaddr,unsigned long pfn) { -unsigned int paddr = pfn <<PAGE_SHIFT ; +phys_addr_t paddr = pfn <<PAGE_SHIFT ; u_vaddr &=PAGE_MASK ;
@@ -1055,8 +1055,9 @@ void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long u_vaddr) {/* TBD: do we really need to clear the kernel mapping */ -__flush_dcache_page (page_address (page), u_vaddr); -__flush_dcache_page (page_address (page),page_address (page)); +__flush_dcache_page ((phys_addr_t )page_address (page), u_vaddr); +__flush_dcache_page ((phys_addr_t )page_address (page), + (phys_addr_t )page_address (page)); }
arch/arc/plat-eznps/include/plat/ctop.h +10 -0
@@ -21,6 +21,7 @@#error "Incorrect ctop.h include"#endif +#include <linux/types.h> #include <soc/nps/common.h> /* core auxiliary registers */
@@ -143,6 +144,15 @@ struct nps_host_reg_gim_p_int_dst { };/* AUX registers definition */ +struct nps_host_reg_aux_dpc { +union { +struct { +u32 ien:1 , men:1 , hen:1 , reserved:29 ; + }; +u32 value; + }; +}; + struct nps_host_reg_aux_udmc { union { struct {
arch/arc/plat-eznps/mtm.c +4 -2
@@ -15,6 +15,8 @@*/ #include <linux/smp.h> +#include <linux/init.h> +#include <linux/kernel.h> #include <linux/io.h> #include <linux/log2.h> #include <asm/arcregs.h>
@@ -157,10 +159,10 @@ void mtm_enable_core(unsigned int cpu)/* Verify and set the value of the mtm hs counter */ static int __init set_mtm_hs_ctr (char *ctr_str) { -long hs_ctr; +int hs_ctr;int ret; - ret =kstrtol (ctr_str,0 , &hs_ctr); + ret =kstrtoint (ctr_str,0 , &hs_ctr);if (ret || hs_ctr >MT_HS_CNT_MAX || hs_ctr <MT_HS_CNT_MIN ) { pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n",
arch/arm/probes/kprobes/core.c +2 -2
@@ -291,8 +291,8 @@ void __kprobes kprobe_handler(struct pt_regs *regs)break ;case KPROBE_REENTER :/* A nested probe was hit in FIQ, it is a BUG */ -pr_warn ("Unrecoverable kprobe detected at %p.\n" , - p->addr); +pr_warn ("Unrecoverable kprobe detected.\n" ); +dump_kprobe (p);/* fall through */ default :/* impossible cases */
arch/arm/probes/kprobes/test-core.c +0 -1
@@ -1517,7 +1517,6 @@ static bool check_test_results(void)print_registers (&result_regs);if (mem) { -pr_err ("current_stack=%p\n" , current_stack);pr_err ("expected_memory:\n" );print_memory (expected_memory, mem_size);pr_err ("result_memory:\n" );
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -1
@@ -331,7 +331,7 @@ reg = <0x0 0xff120000 0x0 0x100>; interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>; - clock-names = "sclk_uart", "pclk_uart"; + clock-names = "baudclk", "apb_pclk"; dmas = <&dmac 4>, <&dmac 5>; #dma-cells = <2>; pinctrl-names = "default";
arch/arm64/kernel/probes/kprobes.c +1 -1
@@ -275,7 +275,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p,break ;case KPROBE_HIT_SS :case KPROBE_REENTER : -pr_warn ("Unrecoverable kprobe detected at %p.\n" , p->addr); +pr_warn ("Unrecoverable kprobe detected.\n" );dump_kprobe (p);BUG ();break ;
arch/arm64/mm/init.c +5 -1
@@ -287,7 +287,11 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)#ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid (unsigned long pfn) { -return memblock_is_map_memory (pfn <<PAGE_SHIFT ); +phys_addr_t addr = pfn <<PAGE_SHIFT ; + +if ((addr >>PAGE_SHIFT ) != pfn) +return 0 ; +return memblock_is_map_memory (addr); }EXPORT_SYMBOL (pfn_valid);#endif
arch/mips/Makefile +4 -8
@@ -155,15 +155,11 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap -cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ - -Wa,-mips32 -Wa,--trap -cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ - -Wa,-mips32r2 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg -cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ - -Wa,-mips64 -Wa,--trap -cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ - -Wa,-mips64r2 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,--trap +cflags-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,--trap cflags-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,--trap cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \
arch/mips/bcm47xx/setup.c +0 -6
@@ -212,12 +212,6 @@ static int __init bcm47xx_cpu_fixes(void)*/ if (bcm47xx_bus.bcma.bus.chipinfo.id ==BCMA_CHIP_ID_BCM4706 ) cpu_wait =NULL ; - -/* -* BCM47XX Erratum "R10: PCIe Transactions Periodically Fail" -* Enable ExternalSync for sync instruction to take effect -*/ -set_c0_config7 (MIPS_CONF7_ES );break ;#endif }
arch/mips/include/asm/mipsregs.h +0 -3
@@ -680,8 +680,6 @@#define MIPS_CONF7_WII (_ULCAST_(1) << 31)#define MIPS_CONF7_RPS (_ULCAST_(1) << 2) -/* ExternalSync */ -#define MIPS_CONF7_ES (_ULCAST_(1) << 8)#define MIPS_CONF7_IAR (_ULCAST_(1) << 10)#define MIPS_CONF7_AR (_ULCAST_(1) << 16)
@@ -2747,7 +2745,6 @@ __BUILD_SET_C0(status) __BUILD_SET_C0(cause) __BUILD_SET_C0(config) __BUILD_SET_C0(config5) -__BUILD_SET_C0(config7) __BUILD_SET_C0(intcontrol) __BUILD_SET_C0(intctl) __BUILD_SET_C0(srsmap)
arch/mips/include/asm/processor.h +14 -1
@@ -141,7 +141,7 @@ struct mips_fpu_struct {#define NUM_DSP_REGS 6 -typedef __u32 dspreg_t ; +typedef unsigned long dspreg_t ;struct mips_dsp_state {dspreg_t dspr[NUM_DSP_REGS ];
@@ -388,7 +388,20 @@ unsigned long get_wchan(struct task_struct *p);#define KSTK_ESP (tsk) (task_pt_regs(tsk)->regs[29])#define KSTK_STATUS (tsk) (task_pt_regs(tsk)->cp0_status) +#ifdef CONFIG_CPU_LOONGSON3 +/* +* Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a +* tight read loop is executed, because reads take priority over writes & the +* hardware (incorrectly) doesn't ensure that writes will eventually occur. +* +* Since spin loops of any kind should have a cpu_relax() in them, force an SFB +* flush from cpu_relax() such that any pending writes will become visible as +* expected. +*/ +#define cpu_relax () smp_mb() +#else #define cpu_relax () barrier() +#endif /* * Return_address is a replacement for __builtin_return_address(count)
arch/mips/kernel/ptrace.c +1 -1
@@ -847,7 +847,7 @@ long arch_ptrace(struct task_struct *child, long request, goto out; } dregs =__get_dsp_regs (child); - tmp = (unsigned long ) (dregs[addr -DSP_BASE ]); + tmp = dregs[addr -DSP_BASE ];break ; }case DSP_CONTROL :
arch/mips/kernel/ptrace32.c +1 -1
@@ -141,7 +141,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, goto out; } dregs =__get_dsp_regs (child); - tmp = (unsigned long ) (dregs[addr -DSP_BASE ]); + tmp = dregs[addr -DSP_BASE ];break ; }case DSP_CONTROL :
arch/mips/lib/multi3.c +3 -3
@@ -4,12 +4,12 @@#include "libgcc.h" /* -* GCC 7 suboptimally generates __multi3 calls for mips64r6, so for that -* specific case only we'll implement it here. +* GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for +* that specific case only we implement that intrinsic here. * * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981 */ -#if defined(CONFIG_64BIT ) && defined(CONFIG_CPU_MIPSR6 ) && (__GNUC__ ==7 ) +#if defined(CONFIG_64BIT ) && defined(CONFIG_CPU_MIPSR6 ) && (__GNUC__ <8 )/* multiply 64-bit values, low 64-bits returned */ static inline long long notrace dmulu (long long a,long long b)
arch/powerpc/net/bpf_jit_comp64.c +5 -24
@@ -322,6 +322,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,u64 imm64;u8 *func;u32 true_cond; +u32 tmp_idx;/* * addrs[] maps a BPF bytecode address into a real offset from
@@ -681,11 +682,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,case BPF_STX |BPF_XADD |BPF_W :/* Get EA into TMP_REG_1 */ PPC_ADDI (b2p[TMP_REG_1 ], dst_reg, off); -/* error if EA is not word-aligned */ -PPC_ANDI (b2p[TMP_REG_2 ], b2p[TMP_REG_1 ],0x03 ); -PPC_BCC_SHORT (COND_EQ , (ctx->idx *4 ) +12 ); -PPC_LI (b2p[BPF_REG_0 ],0 ); -PPC_JMP (exit_addr); + tmp_idx = ctx->idx *4 ;/* load value from memory into TMP_REG_2 */ PPC_BPF_LWARX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ],0 );/* add value from src_reg into this */
@@ -693,32 +690,16 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,/* store result back */ PPC_BPF_STWCX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ]);/* we're done if this succeeded */ -PPC_BCC_SHORT (COND_EQ , (ctx->idx *4 ) + (7 *4 )); -/* otherwise, let's try once more */ -PPC_BPF_LWARX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ],0 ); -PPC_ADD (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], src_reg); -PPC_BPF_STWCX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ]); -/* exit if the store was not successful */ -PPC_LI (b2p[BPF_REG_0 ],0 ); -PPC_BCC (COND_NE , exit_addr); +PPC_BCC_SHORT (COND_NE , tmp_idx);break ;/* *(u64 *)(dst + off) += src */ case BPF_STX |BPF_XADD |BPF_DW :PPC_ADDI (b2p[TMP_REG_1 ], dst_reg, off); -/* error if EA is not doubleword-aligned */ -PPC_ANDI (b2p[TMP_REG_2 ], b2p[TMP_REG_1 ],0x07 ); -PPC_BCC_SHORT (COND_EQ , (ctx->idx *4 ) + (3 *4 )); -PPC_LI (b2p[BPF_REG_0 ],0 ); -PPC_JMP (exit_addr); -PPC_BPF_LDARX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ],0 ); -PPC_ADD (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], src_reg); -PPC_BPF_STDCX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ]); -PPC_BCC_SHORT (COND_EQ , (ctx->idx *4 ) + (7 *4 )); + tmp_idx = ctx->idx *4 ;PPC_BPF_LDARX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ],0 );PPC_ADD (b2p[TMP_REG_2 ], b2p[TMP_REG_2 ], src_reg);PPC_BPF_STDCX (b2p[TMP_REG_2 ],0 , b2p[TMP_REG_1 ]); -PPC_LI (b2p[BPF_REG_0 ],0 ); -PPC_BCC (COND_NE , exit_addr); +PPC_BCC_SHORT (COND_NE , tmp_idx);break ;/*
arch/s390/include/asm/qdio.h +0 -1
@@ -262,7 +262,6 @@ struct qdio_outbuf_state {void *user; }; -#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00#define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01#define CHSC_AC1_INITIATE_INPUTQ 0x80
arch/s390/mm/fault.c +2 -0
@@ -486,6 +486,8 @@ static inline int do_exception(struct pt_regs *regs, int access)/* No reason to continue if interrupted by SIGKILL. */ if ((fault &VM_FAULT_RETRY ) &&fatal_signal_pending (current)) { fault =VM_FAULT_SIGNAL ; +if (flags &FAULT_FLAG_RETRY_NOWAIT ) + goto out_up; goto out; }if (unlikely (fault &VM_FAULT_ERROR ))
arch/s390/mm/page-states.c +1 -1
@@ -271,7 +271,7 @@ void arch_set_page_states(int make_stable)list_for_each (l, &zone->free_area[order].free_list[t]) { page = list_entry(l, struct page, lru);if (make_stable) -set_page_stable_dat (page,0 ); +set_page_stable_dat (page, order);else set_page_unused (page, order); }
arch/s390/net/bpf_jit_comp.c +0 -2
@@ -518,8 +518,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)/* br %r1 */ _EMIT2 (0x07f1 ); }else { -/* larl %r1,.+14 */ -EMIT6_PCREL_RILB (0xc0000000 ,REG_1 , jit->prg +14 );/* ex 0,S390_lowcore.br_r1_tampoline */ EMIT4_DISP (0x44000000 ,REG_0 ,REG_0 , offsetof(struct lowcore , br_r1_trampoline));
arch/s390/numa/numa.c +2 -14
@@ -134,26 +134,14 @@ void __init numa_setup(void) {pr_info ("NUMA mode: %s\n" , mode->name);nodes_clear (node_possible_map); +/* Initially attach all possible CPUs to node 0. */ +cpumask_copy (&node_to_cpumask_map[0 ], cpu_possible_mask);if (mode->setup) mode->setup ();numa_setup_memory ();memblock_dump_all (); } -/* -* numa_init_early() - Initialization initcall -* -* This runs when only one CPU is online and before the first -* topology update is called for by the scheduler. -*/ -static int __init numa_init_early (void ) -{ -/* Attach all possible CPUs to node 0 for now. */ -cpumask_copy (&node_to_cpumask_map[0 ], cpu_possible_mask); -return 0 ; -} -early_initcall (numa_init_early); -/* * numa_init_late() - Initialization initcall *
arch/s390/pci/pci.c +2 -0
@@ -420,6 +420,8 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) hwirq =0 ;for_each_pci_msi_entry (msi, pdev) { rc = -EIO ; +if (hwirq >= msi_vecs) +break ; irq =irq_alloc_desc (0 );/* Alloc irq on node 0 */ if (irq <0 )return -ENOMEM ;
arch/sparc/include/asm/Kbuild +1 -0
@@ -14,6 +14,7 @@ generic-y += local64.h generic-y += mcs_spinlock.h generic-y += mm-arch-hooks.h generic-y += module.h +generic-y += msi.h generic-y += preempt.h generic-y += rwsem.h generic-y += serial.h
arch/sparc/kernel/time_64.c +1 -1
@@ -813,7 +813,7 @@ static void __init get_tick_patch(void) } } -static void init_tick_ops (struct sparc64_tick_ops *ops) +static void __init init_tick_ops (struct sparc64_tick_ops *ops) {unsigned long freq, quotient, tick;
arch/x86/Kconfig +1 -0
@@ -170,6 +170,7 @@ config X86 select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP select HAVE_RCU_TABLE_FREE + select HAVE_RCU_TABLE_INVALIDATE if HAVE_RCU_TABLE_FREE select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE if X86_64 && UNWINDER_FRAME_POINTER && STACK_VALIDATION select HAVE_STACK_VALIDATION if X86_64
arch/x86/boot/compressed/Makefile +6 -2
@@ -104,9 +104,13 @@ define cmd_check_data_rel done endef +# We need to run two commands under "if_changed", so merge them into a +# single invocation. +quiet_cmd_check-and-link-vmlinux = LD $@ + cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld) + $(obj)/vmlinux: $(vmlinux-objs-y) FORCE - $(call if_changed,check_data_rel) - $(call if_changed,ld) + $(call if_changed,check-and-link-vmlinux) OBJCOPYFLAGS_vmlinux.bin := -R .comment -S $(obj)/vmlinux.bin: vmlinux FORCE
arch/x86/entry/vdso/Makefile +4 -2
@@ -74,9 +74,9 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \ $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \ -fno-omit-frame-pointer -foptimize-sibling-calls \ - -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO + -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO $(RETPOLINE_VDSO_CFLAGS) -$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) +$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) # # vDSO code runs in userspace and -pg doesn't help with profiling anyway.
@@ -147,11 +147,13 @@ KBUILD_CFLAGS_32 := $(filter-out -mcmodel=kernel,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32)) +KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector) KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) KBUILD_CFLAGS_32 += -fno-omit-frame-pointer KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING +KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS) $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32) $(obj)/vdso32.so.dbg: FORCE \
arch/x86/events/amd/ibs.c +5 -1
@@ -579,7 +579,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) {struct cpu_perf_ibs *pcpu =this_cpu_ptr (perf_ibs->pcpu);struct perf_event *event = pcpu->event; -struct hw_perf_event *hwc = &event->hw; +struct hw_perf_event *hwc;struct perf_sample_data data;struct perf_raw_record raw;struct pt_regs regs;
@@ -602,6 +602,10 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)return 0 ; } +if (WARN_ON_ONCE (!event)) + goto fail; + + hwc = &event->hw; msr = hwc->config_base; buf = ibs_data.regs;rdmsrl (msr, *buf);
arch/x86/events/core.c +1 -1
@@ -2462,7 +2462,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regsperf_callchain_store (entry, regs->ip); -if (!current->mm) +if (!nmi_uaccess_okay ())return ;if (perf_callchain_user32 (regs, entry))
arch/x86/include/asm/irqflags.h +2 -1
@@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)return flags; } -static inline void native_restore_fl (unsigned long flags) +extern inline void native_restore_fl (unsigned long flags); +extern inline void native_restore_fl (unsigned long flags) { asmvolatile ("push %0 ; popf" : /* no output */
arch/x86/include/asm/processor.h +4 -2
@@ -132,6 +132,8 @@ struct cpuinfo_x86 {/* Index into per_cpu list: */ u16 cpu_index;u32 microcode; +/* Address space bits used by the cache internally */ +u8 x86_cache_bits; } __randomize_layout;struct cpuid_regs {
@@ -180,9 +182,9 @@ extern const struct seq_operations cpuinfo_op;extern void cpu_detect (struct cpuinfo_x86 *c); -static inline unsigned long l1tf_pfn_limit (void ) +static inline unsigned long long l1tf_pfn_limit (void ) { -return BIT (boot_cpu_data.x86_phys_bits -1 -PAGE_SHIFT ) -1 ; +return BIT_ULL (boot_cpu_data.x86_cache_bits -1 -PAGE_SHIFT ); }extern void early_cpu_init (void );
arch/x86/include/asm/tlbflush.h +40 -0
@@ -175,8 +175,16 @@ struct tlb_state {* are on. This means that it may not match current->active_mm, * which will contain the previous user mm when we're in lazy TLB * mode even if we've already switched back to swapper_pg_dir. +* +* During switch_mm_irqs_off(), loaded_mm will be set to +* LOADED_MM_SWITCHING during the brief interrupts-off window +* when CR3 and loaded_mm would otherwise be inconsistent. This +* is for nmi_uaccess_okay()'s benefit. */ struct mm_struct *loaded_mm; + +#define LOADED_MM_SWITCHING ((struct mm_struct *)1) +u16 loaded_mm_asid;u16 next_asid;/* last user mm's ctx id */
@@ -246,6 +254,38 @@ struct tlb_state { }; DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate); +/* +* Blindly accessing user memory from NMI context can be dangerous +* if we're in the middle of switching the current user task or +* switching the loaded mm. It can also be dangerous if we +* interrupted some kernel code that was temporarily using a +* different mm. +*/ +static inline bool nmi_uaccess_okay (void ) +{ +struct mm_struct *loaded_mm =this_cpu_read (cpu_tlbstate.loaded_mm); +struct mm_struct *current_mm = current->mm; + +VM_WARN_ON_ONCE (!loaded_mm); + +/* +* The condition we want to check is +* current_mm->pgd == __va(read_cr3_pa()). This may be slow, though, +* if we're running in a VM with shadow paging, and nmi_uaccess_okay() +* is supposed to be reasonably fast. +* +* Instead, we check the almost equivalent but somewhat conservative +* condition below, and we rely on the fact that switch_mm_irqs_off() +* sets loaded_mm to LOADED_MM_SWITCHING before writing to CR3. +*/ +if (loaded_mm != current_mm) +return false; + +VM_WARN_ON_ONCE (current_mm->pgd !=__va (read_cr3_pa ())); + +return true; +} +/* Initialize cr4 shadow for this CPU. */ static inline void cr4_init_shadow (void ) {
arch/x86/include/asm/vgtod.h +1 -1
@@ -93,7 +93,7 @@ static inline unsigned int __getcpu(void)* * If RDPID is available, use it. */ -alternative_io ("lsl %[p],%[seg]" , +alternative_io ("lsl %[seg],%[p]" ,".byte 0xf3,0x0f,0xc7,0xf8" ,/* RDPID %eax/rax */ X86_FEATURE_RDPID, [p] "=a" (p), [seg] "r" (__PER_CPU_SEG));
arch/x86/kernel/cpu/bugs.c +45 -5
71 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +1 -0
@@ -890,6 +890,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) } }#endif + c->x86_cache_bits = c->x86_phys_bits; }static const __initconst struct x86_cpu_id cpu_no_speculation[] = {
arch/x86/kernel/cpu/intel.c +3 -0
@@ -150,6 +150,9 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)if (cpu_has (c,X86_FEATURE_HYPERVISOR ))return false; +if (c->x86 !=6 ) +return false; +for (i =0 ; i <ARRAY_SIZE (spectre_bad_microcodes); i++) {if (c->x86_model == spectre_bad_microcodes[i].model && c->x86_stepping == spectre_bad_microcodes[i].stepping)
arch/x86/kernel/dumpstack.c +4 -0
@@ -17,6 +17,7 @@#include <linux/bug.h> #include <linux/nmi.h> #include <linux/sysfs.h> +#include <linux/kasan.h> #include <asm/cpu_entry_area.h> #include <asm/stacktrace.h>
@@ -298,7 +299,10 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr)* We're not going to return, but we might be on an IST stack or * have very little stack space left. Rewind the stack and kill * the task. +* Before we rewind the stack, we have to tell KASAN that we're going to +* reuse the task stack and that existing poisons are invalid. */ +kasan_unpoison_task_stack (current);rewind_stack_do_exit (signr); }NOKPROBE_SYMBOL (oops_end);
arch/x86/kernel/process_64.c +1 -0
@@ -370,6 +370,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)start_thread_common (regs, new_ip, new_sp, __USER_CS, __USER_DS,0 ); } +EXPORT_SYMBOL_GPL (start_thread);#ifdef CONFIG_COMPAT void compat_start_thread (struct pt_regs *regs,u32 new_ip,u32 new_sp)
arch/x86/kvm/svm.c +4 -4
@@ -5067,8 +5067,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)clgi (); -local_irq_enable (); -/* * If this vCPU has touched SPEC_CTRL, restore the guest's value if * it's non-zero. Since vmentry is serialising on affected CPUs, there
@@ -5077,6 +5075,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)*/ x86_spec_ctrl_set_guest (svm->spec_ctrl, svm->virt_spec_ctrl); +local_irq_enable (); + asmvolatile ("push %%" _ASM_BP"; \n\t" "mov %c[rbx](%[svm]), %%" _ASM_BX " \n\t"
@@ -5199,12 +5199,12 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)if (unlikely (!msr_write_intercepted (vcpu,MSR_IA32_SPEC_CTRL ))) svm->spec_ctrl =native_read_msr (MSR_IA32_SPEC_CTRL ); -x86_spec_ctrl_restore_host (svm->spec_ctrl, svm->virt_spec_ctrl); -reload_tss (vcpu);local_irq_disable (); +x86_spec_ctrl_restore_host (svm->spec_ctrl, svm->virt_spec_ctrl); + vcpu->arch.cr2 = svm->vmcb->save.cr2; vcpu->arch.regs[VCPU_REGS_RAX ] = svm->vmcb->save.rax; vcpu->arch.regs[VCPU_REGS_RSP ] = svm->vmcb->save.rsp;
arch/x86/kvm/vmx.c +7 -11
@@ -8108,21 +8108,20 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)/* Emulate the VMPTRST instruction */ static int handle_vmptrst (struct kvm_vcpu *vcpu) { -unsigned long exit_qualification =vmcs_readl (EXIT_QUALIFICATION ); -u32 vmx_instruction_info =vmcs_read32 (VMX_INSTRUCTION_INFO ); -gva_t vmcs_gva; +unsigned long exit_qual =vmcs_readl (EXIT_QUALIFICATION ); +u32 instr_info =vmcs_read32 (VMX_INSTRUCTION_INFO ); +gpa_t current_vmptr =to_vmx (vcpu)->nested.current_vmptr;struct x86_exception e; +gva_t gva;if (!nested_vmx_check_permission (vcpu))return 1 ; -if (get_vmx_mem_address (vcpu, exit_qualification, - vmx_instruction_info, true, &vmcs_gva)) +if (get_vmx_mem_address (vcpu, exit_qual, instr_info, true, &gva))return 1 ;/* *_system ok, nested_vmx_check_permission has verified cpl=0 */ -if (kvm_write_guest_virt_system (vcpu, vmcs_gva, - (void *)&to_vmx (vcpu)->nested.current_vmptr, -sizeof (u64), &e)) { +if (kvm_write_guest_virt_system (vcpu, gva, (void *)¤t_vmptr, +sizeof (gpa_t), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
@@ -9171,9 +9170,6 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)* information but as all relevant affected CPUs have 32KiB L1D cache size * there is no point in doing so. */ -#define L1D_CACHE_ORDER 4 -static void *vmx_l1d_flush_pages; -static void vmx_l1d_flush (struct kvm_vcpu *vcpu) {int size =PAGE_SIZE <<L1D_CACHE_ORDER ;
arch/x86/lib/usercopy.c +5 -0
@@ -7,6 +7,8 @@#include <linux/uaccess.h> #include <linux/export.h> +#include <asm/tlbflush.h> +/* * We rely on the nested NMI work to allow atomic faults from the NMI path; the * nested NMI paths are careful to preserve CR2.
@@ -19,6 +21,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n)if (__range_not_ok (from, n,TASK_SIZE ))return n; +if (!nmi_uaccess_okay ()) +return n; +/* * Even though this function is typically called from NMI/IRQ context * disable pagefaults so that its behaviour is consistent even when
arch/x86/mm/init.c +2 -2
@@ -892,7 +892,7 @@ unsigned long max_swapfile_size(void)if (boot_cpu_has_bug (X86_BUG_L1TF )) {/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ -unsigned long l1tf_limit =l1tf_pfn_limit () +1 ; +unsigned long long l1tf_limit =l1tf_pfn_limit ();/* * We encode swap offsets also with 3 bits below those for pfn * which makes the usable limit higher.
@@ -900,7 +900,7 @@ unsigned long max_swapfile_size(void)#if CONFIG_PGTABLE_LEVELS >2 l1tf_limit <<=PAGE_SHIFT -SWP_OFFSET_FIRST_BIT ;#endif - pages = min_t(unsigned long, l1tf_limit, pages); + pages = min_t(unsigned long long, l1tf_limit, pages); }return pages; }
arch/x86/mm/mmap.c +1 -1
@@ -191,7 +191,7 @@ bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)/* If it's real memory always allow */ if (pfn_valid (pfn))return true; -if (pfn >l1tf_pfn_limit () && !capable (CAP_SYS_ADMIN )) +if (pfn >=l1tf_pfn_limit () && !capable (CAP_SYS_ADMIN ))return false;return true; }
arch/x86/mm/tlb.c +7 -0
@@ -292,6 +292,10 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,choose_new_asid (next, next_tlb_gen, &new_asid, &need_flush); +/* Let nmi_uaccess_okay() know that we're changing CR3. */ +this_cpu_write (cpu_tlbstate.loaded_mm,LOADED_MM_SWITCHING ); +barrier (); +if (need_flush) {this_cpu_write (cpu_tlbstate.ctxs[new_asid].ctx_id, next->context.ctx_id);this_cpu_write (cpu_tlbstate.ctxs[new_asid].tlb_gen, next_tlb_gen);
@@ -322,6 +326,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,if (next != &init_mm)this_cpu_write (cpu_tlbstate.last_ctx_id, next->context.ctx_id); +/* Make sure we write CR3 before loaded_mm. */ +barrier (); +this_cpu_write (cpu_tlbstate.loaded_mm, next);this_cpu_write (cpu_tlbstate.loaded_mm_asid, new_asid); }
drivers/base/power/clock_ops.c +1 -1
@@ -185,7 +185,7 @@ EXPORT_SYMBOL_GPL(of_pm_clk_add_clk);int of_pm_clk_add_clks (struct device *dev) {struct clk **clks; -unsigned int i, count; +int i, count;int ret;if (!dev || !dev->of_node)
drivers/block/nbd.c +79 -17
231 lines not on this page · raw message
drivers/cdrom/cdrom.c +1 -1
@@ -2542,7 +2542,7 @@ static int cdrom_ioctl_drive_status(struct cdrom_device_info *cdi,if (!CDROM_CAN (CDC_SELECT_DISC ) || (arg ==CDSL_CURRENT || arg ==CDSL_NONE ))return cdi->ops->drive_status (cdi,CDSL_CURRENT ); -if (((int )arg >= cdi->capacity)) +if (arg >= cdi->capacity)return -EINVAL ;return cdrom_slot_status (cdi, arg); }
drivers/char/tpm/tpm-interface.c +1 -1
@@ -423,7 +423,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip, header->tag =cpu_to_be16 (TPM2_ST_NO_SESSIONS ); header->return_code =cpu_to_be32 (TPM2_RC_COMMAND_CODE |TSS2_RESMGR_TPM_RC_LAYER ); -return bufsiz; +return sizeof (*header); }if (bufsiz >TPM_BUFSIZE )
drivers/clk/rockchip/clk-rk3399.c +1 -1
@@ -630,7 +630,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {MUX (0 ,"clk_i2sout_src" , mux_i2sch_p,CLK_SET_RATE_PARENT ,RK3399_CLKSEL_CON (31 ),0 ,2 ,MFLAGS ),COMPOSITE_NODIV (SCLK_I2S_8CH_OUT ,"clk_i2sout" , mux_i2sout_p,CLK_SET_RATE_PARENT , -RK3399_CLKSEL_CON (30 ),8 ,2 ,MFLAGS , +RK3399_CLKSEL_CON (31 ),2 ,1 ,MFLAGS , RK3399_CLKGATE_CON(8), 12, GFLAGS),/* uart */
drivers/crypto/vmx/aes_ctr.c +16 -15
@@ -27,21 +27,23 @@#include <asm/switch_to.h> #include <crypto/aes.h> #include <crypto/scatterwalk.h> +#include <crypto/skcipher.h> +#include "aesp8-ppc.h" struct p8_aes_ctr_ctx { -struct crypto_blkcipher *fallback; +struct crypto_skcipher *fallback;struct aes_key enc_key; };static int p8_aes_ctr_init (struct crypto_tfm *tfm) {const char *alg =crypto_tfm_alg_name (tfm); -struct crypto_blkcipher *fallback; +struct crypto_skcipher *fallback;struct p8_aes_ctr_ctx *ctx =crypto_tfm_ctx (tfm); - fallback = -crypto_alloc_blkcipher (alg,0 ,CRYPTO_ALG_NEED_FALLBACK ); + fallback =crypto_alloc_skcipher (alg,0 , +CRYPTO_ALG_ASYNC |CRYPTO_ALG_NEED_FALLBACK );if (IS_ERR (fallback)) { printk(KERN_ERR "Failed to allocate transformation for '%s': %ld\n",
@@ -49,9 +51,9 @@ static int p8_aes_ctr_init(struct crypto_tfm *tfm)return PTR_ERR (fallback); } -crypto_blkcipher_set_flags ( +crypto_skcipher_set_flags ( fallback, -crypto_blkcipher_get_flags ((struct crypto_blkcipher *)tfm)); +crypto_skcipher_get_flags ((struct crypto_skcipher *)tfm)); ctx->fallback = fallback;return 0 ;
@@ -62,7 +64,7 @@ static void p8_aes_ctr_exit(struct crypto_tfm *tfm)struct p8_aes_ctr_ctx *ctx =crypto_tfm_ctx (tfm);if (ctx->fallback) { -crypto_free_blkcipher (ctx->fallback); +crypto_free_skcipher (ctx->fallback); ctx->fallback =NULL ; } }
@@ -81,7 +83,7 @@ static int p8_aes_ctr_setkey(struct crypto_tfm *tfm, const u8 *key,pagefault_enable ();preempt_enable (); - ret +=crypto_blkcipher_setkey (ctx->fallback, key, keylen); + ret +=crypto_skcipher_setkey (ctx->fallback, key, keylen);return ret; }
@@ -115,15 +117,14 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,struct blkcipher_walk walk;struct p8_aes_ctr_ctx *ctx =crypto_tfm_ctx (crypto_blkcipher_tfm (desc->tfm)); -struct blkcipher_desc fallback_desc = { - .tfm = ctx->fallback, - .info = desc->info, - .flags = desc->flags - };if (in_interrupt ()) { - ret =crypto_blkcipher_encrypt (&fallback_desc, dst, src, - nbytes); +SKCIPHER_REQUEST_ON_STACK (req, ctx->fallback); +skcipher_request_set_tfm (req, ctx->fallback); +skcipher_request_set_callback (req, desc->flags,NULL ,NULL ); +skcipher_request_set_crypt (req, src, dst, nbytes, desc->info); + ret =crypto_skcipher_encrypt (req); +skcipher_request_zero (req); }else {blkcipher_walk_init (&walk, dst, src, nbytes); ret =blkcipher_walk_virt_block (desc, &walk,AES_BLOCK_SIZE );
drivers/gpio/gpiolib-acpi.c +55 -1
107 lines not on this page · raw message
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +12 -0
@@ -424,6 +424,18 @@ static void adv7511_hpd_work(struct work_struct *work)else status = connector_status_disconnected; +/* +* The bridge resets its registers on unplug. So when we get a plug +* event and we're already supposed to be powered, cycle the bridge to +* restore its state. +*/ +if (status == connector_status_connected && + adv7511->connector.status == connector_status_disconnected && + adv7511->powered) { +regcache_mark_dirty (adv7511->regmap); +adv7511_power_on (adv7511); + } +if (adv7511->connector.status != status) { adv7511->connector.status = status;drm_kms_helper_hotplug_event (adv7511->connector.dev);
drivers/gpu/drm/imx/imx-ldb.c +6 -3
@@ -612,6 +612,9 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)return PTR_ERR (imx_ldb->regmap); } +/* disable LDB by resetting the control register to POR default */ +regmap_write (imx_ldb->regmap,IOMUXC_GPR2 ,0 ); + imx_ldb->dev = dev;if (of_id)
@@ -652,14 +655,14 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)if (ret || i <0 || i >1 )return -EINVAL ; +if (!of_device_is_available (child)) +continue ; +if (dual && i >0 ) {dev_warn (dev,"dual-channel mode, ignoring second output\n" );continue ; } -if (!of_device_is_available (child)) -continue ; - channel = &imx_ldb->channel[i]; channel->ldb = imx_ldb; channel->chno = i;
drivers/gpu/drm/udl/udl_drv.h +1 -1
@@ -110,7 +110,7 @@ udl_fb_user_fb_create(struct drm_device *dev,struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd); -int udl_render_hline (struct drm_device *dev,int bpp,struct urb **urb_ptr, +int udl_render_hline (struct drm_device *dev,int log_bpp,struct urb **urb_ptr,const char *front,char **urb_buf_ptr,u32 byte_offset,u32 device_byte_offset,u32 byte_width,int *ident_ptr,int *sent_ptr);
drivers/gpu/drm/udl/udl_fb.c +10 -7
@@ -90,7 +90,10 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,int bytes_identical =0 ;struct urb *urb;int aligned_x; -int bpp = fb->base.format->cpp[0 ]; +int log_bpp; + +BUG_ON (!is_power_of_2 (fb->base.format->cpp[0 ])); + log_bpp =__ffs (fb->base.format->cpp[0 ]);if (!fb->active_16)return 0 ;
@@ -125,12 +128,12 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,for (i = y; i < y + height ; i++) {const int line_offset = fb->base.pitches[0 ] * i; -const int byte_offset = line_offset + (x * bpp); -const int dev_byte_offset = (fb->base.width * bpp * i) + (x * bpp); -if (udl_render_hline (dev, bpp, &urb, +const int byte_offset = line_offset + (x << log_bpp); +const int dev_byte_offset = (fb->base.width * i + x) << log_bpp; +if (udl_render_hline (dev, log_bpp, &urb, (char *) fb->obj->vmapping, &cmd, byte_offset, dev_byte_offset, - width * bpp, + width << log_bpp, &bytes_identical, &bytes_sent)) goto error; }
@@ -149,7 +152,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, error:atomic_add (bytes_sent, &udl->bytes_sent);atomic_add (bytes_identical, &udl->bytes_identical); -atomic_add (width*height*bpp, &udl->bytes_rendered); +atomic_add ((width * height) << log_bpp, &udl->bytes_rendered); end_cycles =get_cycles (); atomic_add(((unsigned int) ((end_cycles - start_cycles) >> 10)), /* Kcycles */
@@ -221,7 +224,7 @@ static int udl_fb_open(struct fb_info *info, int user)struct fb_deferred_io *fbdefio; - fbdefio =kmalloc (sizeof (struct fb_deferred_io ),GFP_KERNEL ); + fbdefio =kzalloc (sizeof (struct fb_deferred_io ),GFP_KERNEL );if (fbdefio) { fbdefio->delay =DL_DEFIO_WRITE_DELAY ;
drivers/gpu/drm/udl/udl_main.c +19 -16
@@ -169,18 +169,13 @@ static void udl_free_urb_list(struct drm_device *dev)struct list_head *node;struct urb_node *unode;struct urb *urb; -int ret;unsigned long flags;DRM_DEBUG ("Waiting for completes and freeing all render urbs\n" );/* keep waiting and freeing, until we've got 'em all */ while (count--) { - -/* Getting interrupted means a leak, but ok at shutdown*/ - ret =down_interruptible (&udl->urbs.limit_sem); -if (ret) -break ; +down (&udl->urbs.limit_sem);spin_lock_irqsave (&udl->urbs.lock, flags);
@@ -204,17 +199,22 @@ static void udl_free_urb_list(struct drm_device *dev)static int udl_alloc_urb_list (struct drm_device *dev,int count,size_t size) {struct udl_device *udl = dev->dev_private; -int i =0 ;struct urb *urb;struct urb_node *unode;char *buf; +size_t wanted_size = count * size;spin_lock_init (&udl->urbs.lock); +retry: udl->urbs.size = size;INIT_LIST_HEAD (&udl->urbs.list); -while (i < count) { +sema_init (&udl->urbs.limit_sem,0 ); + udl->urbs.count =0 ; + udl->urbs.available =0 ; + +while (udl->urbs.count * size < wanted_size) { unode =kzalloc (sizeof (struct urb_node ),GFP_KERNEL );if (!unode)break ;
@@ -230,11 +230,16 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size) } unode->urb = urb; - buf =usb_alloc_coherent (udl->udev,MAX_TRANSFER ,GFP_KERNEL , + buf =usb_alloc_coherent (udl->udev, size,GFP_KERNEL , &urb->transfer_dma);if (!buf) {kfree (unode);usb_free_urb (urb); +if (size >PAGE_SIZE ) { + size /=2 ; +udl_free_urb_list (dev); + goto retry; + }break ; }
@@ -245,16 +250,14 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)list_add_tail (&unode->entry, &udl->urbs.list); - i++; +up (&udl->urbs.limit_sem); + udl->urbs.count++; + udl->urbs.available++; } -sema_init (&udl->urbs.limit_sem, i); - udl->urbs.count = i; - udl->urbs.available = i; - -DRM_DEBUG ("allocated %d %d byte urbs\n" , i, (int ) size); +DRM_DEBUG ("allocated %d %d byte urbs\n" , udl->urbs.count, (int ) size); -return i; +return udl->urbs.count; }struct urb *udl_get_urb (struct drm_device *dev)
drivers/gpu/drm/udl/udl_transfer.c +20 -19
@@ -83,12 +83,12 @@ static inline u16 pixel32_to_be16(const uint32_t pixel) ((pixel >> 8) & 0xf800)); } -static inline u16 get_pixel_val16 (const uint8_t *pixel,int bpp) +static inline u16 get_pixel_val16 (const uint8_t *pixel,int log_bpp) { -u16 pixel_val16 =0 ; -if (bpp ==2 ) +u16 pixel_val16; +if (log_bpp ==1 ) pixel_val16 = *(const uint16_t *)pixel; -else if (bpp ==4 ) +else pixel_val16 =pixel32_to_be16 (*(const uint32_t *)pixel);return pixel_val16; }
@@ -125,8 +125,9 @@ static void udl_compress_hline16(const u8 *const pixel_end, uint32_t *device_address_ptr, uint8_t **command_buffer_ptr, - const uint8_t *const cmd_buffer_end, int bpp) + const uint8_t *const cmd_buffer_end, int log_bpp) { + const int bpp = 1 << log_bpp;const u8 *pixel = *pixel_start_ptr;uint32_t dev_addr = *device_address_ptr;uint8_t *cmd = *command_buffer_ptr;
@@ -153,12 +154,12 @@ static void udl_compress_hline16( raw_pixels_count_byte = cmd++;/* we'll know this later */ raw_pixel_start = pixel; - cmd_pixel_end = pixel +min3 (MAX_CMD_PIXELS +1UL , - (unsigned long )(pixel_end - pixel) / bpp, - (unsigned long )(cmd_buffer_end -1 - cmd) /2 ) * bpp; + cmd_pixel_end = pixel + (min3 (MAX_CMD_PIXELS +1UL , + (unsigned long )(pixel_end - pixel) >> log_bpp, + (unsigned long )(cmd_buffer_end -1 - cmd) /2 ) << log_bpp);prefetch_range ((void *) pixel, cmd_pixel_end - pixel); - pixel_val16 =get_pixel_val16 (pixel, bpp); + pixel_val16 =get_pixel_val16 (pixel, log_bpp);while (pixel < cmd_pixel_end) {const u8 *const start = pixel;
@@ -170,7 +171,7 @@ static void udl_compress_hline16( pixel += bpp;while (pixel < cmd_pixel_end) { - pixel_val16 =get_pixel_val16 (pixel, bpp); + pixel_val16 =get_pixel_val16 (pixel, log_bpp);if (pixel_val16 != repeating_pixel_val16)break ; pixel += bpp;
@@ -179,10 +180,10 @@ static void udl_compress_hline16(if (unlikely (pixel > start + bpp)) {/* go back and fill in raw pixel count */ *raw_pixels_count_byte = (((start - - raw_pixel_start) / bpp) +1 ) &0xFF ; + raw_pixel_start) >> log_bpp) +1 ) &0xFF ;/* immediately after raw data is repeat byte */ - *cmd++ = (((pixel - start) / bpp) -1 ) &0xFF ; + *cmd++ = (((pixel - start) >> log_bpp) -1 ) &0xFF ;/* Then start another raw pixel span */ raw_pixel_start = pixel;
@@ -192,14 +193,14 @@ static void udl_compress_hline16(if (pixel > raw_pixel_start) {/* finalize last RAW span */ - *raw_pixels_count_byte = ((pixel-raw_pixel_start) / bpp) &0xFF ; + *raw_pixels_count_byte = ((pixel - raw_pixel_start) >> log_bpp) &0xFF ; }else {/* undo unused byte */ cmd--; } - *cmd_pixels_count_byte = ((pixel - cmd_pixel_start) / bpp) &0xFF ; - dev_addr += ((pixel - cmd_pixel_start) / bpp) *2 ; + *cmd_pixels_count_byte = ((pixel - cmd_pixel_start) >> log_bpp) &0xFF ; + dev_addr += ((pixel - cmd_pixel_start) >> log_bpp) *2 ; }if (cmd_buffer_end <=MIN_RLX_CMD_BYTES + cmd) {
@@ -222,19 +223,19 @@ static void udl_compress_hline16(* (that we can only write to, slowly, and can never read), and (optionally) * our shadow copy that tracks what's been sent to that hardware buffer. */ -int udl_render_hline (struct drm_device *dev,int bpp,struct urb **urb_ptr, +int udl_render_hline (struct drm_device *dev,int log_bpp,struct urb **urb_ptr,const char *front,char **urb_buf_ptr,u32 byte_offset,u32 device_byte_offset,u32 byte_width,int *ident_ptr,int *sent_ptr) {const u8 *line_start, *line_end, *next_pixel; -u32 base16 =0 + (device_byte_offset / bpp) *2 ; +u32 base16 =0 + (device_byte_offset >> log_bpp) *2 ;struct urb *urb = *urb_ptr;u8 *cmd = *urb_buf_ptr;u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length; -BUG_ON (!(bpp ==2 || bpp ==4 )); +BUG_ON (!(log_bpp ==1 || log_bpp ==2 )); line_start = (u8 *) (front + byte_offset); next_pixel = line_start;
@@ -244,7 +245,7 @@ int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,udl_compress_hline16 (&next_pixel, line_end, &base16, - (u8 **) &cmd, (u8 *) cmd_end, bpp); + (u8 **) &cmd, (u8 *) cmd_end, log_bpp);if (cmd >= cmd_end) {int len = cmd - (u8 *) urb->transfer_buffer;
drivers/hwmon/nct6775.c +2 -0
@@ -63,6 +63,7 @@#include <linux/bitops.h> #include <linux/dmi.h> #include <linux/io.h> +#include <linux/nospec.h> #include "lm75.h" #define USE_ALTERNATE
@@ -2642,6 +2643,7 @@ store_pwm_weight_temp_sel(struct device *dev, struct device_attribute *attr,return err;if (val >NUM_TEMP )return -EINVAL ; + val =array_index_nospec (val,NUM_TEMP +1 );if (val && (!(data->have_temp &BIT (val -1 )) || !data->temp_src[val -1 ]))return -EINVAL ;
drivers/i2c/busses/i2c-davinci.c +6 -2
@@ -234,12 +234,16 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)/* * It's not always possible to have 1 to 2 ratio when d=7, so fall back * to minimal possible clkh in this case. +* +* Note: +* CLKH is not allowed to be 0, in this case I2C clock is not generated +* at all */ -if (clk >= clkl + d) { +if (clk > clkl + d) { clkh = clk - clkl - d; clkl -= d; }else { - clkh =0 ; + clkh =1 ; clkl = clk - (d <<1 ); }
drivers/i2c/i2c-core-base.c +1 -1
@@ -638,7 +638,7 @@ static int i2c_check_addr_busy(struct i2c_adapter *adapter, int addr)static void i2c_adapter_lock_bus (struct i2c_adapter *adapter,unsigned int flags) { -rt_mutex_lock (&adapter->bus_lock); +rt_mutex_lock_nested (&adapter->bus_lock,i2c_adapter_depth (adapter)); }/**
drivers/i2c/i2c-mux.c +2 -2
@@ -144,7 +144,7 @@ static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags)struct i2c_mux_priv *priv = adapter->algo_data;struct i2c_adapter *parent = priv->muxc->parent; -rt_mutex_lock (&parent->mux_lock); +rt_mutex_lock_nested (&parent->mux_lock,i2c_adapter_depth (adapter));if (!(flags &I2C_LOCK_ROOT_ADAPTER ))return ;i2c_lock_bus (parent, flags);
@@ -181,7 +181,7 @@ static void i2c_parent_lock_bus(struct i2c_adapter *adapter,struct i2c_mux_priv *priv = adapter->algo_data;struct i2c_adapter *parent = priv->muxc->parent; -rt_mutex_lock (&parent->mux_lock); +rt_mutex_lock_nested (&parent->mux_lock,i2c_adapter_depth (adapter));i2c_lock_bus (parent, flags); }
drivers/iommu/arm-smmu.c +10 -6
@@ -2100,12 +2100,16 @@ static int arm_smmu_device_probe(struct platform_device *pdev)if (err)return err; -if (smmu->version ==ARM_SMMU_V2 && - smmu->num_context_banks != smmu->num_context_irqs) { -dev_err (dev, -"found only %d context interrupt(s) but %d required\n" , - smmu->num_context_irqs, smmu->num_context_banks); -return -ENODEV ; +if (smmu->version ==ARM_SMMU_V2 ) { +if (smmu->num_context_banks > smmu->num_context_irqs) { +dev_err (dev, +"found only %d context irq(s) but %d required\n" , + smmu->num_context_irqs, smmu->num_context_banks); +return -ENODEV ; + } + +/* Ignore superfluous interrupts */ + smmu->num_context_irqs = smmu->num_context_banks; }for (i =0 ; i < smmu->num_global_irqs; ++i) {
drivers/misc/mei/main.c +0 -1
@@ -291,7 +291,6 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, goto out; } - *offset =0 ; cb =mei_cl_alloc_cb (cl, length,MEI_FOP_WRITE , file);if (!cb) { rets = -ENOMEM ;
drivers/net/can/m_can/m_can.c +3 -4
@@ -1637,8 +1637,6 @@ static int m_can_plat_probe(struct platform_device *pdev) priv->can.clock.freq =clk_get_rate (cclk); priv->mram_base = mram_addr; -m_can_of_parse_mram (priv, mram_config_vals); -platform_set_drvdata (pdev, dev);SET_NETDEV_DEV (dev, &pdev->dev);
@@ -1649,6 +1647,8 @@ static int m_can_plat_probe(struct platform_device *pdev) goto failed_free_dev; } +m_can_of_parse_mram (priv, mram_config_vals); +devm_can_led_init (dev); dev_info(&pdev->dev, "%s device registered (irq=%d, version=%d)\n",
@@ -1698,8 +1698,6 @@ static __maybe_unused int m_can_resume(struct device *dev)pinctrl_pm_select_default_state (dev); -m_can_init_ram (priv); - priv->can.state =CAN_STATE_ERROR_ACTIVE ;if (netif_running (ndev)) {
@@ -1709,6 +1707,7 @@ static __maybe_unused int m_can_resume(struct device *dev)if (ret)return ret; +m_can_init_ram (priv);m_can_start (ndev);netif_device_attach (ndev);netif_start_queue (ndev);
drivers/net/can/mscan/mpc5xxx_can.c +5 -0
@@ -86,6 +86,11 @@ static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,return 0 ; } cdm =of_iomap (np_cdm,0 ); +if (!cdm) { +of_node_put (np_cdm); +dev_err (&ofdev->dev,"can't map clock node!\n" ); +return 0 ; + }if (in_8 (&cdm->ipb_clk_sel) &0x1 ) freq *=2 ;
drivers/net/ethernet/3com/Kconfig +1 -1
@@ -32,7 +32,7 @@ config EL3 config 3C515 tristate "3c515 ISA \"Fast EtherLink\"" - depends on ISA && ISA_DMA_API + depends on ISA && ISA_DMA_API && !PPC32 ---help--- If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet network card, say Y here.
drivers/net/ethernet/amd/Kconfig +2 -2
@@ -44,7 +44,7 @@ config AMD8111_ETH config LANCE tristate "AMD LANCE and PCnet (AT1500 and NE2100) support" - depends on ISA && ISA_DMA_API && !ARM + depends on ISA && ISA_DMA_API && !ARM && !PPC32 ---help--- If you have a network (Ethernet) card of this type, say Y here. Some LinkSys cards are of this type.
@@ -138,7 +138,7 @@ config PCMCIA_NMCLAN config NI65 tristate "NI6510 support" - depends on ISA && ISA_DMA_API && !ARM + depends on ISA && ISA_DMA_API && !ARM && !PPC32 ---help--- If you have a network (Ethernet) card of this type, say Y here.
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +1 -0
@@ -1685,6 +1685,7 @@ static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter) skb =build_skb (page_address (page) + adapter->rx_page_offset, adapter->rx_frag_size);if (likely (skb)) { +skb_reserve (skb,NET_SKB_PAD ); adapter->rx_page_offset += adapter->rx_frag_size;if (adapter->rx_page_offset >=PAGE_SIZE ) adapter->rx_page =NULL ;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +10 -3
@@ -3387,14 +3387,18 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info)DP (BNX2X_MSG_ETHTOOL ,"rss re-configured, UDP 4-tupple %s\n" , udp_rss_requested ?"enabled" :"disabled" ); -return bnx2x_rss (bp, &bp->rss_conf_obj, false, true); +if (bp->state ==BNX2X_STATE_OPEN ) +return bnx2x_rss (bp, &bp->rss_conf_obj, false, + true); }else if ((info->flow_type ==UDP_V6_FLOW ) && (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested;DP (BNX2X_MSG_ETHTOOL ,"rss re-configured, UDP 4-tupple %s\n" , udp_rss_requested ?"enabled" :"disabled" ); -return bnx2x_rss (bp, &bp->rss_conf_obj, false, true); +if (bp->state ==BNX2X_STATE_OPEN ) +return bnx2x_rss (bp, &bp->rss_conf_obj, false, + true); }return 0 ;
@@ -3508,7 +3512,10 @@ static int bnx2x_set_rxfh(struct net_device *dev, const u32 *indir, bp->rss_conf_obj.ind_table[i] = indir[i] + bp->fp->cl_id; } -return bnx2x_config_rss_eth (bp, false); +if (bp->state ==BNX2X_STATE_OPEN ) +return bnx2x_config_rss_eth (bp, false); + +return 0 ; }/**
drivers/net/ethernet/cirrus/Kconfig +1 -0
@@ -19,6 +19,7 @@ if NET_VENDOR_CIRRUS config CS89x0 tristate "CS89x0 support" depends on ISA || EISA || ARM + depends on !PPC32 ---help--- Support for CS89x0 chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the file
drivers/net/ethernet/cisco/enic/enic_main.c +28 -52
116 lines not on this page · raw message
drivers/net/ethernet/huawei/hinic/hinic_main.c +1 -0
@@ -981,6 +981,7 @@ static int nic_dev_init(struct pci_dev *pdev)hinic_hwdev_cb_register (nic_dev->hwdev,HINIC_MGMT_MSG_CMD_LINK_STATUS , nic_dev, link_status_event_handler); +SET_NETDEV_DEV (netdev, &pdev->dev); err =register_netdev (netdev);if (err) {dev_err (&pdev->dev,"Failed to register netdev\n" );
drivers/net/ethernet/netronome/nfp/flower/main.c +3 -1
@@ -79,7 +79,7 @@ nfp_flower_repr_get_type_and_port(struct nfp_app *app, u32 port_id, u8 *port)return NFP_REPR_TYPE_VF ; } -return NFP_FLOWER_CMSG_PORT_TYPE_UNSPEC ; +return __NFP_REPR_TYPE_MAX; } static struct net_device *
@@ -90,6 +90,8 @@ nfp_flower_repr_get(struct nfp_app *app, u32 port_id)u8 port =0 ; repr_type =nfp_flower_repr_get_type_and_port (app, port_id, &port); +if (repr_type >NFP_REPR_TYPE_MAX ) +return NULL ; reprs =rcu_dereference (app->reprs[repr_type]);if (!reprs)
drivers/net/ethernet/qlogic/qed/qed_l2.c +7 -8
@@ -663,7 +663,7 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn, p_ramrod->common.update_approx_mcast_flg =1 ;for (i =0 ; i <ETH_MULTICAST_MAC_BINS_IN_REGS ; i++) { -u32 *p_bins = (u32 *)p_params->bins; +u32 *p_bins = p_params->bins; p_ramrod->approx_mcast.bins[i] =cpu_to_le32 (p_bins[i]); }
@@ -1474,8 +1474,8 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,enum spq_mode comp_mode, struct qed_spq_comp_cb *p_comp_data) { - unsigned long bins[ETH_MULTICAST_MAC_BINS_IN_REGS]; struct vport_update_ramrod_data *p_ramrod = NULL; +u32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS ];struct qed_spq_entry *p_ent =NULL ;struct qed_sp_init_data init_data;u8 abs_vport_id =0 ;
@@ -1511,26 +1511,25 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,/* explicitly clear out the entire vector */ memset (&p_ramrod->approx_mcast.bins,0 ,sizeof (p_ramrod->approx_mcast.bins)); -memset (bins,0 ,sizeof (unsigned long ) * -ETH_MULTICAST_MAC_BINS_IN_REGS ); +memset (bins,0 ,sizeof (bins));/* filter ADD op is explicit set op and it removes * any existing filters for the vport */ if (p_filter_cmd->opcode ==QED_FILTER_ADD ) {for (i =0 ; i < p_filter_cmd->num_mc_addrs; i++) { -u32 bit; +u32 bit, nbits; bit =qed_mcast_bin_from_mac (p_filter_cmd->mac[i]); -__set_bit (bit, bins); + nbits =sizeof (u32) *BITS_PER_BYTE ; + bins[bit / nbits] |=1 << (bit % nbits); }/* Convert to correct endianity */ for (i =0 ; i <ETH_MULTICAST_MAC_BINS_IN_REGS ; i++) {struct vport_update_ramrod_mcast *p_ramrod_bins; -u32 *p_bins = (u32 *)bins; p_ramrod_bins = &p_ramrod->approx_mcast; - p_ramrod_bins->bins[i] =cpu_to_le32 (p_bins[i]); + p_ramrod_bins->bins[i] =cpu_to_le32 (bins[i]); } }
drivers/net/ethernet/qlogic/qed/qed_l2.h +1 -1
@@ -214,7 +214,7 @@ struct qed_sp_vport_update_params {u8 anti_spoofing_en;u8 update_accept_any_vlan_flg;u8 accept_any_vlan; -unsigned long bins[8 ]; +u32 bins[8 ];struct qed_rss_params *rss_params;struct qed_filter_accept_flags accept_flags;struct qed_sge_tpa_params *sge_tpa_params;
drivers/net/ethernet/qlogic/qed/qed_mcp.c +10 -3
@@ -1182,6 +1182,7 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,break ;default : p_link->speed =0 ; + p_link->link_up =0 ; }if (p_link->link_up && p_link->speed)
@@ -1279,9 +1280,15 @@ int qed_mcp_set_link(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, bool b_up) phy_cfg.pause |= (params->pause.forced_tx) ?ETH_PAUSE_TX :0 ; phy_cfg.adv_speed = params->speed.advertised_speeds; phy_cfg.loopback_mode = params->loopback_mode; -if (p_hwfn->mcp_info->capabilities &FW_MB_PARAM_FEATURE_SUPPORT_EEE ) { -if (params->eee.enable) - phy_cfg.eee_cfg |=EEE_CFG_EEE_ENABLED ; + +/* There are MFWs that share this capability regardless of whether +* this is feasible or not. And given that at the very least adv_caps +* would be set internally by qed, we want to make sure LFA would +* still work. +*/ +if ((p_hwfn->mcp_info->capabilities & +FW_MB_PARAM_FEATURE_SUPPORT_EEE ) && params->eee.enable) { + phy_cfg.eee_cfg |=EEE_CFG_EEE_ENABLED ;if (params->eee.tx_lpi_enable) phy_cfg.eee_cfg |=EEE_CFG_TX_LPI ;if (params->eee.adv_caps &QED_EEE_1G_ADV )
drivers/net/ethernet/qlogic/qed/qed_sriov.c +1 -1
@@ -2826,7 +2826,7 @@ qed_iov_vp_update_mcast_bin_param(struct qed_hwfn *p_hwfn, p_data->update_approx_mcast_flg =1 ;memcpy (p_data->bins, p_mcast_tlv->bins, -sizeof (unsigned long ) *ETH_MULTICAST_MAC_BINS_IN_REGS ); +sizeof (u32) *ETH_MULTICAST_MAC_BINS_IN_REGS ); *tlvs_mask |=1 <<QED_IOV_VP_UPDATE_MCAST ; }
drivers/net/ethernet/qlogic/qed/qed_vf.c +2 -2
@@ -1126,7 +1126,7 @@ int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn, resp_size +=sizeof (struct pfvf_def_resp_tlv );memcpy (p_mcast_tlv->bins, p_params->bins, -sizeof (unsigned long ) *ETH_MULTICAST_MAC_BINS_IN_REGS ); +sizeof (u32) *ETH_MULTICAST_MAC_BINS_IN_REGS ); } update_rx = p_params->accept_flags.update_rx_mode_config;
@@ -1272,7 +1272,7 @@ void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,u32 bit; bit =qed_mcast_bin_from_mac (p_filter_cmd->mac[i]); -__set_bit (bit, sp_params.bins); + sp_params.bins[bit /32 ] |=1 << (bit %32 ); } }
drivers/net/ethernet/qlogic/qed/qed_vf.h +6 -1
@@ -392,7 +392,12 @@ struct vfpf_vport_update_mcast_bin_tlv {struct channel_tlv tl;u8 padding[4 ]; -u64 bins[8 ]; +/* There are only 256 approx bins, and in HSI they're divided into +* 32-bit values. As old VFs used to set-bit to the values on its side, +* the upper half of the array is never expected to contain any data. +*/ +u64 bins[4 ]; +u64 obsolete_bins[4 ]; };struct vfpf_vport_update_accept_param_tlv {
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +1 -0
@@ -218,6 +218,7 @@ int axienet_mdio_setup(struct axienet_local *lp, struct device_node *np) ret =of_mdiobus_register (bus, np1);if (ret) {mdiobus_free (bus); + lp->mii_bus =NULL ;return ret; }return 0 ;
drivers/net/usb/qmi_wwan.c +1 -1
@@ -1245,7 +1245,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, 0x81d7, 1)}, /* Dell Wireless 5821e */ + {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
drivers/net/wan/lmc/lmc_main.c +1 -1
@@ -1371,7 +1371,7 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance) /*fold00*/case 0x001 :printk (KERN_WARNING "%s: Master Abort (naughty)\n" , dev->name);break ; -case 0x010 : +case 0x002 :printk (KERN_WARNING "%s: Target Abort (not so naughty)\n" , dev->name);break ;default :
drivers/net/wireless/broadcom/b43/leds.c +1 -1
@@ -131,7 +131,7 @@ static int b43_register_led(struct b43_wldev *dev, struct b43_led *led, led->wl = dev->wl; led->index = led_index; led->activelow = activelow; -strncpy (led->name, name,sizeof (led->name)); +strlcpy (led->name, name,sizeof (led->name));atomic_set (&led->state,0 ); led->led_dev.name = led->name;
drivers/net/wireless/broadcom/b43legacy/leds.c +1 -1
@@ -101,7 +101,7 @@ static int b43legacy_register_led(struct b43legacy_wldev *dev, led->dev = dev; led->index = led_index; led->activelow = activelow; -strncpy (led->name, name,sizeof (led->name)); +strlcpy (led->name, name,sizeof (led->name)); led->led_dev.name = led->name; led->led_dev.default_trigger = default_trigger;
drivers/nvme/host/pci.c +8 -0
@@ -306,6 +306,14 @@ static bool nvme_dbbuf_update_and_check_event(u16 value, u32 *dbbuf_db, old_value = *dbbuf_db; *dbbuf_db = value; +/* +* Ensure that the doorbell is updated before reading the event +* index from memory. The controller needs to provide similar +* ordering to ensure the envent index is updated before reading +* the doorbell. +*/ +mb (); +if (!nvme_dbbuf_need_event (*dbbuf_ei, value, old_value))return false; }
drivers/pinctrl/freescale/pinctrl-imx1-core.c +1 -1
@@ -433,7 +433,7 @@ static void imx1_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,const char *name;int i, ret; -if (group > info->ngroups) +if (group >= info->ngroups)return ;seq_puts (s,"\n" );
drivers/platform/x86/ideapad-laptop.c +2 -2
@@ -1097,10 +1097,10 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { }, }, { - .ident = "Lenovo Legion Y520-15IKBN", + .ident = "Lenovo Legion Y520-15IKB", .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBN"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKB"), }, }, {
drivers/power/supply/generic-adc-battery.c +15 -10
@@ -243,10 +243,10 @@ static int gab_probe(struct platform_device *pdev)struct power_supply_desc *psy_desc;struct power_supply_config psy_cfg = {};struct gab_platform_data *pdata = pdev->dev.platform_data; -enum power_supply_property *properties;int ret =0 ;int chan; -int index =0 ; +int index =ARRAY_SIZE (gab_props); +bool any = false; adc_bat =devm_kzalloc (&pdev->dev,sizeof (*adc_bat),GFP_KERNEL );if (!adc_bat) {
@@ -280,8 +280,6 @@ static int gab_probe(struct platform_device *pdev) }memcpy (psy_desc->properties, gab_props,sizeof (gab_props)); - properties = (enum power_supply_property *) - ((char *)psy_desc->properties +sizeof (gab_props));/* * getting channel from iio and copying the battery properties
@@ -295,15 +293,22 @@ static int gab_probe(struct platform_device *pdev) adc_bat->channel[chan] =NULL ; }else {/* copying properties for supported channels only */ -memcpy (properties +sizeof (*(psy_desc->properties)) * index, - &gab_dyn_props[chan], -sizeof (gab_dyn_props[chan])); - index++; +int index2; + +for (index2 =0 ; index2 < index; index2++) { +if (psy_desc->properties[index2] == + gab_dyn_props[chan]) +break ;/* already known */ + } +if (index2 == index)/* really new */ + psy_desc->properties[index++] = + gab_dyn_props[chan]; + any = true; } }/* none of the channels are supported so let's bail out */ -if (index ==0 ) { +if (!any) { ret = -ENODEV ; goto second_mem_fail; }
@@ -314,7 +319,7 @@ static int gab_probe(struct platform_device *pdev)* as come channels may be not be supported by the device.So * we need to take care of that. */ - psy_desc->num_properties =ARRAY_SIZE (gab_props) + index; + psy_desc->num_properties = index; adc_bat->psy =power_supply_register (&pdev->dev, psy_desc, &psy_cfg);if (IS_ERR (adc_bat->psy)) {
drivers/s390/cio/qdio_main.c +2 -3
@@ -641,21 +641,20 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q,unsigned long phys_aob =0 ;if (!q->use_cq) - goto out; +return 0 ;if (!q->aobs[bufnr]) {struct qaob *aob =qdio_allocate_aob (); q->aobs[bufnr] = aob; }if (q->aobs[bufnr]) { - q->sbal_state[bufnr].flags =QDIO_OUTBUF_STATE_FLAG_NONE ; q->sbal_state[bufnr].aob = q->aobs[bufnr]; q->aobs[bufnr]->user1 = (u64 ) q->sbal_state[bufnr].user; phys_aob =virt_to_phys (q->aobs[bufnr]);WARN_ON_ONCE (phys_aob &0xFF ); } -out: + q->sbal_state[bufnr].flags =0 ;return phys_aob; }
drivers/scsi/fcoe/fcoe_ctlr.c +3 -3
@@ -754,9 +754,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport,case ELS_LOGO :if (fip->mode ==FIP_MODE_VN2VN ) {if (fip->state !=FIP_ST_VNMP_UP ) -return -EINVAL ; + goto drop;if (ntoh24 (fh->fh_d_id) ==FC_FID_FLOGI ) -return -EINVAL ; + goto drop; }else {if (fip->state !=FIP_ST_ENABLED )return 0 ;
@@ -799,9 +799,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr *fip, struct fc_lport *lport, fip->send (fip, skb);return -EINPROGRESS ; drop: -kfree_skb (skb);LIBFCOE_FIP_DBG (fip,"drop els_send op %u d_id %x\n" , op,ntoh24 (fh->fh_d_id)); +kfree_skb (skb);return -EINVAL ; }EXPORT_SYMBOL (fcoe_ctlr_els_send);
drivers/scsi/libfc/fc_rport.c +1 -0
@@ -2164,6 +2164,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)FC_RPORT_DBG (rdata,"Received LOGO request while in state %s\n" ,fc_rport_state (rdata)); + rdata->flags &= ~FC_RP_STARTED ;fc_rport_enter_delete (rdata,RPORT_EV_STOP );mutex_unlock (&rdata->rp_mutex);kref_put (&rdata->kref, fc_rport_destroy);
drivers/scsi/libiscsi.c +6 -6
@@ -284,11 +284,11 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)*/ if (opcode !=ISCSI_OP_SCSI_DATA_OUT ) {iscsi_conn_printk (KERN_INFO , conn, -"task [op %x/%x itt " +"task [op %x itt " "0x%x/0x%x] " "rejected.\n" , - task->hdr->opcode, opcode, - task->itt, task->hdr_itt); + opcode, task->itt, + task->hdr_itt);return -EACCES ; }/*
@@ -297,10 +297,10 @@ static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode)*/ if (conn->session->fast_abort) {iscsi_conn_printk (KERN_INFO , conn, -"task [op %x/%x itt " +"task [op %x itt " "0x%x/0x%x] fast abort.\n" , - task->hdr->opcode, opcode, - task->itt, task->hdr_itt); + opcode, task->itt, + task->hdr_itt);return -EACCES ; }break ;
drivers/scsi/mpt3sas/mpt3sas_transport.c +3 -2
@@ -1936,12 +1936,12 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,pr_info (MPT3SAS_FMT "%s: host reset in progress!\n" , __func__, ioc->name); rc = -EFAULT ; - goto out; + goto job_done; } rc =mutex_lock_interruptible (&ioc->transport_cmds.mutex);if (rc) - goto out; + goto job_done;if (ioc->transport_cmds.status !=MPT3_CMD_NOT_USED ) { pr_err(MPT3SAS_FMT "%s: transport_cmds in use\n", ioc->name,
@@ -2066,6 +2066,7 @@ _transport_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, out: ioc->transport_cmds.status =MPT3_CMD_NOT_USED ;mutex_unlock (&ioc->transport_cmds.mutex); +job_done:bsg_job_done (job, rc, reslen); }
drivers/scsi/scsi_sysfs.c +18 -2
@@ -721,8 +721,24 @@ static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - if (device_remove_file_self(dev, attr)) - scsi_remove_device(to_scsi_device(dev)); + struct kernfs_node *kn; + + kn =sysfs_break_active_protection (&dev->kobj, &attr->attr); +WARN_ON_ONCE (!kn); +/* +* Concurrent writes into the "delete" sysfs attribute may trigger +* concurrent calls to device_remove_file() and scsi_remove_device(). +* device_remove_file() handles concurrent removal calls by +* serializing these and by ignoring the second and later removal +* attempts. Concurrent calls of scsi_remove_device() are +* serialized. The second and later calls of scsi_remove_device() are +* ignored because the first call of that function changes the device +* state into SDEV_DEL. +*/ +device_remove_file (dev, attr); +scsi_remove_device (to_scsi_device (dev)); +if (kn) +sysfs_unbreak_active_protection (kn);return count; }; static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
drivers/scsi/vmw_pvscsi.c +8 -3
@@ -561,9 +561,14 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter, (btstat == BTSTAT_SUCCESS || btstat == BTSTAT_LINKED_COMMAND_COMPLETED || btstat == BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG)) { - cmd->result = (DID_OK << 16) | sdstat; -if (sdstat ==SAM_STAT_CHECK_CONDITION && cmd->sense_buffer) - cmd->result |= (DRIVER_SENSE <<24 ); +if (sdstat ==SAM_STAT_COMMAND_TERMINATED ) { + cmd->result = (DID_RESET <<16 ); + }else { + cmd->result = (DID_OK <<16 ) | sdstat; +if (sdstat ==SAM_STAT_CHECK_CONDITION && + cmd->sense_buffer) + cmd->result |= (DRIVER_SENSE <<24 ); + } } else switch (btstat) {case BTSTAT_SUCCESS :
drivers/staging/media/omap4iss/iss_video.c +2 -1
@@ -11,7 +11,6 @@* (at your option) any later version. */ -#include <asm/cacheflush.h> #include <linux/clk.h> #include <linux/mm.h> #include <linux/pagemap.h>
@@ -24,6 +23,8 @@#include <media/v4l2-ioctl.h> #include <media/v4l2-mc.h> +#include <asm/cacheflush.h> +#include "iss_video.h" #include "iss.h"
drivers/target/iscsi/cxgbit/cxgbit_target.c +9 -7
@@ -652,6 +652,7 @@ static int cxgbit_set_iso_npdu(struct cxgbit_sock *csk)struct iscsi_param *param;u32 mrdsl, mbl;u32 max_npdu, max_iso_npdu; +u32 max_iso_payload;if (conn->login->leading_connection) { param = iscsi_find_param_from_key(MAXBURSTLENGTH,
@@ -670,8 +671,10 @@ static int cxgbit_set_iso_npdu(struct cxgbit_sock *csk) mrdsl = conn_ops->MaxRecvDataSegmentLength; max_npdu = mbl / mrdsl; - max_iso_npdu =CXGBIT_MAX_ISO_PAYLOAD / - (ISCSI_HDR_LEN + mrdsl + + max_iso_payload =rounddown (CXGBIT_MAX_ISO_PAYLOAD , csk->emss); + + max_iso_npdu = max_iso_payload / + (ISCSI_HDR_LEN + mrdsl + cxgbit_digest_len[csk->submode]); csk->max_iso_npdu =min (max_npdu, max_iso_npdu);
@@ -741,6 +744,9 @@ static int cxgbit_set_params(struct iscsi_conn *conn)if (conn_ops->MaxRecvDataSegmentLength > cdev->mdsl) conn_ops->MaxRecvDataSegmentLength = cdev->mdsl; +if (cxgbit_set_digest (csk)) +return -1 ; +if (conn->login->leading_connection) { param =iscsi_find_param_from_key (ERRORRECOVERYLEVEL , conn->param_list);
@@ -764,7 +770,7 @@ static int cxgbit_set_params(struct iscsi_conn *conn)if (is_t5 (cdev->lldi.adapter_type)) goto enable_ddp;else - goto enable_digest; +return 0 ; }if (test_bit (CDEV_ISO_ENABLE , &cdev->flags)) {
@@ -781,10 +787,6 @@ static int cxgbit_set_params(struct iscsi_conn *conn) } } -enable_digest: -if (cxgbit_set_digest (csk)) -return -1 ; -return 0 ; }
drivers/target/iscsi/iscsi_target_login.c +21 -14
@@ -345,8 +345,7 @@ static int iscsi_login_zero_tsih_s1(pr_err ("idr_alloc() for sess_idr failed\n" );iscsit_tx_login_rsp (conn,ISCSI_STATUS_CLS_TARGET_ERR ,ISCSI_LOGIN_STATUS_NO_RESOURCES ); -kfree (sess); -return -ENOMEM ; + goto free_sess; } sess->creation_time =get_jiffies_64 ();
@@ -362,20 +361,28 @@ static int iscsi_login_zero_tsih_s1( ISCSI_LOGIN_STATUS_NO_RESOURCES);pr_err ("Unable to allocate memory for" " struct iscsi_sess_ops.\n" ); -kfree (sess); -return -ENOMEM ; + goto remove_idr; } sess->se_sess =transport_init_session (TARGET_PROT_NORMAL );if (IS_ERR (sess->se_sess)) {iscsit_tx_login_rsp (conn,ISCSI_STATUS_CLS_TARGET_ERR ,ISCSI_LOGIN_STATUS_NO_RESOURCES ); -kfree (sess->sess_ops); -kfree (sess); -return -ENOMEM ; + goto free_ops; }return 0 ; + +free_ops: +kfree (sess->sess_ops); +remove_idr: +spin_lock_bh (&sess_idr_lock); +idr_remove (&sess_idr, sess->session_index); +spin_unlock_bh (&sess_idr_lock); +free_sess: +kfree (sess); + conn->sess =NULL ; +return -ENOMEM ; } static int iscsi_login_zero_tsih_s2(
@@ -1162,13 +1169,13 @@ void iscsi_target_login_sess_out(struct iscsi_conn *conn, ISCSI_LOGIN_STATUS_INIT_ERR);if (!zero_tsih || !conn->sess) goto old_sess_out; -if (conn->sess->se_sess) -transport_free_session (conn->sess->se_sess); -if (conn->sess->session_index !=0 ) { -spin_lock_bh (&sess_idr_lock); -idr_remove (&sess_idr, conn->sess->session_index); -spin_unlock_bh (&sess_idr_lock); - } + +transport_free_session (conn->sess->se_sess); + +spin_lock_bh (&sess_idr_lock); +idr_remove (&sess_idr, conn->sess->session_index); +spin_unlock_bh (&sess_idr_lock); +kfree (conn->sess->sess_ops);kfree (conn->sess); conn->sess =NULL ;
drivers/usb/gadget/function/f_uac2.c +12 -12
@@ -442,14 +442,14 @@ static struct usb_descriptor_header *hs_audio_desc[] = { };struct cntrl_cur_lay3 { -__u32 dCUR; +__le32 dCUR; };struct cntrl_range_lay3 { -__u16 wNumSubRanges; -__u32 dMIN; -__u32 dMAX; -__u32 dRES; +__le16 wNumSubRanges; +__le32 dMIN; +__le32 dMAX; +__le32 dRES; } __packed; static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
@@ -563,13 +563,13 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) agdev->out_ep =usb_ep_autoconfig (gadget, &fs_epout_desc);if (!agdev->out_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); -return ret; +return -ENODEV ; } agdev->in_ep =usb_ep_autoconfig (gadget, &fs_epin_desc);if (!agdev->in_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); -return ret; +return -ENODEV ; } agdev->in_ep_maxpsize = max_t(u16,
@@ -707,9 +707,9 @@ in_rq_cur(struct usb_function *fn, const struct usb_ctrlrequest *cr)memset (&c,0 ,sizeof (struct cntrl_cur_lay3 ));if (entity_id ==USB_IN_CLK_ID ) - c.dCUR = p_srate; + c.dCUR =cpu_to_le32 (p_srate);else if (entity_id ==USB_OUT_CLK_ID ) - c.dCUR = c_srate; + c.dCUR =cpu_to_le32 (c_srate); value =min_t (unsigned, w_length,sizeof c);memcpy (req->buf, &c, value);
@@ -746,15 +746,15 @@ in_rq_range(struct usb_function *fn, const struct usb_ctrlrequest *cr)if (control_selector ==UAC2_CS_CONTROL_SAM_FREQ ) {if (entity_id ==USB_IN_CLK_ID ) - r.dMIN = p_srate; + r.dMIN =cpu_to_le32 (p_srate);else if (entity_id ==USB_OUT_CLK_ID ) - r.dMIN = c_srate; + r.dMIN =cpu_to_le32 (c_srate);else return -EOPNOTSUPP ; r.dMAX = r.dMIN; r.dRES =0 ; - r.wNumSubRanges =1 ; + r.wNumSubRanges =cpu_to_le16 (1 ); value =min_t (unsigned, w_length,sizeof r);memcpy (req->buf, &r, value);
drivers/usb/gadget/function/u_audio.c +33 -55
166 lines not on this page · raw message
drivers/usb/gadget/udc/r8a66597-udc.c +3 -3
@@ -835,11 +835,11 @@ static void init_controller(struct r8a66597 *r8a66597)r8a66597_bset (r8a66597,XCKE ,SYSCFG0 ); -msleep (3 ); +mdelay (3 );r8a66597_bset (r8a66597,PLLC ,SYSCFG0 ); -msleep (1 ); +mdelay (1 );r8a66597_bset (r8a66597,SCKE ,SYSCFG0 );
@@ -1193,7 +1193,7 @@ __acquires(r8a66597->lock) r8a66597->ep0_req->length =2 ;/* AV: what happens if we get called again before that gets through? */ spin_unlock (&r8a66597->lock); -r8a66597_queue (r8a66597->gadget.ep0, r8a66597->ep0_req,GFP_KERNEL ); +r8a66597_queue (r8a66597->gadget.ep0, r8a66597->ep0_req,GFP_ATOMIC );spin_lock (&r8a66597->lock); }
drivers/usb/phy/phy-fsl-usb.c +3 -1
@@ -874,6 +874,7 @@ int usb_otg_start(struct platform_device *pdev)if (pdata->init && pdata->init (pdev) !=0 )return -EINVAL ; +#ifdef CONFIG_PPC32 if (pdata->big_endian_mmio) { _fsl_readl = _fsl_readl_be; _fsl_writel = _fsl_writel_be;
@@ -881,6 +882,7 @@ int usb_otg_start(struct platform_device *pdev) _fsl_readl = _fsl_readl_le; _fsl_writel = _fsl_writel_le; } +#endif /* request irq */ p_otg->irq =platform_get_irq (pdev,0 );
@@ -971,7 +973,7 @@ int usb_otg_start(struct platform_device *pdev)/* * state file in sysfs */ -static int show_fsl_usb2_otg_state (struct device *dev, +static ssize_t show_fsl_usb2_otg_state (struct device *dev,struct device_attribute *attr,char *buf) {struct otg_fsm *fsm = &fsl_otg_dev->fsm;
fs/btrfs/disk-io.c +6 -4
@@ -1098,8 +1098,9 @@ static int btree_writepages(struct address_space *mapping, fs_info =BTRFS_I (mapping->host)->root->fs_info;/* this is a bit racy, but that's ok */ - ret =percpu_counter_compare (&fs_info->dirty_metadata_bytes, -BTRFS_DIRTY_METADATA_THRESH ); + ret =__percpu_counter_compare (&fs_info->dirty_metadata_bytes, +BTRFS_DIRTY_METADATA_THRESH , + fs_info->dirty_metadata_batch);if (ret <0 )return 0 ; }
@@ -4030,8 +4031,9 @@ static void __btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info,if (flush_delayed)btrfs_balance_delayed_items (fs_info); - ret =percpu_counter_compare (&fs_info->dirty_metadata_bytes, -BTRFS_DIRTY_METADATA_THRESH ); + ret =__percpu_counter_compare (&fs_info->dirty_metadata_bytes, +BTRFS_DIRTY_METADATA_THRESH , + fs_info->dirty_metadata_batch);if (ret >0 ) {balance_dirty_pages_ratelimited (fs_info->btree_inode->i_mapping); }
fs/btrfs/extent-tree.c +1 -1
@@ -4407,7 +4407,7 @@ int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes) data_sinfo->flags, bytes, 1);spin_unlock (&data_sinfo->lock); -return ret; +return 0 ; } int btrfs_check_data_free_space(struct inode *inode,
fs/btrfs/inode.c +0 -26
@@ -6152,32 +6152,6 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx)return ret; } -int btrfs_write_inode (struct inode *inode,struct writeback_control *wbc) -{ -struct btrfs_root *root =BTRFS_I (inode)->root; -struct btrfs_trans_handle *trans; -int ret =0 ; -bool nolock = false; - -if (test_bit (BTRFS_INODE_DUMMY , &BTRFS_I (inode)->runtime_flags)) -return 0 ; - -if (btrfs_fs_closing (root->fs_info) && -btrfs_is_free_space_inode (BTRFS_I (inode))) - nolock = true; - -if (wbc->sync_mode ==WB_SYNC_ALL ) { -if (nolock) - trans =btrfs_join_transaction_nolock (root); -else - trans =btrfs_join_transaction (root); -if (IS_ERR (trans)) -return PTR_ERR (trans); - ret =btrfs_commit_transaction (trans); - } -return ret; -} -/* * This is somewhat expensive, updating the tree every time the * inode changes. But, it is most likely to find the inode in cache.
fs/btrfs/super.c +0 -1
@@ -2271,7 +2271,6 @@ static const struct super_operations btrfs_super_ops = { .sync_fs = btrfs_sync_fs, .show_options = btrfs_show_options, .show_devname = btrfs_show_devname, - .write_inode = btrfs_write_inode, .alloc_inode = btrfs_alloc_inode, .destroy_inode = btrfs_destroy_inode, .statfs = btrfs_statfs,
fs/cachefiles/namei.c +0 -1
@@ -195,7 +195,6 @@ static int cachefiles_mark_object_active(struct cachefiles_cache *cache,pr_err ("\n" );pr_err ("Error: Unexpected object collision\n" );cachefiles_printk_object (object, xobject); -BUG (); }atomic_inc (&xobject->usage);write_unlock (&cache->active_lock);
fs/cachefiles/rdwr.c +12 -5
@@ -27,6 +27,7 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,struct cachefiles_one_read *monitor = container_of(wait, struct cachefiles_one_read, monitor);struct cachefiles_object *object; +struct fscache_retrieval *op = monitor->op;struct wait_bit_key *key = _key;struct page *page = wait->private;
@@ -51,16 +52,22 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,list_del (&wait->entry);/* move onto the action list and queue for FS-Cache thread pool */ -ASSERT (monitor->op); +ASSERT (op); - object =container_of (monitor->op->op.object, - struct cachefiles_object, fscache); +/* We need to temporarily bump the usage count as we don't own a ref +* here otherwise cachefiles_read_copier() may free the op between the +* monitor being enqueued on the op->to_do list and the op getting +* enqueued on the work queue. +*/ +fscache_get_retrieval (op); + object = container_of(op->op.object, struct cachefiles_object, fscache);spin_lock (&object->work_lock); -list_add_tail (&monitor->op_link, &monitor->op->to_do); +list_add_tail (&monitor->op_link, &op->to_do);spin_unlock (&object->work_lock); -fscache_enqueue_retrieval (monitor->op); +fscache_enqueue_retrieval (op); +fscache_put_retrieval (op);return 0 ; }
fs/cifs/cifs_debug.c +23 -7
@@ -123,25 +123,41 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)seq_printf (m,"CIFS Version %s\n" ,CIFS_VERSION );seq_printf (m,"Features:" );#ifdef CONFIG_CIFS_DFS_UPCALL -seq_printf (m," dfs" ); +seq_printf (m," DFS" );#endif #ifdef CONFIG_CIFS_FSCACHE -seq_printf (m," fscache" ); +seq_printf (m,",FSCACHE" ); +#endif +#ifdef CONFIG_CIFS_SMB_DIRECT +seq_printf (m,",SMB_DIRECT" ); +#endif +#ifdef CONFIG_CIFS_STATS2 +seq_printf (m,",STATS2" ); +#elif defined(CONFIG_CIFS_STATS ) +seq_printf (m,",STATS" ); +#endif +#ifdef CONFIG_CIFS_DEBUG2 +seq_printf (m,",DEBUG2" ); +#elif defined(CONFIG_CIFS_DEBUG ) +seq_printf (m,",DEBUG" ); +#endif +#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY +seq_printf (m,",ALLOW_INSECURE_LEGACY" );#endif #ifdef CONFIG_CIFS_WEAK_PW_HASH -seq_printf (m," lanman" ); +seq_printf (m,",WEAK_PW_HASH" );#endif #ifdef CONFIG_CIFS_POSIX -seq_printf (m," posix" ); +seq_printf (m,",CIFS_POSIX" );#endif #ifdef CONFIG_CIFS_UPCALL -seq_printf (m," spnego" ); +seq_printf (m,",UPCALL(SPNEGO)" );#endif #ifdef CONFIG_CIFS_XATTR -seq_printf (m," xattr" ); +seq_printf (m,",XATTR" );#endif #ifdef CONFIG_CIFS_ACL -seq_printf (m," acl" ); +seq_printf (m,",ACL" );#endif seq_putc (m,'\n' );seq_printf (m,"Active VFS Requests: %d\n" , GlobalTotalActiveXid);
fs/cifs/cifsfs.c +10 -8
@@ -197,14 +197,16 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) xid =get_xid (); -/* -* PATH_MAX may be too long - it would presumably be total path, -* but note that some servers (includinng Samba 3) have a shorter -* maximum path. -* -* Instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO. -*/ - buf->f_namelen =PATH_MAX ; +if (le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength) >0 ) + buf->f_namelen = +le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength); +else + buf->f_namelen =PATH_MAX ; + + buf->f_fsid.val[0 ] = tcon->vol_serial_number; +/* are using part of create time for more randomness, see man statfs */ + buf->f_fsid.val[1 ] = (int )le64_to_cpu (tcon->vol_create_time); + buf->f_files =0 ;/* undefined */ buf->f_ffree =0 ;/* unlimited */
fs/cifs/inode.c +2 -0
@@ -1122,6 +1122,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,if (!server->ops->set_file_info)return -ENOSYS ; + info_buf.Pad =0 ; +if (attrs->ia_valid &ATTR_ATIME ) { set_time = true; info_buf.LastAccessTime =
fs/cifs/link.c +2 -2
@@ -396,7 +396,7 @@ smb3_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,struct cifs_io_parms io_parms;int buf_type =CIFS_NO_BUFFER ;__le16 *utf16_path; -__u8 oplock =SMB2_OPLOCK_LEVEL_II ; +__u8 oplock =SMB2_OPLOCK_LEVEL_NONE ;struct smb2_file_all_info *pfile_info =NULL ; oparms.tcon = tcon;
@@ -458,7 +458,7 @@ smb3_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,struct cifs_io_parms io_parms;int create_options =CREATE_NOT_DIR ;__le16 *utf16_path; -__u8 oplock =SMB2_OPLOCK_LEVEL_EXCLUSIVE ; +__u8 oplock =SMB2_OPLOCK_LEVEL_NONE ;struct kvec iov[2 ];if (backup_cred (cifs_sb))
fs/cifs/sess.c +6 -0
@@ -398,6 +398,12 @@ int build_ntlmssp_auth_blob(unsigned char **pbuffer, goto setup_ntlmv2_ret; } *pbuffer =kmalloc (size_of_ntlmssp_blob (ses),GFP_KERNEL ); +if (!*pbuffer) { + rc = -ENOMEM ; +cifs_dbg (VFS ,"Error %d during NTLMSSP allocation\n" , rc); + *buflen =0 ; + goto setup_ntlmv2_ret; + } sec_blob = (AUTHENTICATE_MESSAGE *)*pbuffer;memcpy (sec_blob->Signature,NTLMSSP_SIGNATURE ,8 );
fs/cifs/smb2inode.c +1 -1
@@ -267,7 +267,7 @@ smb2_set_file_info(struct inode *inode, const char *full_path,int rc;if ((buf->CreationTime ==0 ) && (buf->LastAccessTime ==0 ) && - (buf->LastWriteTime ==0 ) && (buf->ChangeTime) && + (buf->LastWriteTime ==0 ) && (buf->ChangeTime ==0 ) && (buf->Attributes ==0 ))return 0 ;/* would be a no op, no sense sending this */
fs/cifs/smb2ops.c +29 -7
@@ -332,6 +332,8 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon) FS_ATTRIBUTE_INFORMATION);SMB2_QFS_attr (xid, tcon, fid.persistent_fid, fid.volatile_fid,FS_DEVICE_INFORMATION ); +SMB2_QFS_attr (xid, tcon, fid.persistent_fid, fid.volatile_fid, +FS_VOLUME_INFORMATION );SMB2_QFS_attr (xid, tcon, fid.persistent_fid, fid.volatile_fid,FS_SECTOR_SIZE_INFORMATION );/* SMB3 specific */ SMB2_close (xid, tcon, fid.persistent_fid, fid.volatile_fid);
@@ -1129,6 +1131,13 @@ smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon, } +/* GMT Token is @GMT-YYYY.MM.DD-HH.MM.SS Unicode which is 48 bytes + null */ +#define GMT_TOKEN_SIZE 50 + +/* +* Input buffer contains (empty) struct smb_snapshot array with size filled in +* For output see struct SRV_SNAPSHOT_ARRAY in MS-SMB2 section 2.2.32.2 +*/ static int smb3_enum_snapshots (const unsigned int xid,struct cifs_tcon *tcon,struct cifsFileInfo *cfile,void __user *ioc_buf)
@@ -1158,14 +1167,27 @@ smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon,kfree (retbuf);return rc; } -if (snapshot_in.snapshot_array_size <sizeof (struct smb_snapshot_array )) { - rc = -ERANGE ; -kfree (retbuf); -return rc; - } -if (ret_data_len > snapshot_in.snapshot_array_size) - ret_data_len = snapshot_in.snapshot_array_size; +/* +* Check for min size, ie not large enough to fit even one GMT +* token (snapshot). On the first ioctl some users may pass in +* smaller size (or zero) to simply get the size of the array +* so the user space caller can allocate sufficient memory +* and retry the ioctl again with larger array size sufficient +* to hold all of the snapshot GMT tokens on the second try. +*/ +if (snapshot_in.snapshot_array_size <GMT_TOKEN_SIZE ) + ret_data_len =sizeof (struct smb_snapshot_array ); + +/* +* We return struct SRV_SNAPSHOT_ARRAY, followed by +* the snapshot array (of 50 byte GMT tokens) each +* representing an available previous version of the data +*/ +if (ret_data_len > (snapshot_in.snapshot_array_size + +sizeof (struct smb_snapshot_array ))) + ret_data_len = snapshot_in.snapshot_array_size + +sizeof (struct smb_snapshot_array );if (copy_to_user (ioc_buf, retbuf, ret_data_len)) rc = -EFAULT ;
fs/cifs/smb2pdu.c +8 -0
@@ -3455,6 +3455,9 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, }else if (level ==FS_SECTOR_SIZE_INFORMATION ) { max_len =sizeof (struct smb3_fs_ss_info ); min_len =sizeof (struct smb3_fs_ss_info ); + }else if (level ==FS_VOLUME_INFORMATION ) { + max_len =sizeof (struct smb3_fs_vol_info ) +MAX_VOL_LABEL_LEN ; + min_len =sizeof (struct smb3_fs_vol_info ); }else {cifs_dbg (FYI ,"Invalid qfsinfo level %d\n" , level);return -EINVAL ;
@@ -3495,6 +3498,11 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, tcon->ss_flags =le32_to_cpu (ss_info->Flags); tcon->perf_sector_size =le32_to_cpu (ss_info->PhysicalBytesPerSectorForPerf); + }else if (level ==FS_VOLUME_INFORMATION ) { +struct smb3_fs_vol_info *vol_info = (struct smb3_fs_vol_info *) + (offset + (char *)rsp); + tcon->vol_serial_number = vol_info->VolumeSerialNumber; + tcon->vol_create_time = vol_info->VolumeCreationTime; } qfsattr_exit:
fs/cifs/smb2pdu.h +11 -0
@@ -1108,6 +1108,17 @@ struct smb3_fs_ss_info {__le32 ByteOffsetForPartitionAlignment; } __packed; +/* volume info struct - see MS-FSCC 2.5.9 */ +#define MAX_VOL_LABEL_LEN 32 +struct smb3_fs_vol_info { +__le64 VolumeCreationTime; +__u32 VolumeSerialNumber; +__le32 VolumeLabelLength;/* includes trailing null */ +__u8 SupportsObjects;/* True if eg like NTFS, supports objects */ +__u8 Reserved; +__u8 VolumeLabel[0 ];/* variable len */ +} __packed; +/* partial list of QUERY INFO levels */ #define FILE_DIRECTORY_INFORMATION 1#define FILE_FULL_DIRECTORY_INFORMATION 2
fs/ext4/mmp.c +2 -5
@@ -186,11 +186,8 @@ static int kmmpd(void *data) goto exit_thread; } -if (sb_rdonly (sb)) { -ext4_warning (sb,"kmmpd being stopped since filesystem " -"has been remounted as readonly." ); - goto exit_thread; - } +if (sb_rdonly (sb)) +break ; diff = jiffies - last_update_time;if (diff < mmp_update_interval *HZ )
fs/ext4/namei.c +1 -0
@@ -1397,6 +1397,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir, goto cleanup_and_exit;dxtrace (printk (KERN_DEBUG "ext4_find_entry: dx failed, " "falling back\n" )); + ret =NULL ; } nblocks = dir->i_size >>EXT4_BLOCK_SIZE_BITS (sb);if (!nblocks) {
fs/ext4/super.c +2 -0
@@ -5163,6 +5163,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)if (sbi->s_journal)ext4_mark_recovery_complete (sb, es); +if (sbi->s_mmp_tsk) +kthread_stop (sbi->s_mmp_tsk); }else {/* Make sure we can mount this feature set readwrite */
Lines of this file are not shown. View the raw message.
fs/squashfs/file.c +28 -22
50 lines not on this page · raw message
fs/sysfs/file.c +44 -0
44 lines not on this page · raw message
kernel/printk/printk.c +35 -22
57 lines not on this page · raw message
kernel/printk/printk_safe.c +37 -21
58 lines not on this page · raw message
kernel/stop_machine.c +25 -18
43 lines not on this page · raw message
net/netfilter/nf_tables_api.c +40 -19
59 lines not on this page · raw message
scripts/gcc-plugins/latent_entropy_plugin.c +5 -12
Lines of this file are not shown. View the raw message.
scripts/gcc-plugins/randomize_layout_plugin.c +21 -54
75 lines not on this page · raw message
scripts/gcc-plugins/structleak_plugin.c +7 -12
Lines of this file are not shown. View the raw message.
tools/testing/selftests/ftrace/test.d/00basic/snapshot.tc new file +28 -0
Lines of this file are not shown. View the raw message.
virt/kvm/arm/mmu.c +31 -11
42 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.