Linux 4.19.300
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.300 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/include/asm/exception.h | 4 - arch/parisc/include/uapi/asm/pdc.h | 1 arch/parisc/kernel/entry.S | 7 +-- arch/parisc/kernel/head.S | 5 -- arch/x86/include/asm/msr-index.h | 1 arch/x86/include/asm/numa.h | 7 --- arch/x86/kvm/x86.c | 2 arch/x86/mm/numa.c | 7 --- crypto/pcrypt.c | 4 + drivers/atm/iphase.c | 20 +++++---- drivers/clk/qcom/gcc-ipq8074.c | 6 -- drivers/clocksource/tcb_clksrc.c | 1 drivers/clocksource/timer-imx-gpt.c | 18 ++++++-- drivers/dma/stm32-mdma.c | 4 - drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++ drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 - drivers/gpu/drm/amd/include/pptable.h | 4 - drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 +++---- drivers/hid/hid-ids.h | 1 drivers/hid/hid-quirks.c | 1 drivers/i2c/busses/i2c-i801.c | 19 ++++---- drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 ++ drivers/infiniband/hw/hfi1/pcie.c | 9 ---- drivers/mcb/mcb-core.c | 1 drivers/mcb/mcb-parse.c | 2 drivers/media/platform/qcom/venus/hfi_msgs.c | 2 drivers/media/platform/qcom/venus/hfi_parser.c | 15 +++++++ drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++ drivers/media/platform/vivid/vivid-rds-gen.c | 2 drivers/media/rc/ir-sharp-decoder.c | 8 ++- drivers/media/rc/lirc_dev.c | 6 ++ drivers/media/usb/gspca/cpia1.c | 3 + drivers/mmc/host/meson-gx-mmc.c | 1 drivers/mmc/host/vub300.c | 1 drivers/net/dsa/lan9303_mdio.c | 4 - drivers/net/ethernet/cortina/gemini.c | 45 +++++++++++++-------- drivers/net/ethernet/cortina/gemini.h | 4 - drivers/net/ethernet/realtek/r8169_main.c | 4 - drivers/net/ipvlan/ipvlan_core.c | 41 +++++++++++-------- drivers/net/macvlan.c | 2 drivers/net/ppp/ppp_synctty.c | 6 ++ drivers/net/wireless/ath/ath10k/debug.c | 2 drivers/net/wireless/ath/ath9k/debug.c | 2 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 drivers/pci/controller/dwc/pci-keystone.c | 8 +-- drivers/pci/pci-acpi.c | 2 drivers/pci/pci-sysfs.c | 5 -- drivers/platform/x86/thinkpad_acpi.c | 1 drivers/ptp/ptp_chardev.c | 3 - drivers/ptp/ptp_clock.c | 5 +- drivers/ptp/ptp_private.h | 8 ++- drivers/ptp/ptp_sysfs.c | 3 - drivers/scsi/libfc/fc_lport.c | 6 ++ drivers/scsi/virtio_scsi.c | 1 drivers/tty/hvc/hvc_xen.c | 5 +- drivers/tty/serial/meson_uart.c | 44 +++++++++++++++----- drivers/tty/vcc.c | 16 ++++++- drivers/usb/gadget/function/f_ncm.c | 27 +++++------- drivers/xen/events/events_base.c | 4 + fs/cifs/cifs_spnego.c | 4 - fs/ext4/acl.h | 5 ++ fs/ext4/resize.c | 19 +++----- fs/gfs2/quota.c | 11 +++++ fs/iomap.c | 3 + fs/jbd2/recovery.c | 8 +++ fs/jfs/jfs_dmap.c | 23 ++++++++-- fs/jfs/jfs_imap.c | 5 +- fs/nfs/nfs4proc.c | 5 +- fs/quota/dquot.c | 14 ++++++ include/linux/pwm.h | 4 - include/net/sock.h | 26 ++++++++---- kernel/audit_watch.c | 9 +++- kernel/events/ring_buffer.c | 6 ++ kernel/irq/generic-chip.c | 25 ++++++++--- kernel/locking/test-ww_mutex.c | 20 +++++---- kernel/padata.c | 2 kernel/power/snapshot.c | 16 +++---- net/bluetooth/hci_conn.c | 6 -- net/bluetooth/hci_sysfs.c | 23 +++++----- net/core/sock.c | 2 net/ipv4/tcp_output.c | 2 net/mac80211/cfg.c | 4 + net/sched/sch_api.c | 5 +- net/tipc/netlink_compat.c | 1 scripts/gcc-plugins/randomize_layout_plugin.c | 11 +++-- sound/core/info.c | 21 ++++++--- sound/hda/hdac_stream.c | 6 +- sound/pci/hda/patch_realtek.c | 1 tools/testing/selftests/efivarfs/create-read.c | 2 91 files changed, 481 insertions(+), 264 deletions(-)
Alain Volmat (1):
dmaengine: stm32-mdma: correct desc prep when channel running
Alexander Sverdlin (1):
net: dsa: lan9303: consequently nested-lock physical MDIO
Anastasia Belova (1):
cifs: spnego: add ';' in HOST_KEY_LEN
Axel Lin (1):
i2c: sun6i-p2wi: Prevent potential division by zero
Bob Peterson (1):
gfs2: ignore negated quota changes
Brian Geffon (2):
PM: hibernate: Use __get_safe_page() rather than touching the list
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Cezary Rojewski (1):
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Chandradeep Dey (1):
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Christian König (1):
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Colin Ian King (1):
serial: meson: remove redundant initialization of variable id
Dan Carpenter (2):
pwm: Fix double shift bug
mmc: vub300: fix an error code
David Woodhouse (1):
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Dmitry Antipov (2):
wifi: ath9k: fix clang-specific fortify warnings
wifi: ath10k: fix clang-specific fortify warning
Dongli Zhang (1):
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Eric Biggers (1):
quota: explicitly forbid quota files from being encrypted
Eric Dumazet (5):
net: annotate data-races around sk->sk_tx_queue_mapping
net: annotate data-races around sk->sk_dst_pending_confirm
ipvlan: add ipvlan_route_v6_outbound() helper
ptp: annotate data-race around q->head and q->tail
net: sched: fix race condition in qdisc_graft()Greg Kroah-Hartman (1):
Linux 4.19.300
Hans Verkuil (1):
media: vivid: avoid integer overflow
Hardik Gajjar (1):
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Heiner Kallweit (2):
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Helge Deller (3):
parisc/pdc: Add width field to struct pdc_model
parisc: Prevent booting 64-bit kernels on PA1.x machines parisc/pgtable: Do not drop upper 5 address bits of physical address
Herve Codina (1):
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Ilpo Järvinen (2):
RDMA/hfi1: Use FIELD_GET() to extract Link Width
atm: iphase: Do PCI error checks on own line
Jacky Bai (1):
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Jiri Kosina (1):
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
John Stultz (1):
locking/ww_mutex/test: Fix potential workqueue corruption
Juergen Gross (1):
xen/events: fix delayed eoi list handling
Juntong Deng (2):
fs/jfs: Add check for negative db_l2nbperpage fs/jfs: Add validity check for db_maxag and db_agpref
Kathiravan Thirumoorthy (1):
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Kees Cook (1):
randstruct: Fix gcc-plugin performance mode to stay in group
Kemeng Shi (3):
ext4: correct offset of gdb backup in non meta_bg group to update_backups
ext4: correct return value of ext4_convert_meta_bg
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Lad Prabhakar (1):
serial: meson: Use platform_get_irq() to get the interrupt
Linus Walleij (3):
net: ethernet: cortina: Fix max RX frame define
net: ethernet: cortina: Handle large frames
net: ethernet: cortina: Fix MTU max setting
Loys Ollivier (1):
tty: serial: meson: if no alias specified use an available id
Lu Jialin (1):
crypto: pcrypt - Fix hungtask for PADATA_RESET
Lukas Wunner (1):
PCI/sysfs: Protect driver's D3cold preference from user space
Maciej S. Szmigiero (1):
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Manas Ghandat (2):
jfs: fix array-index-out-of-bounds in dbFindLeaf
jfs: fix array-index-out-of-bounds in diAlloc
Mario Limonciello (2):
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Matthew Wilcox (Oracle) (1):
iomap: Set all uptodate bits for an Uptodate page
Max Kellermann (1):
ext4: apply umask if ACL support is disabled
Mike Rapoport (IBM) (1):
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Neil Armstrong (1):
tty: serial: meson: retrieve port FIFO size from DT
Olga Kornievskaia (1):
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Olli Asikainen (1):
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
Paul Moore (2):
audit: don't take task_lock() in audit_exe_compare() code path
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Pavel Krasavin (1):
tty: serial: meson: fix hard LOCKUP on crtscts mode
Ping-Ke Shih (1):
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Qu Huang (1):
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Rajeshwar R Shinde (1):
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Ronald Wahl (1):
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Rong Chen (1):
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Sanjuán García, Jorge (1):
mcb: fix error handling for different scenarios when parsing
Sean Young (2):
media: lirc: drop trailing space from scancode transmit
media: sharp: fix sharp encoding
Shigeru Yoshida (2):
tty: Fix uninit-value access in ppp_sync_receive()
tipc: Fix kernel-infoleak due to uninitialized TLV value
Shuai Xue (1):
perf/core: Bail out early if the request AUX area is out of bound
Takashi Iwai (1):
ALSA: info: Fix potential deadlock at disconnection
Uwe Kleine-König (2):
PCI: keystone: Don't discard .remove() callback
PCI: keystone: Don't discard .probe() callback
Vikash Garodia (4):
media: venus: hfi: add checks to perform sanity on queue pointers
media: venus: hfi_parser: Add check to keep the number of codecs within range
media: venus: hfi: fix the check to handle session buffer requirement
media: venus: hfi: add checks to handle capabilities from firmware
Vincent Whitchurch (1):
ARM: 9320/1: fix stack depot IRQ stack filter
Vlad Buslov (1):
macvlan: Don't propagate promisc change to lower dev in passthru
Wayne Lin (1):
drm/amd/display: Avoid NULL dereference of timing generator
Wenchao Hao (1):
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Willem de Bruijn (1):
ppp: limit MRU to 64K
Yi Yang (1):
tty: vcc: Add check for kstrdup() in vcc_probe()
ZhengHan Wang (1):
Bluetooth: Fix double free in hci_conn_cleanup
Zhihao Cheng (1):
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
zhujun2 (1):
selftests/efivarfs: create-read: fix a resource leak
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 299 +SUBLEVEL = 300 EXTRAVERSION = NAME = "People's Front"
arch/arm/include/asm/exception.h +0 -4
@@ -10,10 +10,6 @@#include <linux/interrupt.h> -#ifdef CONFIG_FUNCTION_GRAPH_TRACER #define __exception_irq_entry __irq_entry -#else -#define __exception_irq_entry -#endif #endif /* __ASM_ARM_EXCEPTION_H */
arch/parisc/include/uapi/asm/pdc.h +1 -0
@@ -443,6 +443,7 @@ struct pdc_model { /* for PDC_MODEL */unsigned long arch_rev;unsigned long pot_key;unsigned long curr_key; +unsigned long width;/* default of PSW_W bit (1=enabled) */ };struct pdc_cache_cf {/* for PDC_CACHE (I/D-caches) */
arch/parisc/kernel/entry.S +3 -4
@@ -522,13 +522,13 @@ * to a CPU TLB 4k PFN (4k => 12 bits to shift) */ #define PAGE_ADD_SHIFT (PAGE_SHIFT-12) #define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12) + #define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT) /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ .macro convert_for_tlb_insert20 pte,tmp #ifdef CONFIG_HUGETLB_PAGE copy \pte,\tmp - extrd,u \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ - 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte + extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_SHIFT,\pte
@@ -536,8 +536,7 @@ depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_HUGE_SHIFT,\pte #else /* Huge pages disabled */ - extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ - 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte + extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ (63-58)+PAGE_ADD_SHIFT,\pte #endif
arch/parisc/kernel/head.S +2 -3
@@ -69,9 +69,8 @@ $bss_loop: stw,ma %arg2,4(%r1) stw,ma %arg3,4(%r1) -#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20) - /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU - * and halt kernel if we detect a PA1.x CPU. */ +#if defined(CONFIG_PA20) + /* check for 64-bit capable CPU as required by current kernel */ ldi 32,%r10 mtctl %r10,%cr11 .level 2.0
arch/x86/include/asm/msr-index.h +1 -0
@@ -414,6 +414,7 @@#define MSR_AMD64_OSVW_STATUS 0xc0010141#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022 +#define MSR_AMD64_TW_CFG 0xc0011023#define MSR_AMD64_DE_CFG 0xc0011029#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
arch/x86/include/asm/numa.h +0 -7
@@ -11,13 +11,6 @@#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) -/* -* Too small node sizes may confuse the VM badly. Usually they -* result from BIOS bugs. So dont recognize nodes as standalone -* NUMA entities that have less than this amount of RAM listed: -*/ -#define NODE_MIN_SIZE (4*1024*1024) -extern int numa_off;/*
arch/x86/kvm/x86.c +2 -0
@@ -2460,6 +2460,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)case MSR_AMD64_PATCH_LOADER :case MSR_AMD64_BU_CFG2 :case MSR_AMD64_DC_CFG : +case MSR_AMD64_TW_CFG :case MSR_F15H_EX_CFG :break ;
@@ -2763,6 +2764,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)case MSR_AMD64_BU_CFG2 :case MSR_IA32_PERF_CTL :case MSR_AMD64_DC_CFG : +case MSR_AMD64_TW_CFG :case MSR_F15H_EX_CFG : msr_info->data =0 ;break ;
arch/x86/mm/numa.c +0 -7
@@ -585,13 +585,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)if (start >= end)continue ; -/* -* Don't confuse VM with a node that doesn't have the -* minimum amount of memory: -*/ -if (end && (end - start) <NODE_MIN_SIZE ) -continue ; -alloc_node_data (nid); }
crypto/pcrypt.c +4 -0
@@ -174,6 +174,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req) err =pcrypt_do_parallel (padata, &ctx->cb_cpu, &pencrypt);if (!err)return -EINPROGRESS ; +if (err == -EBUSY ) +return -EAGAIN ;return err; }
@@ -218,6 +220,8 @@ static int pcrypt_aead_decrypt(struct aead_request *req) err =pcrypt_do_parallel (padata, &ctx->cb_cpu, &pdecrypt);if (!err)return -EINPROGRESS ; +if (err == -EBUSY ) +return -EAGAIN ;return err; }
drivers/atm/iphase.c +11 -9
@@ -2290,19 +2290,21 @@ static int get_esi(struct atm_dev *dev)static int reset_sar (struct atm_dev *dev) {IADEV *iadev; -int i, error =1 ; +int i, error;unsigned int pci[64 ]; iadev =INPH_IA_DEV (dev); -for (i=0 ; i<64 ; i++) -if ((error =pci_read_config_dword (iadev->pci, - i*4 , &pci[i])) !=PCIBIOS_SUCCESSFUL ) -return error; +for (i =0 ; i <64 ; i++) { + error =pci_read_config_dword (iadev->pci, i *4 , &pci[i]); +if (error !=PCIBIOS_SUCCESSFUL ) +return error; + }writel (0 , iadev->reg+IPHASE5575_EXT_RESET ); -for (i=0 ; i<64 ; i++) -if ((error =pci_write_config_dword (iadev->pci, - i*4 , pci[i])) !=PCIBIOS_SUCCESSFUL ) -return error; +for (i =0 ; i <64 ; i++) { + error =pci_write_config_dword (iadev->pci, i *4 , pci[i]); +if (error !=PCIBIOS_SUCCESSFUL ) +return error; + }udelay (5 );return 0 ; }
drivers/clk/qcom/gcc-ipq8074.c +0 -6
@@ -431,7 +431,6 @@ static struct clk_fixed_factor gpll0_out_main_div2 = { }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, };
@@ -478,7 +477,6 @@ static struct clk_alpha_pll_postdiv gpll2 = { }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, };
@@ -511,7 +509,6 @@ static struct clk_alpha_pll_postdiv gpll4 = { }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, };
@@ -545,7 +542,6 @@ static struct clk_alpha_pll_postdiv gpll6 = { }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, };
@@ -559,7 +555,6 @@ static struct clk_fixed_factor gpll6_out_main_div2 = { }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, }, };
@@ -624,7 +619,6 @@ static struct clk_alpha_pll_postdiv nss_crypto_pll = { }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, }, };
drivers/clocksource/tcb_clksrc.c +1 -0
@@ -294,6 +294,7 @@ static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx)writel (mck_divisor_idx/* likely divide-by-8 */ |ATMEL_TC_WAVE |ATMEL_TC_WAVESEL_UP /* free-run */ + |ATMEL_TC_ASWTRG_SET /* TIOA0 rises at software trigger */ |ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */ |ATMEL_TC_ACPC_CLEAR ,/* (duty cycle 50%) */ tcaddr +ATMEL_TC_REG (0 ,CMR ));
drivers/clocksource/timer-imx-gpt.c +13 -5
@@ -473,12 +473,16 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type treturn -ENOMEM ; imxtm->base =of_iomap (np,0 ); -if (!imxtm->base) -return -ENXIO ; +if (!imxtm->base) { + ret = -ENXIO ; + goto err_kfree; + } imxtm->irq =irq_of_parse_and_map (np,0 ); -if (imxtm->irq <=0 ) -return -EINVAL ; +if (imxtm->irq <=0 ) { + ret = -EINVAL ; + goto err_kfree; + } imxtm->clk_ipg =of_clk_get_by_name (np,"ipg" );
@@ -491,11 +495,15 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t ret =_mxc_timer_init (imxtm);if (ret) -return ret; + goto err_kfree; initialized =1 ;return 0 ; + +err_kfree: +kfree (imxtm); +return ret; }static int __init imx1_timer_init_dt (struct device_node *np)
drivers/dma/stm32-mdma.c +2 -2
@@ -520,7 +520,7 @@ static int stm32_mdma_set_xfer_param(struct stm32_mdma_chan *chan, src_maxburst = chan->dma_config.src_maxburst; dst_maxburst = chan->dma_config.dst_maxburst; - ccr =stm32_mdma_read (dmadev,STM32_MDMA_CCR (chan->id)); + ccr =stm32_mdma_read (dmadev,STM32_MDMA_CCR (chan->id)) & ~STM32_MDMA_CCR_EN ; ctcr =stm32_mdma_read (dmadev,STM32_MDMA_CTCR (chan->id)); ctbr =stm32_mdma_read (dmadev,STM32_MDMA_CTBR (chan->id));
@@ -948,7 +948,7 @@ stm32_mdma_prep_dma_memcpy(struct dma_chan *c, dma_addr_t dest, dma_addr_t src,if (!desc)return NULL ; - ccr =stm32_mdma_read (dmadev,STM32_MDMA_CCR (chan->id)); + ccr =stm32_mdma_read (dmadev,STM32_MDMA_CCR (chan->id)) & ~STM32_MDMA_CCR_EN ; ctcr =stm32_mdma_read (dmadev,STM32_MDMA_CTCR (chan->id)); ctbr =stm32_mdma_read (dmadev,STM32_MDMA_CTBR (chan->id)); cbndtr =stm32_mdma_read (dmadev,STM32_MDMA_CBNDTR (chan->id));
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 -0
@@ -168,6 +168,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id, }rcu_read_unlock (); + *result =NULL ;return -ENOENT ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +6 -0
@@ -391,6 +391,9 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,ssize_t result =0 ;int r; +if (!adev->smc_rreg) +return -EPERM ; +if (size &0x3 || *pos &0x3 )return -EINVAL ;
@@ -430,6 +433,9 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *ssize_t result =0 ;int r; +if (!adev->smc_wreg) +return -EPERM ; +if (size &0x3 || *pos &0x3 )return -EINVAL ;
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +2 -2
@@ -281,7 +281,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)for (i =0 ; i <MAX_PIPES ; i++) {struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; -if (res_ctx->pipe_ctx[i].stream != stream) +if (res_ctx->pipe_ctx[i].stream != stream || !tg)continue ;return tg->funcs->get_frame_count (tg);
@@ -305,7 +305,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,for (i =0 ; i <MAX_PIPES ; i++) {struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg; -if (res_ctx->pipe_ctx[i].stream != stream) +if (res_ctx->pipe_ctx[i].stream != stream || !tg)continue ; tg->funcs->get_scanoutpos(tg,
drivers/gpu/drm/amd/include/pptable.h +2 -2
@@ -78,7 +78,7 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLERtypedef struct _ATOM_PPLIB_STATE {UCHAR ucNonClockStateIndex; -UCHAR ucClockStateIndices[1 ];// variable-sized +UCHAR ucClockStateIndices[];// variable-sized }ATOM_PPLIB_STATE ;
@@ -473,7 +473,7 @@ typedef struct _ATOM_PPLIB_STATE_V2/** * Driver will read the first ucNumDPMLevels in this array */ -UCHAR clockInfoIndex[1 ]; +UCHAR clockInfoIndex[]; }ATOM_PPLIB_STATE_V2 ; typedef struct _StateArray{
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h +8 -8
@@ -164,7 +164,7 @@ typedef struct _ATOM_Tonga_State {typedef struct _ATOM_Tonga_State_Array {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_State entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_State entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_State_Array ; typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
@@ -179,7 +179,7 @@ typedef struct _ATOM_Tonga_MCLK_Dependency_Record {typedef struct _ATOM_Tonga_MCLK_Dependency_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_MCLK_Dependency_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_MCLK_Dependency_Record entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_MCLK_Dependency_Table ; typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
@@ -194,7 +194,7 @@ typedef struct _ATOM_Tonga_SCLK_Dependency_Record {typedef struct _ATOM_Tonga_SCLK_Dependency_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_SCLK_Dependency_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_SCLK_Dependency_Record entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_SCLK_Dependency_Table ; typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
@@ -210,7 +210,7 @@ typedef struct _ATOM_Polaris_SCLK_Dependency_Record {typedef struct _ATOM_Polaris_SCLK_Dependency_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Polaris_SCLK_Dependency_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Polaris_SCLK_Dependency_Record entries[];/* Dynamically allocate entries. */ }ATOM_Polaris_SCLK_Dependency_Table ; typedef struct _ATOM_Tonga_PCIE_Record {
@@ -222,7 +222,7 @@ typedef struct _ATOM_Tonga_PCIE_Record {typedef struct _ATOM_Tonga_PCIE_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_PCIE_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_PCIE_Record entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_PCIE_Table ; typedef struct _ATOM_Polaris10_PCIE_Record {
@@ -235,7 +235,7 @@ typedef struct _ATOM_Polaris10_PCIE_Record {typedef struct _ATOM_Polaris10_PCIE_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Polaris10_PCIE_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Polaris10_PCIE_Record entries[];/* Dynamically allocate entries. */ }ATOM_Polaris10_PCIE_Table ;
@@ -252,7 +252,7 @@ typedef struct _ATOM_Tonga_MM_Dependency_Record {typedef struct _ATOM_Tonga_MM_Dependency_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_MM_Dependency_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_MM_Dependency_Record entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_MM_Dependency_Table ; typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
@@ -265,7 +265,7 @@ typedef struct _ATOM_Tonga_Voltage_Lookup_Record {typedef struct _ATOM_Tonga_Voltage_Lookup_Table {UCHAR ucRevId;UCHAR ucNumEntries;/* Number of entries. */ -ATOM_Tonga_Voltage_Lookup_Record entries[1 ];/* Dynamically allocate entries. */ +ATOM_Tonga_Voltage_Lookup_Record entries[];/* Dynamically allocate entries. */ }ATOM_Tonga_Voltage_Lookup_Table ; typedef struct _ATOM_Tonga_Fan_Table {
drivers/hid/hid-ids.h +1 -0
@@ -343,6 +343,7 @@#define USB_VENDOR_ID_DELL 0x413c#define USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE 0x301a +#define USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W 0x4503#define USB_VENDOR_ID_DELORME 0x1163#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
drivers/hid/hid-quirks.c +1 -0
@@ -68,6 +68,7 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, + { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES), HID_QUIRK_MULTI_INPUT },
drivers/i2c/busses/i2c-i801.c +9 -10
@@ -712,15 +712,11 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,return i801_check_post (priv, status); } -for (i =1 ; i <= len; i++) { -if (i == len && read_write ==I2C_SMBUS_READ ) - smbcmd |=SMBHSTCNT_LAST_BYTE ; -outb_p (smbcmd,SMBHSTCNT (priv)); - -if (i ==1 ) -outb_p (inb (SMBHSTCNT (priv)) |SMBHSTCNT_START , -SMBHSTCNT (priv)); +if (len ==1 && read_write ==I2C_SMBUS_READ ) + smbcmd |=SMBHSTCNT_LAST_BYTE ; +outb_p (smbcmd |SMBHSTCNT_START ,SMBHSTCNT (priv)); +for (i =1 ; i <= len; i++) { status =i801_wait_byte_done (priv);if (status) goto exit;
@@ -743,9 +739,12 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv, data->block[0 ] = len; } -/* Retrieve/store value in SMBBLKDAT */ -if (read_write ==I2C_SMBUS_READ ) +if (read_write ==I2C_SMBUS_READ ) { data->block[i] =inb_p (SMBBLKDAT (priv)); +if (i == len -1 ) +outb_p (smbcmd |SMBHSTCNT_LAST_BYTE ,SMBHSTCNT (priv)); + } +if (read_write ==I2C_SMBUS_WRITE && i+1 <= len)outb_p (data->block[i+1 ],SMBBLKDAT (priv));
drivers/i2c/busses/i2c-sun6i-p2wi.c +5 -0
@@ -202,6 +202,11 @@ static int p2wi_probe(struct platform_device *pdev)return -EINVAL ; } +if (clk_freq ==0 ) { +dev_err (dev,"clock-frequency is set to 0 in DT\n" ); +return -EINVAL ; + } +if (of_get_child_count (np) >1 ) {dev_err (dev,"P2WI only supports one slave device\n" );return -EINVAL ;
drivers/infiniband/hw/hfi1/pcie.c +2 -7
@@ -45,6 +45,7 @@* */ +#include <linux/bitfield.h> #include <linux/pci.h> #include <linux/io.h> #include <linux/delay.h>
@@ -273,12 +274,6 @@ static u32 extract_speed(u16 linkstat)return speed; } -/* return the PCIe link speed from the given link status */ -static u32 extract_width (u16 linkstat) -{ -return (linkstat &PCI_EXP_LNKSTA_NLW ) >>PCI_EXP_LNKSTA_NLW_SHIFT ; -} -/* read the link status and set dd->{lbus_width,lbus_speed,lbus_info} */ static void update_lbus_info (struct hfi1_devdata *dd) {
@@ -291,7 +286,7 @@ static void update_lbus_info(struct hfi1_devdata *dd)return ; } - dd->lbus_width =extract_width (linkstat); + dd->lbus_width =FIELD_GET (PCI_EXP_LNKSTA_NLW , linkstat); dd->lbus_speed =extract_speed (linkstat);snprintf (dd->lbus_info,sizeof (dd->lbus_info),"PCIe,%uMHz,x%u" , dd->lbus_speed, dd->lbus_width);
drivers/mcb/mcb-core.c +1 -0
@@ -251,6 +251,7 @@ int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev)return 0 ; out: +put_device (&dev->dev);return ret; }
drivers/mcb/mcb-parse.c +1 -1
@@ -105,7 +105,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,return 0 ; err: -put_device (&mdev->dev); +mcb_free_dev (mdev);return ret; }
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
@@ -359,7 +359,7 @@ session_get_prop_buf_req(struct hfi_msg_session_property_info_pkt *pkt,memcpy (&bufreq[idx], buf_req,sizeof (*bufreq)); idx++; -if (idx >HFI_BUFFER_TYPE_MAX ) +if (idx >=HFI_BUFFER_TYPE_MAX )return HFI_ERR_SESSION_INVALID_PARAMETER ; req_bytes -=sizeof (struct hfi_buffer_requirements );
drivers/media/platform/qcom/venus/hfi_parser.c +15 -0
@@ -19,6 +19,9 @@ static void init_codecs(struct venus_core *core)struct venus_caps *caps = core->caps, *cap;unsigned long bit; +if (hweight_long (core->dec_codecs) +hweight_long (core->enc_codecs) >MAX_CODEC_NUM ) +return ; +for_each_set_bit (bit, &core->dec_codecs,MAX_CODEC_NUM ) { cap = &caps[core->codecs_count++]; cap->codec =BIT (bit);
@@ -86,6 +89,9 @@ static void fill_profile_level(struct venus_caps *cap, const void *data, {const struct hfi_profile_level *pl = data; +if (cap->num_pl + num >=HFI_MAX_PROFILE_COUNT ) +return ; +memcpy (&cap->pl[cap->num_pl], pl, num *sizeof (*pl)); cap->num_pl += num; }
@@ -111,6 +117,9 @@ fill_caps(struct venus_caps *cap, const void *data, unsigned int num) {const struct hfi_capability *caps = data; +if (cap->num_caps + num >=MAX_CAP_ENTRIES ) +return ; +memcpy (&cap->caps[cap->num_caps], caps, num *sizeof (*caps)); cap->num_caps += num; }
@@ -137,6 +146,9 @@ static void fill_raw_fmts(struct venus_caps *cap, const void *fmts, {const struct raw_formats *formats = fmts; +if (cap->num_fmts + num_fmts >=MAX_FMT_ENTRIES ) +return ; +memcpy (&cap->fmts[cap->num_fmts], formats, num_fmts *sizeof (*formats)); cap->num_fmts += num_fmts; }
@@ -159,6 +171,9 @@ parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) rawfmts[i].buftype = fmt->buffer_type; i++; +if (i >=MAX_FMT_ENTRIES ) +return ; +if (pinfo->num_planes >MAX_PLANES )break ;
drivers/media/platform/qcom/venus/hfi_venus.c +10 -0
@@ -220,6 +220,11 @@ static int venus_write_queue(struct venus_hfi_device *hdev, new_wr_idx = wr_idx + dwords; wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx <<2 )); + +if (wr_ptr < (u32 *)queue->qmem.kva || + wr_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size -sizeof (*wr_ptr))) +return -EINVAL ; +if (new_wr_idx < qsize) {memcpy (wr_ptr, packet, dwords <<2 ); }else {
@@ -287,6 +292,11 @@ static int venus_read_queue(struct venus_hfi_device *hdev, } rd_ptr = (u32 *)(queue->qmem.kva + (rd_idx <<2 )); + +if (rd_ptr < (u32 *)queue->qmem.kva || + rd_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size -sizeof (*rd_ptr))) +return -EINVAL ; + dwords = *rd_ptr >>2 ;if (!dwords)return -EINVAL ;
drivers/media/platform/vivid/vivid-rds-gen.c +1 -1
@@ -145,7 +145,7 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq, rds->ta = alt; rds->ms = true;snprintf (rds->psname,sizeof (rds->psname),"%6d.%1d" , - freq /16 , ((freq &0xf ) *10 ) /16 ); + (freq /16 ) %1000000 , (((freq &0xf ) *10 ) /16 ) %10 );if (alt) strlcpy(rds->radiotext, " The Radio Data System can switch between different Radio Texts ",
drivers/media/rc/ir-sharp-decoder.c +5 -3
@@ -23,7 +23,9 @@#define SHARP_UNIT 40000/* ns */ #define SHARP_BIT_PULSE (8 * SHARP_UNIT)/* 320us */ #define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT)/* 1ms (680us space) */ -#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT)/* 2ms (1680ms space) */ +#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT)/* 2ms (1680us space) */ +#define SHARP_BIT_0_SPACE (17 * SHARP_UNIT)/* 680us space */ +#define SHARP_BIT_1_SPACE (42 * SHARP_UNIT)/* 1680us space */ #define SHARP_ECHO_SPACE (1000 * SHARP_UNIT)/* 40 ms */ #define SHARP_TRAILER_SPACE (125 * SHARP_UNIT)/* 5 ms (even longer) */
@@ -176,8 +178,8 @@ static const struct ir_raw_timings_pd ir_sharp_timings = { .header_pulse = 0, .header_space = 0, .bit_pulse = SHARP_BIT_PULSE, - .bit_space[0] = SHARP_BIT_0_PERIOD, - .bit_space[1] = SHARP_BIT_1_PERIOD, + .bit_space[0] = SHARP_BIT_0_SPACE, + .bit_space[1] = SHARP_BIT_1_SPACE, .trailer_pulse = SHARP_BIT_PULSE, .trailer_space = SHARP_ECHO_SPACE, .msb_first = 1,
drivers/media/rc/lirc_dev.c +5 -1
@@ -302,7 +302,11 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,if (ret <0 ) goto out_kfree_raw; - count = ret; +/* drop trailing space */ +if (!(ret %2 )) + count = ret -1 ; +else + count = ret; txbuf =kmalloc_array (count,sizeof (unsigned int ),GFP_KERNEL );if (!txbuf) {
drivers/media/usb/gspca/cpia1.c +3 -0
@@ -28,6 +28,7 @@#include <linux/input.h> #include <linux/sched/signal.h> +#include <linux/bitops.h> #include "gspca.h"
@@ -1033,6 +1034,8 @@ static int set_flicker(struct gspca_dev *gspca_dev, int on, int apply) sd->params.exposure.expMode =2 ; sd->exposure_status =EXPOSURE_NORMAL ; } +if (sd->params.exposure.gain >=BITS_PER_TYPE (currentexp)) +return -EINVAL ; currentexp = currentexp << sd->params.exposure.gain; sd->params.exposure.gain =0 ;/* round down current exposure to nearest value */
drivers/mmc/host/meson-gx-mmc.c +0 -1
@@ -931,7 +931,6 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) cmd_cfg |=FIELD_PREP (CMD_CFG_CMD_INDEX_MASK , cmd->opcode); cmd_cfg |=CMD_CFG_OWNER ;/* owned by CPU */ - cmd_cfg |=CMD_CFG_ERROR ;/* stop in case of error */ meson_mmc_set_response_bits (cmd, &cmd_cfg);
drivers/mmc/host/vub300.c +1 -0
@@ -2321,6 +2321,7 @@ static int vub300_probe(struct usb_interface *interface, vub300->read_only = (0x0010 & vub300->system_port_status.port_flags) ?1 :0 ; }else { + retval = -EINVAL ; goto error5; }usb_set_intfdata (interface, vub300);
drivers/net/dsa/lan9303_mdio.c +2 -2
@@ -41,7 +41,7 @@ static int lan9303_mdio_write(void *ctx, uint32_t reg, uint32_t val)struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; reg <<=2 ;/* reg num to offset */ -mutex_lock (&sw_dev->device->bus->mdio_lock); +mutex_lock_nested (&sw_dev->device->bus->mdio_lock,MDIO_MUTEX_NESTED );lan9303_mdio_real_write (sw_dev->device, reg, val &0xffff );lan9303_mdio_real_write (sw_dev->device, reg +2 , (val >>16 ) &0xffff );mutex_unlock (&sw_dev->device->bus->mdio_lock);
@@ -59,7 +59,7 @@ static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx; reg <<=2 ;/* reg num to offset */ -mutex_lock (&sw_dev->device->bus->mdio_lock); +mutex_lock_nested (&sw_dev->device->bus->mdio_lock,MDIO_MUTEX_NESTED ); *val =lan9303_mdio_real_read (sw_dev->device, reg); *val |= (lan9303_mdio_real_read (sw_dev->device, reg +2 ) <<16 );mutex_unlock (&sw_dev->device->bus->mdio_lock);
drivers/net/ethernet/cortina/gemini.c +29 -16
85 lines not on this page · raw message
drivers/net/ethernet/cortina/gemini.h +2 -2
@@ -502,7 +502,7 @@ union gmac_txdesc_3 {#define SOF_BIT 0x80000000#define EOF_BIT 0x40000000#define EOFIE_BIT BIT(29) -#define MTU_SIZE_BIT_MASK 0x1fff +#define MTU_SIZE_BIT_MASK 0x7ff/* Max MTU 2047 bytes */ /* GMAC Tx Descriptor */ struct gmac_txdesc {
@@ -787,7 +787,7 @@ union gmac_config0 {#define CONFIG0_MAXLEN_1536 0#define CONFIG0_MAXLEN_1518 1#define CONFIG0_MAXLEN_1522 2 -#define CONFIG0_MAXLEN_1542 3 +#define CONFIG0_MAXLEN_1548 3#define CONFIG0_MAXLEN_9k 4/* 9212 */ #define CONFIG0_MAXLEN_10k 5/* 10236 */ #define CONFIG0_MAXLEN_1518__6 6
drivers/net/ethernet/realtek/r8169_main.c +1 -3
@@ -4628,9 +4628,7 @@ static void rtl_set_rx_mode(struct net_device *dev) rx_mode &= ~AcceptMulticast; }else if (netdev_mc_count (dev) >MC_FILTER_LIMIT || dev->flags &IFF_ALLMULTI || - tp->mac_version ==RTL_GIGA_MAC_VER_35 || - tp->mac_version ==RTL_GIGA_MAC_VER_46 || - tp->mac_version ==RTL_GIGA_MAC_VER_48 ) { + tp->mac_version ==RTL_GIGA_MAC_VER_35 ) {/* accept all multicasts */ }else if (netdev_mc_empty (dev)) { rx_mode &= ~AcceptMulticast;
drivers/net/ipvlan/ipvlan_core.c +25 -16
72 lines not on this page · raw message
drivers/net/macvlan.c +1 -1
@@ -769,7 +769,7 @@ static void macvlan_change_rx_flags(struct net_device *dev, int change)if (dev->flags &IFF_UP ) {if (change &IFF_ALLMULTI )dev_set_allmulti (lowerdev, dev->flags &IFF_ALLMULTI ?1 :-1 ); -if (change &IFF_PROMISC ) +if (!macvlan_passthru (vlan->port) && change &IFF_PROMISC )dev_set_promiscuity (lowerdev, dev->flags &IFF_PROMISC ?1 :-1 );
drivers/net/ppp/ppp_synctty.c +5 -1
@@ -467,6 +467,10 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)case PPPIOCSMRU :if (get_user (val, (int __user *) argp))break ; +if (val >U16_MAX ) { + err = -EINVAL ; +break ; + }if (val <PPP_MRU ) val =PPP_MRU ; ap->mru = val;
@@ -702,7 +706,7 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,/* strip address/control field if present */ p = skb->data; -if (p[0 ] ==PPP_ALLSTATIONS && p[1 ] ==PPP_UI ) { +if (skb->len >=2 && p[0 ] ==PPP_ALLSTATIONS && p[1 ] ==PPP_UI ) {/* chop off address/control */ if (skb->len <3 ) goto err;
drivers/net/wireless/ath/ath10k/debug.c +1 -1
@@ -1146,7 +1146,7 @@ void ath10k_debug_get_et_strings(struct ieee80211_hw *hw, u32 sset, u8 *data) {if (sset ==ETH_SS_STATS ) -memcpy (data, *ath10k_gstrings_stats, +memcpy (data, ath10k_gstrings_stats,sizeof (ath10k_gstrings_stats)); }
drivers/net/wireless/ath/ath9k/debug.c +1 -1
@@ -1297,7 +1297,7 @@ void ath9k_get_et_strings(struct ieee80211_hw *hw, u32 sset, u8 *data) {if (sset ==ETH_SS_STATS ) -memcpy (data, *ath9k_gstrings_stats, +memcpy (data, ath9k_gstrings_stats,sizeof (ath9k_gstrings_stats)); }
drivers/net/wireless/ath/ath9k/htc_drv_debug.c +1 -1
@@ -428,7 +428,7 @@ void ath9k_htc_get_et_strings(struct ieee80211_hw *hw, u32 sset, u8 *data) {if (sset ==ETH_SS_STATS ) -memcpy (data, *ath9k_htc_gstrings_stats, +memcpy (data, ath9k_htc_gstrings_stats,sizeof (ath9k_htc_gstrings_stats)); }
drivers/pci/controller/dwc/pci-keystone.c +4 -4
@@ -376,7 +376,7 @@ static const struct dw_pcie_ops dw_pcie_ops = { .link_up = ks_dw_pcie_link_up, }; -static int __exit ks_pcie_remove(struct platform_device *pdev) +static int ks_pcie_remove (struct platform_device *pdev) {struct keystone_pcie *ks_pcie =platform_get_drvdata (pdev);
@@ -385,7 +385,7 @@ static int __exit ks_pcie_remove(struct platform_device *pdev)return 0 ; } -static int __init ks_pcie_probe (struct platform_device *pdev) +static int ks_pcie_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct dw_pcie *pci;
@@ -452,9 +452,9 @@ static int __init ks_pcie_probe(struct platform_device *pdev)return ret; } -static struct platform_driver ks_pcie_driver__refdata = { +static struct platform_driver ks_pcie_driver = { .probe = ks_pcie_probe, - .remove =__exit_p (ks_pcie_remove), + .remove = ks_pcie_remove, .driver = { .name ="keystone-pcie" , .of_match_table =of_match_ptr (ks_pcie_of_match),
drivers/pci/pci-acpi.c +1 -1
@@ -496,7 +496,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev) {int acpi_state, d_max; -if (pdev->no_d3cold) +if (pdev->no_d3cold || !pdev->d3cold_allowed) d_max =ACPI_STATE_D3_HOT ;else d_max =ACPI_STATE_D3_COLD ;
drivers/pci/pci-sysfs.c +1 -4
@@ -519,10 +519,7 @@ static ssize_t d3cold_allowed_store(struct device *dev,return -EINVAL ; pdev->d3cold_allowed = !!val; -if (pdev->d3cold_allowed) -pci_d3cold_enable (pdev); -else -pci_d3cold_disable (pdev); +pci_bridge_d3_update (pdev);pm_runtime_resume (dev);
drivers/platform/x86/thinkpad_acpi.c +1 -0
@@ -9699,6 +9699,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {* Individual addressing is broken on models that expose the * primary battery as BAT1. */ +TPACPI_Q_LNV ('8' ,'F' , true),/* Thinkpad X120e */ TPACPI_Q_LNV ('J' ,'7' , true),/* B5400 */ TPACPI_Q_LNV ('J' ,'I' , true),/* Thinkpad 11e */ TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
drivers/ptp/ptp_chardev.c +2 -1
@@ -346,7 +346,8 @@ ssize_t ptp_read(struct posix_clock *pc,for (i =0 ; i < cnt; i++) { event[i] = queue->buf[queue->head]; - queue->head = (queue->head +1 ) %PTP_MAX_TIMESTAMPS ; +/* Paired with READ_ONCE() in queue_cnt() */ +WRITE_ONCE (queue->head, (queue->head +1 ) %PTP_MAX_TIMESTAMPS ); }spin_unlock_irqrestore (&queue->lock, flags);
drivers/ptp/ptp_clock.c +3 -2
@@ -68,10 +68,11 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue, dst->t.sec = seconds; dst->t.nsec = remainder; +/* Both WRITE_ONCE() are paired with READ_ONCE() in queue_cnt() */ if (!queue_free (queue)) - queue->head = (queue->head +1 ) %PTP_MAX_TIMESTAMPS ; +WRITE_ONCE (queue->head, (queue->head +1 ) %PTP_MAX_TIMESTAMPS ); - queue->tail = (queue->tail +1 ) %PTP_MAX_TIMESTAMPS ; +WRITE_ONCE (queue->tail, (queue->tail +1 ) %PTP_MAX_TIMESTAMPS );spin_unlock_irqrestore (&queue->lock, flags); }
drivers/ptp/ptp_private.h +6 -2
@@ -68,9 +68,13 @@ struct ptp_clock {* that a writer might concurrently increment the tail does not * matter, since the queue remains nonempty nonetheless. */ -static inline int queue_cnt (struct timestamp_event_queue *q) +static inline int queue_cnt (const struct timestamp_event_queue *q) { -int cnt = q->tail - q->head; +/* +* Paired with WRITE_ONCE() in enqueue_external_timestamp(), +* ptp_read(), extts_fifo_show(). +*/ +int cnt =READ_ONCE (q->tail) -READ_ONCE (q->head);return cnt <0 ?PTP_MAX_TIMESTAMPS + cnt : cnt; }
drivers/ptp/ptp_sysfs.c +2 -1
@@ -91,7 +91,8 @@ static ssize_t extts_fifo_show(struct device *dev, qcnt =queue_cnt (queue);if (qcnt) { event = queue->buf[queue->head]; - queue->head = (queue->head +1 ) %PTP_MAX_TIMESTAMPS ; +/* Paired with READ_ONCE() in queue_cnt() */ +WRITE_ONCE (queue->head, (queue->head +1 ) %PTP_MAX_TIMESTAMPS ); }spin_unlock_irqrestore (&queue->lock, flags);
drivers/scsi/libfc/fc_lport.c +6 -0
@@ -250,6 +250,12 @@ static void fc_lport_ptp_setup(struct fc_lport *lport, }mutex_lock (&lport->disc.disc_mutex); lport->ptp_rdata =fc_rport_create (lport, remote_fid); +if (!lport->ptp_rdata) { +printk (KERN_WARNING "libfc: Failed to setup lport 0x%x\n" , + lport->port_id); +mutex_unlock (&lport->disc.disc_mutex); +return ; + }kref_get (&lport->ptp_rdata->kref); lport->ptp_rdata->ids.port_name = remote_wwpn; lport->ptp_rdata->ids.node_name = remote_wwnn;
drivers/scsi/virtio_scsi.c +1 -0
@@ -853,6 +853,7 @@ static int virtscsi_probe(struct virtio_device *vdev)/* We need to know how many queues before we allocate. */ num_queues =virtscsi_config_get (vdev, num_queues) ? :1 ; + num_queues = min_t(unsigned int, nr_cpu_ids, num_queues); num_targets =virtscsi_config_get (vdev, max_target) +1 ;
drivers/tty/hvc/hvc_xen.c +3 -2
@@ -587,7 +587,7 @@ static int __init xen_hvc_init(void) ops = &dom0_hvc_ops; r =xen_initial_domain_console_init ();if (r <0 ) -return r; + goto register_fe; info =vtermno_to_xencons (HVC_COOKIE ); }else { ops = &domU_hvc_ops;
@@ -596,7 +596,7 @@ static int __init xen_hvc_init(void)else r =xen_pv_console_init ();if (r <0 ) -return r; + goto register_fe; info =vtermno_to_xencons (HVC_COOKIE ); info->irq =bind_evtchn_to_irq_lateeoi (info->evtchn);
@@ -621,6 +621,7 @@ static int __init xen_hvc_init(void) } r =0 ; + register_fe: #ifdef CONFIG_HVC_XEN_FRONTEND r =xenbus_register_frontend (&xencons_driver);#endif
drivers/tty/serial/meson_uart.c +34 -10
87 lines not on this page · raw message
drivers/tty/vcc.c +13 -3
@@ -586,18 +586,22 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)return -ENOMEM ; name =kstrdup (dev_name (&vdev->dev),GFP_KERNEL ); +if (!name) { + rv = -ENOMEM ; + goto free_port; + } rv =vio_driver_init (&port->vio, vdev,VDEV_CONSOLE_CON , vcc_versions,ARRAY_SIZE (vcc_versions),NULL , name);if (rv) - goto free_port; + goto free_name; port->vio.debug = vcc_dbg_vio; vcc_ldc_cfg.debug = vcc_dbg_ldc; rv =vio_ldc_alloc (&port->vio, &vcc_ldc_cfg, port);if (rv) - goto free_port; + goto free_name;spin_lock_init (&port->lock);
@@ -631,6 +635,11 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto unreg_tty; } port->domain =kstrdup (domain,GFP_KERNEL ); +if (!port->domain) { + rv = -ENOMEM ; + goto unreg_tty; + } +mdesc_release (hp);
@@ -660,8 +669,9 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)vcc_table_remove (port->index); free_ldc:vio_ldc_free (&port->vio); -free_port: +free_name:kfree (name); +free_port:kfree (port);return rv;
drivers/usb/gadget/function/f_ncm.c +11 -16
@@ -1435,7 +1435,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)struct usb_composite_dev *cdev = c->cdev;struct f_ncm *ncm =func_to_ncm (f);struct usb_string *us; -int status; +int status =0 ;struct usb_ep *ep;struct f_ncm_opts *ncm_opts;
@@ -1453,22 +1453,17 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) f->os_desc_table[0 ].os_desc = &ncm_opts->ncm_os_desc; } -/* -* in drivers/usb/gadget/configfs.c:configfs_composite_bind() -* configurations are bound in sequence with list_for_each_entry, -* in each configuration its functions are bound in sequence -* with list_for_each_entry, so we assume no race condition -* with regard to ncm_opts->bound access -*/ -if (!ncm_opts->bound) { -mutex_lock (&ncm_opts->lock); -gether_set_gadget (ncm_opts->net, cdev->gadget); +mutex_lock (&ncm_opts->lock); +gether_set_gadget (ncm_opts->net, cdev->gadget); +if (!ncm_opts->bound) status =gether_register_netdev (ncm_opts->net); -mutex_unlock (&ncm_opts->lock); -if (status) - goto fail; - ncm_opts->bound = true; - } +mutex_unlock (&ncm_opts->lock); + +if (status) + goto fail; + + ncm_opts->bound = true; + us =usb_gstrings_attach (cdev, ncm_strings,ARRAY_SIZE (ncm_string_defs));if (IS_ERR (us)) {
drivers/xen/events/events_base.c +3 -1
@@ -490,7 +490,9 @@ static void lateeoi_list_add(struct irq_info *info)spin_lock_irqsave (&eoi->eoi_list_lock, flags); -if (list_empty (&eoi->eoi_list)) { + elem = list_first_entry_or_null(&eoi->eoi_list, struct irq_info, + eoi_list); +if (!elem || info->eoi_time < elem->eoi_time) {list_add (&info->eoi_list, &eoi->eoi_list);mod_delayed_work_on (info->eoi_cpu, system_wq, &eoi->delayed, delay);
fs/cifs/cifs_spnego.c +2 -2
@@ -76,8 +76,8 @@ struct key_type cifs_spnego_key_type = {* strlen(";sec=ntlmsspi") */ #define MAX_MECH_STR_LEN 13 -/* strlen of "host=" */ -#define HOST_KEY_LEN 5 +/* strlen of ";host=" */ +#define HOST_KEY_LEN 6/* strlen of ";ip4=" or ";ip6=" */ #define IP_KEY_LEN 5
fs/ext4/acl.h +5 -0
@@ -67,6 +67,11 @@ extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);static inline int ext4_init_acl (handle_t *handle,struct inode *inode,struct inode *dir) { +/* usually, the umask is applied by posix_acl_create(), but if +ext4 ACL support is disabled at compile time, we need to do +it here, because posix_acl_create() will never be called */ + inode->i_mode &= ~current_umask (); +return 0 ; }#endif /* CONFIG_EXT4_FS_POSIX_ACL */
fs/ext4/resize.c +7 -12
@@ -572,13 +572,8 @@ static int setup_new_flex_group_blocks(struct super_block *sb,if (meta_bg ==0 && !ext4_bg_has_super (sb, group)) goto handle_itb; -if (meta_bg ==1 ) { -ext4_group_t first_group; - first_group =ext4_meta_bg_first_group (sb, group); -if (first_group != group +1 && - first_group != group +EXT4_DESC_PER_BLOCK (sb) -1 ) - goto handle_itb; - } +if (meta_bg ==1 ) + goto handle_itb; block = start +ext4_bg_has_super (sb, group);/* Copy all of the GDT blocks into the backup in this group */
@@ -1565,6 +1560,8 @@ static int ext4_flex_group_add(struct super_block *sb,int gdb_num_end = ((group + flex_gd->count -1 ) /EXT4_DESC_PER_BLOCK (sb));int meta_bg =ext4_has_feature_meta_bg (sb); +sector_t padding_blocks = meta_bg ?0 : sbi->s_sbh->b_blocknr - +ext4_group_first_block_no (sb,0 );sector_t old_gdb =0 ; update_backups(sb, ext4_group_first_block_no(sb, 0),
@@ -1576,8 +1573,8 @@ static int ext4_flex_group_add(struct super_block *sb, gdb_num);if (old_gdb == gdb_bh->b_blocknr)continue ; -update_backups (sb, gdb_bh->b_blocknr, gdb_bh->b_data, - gdb_bh->b_size, meta_bg); +update_backups (sb, gdb_bh->b_blocknr - padding_blocks, + gdb_bh->b_data, gdb_bh->b_size, meta_bg); old_gdb = gdb_bh->b_blocknr; } }
@@ -1940,9 +1937,7 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode) errout: ret =ext4_journal_stop (handle); -if (!err) - err = ret; -return ret; +return err ? err : ret; invalid_resize_inode:ext4_error (sb,"corrupted/inconsistent resize inode" );
fs/gfs2/quota.c +11 -0
@@ -434,6 +434,17 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd, (sync_gen && (qd->qd_sync_gen >= *sync_gen)))return 0 ; +/* +* If qd_change is 0 it means a pending quota change was negated. +* We should not sync it, but we still have a qd reference and slot +* reference taken by gfs2_quota_change -> do_qc that need to be put. +*/ +if (!qd->qd_change &&test_and_clear_bit (QDF_CHANGE , &qd->qd_flags)) { +slot_put (qd); +qd_put (qd); +return 0 ; + } +if (!lockref_get_not_dead (&qd->qd_lockref))return 0 ;
fs/iomap.c +3 -0
@@ -109,6 +109,7 @@ static struct iomap_page * iomap_page_create(struct inode *inode, struct page *page) { struct iomap_page *iop = to_iomap_page(page); +unsigned int nr_blocks =PAGE_SIZE /i_blocksize (inode);if (iop ||i_blocksize (inode) ==PAGE_SIZE )return iop;
@@ -118,6 +119,8 @@ iomap_page_create(struct inode *inode, struct page *page)atomic_set (&iop->write_count,0 );spin_lock_init (&iop->uptodate_lock);bitmap_zero (iop->uptodate,PAGE_SIZE /SECTOR_SIZE ); +if (PageUptodate (page)) +bitmap_fill (iop->uptodate, nr_blocks);/* * migrate_page_move_mapping() assumes that pages with private data have
fs/jbd2/recovery.c +8 -0
@@ -247,6 +247,8 @@ int jbd2_journal_recover(journal_t *journal)journal_superblock_t * sb;struct recovery_info info; +errseq_t wb_err; +struct address_space *mapping;memset (&info,0 ,sizeof (info)); sb = journal->j_superblock;
@@ -264,6 +266,9 @@ int jbd2_journal_recover(journal_t *journal)return 0 ; } + wb_err =0 ; + mapping = journal->j_fs_dev->bd_inode->i_mapping; +errseq_check_and_advance (&mapping->wb_err, &wb_err); err =do_one_pass (journal, &info,PASS_SCAN );if (!err) err =do_one_pass (journal, &info,PASS_REVOKE );
@@ -282,6 +287,9 @@ int jbd2_journal_recover(journal_t *journal)jbd2_journal_clear_revoke (journal); err2 =sync_blockdev (journal->j_fs_dev); +if (!err) + err = err2; + err2 =errseq_check_and_advance (&mapping->wb_err, &wb_err);if (!err) err = err2;/* Make sure all replayed data is on permanent storage */
fs/jfs/jfs_dmap.c +18 -5
@@ -100,7 +100,7 @@ static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,static int dbExtend (struct inode *ip,s64 blkno,s64 nblocks,s64 addnblocks);static int dbFindBits (u32 word,int l2nb);static int dbFindCtl (struct bmap * bmp,int l2nb,int level,s64 * blkno); -static int dbFindLeaf (dmtree_t * tp,int l2nb,int *leafidx); +static int dbFindLeaf (dmtree_t *tp,int l2nb,int *leafidx,bool is_ctl);static int dbFreeBits (struct bmap * bmp,struct dmap * dp,s64 blkno,int nblocks); static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
@@ -193,7 +193,8 @@ int dbMount(struct inode *ipbmap) bmp->db_nfree =le64_to_cpu (dbmp_le->dn_nfree); bmp->db_l2nbperpage =le32_to_cpu (dbmp_le->dn_l2nbperpage); -if (bmp->db_l2nbperpage >L2PSIZE -L2MINBLOCKSIZE ) { +if (bmp->db_l2nbperpage >L2PSIZE -L2MINBLOCKSIZE || + bmp->db_l2nbperpage <0 ) { err = -EINVAL ; goto err_release_metapage; }
@@ -207,6 +208,12 @@ int dbMount(struct inode *ipbmap) bmp->db_maxlevel =le32_to_cpu (dbmp_le->dn_maxlevel); bmp->db_maxag =le32_to_cpu (dbmp_le->dn_maxag); bmp->db_agpref =le32_to_cpu (dbmp_le->dn_agpref); +if (bmp->db_maxag >=MAXAG || bmp->db_maxag <0 || + bmp->db_agpref >=MAXAG || bmp->db_agpref <0 ) { + err = -EINVAL ; + goto err_release_metapage; + } + bmp->db_aglevel =le32_to_cpu (dbmp_le->dn_aglevel); bmp->db_agheight =le32_to_cpu (dbmp_le->dn_agheight); bmp->db_agwidth =le32_to_cpu (dbmp_le->dn_agwidth);
@@ -1791,7 +1798,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)* dbFindLeaf() returns the index of the leaf at which * free space was found. */ - rc =dbFindLeaf ((dmtree_t *) dcp, l2nb, &leafidx); + rc =dbFindLeaf ((dmtree_t *) dcp, l2nb, &leafidx, true);/* release the buffer. */
@@ -2038,7 +2045,7 @@ dbAllocDmapLev(struct bmap * bmp,* free space. if sufficient free space is found, dbFindLeaf() * returns the index of the leaf at which free space was found. */ -if (dbFindLeaf ((dmtree_t *) & dp->tree, l2nb, &leafidx)) +if (dbFindLeaf ((dmtree_t *) &dp->tree, l2nb, &leafidx, false))return -ENOSPC ;if (leafidx <0 )
@@ -2998,14 +3005,18 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval)* leafidx - return pointer to be set to the index of the leaf * describing at least l2nb free blocks if sufficient * free blocks are found. +* is_ctl - determines if the tree is of type ctl * * RETURN VALUES: * 0 - success * -ENOSPC - insufficient free blocks. */ -static int dbFindLeaf (dmtree_t * tp,int l2nb,int *leafidx) +static int dbFindLeaf (dmtree_t *tp,int l2nb,int *leafidx,bool is_ctl) {int ti, n =0 , k, x =0 ; +int max_size; + + max_size = is_ctl ?CTLTREESIZE :TREESIZE ;/* first check the root of the tree to see if there is * sufficient free space.
@@ -3026,6 +3037,8 @@ static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)/* sufficient free space found. move to the next * level (or quit if this is the last level). */ +if (x + n > max_size) +return -ENOSPC ;if (l2nb <= tp->dmt_stree[x + n])break ; }
fs/jfs/jfs_imap.c +4 -1
@@ -1335,7 +1335,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)int diAlloc (struct inode *pip,bool dir,struct inode *ip) {int rc, ino, iagno, addext, extno, bitno, sword; -int nwords, rem, i, agno; +int nwords, rem, i, agno, dn_numag;u32 mask, inosmap, extsmap;struct inode *ipimap;struct metapage *mp;
@@ -1371,6 +1371,9 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)/* get the ag number of this iag */ agno =BLKTOAG (JFS_IP (pip)->agstart,JFS_SBI (pip->i_sb)); + dn_numag =JFS_SBI (pip->i_sb)->bmap->db_numag; +if (agno <0 || agno > dn_numag) +return -EIO ;if (atomic_read (&JFS_SBI (pip->i_sb)->bmap->db_active[agno])) {/*
fs/nfs/nfs4proc.c +3 -2
@@ -5143,7 +5143,7 @@ static void nfs4_proc_write_setup(struct nfs_pgio_header *hdr, msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE ];nfs4_init_sequence (&hdr->args.seq_args, &hdr->res.seq_res,0 ,0 ); -nfs4_state_protect_write (server->nfs_client, clnt, msg, hdr); +nfs4_state_protect_write (hdr->ds_clp ? hdr->ds_clp : server->nfs_client, clnt, msg, hdr); }static void nfs4_proc_commit_rpc_prepare (struct rpc_task *task,struct nfs_commit_data *data)
@@ -5184,7 +5184,8 @@ static void nfs4_proc_commit_setup(struct nfs_commit_data *data, struct rpc_mess data->res.server = server; msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT ];nfs4_init_sequence (&data->args.seq_args, &data->res.seq_res,1 ,0 ); -nfs4_state_protect (server->nfs_client,NFS_SP4_MACH_CRED_COMMIT , clnt, msg); +nfs4_state_protect (data->ds_clp ? data->ds_clp : server->nfs_client, +NFS_SP4_MACH_CRED_COMMIT , clnt, msg); } static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args,
fs/quota/dquot.c +14 -0
@@ -2385,6 +2385,20 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)if (sb_has_quota_loaded (sb, type))return -EBUSY ; +/* +* Quota files should never be encrypted. They should be thought of as +* filesystem metadata, not user data. New-style internal quota files +* cannot be encrypted by users anyway, but old-style external quota +* files could potentially be incorrectly created in an encrypted +* directory, hence this explicit check. Some reasons why encrypted +* quota files don't work include: (1) some filesystems that support +* encryption don't handle it in their quota_read and quota_write, and +* (2) cleaning up encrypted quota files at unmount would need special +* consideration, as quota files are cleaned up later than user files. +*/ +if (IS_ENCRYPTED (inode)) +return -EINVAL ; + dqopt->files[type] =igrab (inode);if (!dqopt->files[type])return -EIO ;
include/linux/pwm.h +2 -2
@@ -44,8 +44,8 @@ struct pwm_args { };enum { -PWMF_REQUESTED =1 <<0 , -PWMF_EXPORTED =1 <<1 , +PWMF_REQUESTED =0 , +PWMF_EXPORTED =1 , };/*
include/net/sock.h +19 -7
@@ -1759,21 +1759,33 @@ static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)/* sk_tx_queue_mapping accept only upto a 16-bit value */ if (WARN_ON_ONCE ((unsigned short )tx_queue >=USHRT_MAX ))return ; - sk->sk_tx_queue_mapping = tx_queue; +/* Paired with READ_ONCE() in sk_tx_queue_get() and +* other WRITE_ONCE() because socket lock might be not held. +*/ +WRITE_ONCE (sk->sk_tx_queue_mapping, tx_queue); }#define NO_QUEUE_MAPPING USHRT_MAXstatic inline void sk_tx_queue_clear (struct sock *sk) { - sk->sk_tx_queue_mapping =NO_QUEUE_MAPPING ; +/* Paired with READ_ONCE() in sk_tx_queue_get() and +* other WRITE_ONCE() because socket lock might be not held. +*/ +WRITE_ONCE (sk->sk_tx_queue_mapping,NO_QUEUE_MAPPING ); }static inline int sk_tx_queue_get (const struct sock *sk) { -if (sk && sk->sk_tx_queue_mapping !=NO_QUEUE_MAPPING ) -return sk->sk_tx_queue_mapping; +if (sk) { +/* Paired with WRITE_ONCE() in sk_tx_queue_clear() +* and sk_tx_queue_set(). +*/ +int val =READ_ONCE (sk->sk_tx_queue_mapping); +if (val !=NO_QUEUE_MAPPING ) +return val; + }return -1 ; }
@@ -1906,7 +1918,7 @@ static inline void dst_negative_advice(struct sock *sk)if (ndst != dst) {rcu_assign_pointer (sk->sk_dst_cache, ndst);sk_tx_queue_clear (sk); - sk->sk_dst_pending_confirm =0 ; +WRITE_ONCE (sk->sk_dst_pending_confirm,0 ); } } }
@@ -1917,7 +1929,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)struct dst_entry *old_dst;sk_tx_queue_clear (sk); - sk->sk_dst_pending_confirm =0 ; +WRITE_ONCE (sk->sk_dst_pending_confirm,0 ); old_dst =rcu_dereference_protected (sk->sk_dst_cache,lockdep_sock_is_held (sk));rcu_assign_pointer (sk->sk_dst_cache, dst);
@@ -1930,7 +1942,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)struct dst_entry *old_dst;sk_tx_queue_clear (sk); - sk->sk_dst_pending_confirm =0 ; +WRITE_ONCE (sk->sk_dst_pending_confirm,0 ); old_dst =xchg ((__force struct dst_entry **)&sk->sk_dst_cache, dst);dst_release (old_dst); }
kernel/audit_watch.c +8 -1
@@ -557,11 +557,18 @@ int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark)unsigned long ino;dev_t dev; - exe_file =get_task_exe_file (tsk); +/* only do exe filtering if we are recording @current events/records */ +if (tsk != current) +return 0 ; + +if (!current->mm) +return 0 ; + exe_file =get_mm_exe_file (current->mm);if (!exe_file)return 0 ; ino =file_inode (exe_file)->i_ino; dev =file_inode (exe_file)->i_sb->s_dev;fput (exe_file); +return audit_mark_compare (mark, ino, dev); }
kernel/events/ring_buffer.c +6 -0
@@ -639,6 +639,12 @@ int rb_alloc_aux(struct ring_buffer *rb, struct perf_event *event, } } +/* +* kcalloc_node() is unable to allocate buffer if the size is larger +* than: PAGE_SIZE << MAX_ORDER; directly bail out in this case. +*/ +if (get_order ((unsigned long )nr_pages *sizeof (void *)) >MAX_ORDER ) +return -ENOMEM ; rb->aux_pages =kcalloc_node (nr_pages,sizeof (void *),GFP_KERNEL , node);if (!rb->aux_pages)
kernel/irq/generic-chip.c +19 -6
@@ -537,21 +537,34 @@ EXPORT_SYMBOL_GPL(irq_setup_alt_chip);void irq_remove_generic_chip (struct irq_chip_generic *gc,u32 msk,unsigned int clr,unsigned int set) { -unsigned int i = gc->irq_base; +unsigned int i, virq;raw_spin_lock (&gc_lock);list_del (&gc->list);raw_spin_unlock (&gc_lock); -for (; msk; msk >>=1 , i++) { +for (i =0 ; msk; msk >>=1 , i++) {if (!(msk &0x01 ))continue ; +/* +* Interrupt domain based chips store the base hardware +* interrupt number in gc::irq_base. Otherwise gc::irq_base +* contains the base Linux interrupt number. +*/ +if (gc->domain) { + virq =irq_find_mapping (gc->domain, gc->irq_base + i); +if (!virq) +continue ; + }else { + virq = gc->irq_base + i; + } +/* Remove handler first. That will mask the irq line */ -irq_set_handler (i,NULL ); -irq_set_chip (i, &no_irq_chip); -irq_set_chip_data (i,NULL ); -irq_modify_status (i, clr, set); +irq_set_handler (virq,NULL ); +irq_set_chip (virq, &no_irq_chip); +irq_set_chip_data (virq,NULL ); +irq_modify_status (virq, clr, set); } }EXPORT_SYMBOL_GPL (irq_remove_generic_chip);
kernel/locking/test-ww_mutex.c +12 -8
@@ -439,7 +439,6 @@ static void stress_inorder_work(struct work_struct *work) }while (!time_after (jiffies, stress->timeout));kfree (order); -kfree (stress); }struct reorder_lock {
@@ -504,7 +503,6 @@ static void stress_reorder_work(struct work_struct *work)list_for_each_entry_safe (ll, ln, &locks, link)kfree (ll);kfree (order); -kfree (stress); }static void stress_one_work (struct work_struct *work)
@@ -525,8 +523,6 @@ static void stress_one_work(struct work_struct *work)break ; } }while (!time_after (jiffies, stress->timeout)); - -kfree (stress); }#define STRESS_INORDER BIT(0)
@@ -537,15 +533,24 @@ static void stress_one_work(struct work_struct *work)static int stress (int nlocks,int nthreads,unsigned int flags) {struct ww_mutex *locks; -int n; +struct stress *stress_array; +int n, count; locks =kmalloc_array (nlocks,sizeof (*locks),GFP_KERNEL );if (!locks)return -ENOMEM ; + stress_array =kmalloc_array (nthreads,sizeof (*stress_array), +GFP_KERNEL ); +if (!stress_array) { +kfree (locks); +return -ENOMEM ; + } +for (n =0 ; n < nlocks; n++)ww_mutex_init (&locks[n], &ww_class); + count =0 ;for (n =0 ; nthreads; n++) {struct stress *stress;void (*fn)(struct work_struct *work);
@@ -569,9 +574,7 @@ static int stress(int nlocks, int nthreads, unsigned int flags)if (!fn)continue ; - stress =kmalloc (sizeof (*stress),GFP_KERNEL ); -if (!stress) -break ; + stress = &stress_array[count++];INIT_WORK (&stress->work, fn); stress->locks = locks;
@@ -586,6 +589,7 @@ static int stress(int nlocks, int nthreads, unsigned int flags)for (n =0 ; n < nlocks; n++)ww_mutex_destroy (&locks[n]); +kfree (stress_array);kfree (locks);return 0 ;
kernel/padata.c +1 -1
@@ -121,7 +121,7 @@ int padata_do_parallel(struct padata_instance *pinst,if (!cpumask_test_cpu (cb_cpu, pd->cpumask.cbcpu)) goto out; - err = -EBUSY ; + err = -EBUSY ;if ((pinst->flags &PADATA_RESET )) goto out;
kernel/power/snapshot.c +7 -9
@@ -2376,8 +2376,9 @@ static void *get_highmem_page_buffer(struct page *page, pbe->copy_page = tmp; }else {/* Copy of the page will be stored in normal memory */ - kaddr = safe_pages_list; - safe_pages_list = safe_pages_list->next; + kaddr =__get_safe_page (ca->gfp_mask); +if (!kaddr) +return ERR_PTR (-ENOMEM ); pbe->copy_page =virt_to_page (kaddr); } pbe->next = highmem_pblist;
@@ -2557,8 +2558,9 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca)return ERR_PTR (-ENOMEM ); } pbe->orig_address =page_address (page); - pbe->address = safe_pages_list; - safe_pages_list = safe_pages_list->next; + pbe->address =__get_safe_page (ca->gfp_mask); +if (!pbe->address) +return ERR_PTR (-ENOMEM ); pbe->next = restore_pblist; restore_pblist = pbe;return pbe->address;
@@ -2589,8 +2591,6 @@ int snapshot_write_next(struct snapshot_handle *handle)if (handle->cur >1 && handle->cur > nr_meta_pages + nr_copy_pages)return 0 ; - handle->sync_read =1 ; -if (!handle->cur) {if (!buffer)/* This makes the buffer be freed by swsusp_free() */
@@ -2631,7 +2631,6 @@ int snapshot_write_next(struct snapshot_handle *handle)memory_bm_position_reset (&orig_bm); restore_pblist =NULL ; handle->buffer =get_buffer (&orig_bm, &ca); - handle->sync_read =0 ;if (IS_ERR (handle->buffer))return PTR_ERR (handle->buffer); }
@@ -2643,9 +2642,8 @@ int snapshot_write_next(struct snapshot_handle *handle) handle->buffer =get_buffer (&orig_bm, &ca);if (IS_ERR (handle->buffer))return PTR_ERR (handle->buffer); -if (handle->buffer != buffer) - handle->sync_read =0 ; } + handle->sync_read = (handle->buffer == buffer); handle->cur++;return PAGE_SIZE ; }
net/bluetooth/hci_conn.c +2 -4
@@ -125,13 +125,11 @@ static void hci_conn_cleanup(struct hci_conn *conn)if (hdev->notify) hdev->notify (hdev,HCI_NOTIFY_CONN_DEL ); -hci_conn_del_sysfs (conn); -debugfs_remove_recursive (conn->debugfs); -hci_dev_put (hdev); +hci_conn_del_sysfs (conn); -hci_conn_put (conn); +hci_dev_put (hdev); }static void le_scan_cleanup (struct work_struct *work)
net/bluetooth/hci_sysfs.c +12 -11
@@ -33,7 +33,7 @@ void hci_conn_init_sysfs(struct hci_conn *conn) {struct hci_dev *hdev = conn->hdev; -BT_DBG ("conn %p" , conn); +bt_dev_dbg (hdev,"conn %p" , conn); conn->dev.type = &bt_link; conn->dev.class = bt_class;
@@ -46,27 +46,30 @@ void hci_conn_add_sysfs(struct hci_conn *conn) {struct hci_dev *hdev = conn->hdev; -BT_DBG ("conn %p" , conn); +bt_dev_dbg (hdev,"conn %p" , conn);if (device_is_registered (&conn->dev))return ;dev_set_name (&conn->dev,"%s:%d" , hdev->name, conn->handle); -if (device_add (&conn->dev) <0 ) { +if (device_add (&conn->dev) <0 )bt_dev_err (hdev,"failed to register connection device" ); -return ; - } - -hci_dev_hold (hdev); }void hci_conn_del_sysfs (struct hci_conn *conn) {struct hci_dev *hdev = conn->hdev; -if (!device_is_registered (&conn->dev)) +bt_dev_dbg (hdev,"conn %p" , conn); + +if (!device_is_registered (&conn->dev)) { +/* If device_add() has *not* succeeded, use *only* put_device() +* to drop the reference count. +*/ +put_device (&conn->dev);return ; + }while (1 ) {struct device *dev;
@@ -78,9 +81,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn)put_device (dev); } -device_del (&conn->dev); - -hci_dev_put (hdev); +device_unregister (&conn->dev); }static void bt_host_release (struct device *dev)
net/core/sock.c +1 -1
@@ -496,7 +496,7 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)if (dst && dst->obsolete && dst->ops->check (dst, cookie) ==NULL ) {sk_tx_queue_clear (sk); - sk->sk_dst_pending_confirm =0 ; +WRITE_ONCE (sk->sk_dst_pending_confirm,0 );RCU_INIT_POINTER (sk->sk_dst_cache,NULL );dst_release (dst);return NULL ;
net/ipv4/tcp_output.c +1 -1
@@ -1090,7 +1090,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,skb_set_hash_from_sk (skb, sk);refcount_add (skb->truesize, &sk->sk_wmem_alloc); -skb_set_dst_pending_confirm (skb, sk->sk_dst_pending_confirm); +skb_set_dst_pending_confirm (skb,READ_ONCE (sk->sk_dst_pending_confirm));/* Build TCP header and checksum it. */ th = (struct tcphdr *)skb->data;
net/mac80211/cfg.c +4 -0
@@ -2452,6 +2452,10 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,else *dbm = sdata->vif.bss_conf.txpower; +/* INT_MIN indicates no power level was set yet */ +if (*dbm ==INT_MIN ) +return -EINVAL ; +return 0 ; }
net/sched/sch_api.c +3 -2
@@ -1004,12 +1004,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, skip:if (!ingress) { -notify_and_destroy (net, skb, n, classid, - dev->qdisc, new); + old = dev->qdisc;if (new && !new->ops->attach)qdisc_refcount_inc (new); dev->qdisc = new ? : &noop_qdisc; +notify_and_destroy (net, skb, n, classid, old, new); +if (new && new->ops->attach) new->ops->attach (new); }else {
net/tipc/netlink_compat.c +1 -0
@@ -101,6 +101,7 @@ static int tipc_add_tlv(struct sk_buff *skb, u16 type, void *data, u16 len)return -EMSGSIZE ;skb_put (skb,TLV_SPACE (len)); +memset (tlv,0 ,TLV_SPACE (len)); tlv->tlv_type =htons (type); tlv->tlv_len =htons (TLV_LENGTH (len));if (len && data)
scripts/gcc-plugins/randomize_layout_plugin.c +8 -3
@@ -209,12 +209,14 @@ static void partition_struct(tree *fields, unsigned long length, struct partitiostatic void performance_shuffle (tree *newtree,unsigned long length,ranctx *prng_state) { -unsigned long i, x; +unsigned long i, x, index;struct partition_group size_group[length];unsigned long num_groups =0 ;unsigned long randnum;partition_struct (newtree, length, (struct partition_group *)&size_group, &num_groups); + +/* FIXME: this group shuffle is currently a no-op. */ for (i = num_groups -1 ; i >0 ; i--) {struct partition_group tmp; randnum =ranval (prng_state) % (i +1 );
@@ -224,11 +226,14 @@ static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prn }for (x =0 ; x < num_groups; x++) { -for (i = size_group[x].start + size_group[x].length -1 ; i > size_group[x].start; i--) { +for (index = size_group[x].length -1 ; index >0 ; index--) {tree tmp; + + i = size_group[x].start + index;if (DECL_BIT_FIELD_TYPE (newtree[i]))continue ; - randnum =ranval (prng_state) % (i +1 ); + randnum =ranval (prng_state) % (index +1 ); + randnum += size_group[x].start;// we could handle this case differently if desired if (DECL_BIT_FIELD_TYPE (newtree[randnum]))continue ;
sound/core/info.c +13 -8
@@ -72,7 +72,7 @@ struct snd_info_private_data { };static int snd_info_version_init (void ); -static void snd_info_disconnect (struct snd_info_entry *entry); +static void snd_info_clear_entries (struct snd_info_entry *entry);/*
@@ -598,11 +598,16 @@ void snd_info_card_disconnect(struct snd_card *card) {if (!card)return ; -mutex_lock (&info_mutex); +proc_remove (card->proc_root_link); - card->proc_root_link =NULL ;if (card->proc_root) -snd_info_disconnect (card->proc_root); +proc_remove (card->proc_root->p); + +mutex_lock (&info_mutex); +if (card->proc_root) +snd_info_clear_entries (card->proc_root); + card->proc_root_link =NULL ; + card->proc_root =NULL ;mutex_unlock (&info_mutex); }
@@ -776,15 +781,14 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card, }EXPORT_SYMBOL (snd_info_create_card_entry); -static void snd_info_disconnect (struct snd_info_entry *entry) +static void snd_info_clear_entries (struct snd_info_entry *entry) {struct snd_info_entry *p;if (!entry->p)return ;list_for_each_entry (p, &entry->children, list) -snd_info_disconnect (p); -proc_remove (entry->p); +snd_info_clear_entries (p); entry->p =NULL ; }
@@ -801,8 +805,9 @@ void snd_info_free_entry(struct snd_info_entry * entry)if (!entry)return ;if (entry->p) { +proc_remove (entry->p);mutex_lock (&info_mutex); -snd_info_disconnect (entry); +snd_info_clear_entries (entry);mutex_unlock (&info_mutex); }
sound/hda/hdac_stream.c +4 -2
@@ -241,8 +241,10 @@ struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,struct hdac_stream *res =NULL ;/* make a non-zero unique key for the substream */ -int key = (substream->pcm->device <<16 ) | (substream->number <<2 ) | - (substream->stream +1 ); +int key = (substream->number <<2 ) | (substream->stream +1 ); + +if (substream->pcm) + key |= (substream->pcm->device <<16 );list_for_each_entry (azx_dev, &bus->stream_list, list) {if (azx_dev->direction != substream->stream)
sound/pci/hda/patch_realtek.c +1 -0
@@ -7168,6 +7168,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x10a1 ,"ASUS UX391UA" ,ALC294_FIXUP_ASUS_SPK ),SND_PCI_QUIRK (0x1043 ,0x10c0 ,"ASUS X540SA" ,ALC256_FIXUP_ASUS_MIC ),SND_PCI_QUIRK (0x1043 ,0x10d0 ,"ASUS X540LA/X540LJ" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1043 ,0x10d3 ,"ASUS K6500ZC" ,ALC294_FIXUP_ASUS_SPK ),SND_PCI_QUIRK (0x1043 ,0x115d ,"Asus 1015E" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x1043 ,0x11c0 ,"ASUS X556UR" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
tools/testing/selftests/efivarfs/create-read.c +2 -0
@@ -32,8 +32,10 @@ int main(int argc, char **argv) rc =read (fd, buf,sizeof (buf));if (rc !=0 ) {fprintf (stderr,"Reading a new var should return EOF\n" ); +close (fd);return EXIT_FAILURE ; } +close (fd);return EXIT_SUCCESS ; }