Linux 5.4.133
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.133 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/mips/boot/compressed/string.c | 17 + arch/mips/include/asm/hugetlb.h | 8 arch/mips/include/asm/mipsregs.h | 8 arch/mips/include/asm/pgalloc.h | 10 - arch/mips/loongson64/loongson-3/numa.c | 3 arch/powerpc/include/asm/barrier.h | 2 arch/powerpc/mm/fault.c | 4 block/blk-rq-qos.c | 4 drivers/ata/ahci_sunxi.c | 2 drivers/atm/iphase.c | 2 drivers/atm/nicstar.c | 26 +- drivers/bluetooth/btusb.c | 15 + drivers/char/ipmi/ipmi_watchdog.c | 22 +- drivers/clk/renesas/r8a77995-cpg-mssr.c | 1 drivers/clk/tegra/clk-pll.c | 9 drivers/clocksource/arm_arch_timer.c | 2 drivers/crypto/ccp/psp-dev.c | 4 drivers/extcon/extcon-intel-mrfld.c | 9 drivers/firmware/qemu_fw_cfg.c | 8 drivers/fpga/stratix10-soc.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 21 -- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 22 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 24 ++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 41 +++- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 9 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 drivers/gpu/drm/amd/display/dc/irq_types.h | 2 drivers/gpu/drm/amd/include/navi10_enum.h | 2 drivers/gpu/drm/arm/malidp_planes.c | 9 drivers/gpu/drm/bridge/cdns-dsi.c | 2 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 8 drivers/gpu/drm/mxsfb/Kconfig | 1 drivers/gpu/drm/radeon/radeon_display.c | 1 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 4 drivers/gpu/drm/scheduler/sched_entity.c | 5 drivers/gpu/drm/tegra/dc.c | 10 - drivers/gpu/drm/tegra/drm.c | 2 drivers/gpu/drm/vc4/vc4_drv.h | 2 drivers/gpu/drm/virtio/virtgpu_kms.c | 1 drivers/gpu/drm/zte/Kconfig | 1 drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 drivers/infiniband/core/cma.c | 3 drivers/infiniband/hw/cxgb4/qp.c | 1 drivers/infiniband/sw/rxe/rxe_mr.c | 2 drivers/ipack/carriers/tpci200.c | 5 drivers/isdn/hardware/mISDN/hfcpci.c | 2 drivers/md/persistent-data/dm-btree-remove.c | 3 drivers/md/persistent-data/dm-space-map-disk.c | 9 drivers/md/persistent-data/dm-space-map-metadata.c | 9 drivers/media/i2c/saa6588.c | 4 drivers/media/pci/bt8xx/bttv-driver.c | 6 drivers/media/pci/saa7134/saa7134-video.c | 6 drivers/media/platform/davinci/vpbe_display.c | 2 drivers/media/platform/davinci/vpbe_venc.c | 6 drivers/media/rc/bpf-lirc.c | 3 drivers/media/usb/dvb-usb/dtv5100.c | 7 drivers/media/usb/gspca/sq905.c | 2 drivers/media/usb/gspca/sunplus.c | 8 drivers/media/usb/uvc/uvc_video.c | 27 ++ drivers/media/usb/zr364xx/zr364xx.c | 1 drivers/mmc/core/core.c | 7 drivers/mmc/core/sd.c | 10 - drivers/mmc/host/sdhci.c | 4 drivers/mmc/host/sdhci.h | 1 drivers/net/ethernet/broadcom/genet/bcmmii.c | 4 drivers/net/ethernet/intel/e100.c | 12 - drivers/net/ethernet/intel/ice/ice_type.h | 2 drivers/net/ethernet/intel/igb/igb_main.c | 5 drivers/net/ethernet/intel/igbvf/netdev.c | 4 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 drivers/net/ethernet/micrel/ks8842.c | 4 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 19 -- drivers/net/ethernet/realtek/r8169_main.c | 1 drivers/net/ethernet/sfc/ef10_sriov.c | 25 +- drivers/net/fjes/fjes_main.c | 4 drivers/net/virtio_net.c | 2 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 24 +- drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 15 + drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 3 drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | 3 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 10 - drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 11 - drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 59 +++++- drivers/net/wireless/st/cw1200/cw1200_sdio.c | 1 drivers/net/wireless/ti/wl1251/cmd.c | 9 drivers/net/wireless/ti/wl12xx/main.c | 7 drivers/nvmem/core.c | 9 drivers/pci/controller/pci-aardvark.c | 13 + drivers/pci/quirks.c | 11 + drivers/pinctrl/pinctrl-amd.c | 1 drivers/pinctrl/pinctrl-mcp23s08.c | 10 - drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | 20 +- fs/crypto/fname.c | 9 fs/jfs/inode.c | 3 fs/reiserfs/journal.c | 14 + fs/ubifs/super.c | 1 fs/ubifs/ubifs.h | 2 fs/ubifs/xattr.c | 44 +++- fs/udf/namei.c | 4 include/linux/mfd/abx500/ux500_chargalg.h | 2 include/linux/netdev_features.h | 2 include/linux/wait.h | 2 include/media/v4l2-subdev.h | 4 include/net/sctp/structs.h | 2 include/uapi/linux/ethtool.h | 4 kernel/bpf/core.c | 61 ++++-- kernel/cpu.c | 49 +++++ kernel/sched/wait.c | 9 kernel/trace/trace.c | 91 ++++++---- lib/seq_buf.c | 4 net/bluetooth/hci_core.c | 16 - net/bluetooth/mgmt.c | 3 net/core/dev.c | 11 - net/ipv4/ip_output.c | 32 +-- net/ipv6/ip6_output.c | 32 +-- net/ipv6/output_core.c | 28 --- net/sched/act_api.c | 3 net/sctp/bind_addr.c | 19 +- net/sctp/input.c | 8 net/sctp/ipv6.c | 7 net/sctp/protocol.c | 7 net/sctp/sm_make_chunk.c | 29 +-- net/vmw_vsock/af_vsock.c | 2 net/wireless/wext-spy.c | 14 - net/xfrm/xfrm_user.c | 28 +-- security/selinux/avc.c | 13 - security/smack/smackfs.c | 2 sound/soc/tegra/tegra_alc5632.c | 1 sound/soc/tegra/tegra_max98090.c | 1 sound/soc/tegra/tegra_rt5640.c | 1 sound/soc/tegra/tegra_rt5677.c | 1 sound/soc/tegra/tegra_sgtl5000.c | 1 sound/soc/tegra/tegra_wm8753.c | 1 sound/soc/tegra/tegra_wm8903.c | 1 sound/soc/tegra/tegra_wm9712.c | 1 sound/soc/tegra/trimslice.c | 1 tools/perf/bench/sched-messaging.c | 4 143 files changed, 895 insertions(+), 438 deletions(-)
Al Cooper (1):
mmc: sdhci: Fix warning message when accessing RPMB in HS400 mode
Andrey Grodzovsky (1):
drm/sched: Avoid data corruptions
Andy Shevchenko (1):
net: pch_gbe: Use proper accessors to BE data in pch_ptp_match()
Arnd Bergmann (1):
media: subdev: disallow ioctl for saa6588/davinci
Arturo Giusti (1):
udf: Fix NULL pointer dereference in udf_symlink function
Benjamin Drung (1):
media: uvcvideo: Fix pixel format change for Elgato Cam Link 4K
Bibo Mao (1):
hugetlb: clear huge pte during flush function on mips platform
Christian Löhle (1):
mmc: core: Allow UHS-I voltage switch for SDSC cards if supported
Christophe JAILLET (1):
nvmem: core: add a missing of_node_put
Christophe Leroy (1):
powerpc/mm: Fix lockup on kernel exec fault
Dan Carpenter (1):
drm/vc4: fix argument ordering in vc4_crtc_get_margins()
Daniel Borkmann (1):
bpf: Fix up register-based shifts in interpreter to silence KUBSAN
Daniel Vetter (3):
drm/tegra: Don't set allow_fb_modifiers explicitly drm/msm/mdp4: Fix modifier support enabling drm/arm/malidp: Always list modifiers
Dmitry Osipenko (2):
clk: tegra: Ensure that PLLU configuration is applied properly
ASoC: tegra: Set driver_name=tegra for all machine drivers
Dmytro Laktyushkin (1):
drm/amd/display: fix use_max_lb flag for 420 pixel formats
Eric Biggers (1):
fscrypt: don't ignore minor_hash when hash is 0
Felix Fietkau (1):
mt76: mt7615: fix fixed-rate tx status reporting
Ferry Toth (1):
extcon: intel-mrfld: Sync hardware and software state on init
Gao Xiang (1):
MIPS: fix "mipsel-linux-ld: decompress.c:undefined reference to `memmove'"
Gerd Rausch (1):
RDMA/cma: Fix rdma_resolve_route() memory leak
Greg Kroah-Hartman (1):
Linux 5.4.133
Guchun Chen (1):
drm/amd/display: fix incorrrect valid irq check
Gustavo A. R. Silva (1):
wireless: wext-spy: Fix out-of-bounds warning
Harry Wentland (1):
drm/amd/display: Reject non-zero src_y and src_x for video planes
Heiner Kallweit (1):
r8169: avoid link-up interrupt issue on RTL8106e if user enables ASPM
Hou Tao (1):
dm btree remove: assign new_root only when removal succeeds
Huang Pei (1):
MIPS: add PMD table accounting into MIPS'pmd_alloc_one
Ian Rogers (1):
perf bench: Fix 2 memory sanitizer warnings
Jack Zhang (1):
drm/amd/amdgpu/sriov disable all ip hw status by default
Jakub Kicinski (1):
net: ip: avoid OOM kills with large UDP sends over loopback
Jan Kara (1):
rq-qos: fix missed wake-ups in rq_qos_throttle try two
Jesse Brandeburg (2):
e100: handle eeprom as little endian
igb: handle vlan types with checker enabled
Jian Shen (1):
net: fix mistake path for netdev_features_strings
Jiapeng Chong (1):
RDMA/cxgb4: Fix missing error code in create_qp()
Jing Xiangfeng (1):
drm/radeon: Add the missed drm_gem_object_put() in radeon_user_framebuffer_create()
Joe Thornber (1):
dm space maps: don't reset space map allocation cursor when committing
Joerg Roedel (1):
crypto: ccp - Annotate SEV Firmware file names
Johan Hovold (3):
media: dtv5100: fix control-request directions
media: gspca/sq905: fix control-request direction
media: gspca/sunplus: fix zero-length control requests
Johannes Berg (3):
iwlwifi: mvm: don't change band on bound PHY contexts
iwlwifi: pcie: free IML DMA memory allocation
iwlwifi: pcie: fix context info freeing
Joseph Greathouse (1):
drm/amdgpu: Update NV SIMD-per-CU to 2
Kai-Heng Feng (1):
Bluetooth: Shutdown controller after workqueues are flushed or cancelled
Konstantin Kharlamov (1):
PCI: Leave Apple Thunderbolt controllers on for s2idle or standby
Kuninori Morimoto (1):
clk: renesas: r8a77995: Add ZA2 clock
Lee Gibson (1):
wl1251: Fix possible buffer overflow in wl1251_cmd_scan
Linus Walleij (1):
power: supply: ab8500: Fix an old bug
Liwei Song (1):
ice: set the value of global config lock timeout longer
Longpeng(Mike) (1):
vsock: notify server to shutdown when client has pending signal
Lv Yunlong (1):
ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe
Marcelo Ricardo Leitner (2):
sctp: validate from_addr_param return
sctp: add size validation when walking chunks
Mark Yacoub (1):
drm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check
Maximilian Luz (1):
pinctrl/amd: Add device HID for new AMD GPIO controller
Minchan Kim (1):
selinux: use __GFP_NOWARN with GFP_NOWAIT in the AVC
Nathan Chancellor (2):
powerpc/barrier: Avoid collision with clang's __lwsync macro
qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute
Nick Desaulniers (1):
MIPS: set mips32r5 for virt extensions
Nirmoy Das (1):
drm/amdkfd: use allowed domain for vmbo validation
Pali Rohár (2):
PCI: aardvark: Fix checking for PIO Non-posted Request
PCI: aardvark: Implement workaround for the readback value of VEND_ID
Pascal Terjan (1):
rtl8xxxu: Fix device info for RTL8192EU devices
Paul Burton (2):
tracing: Simplify & fix saved_tgids logic
tracing: Resize tgid_map to pid_max, not PID_MAX_DEFAULT
Pavel Skripkin (3):
reiserfs: add check for invalid 1st journal block
media: zr364xx: fix memory leak in zr364xx_start_readpipe
jfs: fix GPF in diFree
Petr Pavlu (1):
ipmi/watchdog: Stop watchdog timer when the current action is 'none'
Radim Pavlik (1):
pinctrl: mcp23s08: fix race condition in irq handler
Roman Li (1):
drm/amd/display: Update scaling settings on modeset
Russ Weight (1):
fpga: stratix10-soc: Add missing fpga_mgr_free() call
Sai Prakash Ranjan (1):
coresight: tmc-etf: Fix global-out-of-bounds in tmc_update_etf_buffer()
Samuel Holland (1):
clocksource/arm_arch_timer: Improve Allwinner A64 timer workaround
Sean Young (1):
media, bpf: Do not copy more entries than user space requested
Sebastian Andrzej Siewior (1):
net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT
Srinivas Pandruvada (1):
thermal/drivers/int340x/processor_thermal: Fix tcc setting
Steffen Klassert (1):
xfrm: Fix error reporting in xfrm_state_construct.
Tetsuo Handa (1):
smackfs: restrict bytes count in smk_set_cipso()
Thomas Gleixner (1):
cpu/hotplug: Cure the cpusets trainwreck
Thomas Hebb (1):
drm/rockchip: dsi: remove extra component_del() call
Thomas Zimmermann (2):
drm/mxsfb: Don't select DRM_KMS_FB_HELPER
drm/zte: Don't select DRM_KMS_FB_HELPER
Tim Jiang (1):
Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc.
Timo Sigurdsson (1):
ata: ahci_sunxi: Disable DIPM
Tony Lindgren (1):
wlcore/wl12xx: Fix wl12xx get_mac error if device is in ELP
Vladimir Stempen (1):
drm/amd/display: Release MST resources on switch from MST to SST
Wang Li (1):
drm/mediatek: Fix PM reference leak in mtk_crtc_ddp_hw_init()
Wesley Chalmers (1):
drm/amd/display: Set DISPCLK_MAX_ERRDET_CYCLES to 7
Willy Tarreau (1):
ipv6: use prandom_u32() for ID generation
Wolfram Sang (1):
mmc: core: clear flags before allowing to retune
Xianting Tian (1):
virtio_net: Remove BUG() to avoid machine dead
Xiao Yang (1):
RDMA/rxe: Don't overwrite errno from ib_umem_get()
Xie Yongji (1):
drm/virtio: Fix double free on probe failure
Yang Yingliang (5):
net: bcmgenet: check return value after calling platform_get_resource()
net: mvpp2: check return value after calling platform_get_resource()
net: micrel: check return value after calling platform_get_resource()
fjes: check return value after calling platform_get_resource()
net: sched: fix error return code in tcf_del_walker()
Yu Liu (1):
Bluetooth: Fix the HCI to MGMT status conversion table
Yun Zhou (1):
seq_buf: Fix overflow in seq_buf_putmem_hex()
Zheyu Ma (2):
atm: nicstar: use 'dma_free_coherent' instead of 'kfree'
atm: nicstar: register the interrupt handler in the right place
Zhihao Cheng (1):
ubifs: Fix races between xattr_{set|get} and listxattr operations
Zou Wei (6):
atm: iphase: fix possible use-after-free in ia_module_exit()
mISDN: fix possible use-after-free in HFC_cleanup()
atm: nicstar: Fix possible use-after-free in nicstar_cleanup() drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer()
cw1200: add missing MODULE_DEVICE_TABLE
pinctrl: mcp23s08: Fix missing unlock on error in mcp23s08_irq()
mark-yw.chen (1):
Bluetooth: btusb: Fixed too many in-token issue for Mediatek Chip.
xinhui pan (1):
drm/amdkfd: Walk through list with dqm lock hold
zhanglianjie (1):
MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops
Íñigo Huguet (2):
sfc: avoid double pci_remove of VFs
sfc: error code if SRIOV cannot be disabled
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 132 +SUBLEVEL = 133 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/mips/boot/compressed/string.c +17 -0
@@ -5,6 +5,7 @@* Very small subset of simple string routines */ +#include <linux/compiler_attributes.h> #include <linux/types.h> void *memcpy (void *dest,const void *src,size_t n)
@@ -27,3 +28,19 @@ void *memset(void *s, int c, size_t n) ss[i] = c;return s; } + +void *__weak memmove (void *dest,const void *src,size_t n) +{ +unsigned int i; +const char *s = src; +char *d = dest; + +if ((uintptr_t )dest < (uintptr_t )src) { +for (i =0 ; i < n; i++) + d[i] = s[i]; + }else { +for (i = n; i >0 ; i--) + d[i -1 ] = s[i -1 ]; + } +return dest; +}
arch/mips/include/asm/hugetlb.h +7 -1
@@ -53,7 +53,13 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,static inline void huge_ptep_clear_flush (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep) { -flush_tlb_page (vma, addr &huge_page_mask (hstate_vma (vma))); +/* +* clear the huge pte entry firstly, so that the other smp threads will +* not get old pte entry after finishing flush_tlb_page and before +* setting new huge pte entry +*/ +huge_ptep_get_and_clear (vma->vm_mm, addr, ptep); +flush_tlb_page (vma, addr); }#define __HAVE_ARCH_HUGE_PTE_NONE
arch/mips/include/asm/mipsregs.h +4 -4
@@ -2007,7 +2007,7 @@ _ASM_MACRO_0(tlbginvf, _ASM_INSN_IF_MIPS(0x4200000c) ({ int __res; \ __asm__ __volatile__( \ ".set\tpush\n\t" \ - ".set\tmips32r2\n\t" \ + ".set\tmips32r5\n\t" \ _ASM_SET_VIRT \ "mfgc0\t%0, " #source ", %1\n\t" \ ".set\tpop" \
@@ -2020,7 +2020,7 @@ _ASM_MACRO_0(tlbginvf, _ASM_INSN_IF_MIPS(0x4200000c) ({ unsigned long long __res; \ __asm__ __volatile__( \ ".set\tpush\n\t" \ - ".set\tmips64r2\n\t" \ + ".set\tmips64r5\n\t" \ _ASM_SET_VIRT \ "dmfgc0\t%0, " #source ", %1\n\t" \ ".set\tpop" \
@@ -2033,7 +2033,7 @@ _ASM_MACRO_0(tlbginvf, _ASM_INSN_IF_MIPS(0x4200000c) do { \ __asm__ __volatile__( \ ".set\tpush\n\t" \ - ".set\tmips32r2\n\t" \ + ".set\tmips32r5\n\t" \ _ASM_SET_VIRT \ "mtgc0\t%z0, " #register ", %1\n\t" \ ".set\tpop" \
@@ -2045,7 +2045,7 @@ do { \ do { \ __asm__ __volatile__( \ ".set\tpush\n\t" \ - ".set\tmips64r2\n\t" \ + ".set\tmips64r5\n\t" \ _ASM_SET_VIRT \ "dmtgc0\t%z0, " #register ", %1\n\t" \ ".set\tpop" \
arch/mips/include/asm/pgalloc.h +7 -3
@@ -62,11 +62,15 @@ do { \static inline pmd_t *pmd_alloc_one (struct mm_struct *mm,unsigned long address) { -pmd_t *pmd; +pmd_t *pmd =NULL ; +struct page *pg; - pmd = (pmd_t *)__get_free_pages (GFP_KERNEL ,PMD_ORDER ); -if (pmd) + pg =alloc_pages (GFP_KERNEL | __GFP_ACCOUNT,PMD_ORDER ); +if (pg) { +pgtable_pmd_page_ctor (pg); + pmd = (pmd_t *)page_address (pg);pmd_init ((unsigned long )pmd, (unsigned long )invalid_pte_table); + }return pmd; }
arch/mips/loongson64/loongson-3/numa.c +3 -0
@@ -200,6 +200,9 @@ static void __init node_mem_init(unsigned int node)if (node_end_pfn (0 ) >= (0xffffffff >>PAGE_SHIFT ))memblock_reserve ((node_addrspace_offset |0xfe000000 ),32 <<20 ); + +/* Reserve pfn range 0~node[0]->node_start_pfn */ +memblock_reserve (0 ,PAGE_SIZE * start_pfn); } }
arch/powerpc/include/asm/barrier.h +2 -0
@@ -44,6 +44,8 @@# define SMPWMB eieio#endif +/* clang defines this macro for a builtin, which will not work with runtime patching */ +#undef __lwsync#define __lwsync () __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")#define dma_rmb () __lwsync()#define dma_wmb () __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
arch/powerpc/mm/fault.c +1 -3
@@ -204,9 +204,7 @@ static bool bad_kernel_fault(struct pt_regs *regs, unsigned long error_code, {int is_exec =TRAP (regs) ==0x400 ; -/* NX faults set DSISR_PROTFAULT on the 8xx, DSISR_NOEXEC_OR_G on others */ -if (is_exec && (error_code & (DSISR_NOEXEC_OR_G |DSISR_KEYFAULT | -DSISR_PROTFAULT ))) { +if (is_exec) { pr_crit_ratelimited("kernel tried to execute %s page (%lx) - exploit attempt? (uid: %d)\n", address >= TASK_SIZE ? "exec-protected" : "user", address,
block/blk-rq-qos.c +2 -2
@@ -266,8 +266,8 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,if (!has_sleeper &&acquire_inflight_cb (rqw, private_data))return ; -prepare_to_wait_exclusive (&rqw->wait, &data.wq,TASK_UNINTERRUPTIBLE ); - has_sleeper = !wq_has_single_sleeper (&rqw->wait); + has_sleeper = !prepare_to_wait_exclusive (&rqw->wait, &data.wq, +TASK_UNINTERRUPTIBLE ); do { /* The memory barrier in set_task_state saves us here. */ if (data.got_token)
drivers/ata/ahci_sunxi.c +1 -1
@@ -200,7 +200,7 @@ static void ahci_sunxi_start_engine(struct ata_port *ap) }static const struct ata_port_info ahci_sunxi_port_info = { - .flags =AHCI_FLAG_COMMON |ATA_FLAG_NCQ , + .flags =AHCI_FLAG_COMMON |ATA_FLAG_NCQ |ATA_FLAG_NO_DIPM , .pio_mask =ATA_PIO4 , .udma_mask =ATA_UDMA6 , .port_ops = &ahci_platform_ops,
drivers/atm/iphase.c +1 -1
@@ -3295,7 +3295,7 @@ static void __exit ia_module_exit(void) {pci_unregister_driver (&ia_driver); -del_timer (&ia_timer); +del_timer_sync (&ia_timer); }module_init (ia_module_init);
drivers/atm/nicstar.c +14 -12
@@ -297,7 +297,7 @@ static void __exit nicstar_cleanup(void) {XPRINTK ("nicstar: nicstar_cleanup() called.\n" ); -del_timer (&ns_timer); +del_timer_sync (&ns_timer);pci_unregister_driver (&nicstar_driver);
@@ -525,6 +525,15 @@ static int ns_init_card(int i, struct pci_dev *pcidev)/* Set the VPI/VCI MSb mask to zero so we can receive OAM cells */ writel (0x00000000 , card->membase +VPM ); + card->intcnt =0 ; +if (request_irq + (pcidev->irq, &ns_irq_handler,IRQF_SHARED ,"nicstar" , card) !=0 ) { +pr_err ("nicstar%d: can't allocate IRQ %d.\n" , i, pcidev->irq); + error =9 ; +ns_init_card_error (card, error); +return error; + } +/* Initialize TSQ */ card->tsq.org = dma_alloc_coherent(&card->pcidev->dev, NS_TSQSIZE + NS_TSQ_ALIGNMENT,
@@ -751,15 +760,6 @@ static int ns_init_card(int i, struct pci_dev *pcidev) card->efbie =1 ; - card->intcnt =0 ; -if (request_irq - (pcidev->irq, &ns_irq_handler,IRQF_SHARED ,"nicstar" , card) !=0 ) { -printk ("nicstar%d: can't allocate IRQ %d.\n" , i, pcidev->irq); - error =9 ; -ns_init_card_error (card, error); -return error; - } -/* Register device */ card->atmdev =atm_dev_register ("nicstar" , &card->pcidev->dev, &atm_ops,-1 ,NULL );
@@ -837,10 +837,12 @@ static void ns_init_card_error(ns_dev *card, int error)dev_kfree_skb_any (hb); }if (error >=12 ) { -kfree (card->rsq.org); +dma_free_coherent (&card->pcidev->dev,NS_RSQSIZE +NS_RSQ_ALIGNMENT , + card->rsq.org, card->rsq.dma); }if (error >=11 ) { -kfree (card->tsq.org); +dma_free_coherent (&card->pcidev->dev,NS_TSQSIZE +NS_TSQ_ALIGNMENT , + card->tsq.org, card->tsq.dma); }if (error >=10 ) {free_irq (card->pcidev->irq, card);
drivers/bluetooth/btusb.c +10 -5
@@ -2700,11 +2700,6 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev,struct btmtk_wmt_hdr *hdr;int err; -/* Submit control IN URB on demand to process the WMT event */ - err =btusb_mtk_submit_wmt_recv_urb (hdev); -if (err <0 ) -return err; -/* Send the WMT command and wait until the WMT event returns */ hlen =sizeof (*hdr) + wmt_params->dlen;if (hlen >255 )
@@ -2726,6 +2721,11 @@ static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev,return err; } +/* Submit control IN URB on demand to process the WMT event */ + err =btusb_mtk_submit_wmt_recv_urb (hdev); +if (err <0 ) +return err; +/* The vendor specific WMT commands are all answered by a vendor * specific event and will have the Command Status or Command * Complete as with usual HCI command flow control.
@@ -3263,6 +3263,11 @@ static int btusb_setup_qca_download_fw(struct hci_dev *hdev, sent += size; count -= size; +/* ep2 need time to switch from function acl to function dfu, +* so we add 20ms delay here. +*/ +msleep (20 ); +while (count) { size =min_t (size_t, count,QCA_DFU_PACKET_LEN );
drivers/char/ipmi/ipmi_watchdog.c +12 -10
@@ -366,16 +366,18 @@ static int __ipmi_set_timeout(struct ipmi_smi_msg *smi_msg, data[0 ] =0 ;WDOG_SET_TIMER_USE (data[0 ],WDOG_TIMER_USE_SMS_OS ); -if ((ipmi_version_major >1 ) - || ((ipmi_version_major ==1 ) && (ipmi_version_minor >=5 ))) { -/* This is an IPMI 1.5-only feature. */ - data[0 ] |=WDOG_DONT_STOP_ON_SET ; - }else if (ipmi_watchdog_state !=WDOG_TIMEOUT_NONE ) { -/* -* In ipmi 1.0, setting the timer stops the watchdog, we -* need to start it back up again. -*/ - hbnow =1 ; +if (ipmi_watchdog_state !=WDOG_TIMEOUT_NONE ) { +if ((ipmi_version_major >1 ) || + ((ipmi_version_major ==1 ) && (ipmi_version_minor >=5 ))) { +/* This is an IPMI 1.5-only feature. */ + data[0 ] |=WDOG_DONT_STOP_ON_SET ; + }else { +/* +* In ipmi 1.0, setting the timer stops the watchdog, we +* need to start it back up again. +*/ + hbnow =1 ; + } } data[1 ] =0 ;
drivers/clk/renesas/r8a77995-cpg-mssr.c +1 -0
@@ -75,6 +75,7 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {DEF_RATE (".oco" ,CLK_OCO ,8 *1000 *1000 ),/* Core Clock Outputs */ +DEF_FIXED ("za2" ,R8A77995_CLK_ZA2 ,CLK_PLL0D3 ,2 ,1 ),DEF_FIXED ("z2" ,R8A77995_CLK_Z2 ,CLK_PLL0D3 ,1 ,1 ),DEF_FIXED ("ztr" ,R8A77995_CLK_ZTR ,CLK_PLL1 ,6 ,1 ), DEF_FIXED("zt", R8A77995_CLK_ZT, CLK_PLL1, 4, 1),
drivers/clk/tegra/clk-pll.c +4 -5
@@ -1089,7 +1089,8 @@ static int clk_pllu_enable(struct clk_hw *hw)if (pll->lock)spin_lock_irqsave (pll->lock, flags); -_clk_pll_enable (hw); +if (!clk_pll_is_enabled (hw)) +_clk_pll_enable (hw); ret =clk_pll_wait_for_lock (pll);if (ret <0 )
@@ -1706,15 +1707,13 @@ static int clk_pllu_tegra114_enable(struct clk_hw *hw)return -EINVAL ; } -if (clk_pll_is_enabled (hw)) -return 0 ; - input_rate =clk_hw_get_rate (__clk_get_hw (osc));if (pll->lock)spin_lock_irqsave (pll->lock, flags); -_clk_pll_enable (hw); +if (!clk_pll_is_enabled (hw)) +_clk_pll_enable (hw); ret =clk_pll_wait_for_lock (pll);if (ret <0 )
drivers/clocksource/arm_arch_timer.c +1 -1
@@ -348,7 +348,7 @@ static u64 notrace arm64_858921_read_cntvct_el0(void)do { \ _val =read_sysreg (reg); \ _retries--; \ - }while (((_val +1 ) &GENMASK (9 ,0 )) <=1 && _retries); \ + }while (((_val +1 ) &GENMASK (8 ,0 )) <=1 && _retries); \ \WARN_ON_ONCE (!_retries); \ _val; \
drivers/crypto/ccp/psp-dev.c +4 -0
@@ -40,6 +40,10 @@ static int psp_probe_timeout = 5;module_param (psp_probe_timeout, int,0644 );MODULE_PARM_DESC (psp_probe_timeout," default timeout value, in seconds, during PSP device probe" ); +MODULE_FIRMWARE ("amd/amd_sev_fam17h_model0xh.sbin" );/* 1st gen EPYC */ +MODULE_FIRMWARE ("amd/amd_sev_fam17h_model3xh.sbin" );/* 2nd gen EPYC */ +MODULE_FIRMWARE ("amd/amd_sev_fam19h_model0xh.sbin" );/* 3rd gen EPYC */ +static bool psp_dead;static int psp_timeout;
drivers/extcon/extcon-intel-mrfld.c +9 -0
@@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)struct intel_soc_pmic *pmic =dev_get_drvdata (dev->parent);struct regmap *regmap = pmic->regmap;struct mrfld_extcon_data *data; +unsigned int status;unsigned int id;int irq, ret;
@@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)/* Get initial state */ mrfld_extcon_role_detect (data); +/* +* Cached status value is used for cable detection, see comments +* in mrfld_extcon_cable_detect(), we need to sync cached value +* with a real state of the hardware. +*/ +regmap_read (regmap,BCOVE_SCHGRIRQ1 , &status); + data->status = status; +mrfld_extcon_clear (data,BCOVE_MIRQLVL1 ,BCOVE_LVL1_CHGR );mrfld_extcon_clear (data,BCOVE_MCHGRIRQ1 ,BCOVE_CHGRIRQ_ALL );
drivers/firmware/qemu_fw_cfg.c +3 -5
@@ -296,15 +296,13 @@ static int fw_cfg_do_platform_probe(struct platform_device *pdev)return 0 ; } -static ssize_t fw_cfg_showrev (struct kobject *k,struct attribute *a,char *buf) +static ssize_t fw_cfg_showrev (struct kobject *k,struct kobj_attribute *a, +char *buf) {return sprintf (buf,"%u\n" , fw_cfg_rev); } -static const struct { -struct attribute attr; -ssize_t (*show)(struct kobject *k,struct attribute *a,char *buf); -} fw_cfg_rev_attr = { +static const struct kobj_attribute fw_cfg_rev_attr = { .attr = { .name ="rev" , .mode =S_IRUSR }, .show = fw_cfg_showrev, };
drivers/fpga/stratix10-soc.c +1 -0
@@ -476,6 +476,7 @@ static int s10_remove(struct platform_device *pdev)struct s10_priv *priv = mgr->priv;fpga_mgr_unregister (mgr); +fpga_mgr_free (mgr);stratix10_svc_free_channel (priv->chan);return 0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +4 -17
@@ -55,12 +55,6 @@ static struct {spinlock_t mem_limit_lock; } kfd_mem_limit; -/* Struct used for amdgpu_amdkfd_bo_validate */ -struct amdgpu_vm_parser { -uint32_t domain; -bool wait; -}; -static const char *const domain_bit_to_string[] = {"CPU" ,"GTT" ,
@@ -293,11 +287,9 @@ static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain,return ret; } -static int amdgpu_amdkfd_validate (void *param,struct amdgpu_bo *bo) +static int amdgpu_amdkfd_validate_vm_bo (void *_unused,struct amdgpu_bo *bo) { -struct amdgpu_vm_parser *p = param; - -return amdgpu_amdkfd_bo_validate (bo, p->domain, p->wait); +return amdgpu_amdkfd_bo_validate (bo, bo->allowed_domains, false); }/* vm_validate_pt_pd_bos - Validate page table and directory BOs
@@ -311,20 +303,15 @@ static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm) {struct amdgpu_bo *pd = vm->root.base.bo;struct amdgpu_device *adev =amdgpu_ttm_adev (pd->tbo.bdev); -struct amdgpu_vm_parser param;int ret; - param.domain =AMDGPU_GEM_DOMAIN_VRAM ; - param.wait = false; - - ret =amdgpu_vm_validate_pt_bos (adev, vm, amdgpu_amdkfd_validate, - ¶m); + ret =amdgpu_vm_validate_pt_bos (adev, vm, amdgpu_amdkfd_validate_vm_bo,NULL );if (ret) {pr_err ("amdgpu: failed to validate PT BOs\n" );return ret; } - ret =amdgpu_amdkfd_validate (¶m, pd); + ret =amdgpu_amdkfd_validate_vm_bo (NULL , pd);if (ret) {pr_err ("amdgpu: failed to validate PD\n" );return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -2291,7 +2291,7 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) AMD_IP_BLOCK_TYPE_IH, }; -for (i =0 ; i <ARRAY_SIZE (ip_order); i++) { +for (i =0 ; i < adev->num_ip_blocks; i++) {int j;struct amdgpu_ip_block *block;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +12 -10
@@ -1584,7 +1584,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm, struct qcm_process_device *qpd) {int retval; -struct queue *q, *next; +struct queue *q;struct kernel_queue *kq, *kq_next;struct mqd_manager *mqd_mgr;struct device_process_node *cur, *next_dpn;
@@ -1639,24 +1639,26 @@ static int process_termination_cpsch(struct device_queue_manager *dqm, qpd->reset_wavefronts = false; } -dqm_unlock (dqm); - -/* Outside the DQM lock because under the DQM lock we can't do -* reclaim or take other locks that others hold while reclaiming. -*/ -if (found) -kfd_dec_compute_active (dqm->dev); -/* Lastly, free mqd resources. * Do free_mqd() after dqm_unlock to avoid circular locking. */ -list_for_each_entry_safe (q, next, &qpd->queues_list, list) { +while (!list_empty (&qpd->queues_list)) { + q = list_first_entry(&qpd->queues_list, struct queue, list); mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type ( q->properties.type)];list_del (&q->list); qpd->queue_count--; +dqm_unlock (dqm); mqd_mgr->free_mqd (mqd_mgr, q->mqd, q->mqd_mem_obj); +dqm_lock (dqm); } +dqm_unlock (dqm); + +/* Outside the DQM lock because under the DQM lock we can't do +* reclaim or take other locks that others hold while reclaiming. +*/ +if (found) +kfd_dec_compute_active (dqm->dev);return retval; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +23 -1
@@ -2632,6 +2632,23 @@ static int fill_dc_scaling_info(const struct drm_plane_state *state, scaling_info->src_rect.x = state->src_x >>16 ; scaling_info->src_rect.y = state->src_y >>16 ; +/* +* For reasons we don't (yet) fully understand a non-zero +* src_y coordinate into an NV12 buffer can cause a +* system hang. To avoid hangs (and maybe be overly cautious) +* let's reject both non-zero src_x and src_y. +* +* We currently know of only one use-case to reproduce a +* scenario with non-zero src_x and src_y for NV12, which +* is to gesture the YouTube Android app into full screen +* on ChromeOS. +*/ +if (state->fb && + state->fb->format->format ==DRM_FORMAT_NV12 && + (scaling_info->src_rect.x !=0 || + scaling_info->src_rect.y !=0 )) +return -EINVAL ; +/* * For reasons we don't (yet) fully understand a non-zero * src_y coordinate into an NV12 buffer can cause a
@@ -6832,7 +6849,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,BUG_ON (dm_new_crtc_state->stream ==NULL );/* Scaling or underscan settings */ -if (is_scaling_state_different (dm_old_conn_state, dm_new_conn_state)) +if (is_scaling_state_different (dm_old_conn_state, dm_new_conn_state) || +drm_atomic_crtc_needs_modeset (new_crtc_state))update_stream_scaling_settings ( &new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream);
@@ -7406,6 +7424,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled)continue ; + ret =amdgpu_dm_verify_lut_sizes (new_crtc_state); +if (ret) + goto fail; +if (!new_crtc_state->enable)continue ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -0
@@ -387,6 +387,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,#define MAX_COLOR_LEGACY_LUT_ENTRIES 256void amdgpu_dm_init_color_mod (void ); +int amdgpu_dm_verify_lut_sizes (const struct drm_crtc_state *crtc_state);int amdgpu_dm_update_crtc_color_mgmt (struct dm_crtc_state *crtc);int amdgpu_dm_update_plane_color_mgmt (struct dm_crtc_state *crtc,struct dc_plane_state *dc_plane_state);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +35 -6
55 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -0
@@ -1284,6 +1284,8 @@ static void set_dp_mst_mode(struct dc_link *link, bool mst_enable) link->type = dc_connection_single; link->local_sink = link->remote_sinks[0 ]; link->local_sink->sink_signal =SIGNAL_TYPE_DISPLAY_PORT ; +dc_sink_retain (link->local_sink); +dm_helpers_dp_mst_stop_top_mgr (link->ctx, link); }else if (mst_enable == true && link->type == dc_connection_single && link->remote_sinks[0 ] !=NULL ) {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +6 -3
@@ -484,10 +484,13 @@ static enum lb_memory_config dpp1_dscl_find_lb_memory_config(struct dcn10_dpp *dint vtaps_c = scl_data->taps.v_taps_c;int ceil_vratio =dc_fixpt_ceil (scl_data->ratios.vert);int ceil_vratio_c =dc_fixpt_ceil (scl_data->ratios.vert_c); -enum lb_memory_config mem_cfg =LB_MEMORY_CONFIG_0 ; -if (dpp->base.ctx->dc->debug.use_max_lb) -return mem_cfg; +if (dpp->base.ctx->dc->debug.use_max_lb) { +if (scl_data->format ==PIXEL_FORMAT_420BPP8 + || scl_data->format ==PIXEL_FORMAT_420BPP10 ) +return LB_MEMORY_CONFIG_3 ; +return LB_MEMORY_CONFIG_0 ; + } dpp->base.caps->dscl_calc_lb_num_partitions ( scl_data,LB_MEMORY_CONFIG_1 , &num_part_y, &num_part_c);
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -1
@@ -126,7 +126,7 @@ void dcn20_dccg_init(struct dce_hwseq *hws)REG_WRITE (MILLISECOND_TIME_BASE_DIV ,0x1186a0 );/* This value is dependent on the hardware pipeline delay so set once per SOC */ -REG_WRITE (DISPCLK_FREQ_CHANGE_CNTL ,0x801003c ); +REG_WRITE (DISPCLK_FREQ_CHANGE_CNTL ,0xe01003c ); }void dcn20_display_init (struct dc *dc) {
drivers/gpu/drm/amd/display/dc/irq_types.h +1 -1
@@ -163,7 +163,7 @@ enum irq_type };#define DAL_VALID_IRQ_SRC_NUM (src) \ - ((src) <= DAL_IRQ_SOURCES_NUMBER && (src) > DC_IRQ_SOURCE_INVALID) + ((src) < DAL_IRQ_SOURCES_NUMBER && (src) > DC_IRQ_SOURCE_INVALID)/* Number of Page Flip IRQ Sources. */ #define DAL_PFLIP_IRQ_SRC_NUM \
drivers/gpu/drm/amd/include/navi10_enum.h +1 -1
@@ -430,7 +430,7 @@ ARRAY_2D_DEPTH = 0x00000001,*/ typedef enum ENUM_NUM_SIMD_PER_CU { -NUM_SIMD_PER_CU =0x00000004 , +NUM_SIMD_PER_CU =0x00000002 , }ENUM_NUM_SIMD_PER_CU ;/*
drivers/gpu/drm/arm/malidp_planes.c +7 -2
@@ -922,6 +922,11 @@ static const struct drm_plane_helper_funcs malidp_de_plane_helper_funcs = { .atomic_disable = malidp_de_plane_disable, }; +static const uint64_t linear_only_modifiers[] = { +DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID +}; +int malidp_de_planes_init (struct drm_device *drm) {struct malidp_drm *malidp = drm->dev_private;
@@ -985,8 +990,8 @@ int malidp_de_planes_init(struct drm_device *drm)*/ ret =drm_universal_plane_init (drm, &plane->base, crtcs, &malidp_de_plane_funcs, formats, n, - (id ==DE_SMART ) ?NULL : modifiers, plane_type, -NULL ); + (id ==DE_SMART ) ? linear_only_modifiers : modifiers, + plane_type,NULL );if (ret <0 ) goto cleanup;
drivers/gpu/drm/bridge/cdns-dsi.c +1 -1
@@ -1026,7 +1026,7 @@ static ssize_t cdns_dsi_transfer(struct mipi_dsi_host *host,struct mipi_dsi_packet packet;int ret, i, tx_len, rx_len; - ret =pm_runtime_get_sync (host->dev); + ret =pm_runtime_resume_and_get (host->dev);if (ret <0 )return ret;
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +1 -1
@@ -240,7 +240,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)drm_connector_list_iter_end (&conn_iter); } - ret =pm_runtime_get_sync (crtc->dev->dev); + ret =pm_runtime_resume_and_get (crtc->dev->dev);if (ret <0 ) {DRM_ERROR ("Failed to enable power domain: %d\n" , ret);return ret;
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +0 -2
@@ -88,8 +88,6 @@ static int mdp4_hw_init(struct msm_kms *kms)if (mdp4_kms->rev >1 )mdp4_write (mdp4_kms,REG_MDP4_RESET_STATUS ,1 ); - dev->mode_config.allow_fb_modifiers = true; - out:pm_runtime_put_sync (dev->dev);
drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c +7 -1
@@ -347,6 +347,12 @@ enum mdp4_pipe mdp4_plane_pipe(struct drm_plane *plane)return mdp4_plane->pipe; } +static const uint64_t supported_format_modifiers[] = { +DRM_FORMAT_MOD_SAMSUNG_64_32_TILE , +DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID +}; +/* initialize plane */ struct drm_plane *mdp4_plane_init (struct drm_device *dev,enum mdp4_pipe pipe_id,bool private_plane)
@@ -375,7 +381,7 @@ struct drm_plane *mdp4_plane_init(struct drm_device *dev, type = private_plane ?DRM_PLANE_TYPE_PRIMARY :DRM_PLANE_TYPE_OVERLAY ; ret =drm_universal_plane_init (dev, plane,0xff , &mdp4_plane_funcs, mdp4_plane->formats, mdp4_plane->nformats, -NULL , type,NULL ); + supported_format_modifiers, type,NULL );if (ret) goto fail;
drivers/gpu/drm/mxsfb/Kconfig +0 -1
@@ -10,7 +10,6 @@ config DRM_MXSFB depends on COMMON_CLK select DRM_MXS select DRM_KMS_HELPER - select DRM_KMS_FB_HELPER select DRM_KMS_CMA_HELPER select DRM_PANEL help
drivers/gpu/drm/radeon/radeon_display.c +1 -0
@@ -1333,6 +1333,7 @@ radeon_user_framebuffer_create(struct drm_device *dev,/* Handle is imported dma-buf, so cannot be migrated to VRAM for scanout */ if (obj->import_attach) {DRM_DEBUG_KMS ("Cannot create framebuffer from imported dma_buf\n" ); +drm_gem_object_put (obj);return ERR_PTR (-EINVAL ); }
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +0 -4
@@ -231,7 +231,6 @@ struct dw_mipi_dsi_rockchip {struct dw_mipi_dsi *dmd;const struct rockchip_dw_dsi_chip_data *cdata;struct dw_mipi_dsi_plat_data pdata; -int devcnt; };struct dphy_pll_parameter_map {
@@ -1001,9 +1000,6 @@ static int dw_mipi_dsi_rockchip_remove(struct platform_device *pdev) {struct dw_mipi_dsi_rockchip *dsi =platform_get_drvdata (pdev); -if (dsi->devcnt ==0 ) -component_del (dsi->dev, &dw_mipi_dsi_rockchip_ops); -dw_mipi_dsi_remove (dsi->dmd);return 0 ;
drivers/gpu/drm/scheduler/sched_entity.c +5 -0
@@ -235,11 +235,16 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f,static void drm_sched_entity_kill_jobs (struct drm_sched_entity *entity) {struct drm_sched_job *job; +struct dma_fence *f;int r;while ((job =to_drm_sched_job (spsc_queue_pop (&entity->job_queue)))) {struct drm_sched_fence *s_fence = job->s_fence; +/* Wait for all dependencies to avoid data corruptions */ +while ((f = job->sched->ops->dependency (job, entity))) +dma_fence_wait (f, false); +drm_sched_fence_scheduled (s_fence);dma_fence_set_error (&s_fence->finished, -ESRCH );
drivers/gpu/drm/tegra/dc.c +8 -2
@@ -919,6 +919,11 @@ static const struct drm_plane_helper_funcs tegra_cursor_plane_helper_funcs = { .atomic_disable = tegra_cursor_atomic_disable, }; +static const uint64_t linear_modifiers[] = { +DRM_FORMAT_MOD_LINEAR , +DRM_FORMAT_MOD_INVALID +}; +static struct drm_plane *tegra_dc_cursor_plane_create (struct drm_device *drm,struct tegra_dc *dc) {
@@ -947,7 +952,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm, err =drm_universal_plane_init (drm, &plane->base, possible_crtcs, &tegra_plane_funcs, formats, - num_formats,NULL , + num_formats, linear_modifiers,DRM_PLANE_TYPE_CURSOR ,NULL );if (err <0 ) {kfree (plane);
@@ -1065,7 +1070,8 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, err =drm_universal_plane_init (drm, &plane->base, possible_crtcs, &tegra_plane_funcs, formats, - num_formats,NULL , type,NULL ); + num_formats, linear_modifiers, + type,NULL );if (err <0 ) {kfree (plane);return ERR_PTR (err);
drivers/gpu/drm/tegra/drm.c +0 -2
@@ -122,8 +122,6 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags) drm->mode_config.max_width =4096 ; drm->mode_config.max_height =4096 ; - drm->mode_config.allow_fb_modifiers = true; - drm->mode_config.normalize_zpos = true; drm->mode_config.funcs = &tegra_drm_mode_config_funcs;
drivers/gpu/drm/vc4/vc4_drv.h +1 -1
@@ -750,7 +750,7 @@ bool vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,void vc4_crtc_handle_vblank (struct vc4_crtc *crtc);void vc4_crtc_txp_armed (struct drm_crtc_state *state);void vc4_crtc_get_margins (struct drm_crtc_state *state, -unsigned int *right,unsigned int *left, +unsigned int *left,unsigned int *right,unsigned int *top,unsigned int *bottom);/* vc4_debugfs.c */
drivers/gpu/drm/virtio/virtgpu_kms.c +1 -0
@@ -218,6 +218,7 @@ int virtio_gpu_init(struct drm_device *dev) err_vbufs: vgdev->vdev->config->del_vqs (vgdev->vdev); err_vqs: + dev->dev_private =NULL ;kfree (vgdev);return ret; }
drivers/gpu/drm/zte/Kconfig +0 -1
@@ -3,7 +3,6 @@ config DRM_ZTE tristate "DRM Support for ZTE SoCs" depends on DRM && ARCH_ZX select DRM_KMS_CMA_HELPER - select DRM_KMS_FB_HELPER select DRM_KMS_HELPER select SND_SOC_HDMI_CODEC if SND_SOC select VIDEOMODE_HELPERS
drivers/hwtracing/coresight/coresight-tmc-etf.c +1 -1
@@ -528,7 +528,7 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev, buf_ptr = buf->data_pages[cur] + offset; *buf_ptr =readl_relaxed (drvdata->base +TMC_RRD ); -if (lost && *barrier) { +if (lost && i <CORESIGHT_BARRIER_PKT_SIZE ) { *buf_ptr = *barrier; barrier++; }
drivers/infiniband/core/cma.c +2 -1
@@ -2719,7 +2719,8 @@ static int cma_resolve_ib_route(struct rdma_id_private *id_priv,cma_init_resolve_route_work (work, id_priv); - route->path_rec =kmalloc (sizeof *route->path_rec,GFP_KERNEL ); +if (!route->path_rec) + route->path_rec =kmalloc (sizeof *route->path_rec,GFP_KERNEL );if (!route->path_rec) { ret = -ENOMEM ; goto err1;
drivers/infiniband/hw/cxgb4/qp.c +1 -0
@@ -295,6 +295,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,if (user && (!wq->sq.bar2_pa || (need_rq && !wq->rq.bar2_pa))) {pr_warn ("%s: sqid %u or rqid %u not in BAR2 range\n" ,pci_name (rdev->lldi.pdev), wq->sq.qid, wq->rq.qid); + ret = -EINVAL ; goto free_dma; }
drivers/infiniband/sw/rxe/rxe_mr.c +1 -1
@@ -173,7 +173,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start,if (IS_ERR (umem)) {pr_warn ("err %d from rxe_umem_get\n" , (int )PTR_ERR (umem)); - err = -EINVAL ; + err =PTR_ERR (umem); goto err1; }
drivers/ipack/carriers/tpci200.c +4 -1
@@ -596,8 +596,11 @@ static int tpci200_pci_probe(struct pci_dev *pdev, out_err_bus_register:tpci200_uninstall (tpci200); +/* tpci200->info->cfg_regs is unmapped in tpci200_uninstall */ + tpci200->info->cfg_regs =NULL ; out_err_install: -iounmap (tpci200->info->cfg_regs); +if (tpci200->info->cfg_regs) +iounmap (tpci200->info->cfg_regs); out_err_ioremap:pci_release_region (pdev,TPCI200_CFG_MEM_BAR ); out_err_pci_request:
drivers/isdn/hardware/mISDN/hfcpci.c +1 -1
@@ -2341,7 +2341,7 @@ static void __exitHFC_cleanup (void) {if (timer_pending (&hfc_tl)) -del_timer (&hfc_tl); +del_timer_sync (&hfc_tl);pci_unregister_driver (&hfc_driver); }
drivers/md/persistent-data/dm-btree-remove.c +2 -1
@@ -549,7 +549,8 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,delete_at (n, index); } - *new_root =shadow_root (&spine); +if (!r) + *new_root =shadow_root (&spine);exit_shadow_spine (&spine);return r;
drivers/md/persistent-data/dm-space-map-disk.c +8 -1
@@ -171,6 +171,14 @@ static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b)* Any block we allocate has to be free in both the old and current ll. */ r =sm_ll_find_common_free_block (&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b); +if (r == -ENOSPC ) { +/* +* There's no free block between smd->begin and the end of the metadata device. +* We search before smd->begin in case something has been freed. +*/ + r =sm_ll_find_common_free_block (&smd->old_ll, &smd->ll,0 , smd->begin, b); + } +if (r)return r;
@@ -199,7 +207,6 @@ static int sm_disk_commit(struct dm_space_map *sm)return r;memcpy (&smd->old_ll, &smd->ll,sizeof (smd->old_ll)); - smd->begin =0 ; smd->nr_allocated_this_transaction =0 ; r =sm_disk_get_nr_free (sm, &nr_free);
drivers/md/persistent-data/dm-space-map-metadata.c +8 -1
@@ -452,6 +452,14 @@ static int sm_metadata_new_block_(struct dm_space_map *sm, dm_block_t *b)* Any block we allocate has to be free in both the old and current ll. */ r =sm_ll_find_common_free_block (&smm->old_ll, &smm->ll, smm->begin, smm->ll.nr_blocks, b); +if (r == -ENOSPC ) { +/* +* There's no free block between smm->begin and the end of the metadata device. +* We search before smm->begin in case something has been freed. +*/ + r =sm_ll_find_common_free_block (&smm->old_ll, &smm->ll,0 , smm->begin, b); + } +if (r)return r;
@@ -503,7 +511,6 @@ static int sm_metadata_commit(struct dm_space_map *sm)return r;memcpy (&smm->old_ll, &smm->ll,sizeof (smm->old_ll)); - smm->begin =0 ; smm->allocated_this_transaction =0 ;return 0 ;
drivers/media/i2c/saa6588.c +2 -2
@@ -380,7 +380,7 @@ static void saa6588_configure(struct saa6588 *s)/* ---------------------------------------------------------------------- */ -static long saa6588_ioctl (struct v4l2_subdev *sd,unsigned int cmd,void *arg) +static long saa6588_command (struct v4l2_subdev *sd,unsigned int cmd,void *arg) {struct saa6588 *s =to_saa6588 (sd);struct saa6588_command *a = arg;
@@ -433,7 +433,7 @@ static int saa6588_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)/* ----------------------------------------------------------------------- */ static const struct v4l2_subdev_core_ops saa6588_core_ops = { - .ioctl = saa6588_ioctl, + .command = saa6588_command, };static const struct v4l2_subdev_tuner_ops saa6588_tuner_ops = {
drivers/media/pci/bt8xx/bttv-driver.c +3 -3
@@ -3187,7 +3187,7 @@ static int radio_release(struct file *file) btv->radio_user--; -bttv_call_all (btv, core, ioctl,SAA6588_CMD_CLOSE , &cmd); +bttv_call_all (btv, core, command,SAA6588_CMD_CLOSE , &cmd);if (btv->radio_user ==0 ) btv->has_radio_tuner =0 ;
@@ -3268,7 +3268,7 @@ static ssize_t radio_read(struct file *file, char __user *data, cmd.result = -ENODEV ;radio_enable (btv); -bttv_call_all (btv, core, ioctl,SAA6588_CMD_READ , &cmd); +bttv_call_all (btv, core, command,SAA6588_CMD_READ , &cmd);return cmd.result; }
@@ -3289,7 +3289,7 @@ static __poll_t radio_poll(struct file *file, poll_table *wait) cmd.instance = file; cmd.event_list = wait; cmd.poll_mask = res; -bttv_call_all (btv, core, ioctl,SAA6588_CMD_POLL , &cmd); +bttv_call_all (btv, core, command,SAA6588_CMD_POLL , &cmd);return cmd.poll_mask; }
drivers/media/pci/saa7134/saa7134-video.c +3 -3
@@ -1179,7 +1179,7 @@ static int video_release(struct file *file)saa_call_all (dev, tuner, standby);if (vdev->vfl_type ==VFL_TYPE_RADIO ) -saa_call_all (dev, core, ioctl,SAA6588_CMD_CLOSE , &cmd); +saa_call_all (dev, core, command,SAA6588_CMD_CLOSE , &cmd);mutex_unlock (&dev->lock);return 0 ;
@@ -1198,7 +1198,7 @@ static ssize_t radio_read(struct file *file, char __user *data, cmd.result = -ENODEV ;mutex_lock (&dev->lock); -saa_call_all (dev, core, ioctl,SAA6588_CMD_READ , &cmd); +saa_call_all (dev, core, command,SAA6588_CMD_READ , &cmd);mutex_unlock (&dev->lock);return cmd.result;
@@ -1214,7 +1214,7 @@ static __poll_t radio_poll(struct file *file, poll_table *wait) cmd.event_list = wait; cmd.poll_mask =0 ;mutex_lock (&dev->lock); -saa_call_all (dev, core, ioctl,SAA6588_CMD_POLL , &cmd); +saa_call_all (dev, core, command,SAA6588_CMD_POLL , &cmd);mutex_unlock (&dev->lock);return rc | cmd.poll_mask;
drivers/media/platform/davinci/vpbe_display.c +1 -1
@@ -48,7 +48,7 @@ static int venc_is_second_field(struct vpbe_display *disp_dev) ret =v4l2_subdev_call (vpbe_dev->venc, core, - ioctl, + command,VENC_GET_FLD , &val);if (ret <0 ) {
drivers/media/platform/davinci/vpbe_venc.c +2 -4
@@ -521,9 +521,7 @@ static int venc_s_routing(struct v4l2_subdev *sd, u32 input, u32 output,return ret; } -static long venc_ioctl (struct v4l2_subdev *sd, -unsigned int cmd, -void *arg) +static long venc_command (struct v4l2_subdev *sd,unsigned int cmd,void *arg) {u32 val;
@@ -542,7 +540,7 @@ static long venc_ioctl(struct v4l2_subdev *sd, }static const struct v4l2_subdev_core_ops venc_core_ops = { - .ioctl = venc_ioctl, + .command = venc_command, };static const struct v4l2_subdev_video_ops venc_video_ops = {
drivers/media/rc/bpf-lirc.c +2 -1
@@ -329,7 +329,8 @@ int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr) }if (attr->query.prog_cnt !=0 && prog_ids && cnt) - ret =bpf_prog_array_copy_to_user (progs, prog_ids, cnt); + ret =bpf_prog_array_copy_to_user (progs, prog_ids, + attr->query.prog_cnt); unlock:mutex_unlock (&ir_raw_handler_lock);
drivers/media/usb/dvb-usb/dtv5100.c +5 -2
@@ -26,6 +26,7 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr, u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) { struct dtv5100_state *st = d->priv; +unsigned int pipe;u8 request;u8 type;u16 value;
@@ -34,6 +35,7 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,switch (wlen) {case 1 :/* write { reg }, read { value } */ + pipe =usb_rcvctrlpipe (d->udev,0 ); request = (addr ==DTV5100_DEMOD_ADDR ?DTV5100_DEMOD_READ :DTV5100_TUNER_READ ); type =USB_TYPE_VENDOR |USB_DIR_IN ;
@@ -41,6 +43,7 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,break ;case 2 :/* write { reg, value } */ + pipe =usb_sndctrlpipe (d->udev,0 ); request = (addr ==DTV5100_DEMOD_ADDR ?DTV5100_DEMOD_WRITE :DTV5100_TUNER_WRITE ); type =USB_TYPE_VENDOR |USB_DIR_OUT ;
@@ -54,7 +57,7 @@ static int dtv5100_i2c_msg(struct dvb_usb_device *d, u8 addr,memcpy (st->data, rbuf, rlen);msleep (1 );/* avoid I2C errors */ -return usb_control_msg (d->udev,usb_rcvctrlpipe (d->udev,0 ), request, +return usb_control_msg (d->udev, pipe, request, type, value, index, st->data, rlen,DTV5100_USB_TIMEOUT ); }
@@ -141,7 +144,7 @@ static int dtv5100_probe(struct usb_interface *intf,/* initialize non qt1010/zl10353 part? */ for (i =0 ; dtv5100_init[i].request; i++) { - ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), dtv5100_init[i].request, USB_TYPE_VENDOR | USB_DIR_OUT, dtv5100_init[i].value,
drivers/media/usb/gspca/sq905.c +1 -1
@@ -116,7 +116,7 @@ static int sq905_command(struct gspca_dev *gspca_dev, u16 index) } ret = usb_control_msg(gspca_dev->dev, - usb_sndctrlpipe(gspca_dev->dev, 0), + usb_rcvctrlpipe(gspca_dev->dev, 0), USB_REQ_SYNCH_FRAME, /* request */ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, SQ905_PING, 0, gspca_dev->usb_buf, 1,
drivers/media/usb/gspca/sunplus.c +6 -2
@@ -242,6 +242,10 @@ static void reg_r(struct gspca_dev *gspca_dev,gspca_err (gspca_dev,"reg_r: buffer overflow\n" );return ; } +if (len ==0 ) { +gspca_err (gspca_dev,"reg_r: zero-length read\n" ); +return ; + }if (gspca_dev->usb_err <0 )return ; ret = usb_control_msg(gspca_dev->dev,
@@ -250,7 +254,7 @@ static void reg_r(struct gspca_dev *gspca_dev,USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE ,0 ,/* value */ index, - len ? gspca_dev->usb_buf :NULL , len, + gspca_dev->usb_buf, len, 500);if (ret <0 ) {pr_err ("reg_r err %d\n" , ret);
@@ -727,7 +731,7 @@ static int sd_start(struct gspca_dev *gspca_dev)case MegaImageVI:reg_w_riv (gspca_dev,0xf0 ,0 ,0 );spca504B_WaitCmdStatus (gspca_dev); -reg_r (gspca_dev,0xf0 ,4 ,0 ); +reg_w_riv (gspca_dev,0xf0 ,4 ,0 );spca504B_WaitCmdStatus (gspca_dev);break ;default :
drivers/media/usb/uvc/uvc_video.c +27 -0
@@ -124,10 +124,37 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,static void uvc_fixup_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl) { +static const struct usb_device_id elgato_cam_link_4k = { +USB_DEVICE (0x0fd9 ,0x0066 ) + };struct uvc_format *format =NULL ;struct uvc_frame *frame =NULL ;unsigned int i; +/* +* The response of the Elgato Cam Link 4K is incorrect: The second byte +* contains bFormatIndex (instead of being the second byte of bmHint). +* The first byte is always zero. The third byte is always 1. +* +* The UVC 1.5 class specification defines the first five bits in the +* bmHint bitfield. The remaining bits are reserved and should be zero. +* Therefore a valid bmHint will be less than 32. +* +* Latest Elgato Cam Link 4K firmware as of 2021-03-23 needs this fix. +* MCU: 20.02.19, FPGA: 67 +*/ +if (usb_match_one_id (stream->dev->intf, &elgato_cam_link_4k) && + ctrl->bmHint >255 ) { +u8 corrected_format_index = ctrl->bmHint >>8 ; + +/* uvc_dbg(stream->dev, VIDEO, +"Correct USB video probe response from {bmHint: 0x%04x, bFormatIndex: %u} to {bmHint: 0x%04x, bFormatIndex: %u}\n", +ctrl->bmHint, ctrl->bFormatIndex, +1, corrected_format_index); */ + ctrl->bmHint =1 ; + ctrl->bFormatIndex = corrected_format_index; + } +for (i =0 ; i < stream->nformats; ++i) {if (stream->format[i].index == ctrl->bFormatIndex) { format = &stream->format[i];
drivers/media/usb/zr364xx/zr364xx.c +1 -0
@@ -1037,6 +1037,7 @@ static int zr364xx_start_readpipe(struct zr364xx_camera *cam)DBG ("submitting URB %p\n" , pipe_info->stream_urb); retval =usb_submit_urb (pipe_info->stream_urb,GFP_KERNEL );if (retval) { +usb_free_urb (pipe_info->stream_urb); printk(KERN_ERR KBUILD_MODNAME ": start read pipe failed\n");return retval; }
drivers/mmc/core/core.c +5 -2
@@ -953,11 +953,14 @@ int mmc_execute_tuning(struct mmc_card *card) err = host->ops->execute_tuning (host, opcode); -if (err) +if (err) {pr_err ("%s: tuning execution failed: %d\n" ,mmc_hostname (host), err); -else + }else { + host->retune_now =0 ; + host->need_retune =0 ;mmc_retune_enable (host); + }return err; }
drivers/mmc/core/sd.c +6 -4
@@ -793,11 +793,13 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)return err;/* -* In case CCS and S18A in the response is set, start Signal Voltage -* Switch procedure. SPI mode doesn't support CMD11. +* In case the S18A bit is set in the response, let's start the signal +* voltage switch procedure. SPI mode doesn't support CMD11. +* Note that, according to the spec, the S18A bit is not valid unless +* the CCS bit is set as well. We deliberately deviate from the spec in +* regards to this, which allows UHS-I to be supported for SDSC cards. */ -if (!mmc_host_is_spi (host) && rocr && - ((*rocr &0x41000000 ) ==0x41000000 )) { +if (!mmc_host_is_spi (host) && rocr && (*rocr &0x01000000 )) { err =mmc_set_uhs_voltage (host, pocr);if (err == -EAGAIN ) { retries--;
drivers/mmc/host/sdhci.c +4 -0
@@ -1511,6 +1511,10 @@ static u16 sdhci_get_preset_value(struct sdhci_host *host)u16 preset =0 ;switch (host->timing) { +case MMC_TIMING_MMC_HS : +case MMC_TIMING_SD_HS : + preset =sdhci_readw (host,SDHCI_PRESET_FOR_HIGH_SPEED ); +break ;case MMC_TIMING_UHS_SDR12 : preset =sdhci_readw (host,SDHCI_PRESET_FOR_SDR12 );break ;
drivers/mmc/host/sdhci.h +1 -0
@@ -261,6 +261,7 @@/* 60-FB reserved */ +#define SDHCI_PRESET_FOR_HIGH_SPEED 0x64#define SDHCI_PRESET_FOR_SDR12 0x66#define SDHCI_PRESET_FOR_SDR25 0x68#define SDHCI_PRESET_FOR_SDR50 0x6A
drivers/net/ethernet/broadcom/genet/bcmmii.c +4 -0
@@ -426,6 +426,10 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)int id, ret; pres =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!pres) { +dev_err (&pdev->dev,"Invalid resource\n" ); +return -EINVAL ; + }memset (&res,0 ,sizeof (res));memset (&ppd,0 ,sizeof (ppd));
drivers/net/ethernet/intel/e100.c +6 -6
@@ -1398,7 +1398,7 @@ static int e100_phy_check_without_mii(struct nic *nic)u8 phy_type;int without_mii; - phy_type = (nic->eeprom[eeprom_phy_iface] >>8 ) &0x0f ; + phy_type = (le16_to_cpu (nic->eeprom[eeprom_phy_iface]) >>8 ) &0x0f ;switch (phy_type) {case NoSuchPhy:/* Non-MII PHY; UNTESTED! */
@@ -1518,7 +1518,7 @@ static int e100_phy_init(struct nic *nic)mdio_write (netdev, nic->mii.phy_id,MII_BMCR , bmcr); }else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && (mdio_read (netdev, nic->mii.phy_id,MII_TPISTATUS ) &0x8000 ) && - (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { + (le16_to_cpu (nic->eeprom[eeprom_cnfg_mdix]) & eeprom_mdix_enabled))) {/* enable/disable MDI/MDI-X auto-switching. */ mdio_write (netdev, nic->mii.phy_id,MII_NCONFIG , nic->mii.force_media ?0 :NCONFIG_AUTO_SWITCH );
@@ -2266,9 +2266,9 @@ static int e100_asf(struct nic *nic) {/* ASF can be enabled from eeprom */ return (nic->pdev->device >=0x1050 ) && (nic->pdev->device <=0x1057 ) && - (nic->eeprom[eeprom_config_asf] & eeprom_asf) && - !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && - ((nic->eeprom[eeprom_smbus_addr] &0xFF ) !=0xFE ); + (le16_to_cpu (nic->eeprom[eeprom_config_asf]) & eeprom_asf) && + !(le16_to_cpu (nic->eeprom[eeprom_config_asf]) & eeprom_gcl) && + ((le16_to_cpu (nic->eeprom[eeprom_smbus_addr]) &0xFF ) !=0xFE ); }static int e100_up (struct nic *nic)
@@ -2924,7 +2924,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* Wol magic packet can be enabled from eeprom */ if ((nic->mac >= mac_82558_D101_A4) && - (nic->eeprom[eeprom_id] & eeprom_id_wol)) { + (le16_to_cpu (nic->eeprom[eeprom_id]) & eeprom_id_wol)) { nic->flags |= wol_magic;device_set_wakeup_enable (&pdev->dev, true); }
drivers/net/ethernet/intel/ice/ice_type.h +1 -1
@@ -48,7 +48,7 @@ enum ice_aq_res_ids {/* FW update timeout definitions are in milliseconds */ #define ICE_NVM_TIMEOUT 180000#define ICE_CHANGE_LOCK_TIMEOUT 1000 -#define ICE_GLOBAL_CFG_LOCK_TIMEOUT 3000 +#define ICE_GLOBAL_CFG_LOCK_TIMEOUT 5000enum ice_aq_res_access_type {ICE_RES_READ =1 ,
drivers/net/ethernet/intel/igb/igb_main.c +3 -2
@@ -2651,7 +2651,8 @@ static int igb_parse_cls_flower(struct igb_adapter *adapter, } input->filter.match_flags |=IGB_FILTER_FLAG_VLAN_TCI ; - input->filter.vlan_tci = match.key->vlan_priority; + input->filter.vlan_tci = + (__force __be16 )match.key->vlan_priority; } }
@@ -8255,7 +8256,7 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring,if (igb_test_staterr (rx_desc,E1000_RXDEXT_STATERR_LB ) &&test_bit (IGB_RING_FLAG_RX_LB_VLAN_BSWAP , &rx_ring->flags)) - vid =be16_to_cpu (rx_desc->wb.upper.vlan); + vid =be16_to_cpu ((__force __be16 )rx_desc->wb.upper.vlan);else vid =le16_to_cpu (rx_desc->wb.upper.vlan);
drivers/net/ethernet/intel/igbvf/netdev.c +2 -2
@@ -83,14 +83,14 @@ static int igbvf_desc_unused(struct igbvf_ring *ring)static void igbvf_receive_skb (struct igbvf_adapter *adapter,struct net_device *netdev,struct sk_buff *skb, -u32 status,u16 vlan) +u32 status,__le16 vlan) {u16 vid;if (status &E1000_RXD_STAT_VP ) {if ((adapter->flags &IGBVF_FLAG_RX_LB_VLAN_BSWAP ) && (status &E1000_RXDEXT_STATERR_LB )) - vid =be16_to_cpu (vlan) &E1000_RXD_SPC_VLAN_MASK ; + vid =be16_to_cpu ((__force __be16 )vlan) &E1000_RXD_SPC_VLAN_MASK ;else vid =le16_to_cpu (vlan) &E1000_RXD_SPC_VLAN_MASK ;if (test_bit (vid, adapter->active_vlans))
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +4 -0
@@ -5740,6 +5740,10 @@ static int mvpp2_probe(struct platform_device *pdev)return PTR_ERR (priv->lms_base); }else { res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); +if (!res) { +dev_err (&pdev->dev,"Invalid resource\n" ); +return -EINVAL ; + }if (has_acpi_companion (&pdev->dev)) {/* In case the MDIO memory region is declared in * the ACPI, it can already appear as 'in-use'
drivers/net/ethernet/micrel/ks8842.c +4 -0
@@ -1136,6 +1136,10 @@ static int ks8842_probe(struct platform_device *pdev)unsigned i; iomem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!iomem) { +dev_err (&pdev->dev,"Invalid resource\n" ); +return -EINVAL ; + }if (!request_mem_region (iomem->start,resource_size (iomem),DRV_NAME )) goto err_mem_region;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +6 -13
@@ -107,7 +107,7 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid) {u8 *data = skb->data;unsigned int offset; -u16 *hi, *id; +u16 hi, id;u32 lo;if (ptp_classify_raw (skb) ==PTP_CLASS_NONE )
@@ -118,14 +118,11 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)if (skb->len < offset +OFF_PTP_SEQUENCE_ID +sizeof (seqid))return 0 ; - hi = (u16 *)(data + offset +OFF_PTP_SOURCE_UUID ); - id = (u16 *)(data + offset +OFF_PTP_SEQUENCE_ID ); + hi =get_unaligned_be16 (data + offset +OFF_PTP_SOURCE_UUID +0 ); + lo =get_unaligned_be32 (data + offset +OFF_PTP_SOURCE_UUID +2 ); + id =get_unaligned_be16 (data + offset +OFF_PTP_SEQUENCE_ID ); -memcpy (&lo, &hi[1 ],sizeof (lo)); - -return (uid_hi == *hi && - uid_lo == lo && - seqid == *id); +return (uid_hi == hi && uid_lo == lo && seqid == id); } static void
@@ -135,7 +132,6 @@ pch_rx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)struct pci_dev *pdev;u64 ns;u32 hi, lo, val; -u16 uid, seq;if (!adapter->hwts_rx_en)return ;
@@ -151,10 +147,7 @@ pch_rx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb) lo =pch_src_uuid_lo_read (pdev); hi =pch_src_uuid_hi_read (pdev); - uid = hi &0xffff ; - seq = (hi >>16 ) &0xffff ; - -if (!pch_ptp_match (skb,htons (uid),htonl (lo),htons (seq))) +if (!pch_ptp_match (skb, hi, lo, hi >>16 )) goto out; ns =pch_rx_snap_read (pdev);
drivers/net/ethernet/realtek/r8169_main.c +0 -1
@@ -5190,7 +5190,6 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)RTL_W8 (tp,DLLPR ,RTL_R8 (tp,DLLPR ) & ~PFM_EN );rtl_pcie_state_l2l3_disable (tp); -rtl_hw_aspm_clkreq_enable (tp, true); }DECLARE_RTL_COND (rtl_mac_ocp_e00e_cond)
drivers/net/ethernet/sfc/ef10_sriov.c +12 -13
@@ -403,12 +403,17 @@ static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs)return rc; } +/* Disable SRIOV and remove VFs +* If some VFs are attached to a guest (using Xen, only) nothing is +* done if force=false, and vports are freed if force=true (for the non +* attachedc ones, only) but SRIOV is not disabled and VFs are not +* removed in either case. +*/ static int efx_ef10_pci_sriov_disable (struct efx_nic *efx,bool force) {struct pci_dev *dev = efx->pci_dev; -unsigned int vfs_assigned =0 ; - - vfs_assigned =pci_vfs_assigned (dev); +unsigned int vfs_assigned =pci_vfs_assigned (dev); +int rc =0 ;if (vfs_assigned && !force) { netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; "
@@ -418,10 +423,12 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)if (!vfs_assigned)pci_disable_sriov (dev); +else + rc = -EBUSY ;efx_ef10_sriov_free_vf_vswitching (efx); efx->vf_count =0 ; -return 0 ; +return rc; }int efx_ef10_sriov_configure (struct efx_nic *efx,int num_vfs)
@@ -440,7 +447,6 @@ int efx_ef10_sriov_init(struct efx_nic *efx)void efx_ef10_sriov_fini (struct efx_nic *efx) {struct efx_ef10_nic_data *nic_data = efx->nic_data; -unsigned int i;int rc;if (!nic_data->vf) {
@@ -450,14 +456,7 @@ void efx_ef10_sriov_fini(struct efx_nic *efx)return ; } -/* Remove any VFs in the host */ -for (i =0 ; i < efx->vf_count; ++i) { -struct efx_nic *vf_efx = nic_data->vf[i].efx; - -if (vf_efx) - vf_efx->pci_dev->driver->remove (vf_efx->pci_dev); - } - +/* Disable SRIOV and remove any VFs in the host */ rc =efx_ef10_pci_sriov_disable (efx, true);if (rc) netif_dbg(efx, drv, efx->net_dev,
drivers/net/fjes/fjes_main.c +4 -0
@@ -1262,6 +1262,10 @@ static int fjes_probe(struct platform_device *plat_dev) adapter->interrupt_watch_enable = false; res =platform_get_resource (plat_dev,IORESOURCE_MEM ,0 ); +if (!res) { + err = -EINVAL ; + goto err_free_control_wq; + } hw->hw_res.start = res->start; hw->hw_res.size =resource_size (res); hw->hw_res.irq =platform_get_irq (plat_dev,0 );
drivers/net/virtio_net.c +1 -1
@@ -1548,7 +1548,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb)if (virtio_net_hdr_from_skb (skb, &hdr->hdr,virtio_is_little_endian (vi->vdev), false,0 )) -BUG (); +return -EPROTO ;if (vi->mergeable_rx_bufs) hdr->num_buffers =0 ;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +18 -6
@@ -3725,6 +3725,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct cfg80211_chan_def chandef;struct iwl_mvm_phy_ctxt *phy_ctxt; +bool band_change_removal;int ret, i; IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value,
@@ -3794,19 +3795,30 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,cfg80211_chandef_create (&chandef, channel,NL80211_CHAN_NO_HT );/* -* Change the PHY context configuration as it is currently referenced -* only by the P2P Device MAC +* Check if the remain-on-channel is on a different band and that +* requires context removal, see iwl_mvm_phy_ctxt_changed(). If +* so, we'll need to release and then re-configure here, since we +* must not remove a PHY context that's part of a binding. */ -if (mvmvif->phy_ctxt->ref ==1 ) { + band_change_removal = +fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT ) && + mvmvif->phy_ctxt->channel->band != chandef.chan->band; + +if (mvmvif->phy_ctxt->ref ==1 && !band_change_removal) { +/* +* Change the PHY context configuration as it is currently +* referenced only by the P2P Device MAC (and we can modify it) +*/ ret =iwl_mvm_phy_ctxt_changed (mvm, mvmvif->phy_ctxt, &chandef,1 ,1 );if (ret) goto out_unlock; }else {/* -* The PHY context is shared with other MACs. Need to remove the -* P2P Device from the binding, allocate an new PHY context and -* create a new binding +* The PHY context is shared with other MACs (or we're trying to +* switch bands), so remove the P2P Device from the binding, +* allocate an new PHY context and create a new binding. */ phy_ctxt =iwl_mvm_get_free_phy_ctxt (mvm);if (!phy_ctxt) {
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +10 -5
@@ -63,7 +63,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,struct iwl_prph_scratch *prph_scratch;struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl;struct iwl_prph_info *prph_info; -void *iml_img;u32 control_flags =0 ;int ret; int cmdq_size = max_t(u32, IWL_CMD_QUEUE_SIZE,
@@ -162,14 +161,15 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, trans_pcie->prph_scratch = prph_scratch;/* Allocate IML */ - iml_img =dma_alloc_coherent (trans->dev, trans->iml_len, - &trans_pcie->iml_dma_addr,GFP_KERNEL ); -if (!iml_img) { + trans_pcie->iml =dma_alloc_coherent (trans->dev, trans->iml_len, + &trans_pcie->iml_dma_addr, +GFP_KERNEL ); +if (!trans_pcie->iml) { ret = -ENOMEM ; goto err_free_ctxt_info; } -memcpy (iml_img, trans->iml, trans->iml_len); +memcpy (trans_pcie->iml, trans->iml, trans->iml_len);iwl_enable_fw_load_int_ctx_info (trans);
@@ -242,6 +242,11 @@ void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans) trans_pcie->ctxt_info_dma_addr =0 ; trans_pcie->ctxt_info_gen3 =NULL ; +dma_free_coherent (trans->dev, trans->iml_len, trans_pcie->iml, + trans_pcie->iml_dma_addr); + trans_pcie->iml_dma_addr =0 ; + trans_pcie->iml =NULL ; +iwl_pcie_ctxt_info_free_fw_img (trans); dma_free_coherent(trans->dev, sizeof(*trans_pcie->prph_scratch),
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +3 -0
@@ -475,6 +475,8 @@ struct cont_rec {* Context information addresses will be taken from here. * This is driver's local copy for keeping track of size and * count for allocating and freeing the memory. +* @iml: image loader image virtual address +* @iml_dma_addr: image loader image DMA address * @trans: pointer to the generic transport area * @scd_base_addr: scheduler sram base address in SRAM * @scd_bc_tbls: pointer to the byte count table of the scheduler
@@ -522,6 +524,7 @@ struct iwl_trans_pcie { };struct iwl_prph_info *prph_info;struct iwl_prph_scratch *prph_scratch; +void *iml;dma_addr_t ctxt_info_dma_addr;dma_addr_t prph_info_dma_addr;dma_addr_t prph_scratch_dma_addr;
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +2 -1
@@ -269,7 +269,8 @@ void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr)/* now that we got alive we can free the fw image & the context info. * paging memory cannot be freed included since FW will still use it */ -iwl_pcie_ctxt_info_free (trans); +if (trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_AX210 ) +iwl_pcie_ctxt_info_free (trans);/* * Re-enable all the interrupts, including the RF-Kill one, now that
drivers/net/wireless/mediatek/mt76/mt7615/mac.c +4 -6
@@ -840,22 +840,20 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta,int first_idx =0 , last_idx;int i, idx, count;bool fixed_rate, ack_timeout; -bool probe, ampdu, cck = false; +bool ampdu, cck = false;bool rs_idx;u32 rate_set_tsf;u32 final_rate, final_rate_flags, final_nss, txs; - fixed_rate = info->status.rates[0 ].count; - probe = !!(info->flags &IEEE80211_TX_CTL_RATE_CTRL_PROBE ); - txs =le32_to_cpu (txs_data[1 ]); - ampdu = !fixed_rate && (txs &MT_TXS1_AMPDU ); + ampdu = txs &MT_TXS1_AMPDU ; txs =le32_to_cpu (txs_data[3 ]); count =FIELD_GET (MT_TXS3_TX_COUNT , txs); last_idx =FIELD_GET (MT_TXS3_LAST_TX_RATE , txs); txs =le32_to_cpu (txs_data[0 ]); + fixed_rate = txs &MT_TXS0_FIXED_RATE ; final_rate =FIELD_GET (MT_TXS0_TX_RATE , txs); ack_timeout = txs &MT_TXS0_ACK_TIMEOUT ;
@@ -877,7 +875,7 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta, first_idx =max_t (int,0 , last_idx - (count +1 ) /MT7615_RATE_RETRY ); -if (fixed_rate && !probe) { +if (fixed_rate) { info->status.rates[0 ].count = count; i =0 ; goto out;
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +3 -8
@@ -853,15 +853,10 @@ struct rtl8192eu_efuse {u8 usb_optional_function;u8 res9[2 ];u8 mac_addr[ETH_ALEN ];/* 0xd7 */ -u8 res10[2 ]; -u8 vendor_name[7 ]; -u8 res11[2 ]; -u8 device_name[0x0b ];/* 0xe8 */ -u8 res12[2 ]; -u8 serial[0x0b ];/* 0xf5 */ -u8 res13[0x30 ]; +u8 device_info[80 ]; +u8 res11[3 ];u8 unknown[0x0d ];/* 0x130 */ -u8 res14[0xc3 ]; +u8 res12[0xc3 ]; };struct rtl8xxxu_reg8val {
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c +53 -6
74 lines not on this page · raw message
drivers/net/wireless/st/cw1200/cw1200_sdio.c +1 -0
@@ -60,6 +60,7 @@ static const struct sdio_device_id cw1200_sdio_ids[] = { { SDIO_DEVICE(SDIO_VENDOR_ID_STE, SDIO_DEVICE_ID_STE_CW1200) }, { /* end: all zeroes */ }, }; +MODULE_DEVICE_TABLE (sdio, cw1200_sdio_ids);/* hwbus_ops implemetation */
drivers/net/wireless/ti/wl1251/cmd.c +6 -3
@@ -466,9 +466,12 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, cmd->channels[i].channel = channels[i]->hw_value; } - cmd->params.ssid_len = ssid_len; -if (ssid) -memcpy (cmd->params.ssid, ssid, ssid_len); +if (ssid) { +int len =clamp_val (ssid_len,0 ,IEEE80211_MAX_SSID_LEN ); + + cmd->params.ssid_len = len; +memcpy (cmd->params.ssid, ssid, len); + } ret =wl1251_cmd_send (wl,CMD_SCAN , cmd,sizeof (*cmd));if (ret <0 ) {
drivers/net/wireless/ti/wl12xx/main.c +7 -0
@@ -1503,6 +1503,13 @@ static int wl12xx_get_fuse_mac(struct wl1271 *wl)u32 mac1, mac2;int ret; +/* Device may be in ELP from the bootloader or kexec */ + ret =wlcore_write32 (wl,WL12XX_WELP_ARM_COMMAND ,WELP_ARM_COMMAND_VAL ); +if (ret <0 ) + goto out; + +usleep_range (500000 ,700000 ); + ret =wlcore_set_partition (wl, &wl->ptable[PART_DRPW ]);if (ret <0 ) goto out;
drivers/nvmem/core.c +6 -3
@@ -318,15 +318,17 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)continue ;if (len <2 *sizeof (u32)) {dev_err (dev,"nvmem: invalid reg on %pOF\n" , child); +of_node_put (child);return -EINVAL ; } cell =kzalloc (sizeof (*cell),GFP_KERNEL ); -if (!cell) +if (!cell) { +of_node_put (child);return -ENOMEM ; + } cell->nvmem = nvmem; - cell->np =of_node_get (child); cell->offset =be32_to_cpup (addr++); cell->bytes =be32_to_cpup (addr); cell->name =kasprintf (GFP_KERNEL ,"%pOFn" , child);
@@ -347,11 +349,12 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) cell->name, nvmem->stride);/* Cells already added will be freed later. */ kfree_const (cell->name); -of_node_put (cell->np);kfree (cell); +of_node_put (child);return -EINVAL ; } + cell->np =of_node_get (child);nvmem_cell_add (cell); }
drivers/pci/controller/pci-aardvark.c +12 -1
@@ -61,7 +61,7 @@#define PIO_COMPLETION_STATUS_UR 1#define PIO_COMPLETION_STATUS_CRS 2#define PIO_COMPLETION_STATUS_CA 4 -#define PIO_NON_POSTED_REQ BIT(0) +#define PIO_NON_POSTED_REQ BIT(10)#define PIO_ADDR_LS (PIO_BASE_ADDR + 0x8)#define PIO_ADDR_MS (PIO_BASE_ADDR + 0xc)#define PIO_WR_DATA (PIO_BASE_ADDR + 0x10)
@@ -127,6 +127,7 @@#define LTSSM_MASK 0x3f#define LTSSM_L0 0x10#define RC_BAR_CONFIG 0x300 +#define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44)/* PCIe core controller registers */ #define CTRL_CORE_BASE_ADDR 0x18000
@@ -268,6 +269,16 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) reg |= (IS_RC_MSK <<IS_RC_SHIFT );advk_writel (pcie, reg,PCIE_CORE_CTRL0_REG ); +/* +* Replace incorrect PCI vendor id value 0x1b4b by correct value 0x11ab. +* VENDOR_ID_REG contains vendor id in low 16 bits and subsystem vendor +* id in high 16 bits. Updating this register changes readback value of +* read-only vendor id bits in PCIE_CORE_DEV_ID_REG register. Workaround +* for erratum 4.1: "The value of device and vendor ID is incorrect". +*/ + reg = (PCI_VENDOR_ID_MARVELL <<16 ) |PCI_VENDOR_ID_MARVELL ; +advk_writel (pcie, reg,VENDOR_ID_REG ); +/* Set Advanced Error Capabilities and Control PF0 register */ reg =PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX | PCIE_CORE_ERR_CAPCTL_ECRC_CHK_TX_EN |
drivers/pci/quirks.c +11 -0
@@ -27,6 +27,7 @@#include <linux/nvme.h> #include <linux/platform_data/x86/apple.h> #include <linux/pm_runtime.h> +#include <linux/suspend.h> #include <linux/switchtec.h> #include <asm/dma.h> /* isa_dma_bridge_buggy */ #include "pci.h"
@@ -3667,6 +3668,16 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)return ;if (pci_pcie_type (dev) !=PCI_EXP_TYPE_UPSTREAM )return ; + +/* +* SXIO/SXFP/SXLF turns off power to the Thunderbolt controller. +* We don't know how to turn it back on again, but firmware does, +* so we can only use SXIO/SXFP/SXLF if we're suspending via +* firmware. +*/ +if (!pm_suspend_via_firmware ()) +return ; + bridge =ACPI_HANDLE (&dev->dev);if (!bridge)return ;
drivers/pinctrl/pinctrl-amd.c +1 -0
@@ -958,6 +958,7 @@ static int amd_gpio_remove(struct platform_device *pdev)static const struct acpi_device_id amd_gpio_acpi_match[] = { {"AMD0030" ,0 }, {"AMDI0030" ,0 }, + {"AMDI0031" ,0 }, { }, };MODULE_DEVICE_TABLE (acpi, amd_gpio_acpi_match);
drivers/pinctrl/pinctrl-mcp23s08.c +5 -5
@@ -459,6 +459,11 @@ static irqreturn_t mcp23s08_irq(int irq, void *data)if (mcp_read (mcp,MCP_INTF , &intf)) goto unlock; +if (intf ==0 ) { +/* There is no interrupt pending */ + goto unlock; + } +if (mcp_read (mcp,MCP_INTCAP , &intcap)) goto unlock;
@@ -476,11 +481,6 @@ static irqreturn_t mcp23s08_irq(int irq, void *data) mcp->cached_gpio = gpio;mutex_unlock (&mcp->lock); -if (intf ==0 ) { -/* There is no interrupt pending */ -return IRQ_HANDLED ; - } -dev_dbg (mcp->chip.parent,"intcap 0x%04X intf 0x%04X gpio_orig 0x%04X gpio 0x%04X\n" , intcap, intf, gpio_orig, gpio);
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +12 -8
@@ -150,24 +150,27 @@ static ssize_t tcc_offset_degree_celsius_show(struct device *dev,if (err)return err; - val = (val >>24 ) &0xff ; + val = (val >>24 ) &0x3f ;return sprintf (buf,"%d\n" , (int )val); } -static int tcc_offset_update (int tcc) +static int tcc_offset_update (unsigned int tcc) {u64 val;int err; -if (!tcc) +if (tcc >63 )return -EINVAL ; err =rdmsrl_safe (MSR_IA32_TEMPERATURE_TARGET , &val);if (err)return err; - val &= ~GENMASK_ULL (31 ,24 ); - val |= (tcc &0xff ) <<24 ; +if (val &BIT (31 )) +return -EPERM ; + + val &= ~GENMASK_ULL (29 ,24 ); + val |= (tcc &0x3f ) <<24 ; err =wrmsrl_safe (MSR_IA32_TEMPERATURE_TARGET , val);if (err)
@@ -176,14 +179,15 @@ static int tcc_offset_update(int tcc)return 0 ; } -static int tcc_offset_save; +static unsigned int tcc_offset_save;static ssize_t tcc_offset_degree_celsius_store (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { +unsigned int tcc;u64 val; -int tcc, err; +int err; err =rdmsrl_safe (MSR_PLATFORM_INFO , &val);if (err)
@@ -192,7 +196,7 @@ static ssize_t tcc_offset_degree_celsius_store(struct device *dev,if (!(val &BIT (30 )))return -EACCES ; -if (kstrtoint (buf,0 , &tcc)) +if (kstrtouint (buf,0 , &tcc))return -EINVAL ; err =tcc_offset_update (tcc);
fs/crypto/fname.c +2 -7
@@ -273,13 +273,8 @@ int fscrypt_fname_disk_to_usr(struct inode *inode, oname->name);return 0 ; } -if (hash) { - digested_name.hash = hash; - digested_name.minor_hash = minor_hash; - }else { - digested_name.hash =0 ; - digested_name.minor_hash =0 ; - } + digested_name.hash = hash; + digested_name.minor_hash = minor_hash;memcpy (digested_name.digest,FSCRYPT_FNAME_DIGEST (iname->name, iname->len),FSCRYPT_FNAME_DIGEST_SIZE );
fs/jfs/inode.c +2 -1
@@ -151,7 +151,8 @@ void jfs_evict_inode(struct inode *inode)if (test_cflag (COMMIT_Freewmap, inode))jfs_free_zero_link (inode); -diFree (inode); +if (JFS_SBI (inode->i_sb)->ipimap) +diFree (inode);/* * Free the inode from the quota allocation.
fs/reiserfs/journal.c +14 -0
@@ -2763,6 +2763,20 @@ int journal_init(struct super_block *sb, const char *j_dev_name, goto free_and_return; } +/* +* Sanity check to see if journal first block is correct. +* If journal first block is invalid it can cause +* zeroing important superblock members. +*/ +if (!SB_ONDISK_JOURNAL_DEVICE (sb) && +SB_ONDISK_JOURNAL_1st_BLOCK (sb) <SB_JOURNAL_1st_RESERVED_BLOCK (sb)) { +reiserfs_warning (sb,"journal-1393" , +"journal 1st super block is invalid: 1st reserved block %d, but actual 1st block is %d" , +SB_JOURNAL_1st_RESERVED_BLOCK (sb), +SB_ONDISK_JOURNAL_1st_BLOCK (sb)); + goto free_and_return; + } +if (journal_init_dev (sb, journal, j_dev_name) !=0 ) {reiserfs_warning (sb,"sh-462" ,"unable to initialize journal device" );
fs/ubifs/super.c +1 -0
@@ -257,6 +257,7 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb)memset ((void *)ui +sizeof (struct inode ),0 ,sizeof (struct ubifs_inode ) -sizeof (struct inode ));mutex_init (&ui->ui_mutex); +init_rwsem (&ui->xattr_sem);spin_lock_init (&ui->ui_lock);return &ui->vfs_inode; };
fs/ubifs/ubifs.h +2 -0
@@ -356,6 +356,7 @@ struct ubifs_gced_idx_leb {* @ui_mutex: serializes inode write-back with the rest of VFS operations, * serializes "clean <-> dirty" state changes, serializes bulk-read, * protects @dirty, @bulk_read, @ui_size, and @xattr_size +* @xattr_sem: serilizes write operations (remove|set|create) on xattr * @ui_lock: protects @synced_i_size * @synced_i_size: synchronized size of inode, i.e. the value of inode size * currently stored on the flash; used only for regular file
@@ -409,6 +410,7 @@ struct ubifs_inode { unsigned int bulk_read:1; unsigned int compr_type:2;struct mutex ui_mutex; +struct rw_semaphore xattr_sem;spinlock_t ui_lock;loff_t synced_i_size;loff_t ui_size;
fs/ubifs/xattr.c +33 -11
146 lines not on this page · raw message
fs/udf/namei.c +4 -0
@@ -933,6 +933,10 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, iinfo->i_location.partitionReferenceNum, 0); epos.bh =udf_tgetblk (sb, block); +if (unlikely (!epos.bh)) { + err = -ENOMEM ; + goto out_no_entry; + }lock_buffer (epos.bh);memset (epos.bh->b_data,0x00 , bsize);set_buffer_uptodate (epos.bh);
include/linux/mfd/abx500/ux500_chargalg.h +1 -1
@@ -15,7 +15,7 @@* - POWER_SUPPLY_TYPE_USB, * because only them store as drv_data pointer to struct ux500_charger. */ -#define psy_to_ux500_charger (x) power_supply_get_drvdata(psy) +#define psy_to_ux500_charger (x) power_supply_get_drvdata(x)/* Forward declaration */ struct ux500_charger ;
include/linux/netdev_features.h +1 -1
@@ -83,7 +83,7 @@ enum {/* * Add your fresh new feature above and remember to update -* netdev_features_strings[] in net/core/ethtool.c and maybe +* netdev_features_strings[] in net/ethtool/common.c and maybe * some feature mask #defines below. Please also describe it * in Documentation/networking/netdev-features.txt. */
include/linux/wait.h +1 -1
@@ -1121,7 +1121,7 @@ do { \* Waitqueues which are removed from the waitqueue_head at wakeup time */ void prepare_to_wait (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry,int state); -void prepare_to_wait_exclusive (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry,int state); +bool prepare_to_wait_exclusive (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry,int state);long prepare_to_wait_event (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry,int state);void finish_wait (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry);long wait_woken (struct wait_queue_entry *wq_entry,unsigned mode,long timeout);
include/media/v4l2-subdev.h +4 -0
@@ -162,6 +162,9 @@ struct v4l2_subdev_io_pin_config {* @s_gpio: set GPIO pins. Very simple right now, might need to be extended with * a direction argument if needed. * +* @command: called by in-kernel drivers in order to call functions internal +* to subdev drivers driver that have a separate callback. +* * @ioctl: called at the end of ioctl() syscall handler at the V4L2 core. * used to provide support for private ioctls used on the driver. *
@@ -193,6 +196,7 @@ struct v4l2_subdev_core_ops {int (*load_fw)(struct v4l2_subdev *sd);int (*reset)(struct v4l2_subdev *sd,u32 val);int (*s_gpio)(struct v4l2_subdev *sd,u32 val); +long (*command)(struct v4l2_subdev *sd,unsigned int cmd,void *arg);long (*ioctl)(struct v4l2_subdev *sd,unsigned int cmd,void *arg);#ifdef CONFIG_COMPAT long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd,
include/net/sctp/structs.h +1 -1
@@ -466,7 +466,7 @@ struct sctp_af { int saddr);void (*from_sk) (union sctp_addr *,struct sock *sk); -void (*from_addr_param) (union sctp_addr *, +bool (*from_addr_param) (union sctp_addr *,union sctp_addr_param *,__be16 port,int iif); int (*to_addr_param) (const union sctp_addr *,
include/uapi/linux/ethtool.h +2 -2
@@ -223,7 +223,7 @@ enum tunable_id {ETHTOOL_PFC_PREVENTION_TOUT ,/* timeout in msecs */ /* * Add your fresh new tunable attribute above and remember to update -* tunable_strings[] in net/core/ethtool.c +* tunable_strings[] in net/ethtool/common.c */ __ETHTOOL_TUNABLE_COUNT, };
@@ -287,7 +287,7 @@ enum phy_tunable_id {ETHTOOL_PHY_EDPD ,/* * Add your fresh new phy tunable attribute above and remember to update -* phy_tunable_strings[] in net/core/ethtool.c +* phy_tunable_strings[] in net/ethtool/common.c */ __ETHTOOL_PHY_TUNABLE_COUNT, };
kernel/bpf/core.c +43 -18
85 lines not on this page · raw message
kernel/cpu.c +49 -0
73 lines not on this page · raw message
kernel/sched/wait.c +7 -2
@@ -232,17 +232,22 @@ prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_ent }EXPORT_SYMBOL (prepare_to_wait); -void +/* Returns true if we are the first waiter in the queue, false otherwise. */ +bool prepare_to_wait_exclusive (struct wait_queue_head *wq_head,struct wait_queue_entry *wq_entry,int state) {unsigned long flags; +bool was_empty = false; wq_entry->flags |=WQ_FLAG_EXCLUSIVE ;spin_lock_irqsave (&wq_head->lock, flags); -if (list_empty (&wq_entry->entry)) +if (list_empty (&wq_entry->entry)) { + was_empty =list_empty (&wq_head->head);__add_wait_queue_entry_tail (wq_head, wq_entry); + }set_current_state (state);spin_unlock_irqrestore (&wq_head->lock, flags); +return was_empty; }EXPORT_SYMBOL (prepare_to_wait_exclusive);
kernel/trace/trace.c +55 -36
149 lines not on this page · raw message
lib/seq_buf.c +3 -1
@@ -228,8 +228,10 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,WARN_ON (s->size ==0 ); +BUILD_BUG_ON (MAX_MEMHEX_BYTES *2 >=HEX_CHARS ); +while (len) { - start_len =min (len,HEX_CHARS -1 ); + start_len =min (len,MAX_MEMHEX_BYTES );#ifdef __BIG_ENDIANfor (i =0 , j =0 ; i < start_len; i++) {#else
net/bluetooth/hci_core.c +8 -8
@@ -1672,14 +1672,6 @@ int hci_dev_do_close(struct hci_dev *hdev)BT_DBG ("%s %p" , hdev->name, hdev); -if (!hci_dev_test_flag (hdev,HCI_UNREGISTER ) && - !hci_dev_test_flag (hdev,HCI_USER_CHANNEL ) && -test_bit (HCI_UP , &hdev->flags)) { -/* Execute vendor specific shutdown routine */ -if (hdev->shutdown) - hdev->shutdown (hdev); - } -cancel_delayed_work (&hdev->power_off);hci_request_cancel_all (hdev);
@@ -1753,6 +1745,14 @@ int hci_dev_do_close(struct hci_dev *hdev)clear_bit (HCI_INIT , &hdev->flags); } +if (!hci_dev_test_flag (hdev,HCI_UNREGISTER ) && + !hci_dev_test_flag (hdev,HCI_USER_CHANNEL ) && +test_bit (HCI_UP , &hdev->flags)) { +/* Execute vendor specific shutdown routine */ +if (hdev->shutdown) + hdev->shutdown (hdev); + } +/* flush cmd work */ flush_work (&hdev->cmd_work);
net/bluetooth/mgmt.c +3 -0
@@ -219,12 +219,15 @@ static u8 mgmt_status_table[] = {MGMT_STATUS_TIMEOUT ,/* Instant Passed */ MGMT_STATUS_NOT_SUPPORTED ,/* Pairing Not Supported */ MGMT_STATUS_FAILED ,/* Transaction Collision */ +MGMT_STATUS_FAILED ,/* Reserved for future use */ MGMT_STATUS_INVALID_PARAMS ,/* Unacceptable Parameter */ MGMT_STATUS_REJECTED ,/* QoS Rejected */ MGMT_STATUS_NOT_SUPPORTED ,/* Classification Not Supported */ MGMT_STATUS_REJECTED ,/* Insufficient Security */ MGMT_STATUS_INVALID_PARAMS ,/* Parameter Out Of Range */ +MGMT_STATUS_FAILED ,/* Reserved for future use */ MGMT_STATUS_BUSY ,/* Role Switch Pending */ +MGMT_STATUS_FAILED ,/* Reserved for future use */ MGMT_STATUS_FAILED ,/* Slot Violation */ MGMT_STATUS_FAILED ,/* Role Switch Failed */ MGMT_STATUS_INVALID_PARAMS, /* EIR Too Large */
net/core/dev.c +9 -2
@@ -5972,11 +5972,18 @@ EXPORT_SYMBOL(napi_schedule_prep);* __napi_schedule_irqoff - schedule for receive * @n: entry to schedule * -* Variant of __napi_schedule() assuming hard irqs are masked +* Variant of __napi_schedule() assuming hard irqs are masked. +* +* On PREEMPT_RT enabled kernels this maps to __napi_schedule() +* because the interrupt disabled assumption might not be true +* due to force-threaded interrupts and spinlock substitution. */ void __napi_schedule_irqoff (struct napi_struct *n) { -____napi_schedule (this_cpu_ptr (&softnet_data), n); +if (!IS_ENABLED (CONFIG_PREEMPT_RT )) +____napi_schedule (this_cpu_ptr (&softnet_data), n); +else +__napi_schedule (n); }EXPORT_SYMBOL (__napi_schedule_irqoff);
net/ipv4/ip_output.c +18 -14
@@ -1048,7 +1048,7 @@ static int __ip_append_data(struct sock *sk,unsigned int datalen;unsigned int fraglen;unsigned int fraggap; -unsigned int alloclen; +unsigned int alloclen, alloc_extra;unsigned int pagedlen;struct sk_buff *skb_prev; alloc_new_skb:
@@ -1068,35 +1068,39 @@ static int __ip_append_data(struct sock *sk, fraglen = datalen + fragheaderlen; pagedlen =0 ; + alloc_extra = hh_len +15 ; + alloc_extra += exthdrlen; + +/* The last fragment gets additional space at tail. +* Note, with MSG_MORE we overallocate on fragments, +* because we have no idea what fragment will be +* the last. +*/ +if (datalen == length + fraggap) + alloc_extra += rt->dst.trailer_len; +if ((flags &MSG_MORE ) && !(rt->dst.dev->features&NETIF_F_SG )) alloclen = mtu; -else if (!paged) +else if (!paged && + (fraglen + alloc_extra <SKB_MAX_ALLOC || + !(rt->dst.dev->features &NETIF_F_SG ))) alloclen = fraglen;else { alloclen =min_t (int, fraglen,MAX_HEADER ); pagedlen = fraglen - alloclen; } - alloclen += exthdrlen; - -/* The last fragment gets additional space at tail. -* Note, with MSG_MORE we overallocate on fragments, -* because we have no idea what fragment will be -* the last. -*/ -if (datalen == length + fraggap) - alloclen += rt->dst.trailer_len; + alloclen += alloc_extra;if (transhdrlen) { - skb =sock_alloc_send_skb (sk, - alloclen + hh_len +15 , + skb =sock_alloc_send_skb (sk, alloclen, (flags &MSG_DONTWAIT ), &err); }else { skb =NULL ;if (refcount_read (&sk->sk_wmem_alloc) + wmem_alloc_delta <=2 * sk->sk_sndbuf) - skb =alloc_skb (alloclen + hh_len +15 , + skb =alloc_skb (alloclen, sk->sk_allocation);if (unlikely (!skb)) err = -ENOBUFS ;
net/ipv6/ip6_output.c +17 -15
@@ -1484,7 +1484,7 @@ static int __ip6_append_data(struct sock *sk,unsigned int datalen;unsigned int fraglen;unsigned int fraggap; -unsigned int alloclen; +unsigned int alloclen, alloc_extra;unsigned int pagedlen; alloc_new_skb:/* There's no room in the current skb */
@@ -1511,17 +1511,28 @@ static int __ip6_append_data(struct sock *sk, fraglen = datalen + fragheaderlen; pagedlen =0 ; + alloc_extra = hh_len; + alloc_extra += dst_exthdrlen; + alloc_extra += rt->dst.trailer_len; + +/* We just reserve space for fragment header. +* Note: this may be overallocation if the message +* (without MSG_MORE) fits into the MTU. +*/ + alloc_extra +=sizeof (struct frag_hdr ); +if ((flags &MSG_MORE ) && !(rt->dst.dev->features&NETIF_F_SG )) alloclen = mtu; -else if (!paged) +else if (!paged && + (fraglen + alloc_extra <SKB_MAX_ALLOC || + !(rt->dst.dev->features &NETIF_F_SG ))) alloclen = fraglen;else { alloclen =min_t (int, fraglen,MAX_HEADER ); pagedlen = fraglen - alloclen; } - - alloclen += dst_exthdrlen; + alloclen += alloc_extra;if (datalen != length + fraggap) {/*
@@ -1531,30 +1542,21 @@ static int __ip6_append_data(struct sock *sk, datalen += rt->dst.trailer_len; } - alloclen += rt->dst.trailer_len; fraglen = datalen + fragheaderlen; -/* -* We just reserve space for fragment header. -* Note: this may be overallocation if the message -* (without MSG_MORE) fits into the MTU. -*/ - alloclen +=sizeof (struct frag_hdr ); - copy = datalen - transhdrlen - fraggap - pagedlen;if (copy <0 ) { err = -EINVAL ; goto error; }if (transhdrlen) { - skb =sock_alloc_send_skb (sk, - alloclen + hh_len, + skb =sock_alloc_send_skb (sk, alloclen, (flags &MSG_DONTWAIT ), &err); }else { skb =NULL ;if (refcount_read (&sk->sk_wmem_alloc) + wmem_alloc_delta <=2 * sk->sk_sndbuf) - skb =alloc_skb (alloclen + hh_len, + skb =alloc_skb (alloclen, sk->sk_allocation);if (unlikely (!skb)) err = -ENOBUFS ;
net/ipv6/output_core.c +5 -23
@@ -15,29 +15,11 @@ static u32 __ipv6_select_ident(struct net *net,const struct in6_addr *dst, const struct in6_addr *src) { -const struct { -struct in6_addr dst; -struct in6_addr src; - }__aligned(SIPHASH_ALIGNMENT) combined = { - .dst = *dst, - .src = *src, - }; -u32 hash, id; - -/* Note the following code is not safe, but this is okay. */ -if (unlikely (siphash_key_is_zero (&net->ipv4.ip_id_key))) -get_random_bytes (&net->ipv4.ip_id_key, -sizeof (net->ipv4.ip_id_key)); - - hash =siphash (&combined,sizeof (combined), &net->ipv4.ip_id_key); - -/* Treat id of 0 as unset and if we get 0 back from ip_idents_reserve, -* set the hight order instead thus minimizing possible future -* collisions. -*/ - id =ip_idents_reserve (hash,1 ); -if (unlikely (!id)) - id =1 <<31 ; + u32 id; + +do { + id =prandom_u32 (); + }while (!id);return id; }
net/sched/act_api.c +2 -1
@@ -316,7 +316,8 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, }mutex_unlock (&idrinfo->lock); -if (nla_put_u32 (skb,TCA_FCNT , n_i)) + ret =nla_put_u32 (skb,TCA_FCNT , n_i); +if (ret) goto nla_put_failure;nla_nest_end (skb, nest);
net/sctp/bind_addr.c +11 -8
@@ -270,22 +270,19 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, rawaddr = (union sctp_addr_param *)raw_addr_list; af =sctp_get_af_specific (param_type2af (param->type)); -if (unlikely (!af)) { +if (unlikely (!af) || + !af->from_addr_param (&addr, rawaddr,htons (port),0 )) { retval = -EINVAL ; -sctp_bind_addr_clean (bp); -break ; + goto out_err; } - af->from_addr_param (&addr, rawaddr,htons (port),0 );if (sctp_bind_addr_state (bp, &addr) !=-1 ) goto next; retval =sctp_add_bind_addr (bp, &addr,sizeof (addr),SCTP_ADDR_SRC , gfp); -if (retval) { +if (retval)/* Can't finish building the list, clean up. */ -sctp_bind_addr_clean (bp); -break ; - } + goto out_err; next: len =ntohs (param->length);
@@ -294,6 +291,12 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list, }return retval; + +out_err: +if (retval) +sctp_bind_addr_clean (bp); + +return retval; }/********************************************************************
net/sctp/input.c +5 -3
@@ -1131,7 +1131,8 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,if (!af)continue ; - af->from_addr_param (paddr, params.addr, sh->source,0 ); +if (!af->from_addr_param (paddr, params.addr, sh->source,0 )) +continue ; asoc =__sctp_lookup_association (net, laddr, paddr, transportp);if (asoc)
@@ -1174,7 +1175,8 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(if (unlikely (!af))return NULL ; - af->from_addr_param (&paddr, param, peer_port,0 ); +if (af->from_addr_param (&paddr, param, peer_port,0 )) +return NULL ;return __sctp_lookup_association (net, laddr, &paddr, transportp); }
@@ -1245,7 +1247,7 @@ static struct sctp_association *__sctp_rcv_walk_lookup(struct net *net, ch = (struct sctp_chunkhdr *)ch_end; chunk_num++; - }while (ch_end <skb_tail_pointer (skb)); + }while (ch_end +sizeof (*ch) <skb_tail_pointer (skb));return asoc; }
net/sctp/ipv6.c +6 -1
@@ -530,15 +530,20 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk) }/* Initialize a sctp_addr from an address parameter. */ -static void sctp_v6_from_addr_param (union sctp_addr *addr, +static bool sctp_v6_from_addr_param (union sctp_addr *addr,union sctp_addr_param *param,__be16 port,int iif) { +if (ntohs (param->v6.param_hdr.length) <sizeof (struct sctp_ipv6addr_param )) +return false; + addr->v6.sin6_family =AF_INET6 ; addr->v6.sin6_port = port; addr->v6.sin6_flowinfo =0 ;/* BUG */ addr->v6.sin6_addr = param->v6.addr; addr->v6.sin6_scope_id = iif; + +return true; }/* Initialize an address parameter from a sctp_addr and return the length
net/sctp/protocol.c +6 -1
@@ -253,14 +253,19 @@ static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) }/* Initialize a sctp_addr from an address parameter. */ -static void sctp_v4_from_addr_param (union sctp_addr *addr, +static bool sctp_v4_from_addr_param (union sctp_addr *addr,union sctp_addr_param *param,__be16 port,int iif) { +if (ntohs (param->v4.param_hdr.length) <sizeof (struct sctp_ipv4addr_param )) +return false; + addr->v4.sin_family =AF_INET ; addr->v4.sin_port = port; addr->v4.sin_addr.s_addr = param->v4.addr.s_addr;memset (addr->v4.sin_zero,0 ,sizeof (addr->v4.sin_zero)); + +return true; }/* Initialize an address parameter from a sctp_addr and return the length
net/sctp/sm_make_chunk.c +16 -13
@@ -2337,11 +2337,13 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,/* Process the initialization parameters. */ sctp_walk_params(param, peer_init, init_hdr.params) { -if (!src_match && (param.p->type ==SCTP_PARAM_IPV4_ADDRESS || - param.p->type ==SCTP_PARAM_IPV6_ADDRESS )) { +if (!src_match && + (param.p->type ==SCTP_PARAM_IPV4_ADDRESS || + param.p->type ==SCTP_PARAM_IPV6_ADDRESS )) { af =sctp_get_af_specific (param_type2af (param.p->type)); - af->from_addr_param (&addr, param.addr, - chunk->sctp_hdr->source,0 ); +if (!af->from_addr_param (&addr, param.addr, + chunk->sctp_hdr->source,0 )) +continue ;if (sctp_cmp_addr_exact (sctp_source (chunk), &addr)) src_match =1 ; }
@@ -2522,7 +2524,8 @@ static int sctp_process_param(struct sctp_association *asoc,break ; do_addr_param: af =sctp_get_af_specific (param_type2af (param.p->type)); - af->from_addr_param (&addr, param.addr,htons (asoc->peer.port),0 ); +if (!af->from_addr_param (&addr, param.addr,htons (asoc->peer.port),0 )) +break ; scope =sctp_scope (peer_addr);if (sctp_in_scope (net, &addr, scope))if (!sctp_assoc_add_peer (asoc, &addr, gfp,SCTP_UNCONFIRMED ))
@@ -2623,15 +2626,13 @@ static int sctp_process_param(struct sctp_association *asoc, addr_param = param.v +sizeof (struct sctp_addip_param ); af =sctp_get_af_specific (param_type2af (addr_param->p.type)); -if (af ==NULL ) +if (!af)break ; - af->from_addr_param (&addr, addr_param, -htons (asoc->peer.port),0 ); +if (!af->from_addr_param (&addr, addr_param, +htons (asoc->peer.port),0 )) +break ; -/* if the address is invalid, we can't process it. -* XXX: see spec for what to do. -*/ if (!af->addr_valid (&addr,NULL ,NULL ))break ;
@@ -3045,7 +3046,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,if (unlikely (!af))return SCTP_ERROR_DNS_FAILED ; - af->from_addr_param (&addr, addr_param,htons (asoc->peer.port),0 ); +if (!af->from_addr_param (&addr, addr_param,htons (asoc->peer.port),0 )) +return SCTP_ERROR_DNS_FAILED ;/* ADDIP 4.2.1 This parameter MUST NOT contain a broadcast * or multicast address.
@@ -3322,7 +3324,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,/* We have checked the packet before, so we do not check again. */ af =sctp_get_af_specific (param_type2af (addr_param->p.type)); - af->from_addr_param (&addr, addr_param,htons (bp->port),0 ); +if (!af->from_addr_param (&addr, addr_param,htons (bp->port),0 )) +return ;switch (asconf_param->param_hdr.type) {case SCTP_PARAM_ADD_IP :
net/vmw_vsock/af_vsock.c +1 -1
@@ -1217,7 +1217,7 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,if (signal_pending (current)) { err =sock_intr_errno (timeout); - sk->sk_state =TCP_CLOSE ; + sk->sk_state = sk->sk_state ==TCP_ESTABLISHED ?TCP_CLOSING :TCP_CLOSE ; sock->state =SS_UNCONNECTED ;vsock_transport_cancel_pkt (vsk); goto out_wait;
net/wireless/wext-spy.c +7 -7
@@ -120,8 +120,8 @@ int iw_handler_set_thrspy(struct net_device * dev,return -EOPNOTSUPP ;/* Just do it */ -memcpy (&(spydata->spy_thr_low), &(threshold->low), -2 *sizeof (struct iw_quality )); + spydata->spy_thr_low = threshold->low; + spydata->spy_thr_high = threshold->high;/* Clear flag */ memset (spydata->spy_thr_under,'\0' ,sizeof (spydata->spy_thr_under));
@@ -147,8 +147,8 @@ int iw_handler_get_thrspy(struct net_device * dev,return -EOPNOTSUPP ;/* Just do it */ -memcpy (&(threshold->low), &(spydata->spy_thr_low), -2 *sizeof (struct iw_quality )); + threshold->low = spydata->spy_thr_low; + threshold->high = spydata->spy_thr_high;return 0 ; }
@@ -173,10 +173,10 @@ static void iw_send_thrspy_event(struct net_device * dev,memcpy (threshold.addr.sa_data, address,ETH_ALEN ); threshold.addr.sa_family =ARPHRD_ETHER ;/* Copy stats */ -memcpy (&(threshold.qual), wstats,sizeof (struct iw_quality )); + threshold.qual = *wstats;/* Copy also thresholds */ -memcpy (&(threshold.low), &(spydata->spy_thr_low), -2 *sizeof (struct iw_quality )); + threshold.low = spydata->spy_thr_low; + threshold.high = spydata->spy_thr_high;/* Send event to user space */ wireless_send_event (dev,SIOCGIWTHRSPY , &wrqu, (char *) &threshold);
net/xfrm/xfrm_user.c +14 -14
@@ -580,6 +580,20 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,copy_from_user_state (x, p); +if (attrs[XFRMA_ENCAP ]) { + x->encap =kmemdup (nla_data (attrs[XFRMA_ENCAP ]), +sizeof (*x->encap),GFP_KERNEL ); +if (x->encap ==NULL ) + goto error; + } + +if (attrs[XFRMA_COADDR ]) { + x->coaddr =kmemdup (nla_data (attrs[XFRMA_COADDR ]), +sizeof (*x->coaddr),GFP_KERNEL ); +if (x->coaddr ==NULL ) + goto error; + } +if (attrs[XFRMA_SA_EXTRA_FLAGS ]) x->props.extra_flags =nla_get_u32 (attrs[XFRMA_SA_EXTRA_FLAGS ]);
@@ -600,23 +614,9 @@ static struct xfrm_state *xfrm_state_construct(struct net *net, attrs[XFRMA_ALG_COMP]))) goto error; -if (attrs[XFRMA_ENCAP ]) { - x->encap =kmemdup (nla_data (attrs[XFRMA_ENCAP ]), -sizeof (*x->encap),GFP_KERNEL ); -if (x->encap ==NULL ) - goto error; - } -if (attrs[XFRMA_TFCPAD ]) x->tfcpad =nla_get_u32 (attrs[XFRMA_TFCPAD ]); -if (attrs[XFRMA_COADDR ]) { - x->coaddr =kmemdup (nla_data (attrs[XFRMA_COADDR ]), -sizeof (*x->coaddr),GFP_KERNEL ); -if (x->coaddr ==NULL ) - goto error; - } -xfrm_mark_get (attrs, &x->mark);xfrm_smark_init (attrs, &x->props.smark);
security/selinux/avc.c +7 -6
@@ -294,26 +294,27 @@ static struct avc_xperms_decision_nodestruct avc_xperms_decision_node *xpd_node;struct extended_perms_decision *xpd; - xpd_node =kmem_cache_zalloc (avc_xperms_decision_cachep,GFP_NOWAIT ); + xpd_node =kmem_cache_zalloc (avc_xperms_decision_cachep, +GFP_NOWAIT | __GFP_NOWARN);if (!xpd_node)return NULL ; xpd = &xpd_node->xpd;if (which &XPERMS_ALLOWED ) { xpd->allowed =kmem_cache_zalloc (avc_xperms_data_cachep, -GFP_NOWAIT ); +GFP_NOWAIT | __GFP_NOWARN);if (!xpd->allowed) goto error; }if (which &XPERMS_AUDITALLOW ) { xpd->auditallow =kmem_cache_zalloc (avc_xperms_data_cachep, -GFP_NOWAIT ); +GFP_NOWAIT | __GFP_NOWARN);if (!xpd->auditallow) goto error; }if (which &XPERMS_DONTAUDIT ) { xpd->dontaudit =kmem_cache_zalloc (avc_xperms_data_cachep, -GFP_NOWAIT ); +GFP_NOWAIT | __GFP_NOWARN);if (!xpd->dontaudit) goto error; }
@@ -341,7 +342,7 @@ static struct avc_xperms_node *avc_xperms_alloc(void) {struct avc_xperms_node *xp_node; - xp_node =kmem_cache_zalloc (avc_xperms_cachep,GFP_NOWAIT ); + xp_node =kmem_cache_zalloc (avc_xperms_cachep,GFP_NOWAIT | __GFP_NOWARN);if (!xp_node)return xp_node;INIT_LIST_HEAD (&xp_node->xpd_head);
@@ -497,7 +498,7 @@ static struct avc_node *avc_alloc_node(struct selinux_avc *avc) {struct avc_node *node; - node =kmem_cache_zalloc (avc_node_cachep,GFP_NOWAIT ); + node =kmem_cache_zalloc (avc_node_cachep,GFP_NOWAIT | __GFP_NOWARN);if (!node) goto out;
security/smack/smackfs.c +2 -0
@@ -855,6 +855,8 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf,if (format ==SMK_FIXED24_FMT && (count <SMK_CIPSOMIN || count >SMK_CIPSOMAX ))return -EINVAL ; +if (count >PAGE_SIZE ) +return -EINVAL ; data =memdup_user_nul (buf, count);if (IS_ERR (data))
sound/soc/tegra/tegra_alc5632.c +1 -0
@@ -139,6 +139,7 @@ static struct snd_soc_dai_link tegra_alc5632_dai = {static struct snd_soc_card snd_soc_tegra_alc5632 = { .name ="tegra-alc5632" , + .driver_name ="tegra" , .owner =THIS_MODULE , .dai_link = &tegra_alc5632_dai, .num_links =1 ,
sound/soc/tegra/tegra_max98090.c +1 -0
@@ -182,6 +182,7 @@ static struct snd_soc_dai_link tegra_max98090_dai = {static struct snd_soc_card snd_soc_tegra_max98090 = { .name ="tegra-max98090" , + .driver_name ="tegra" , .owner =THIS_MODULE , .dai_link = &tegra_max98090_dai, .num_links =1 ,
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.