Linux 4.9.224
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.9.224 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 23 +- arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts | 4 arch/arm/boot/dts/r8a73a4.dtsi | 9 - arch/arm/boot/dts/r8a7740.dtsi | 2 arch/x86/include/asm/stackprotector.h | 7 arch/x86/kernel/smpboot.c | 8 arch/x86/kvm/x86.c | 2 arch/x86/xen/smp.c | 1 block/blk-core.c | 3 crypto/lrw.c | 4 crypto/xts.c | 4 drivers/acpi/video_detect.c | 11 - drivers/dma/mmp_tdma.c | 2 drivers/dma/pch_dma.c | 2 drivers/gpu/drm/qxl/qxl_image.c | 3 drivers/infiniband/core/addr.c | 8 drivers/infiniband/hw/i40iw/i40iw_hw.c | 2 drivers/infiniband/hw/mlx4/qp.c | 14 + drivers/infiniband/sw/rxe/rxe_net.c | 8 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 18 +- drivers/net/ethernet/mellanox/mlx4/main.c | 4 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 6 drivers/net/ethernet/moxa/moxart_ether.c | 2 drivers/net/ethernet/natsemi/jazzsonic.c | 6 drivers/net/geneve.c | 4 drivers/net/macsec.c | 3 drivers/net/phy/dp83640.c | 2 drivers/net/phy/micrel.c | 4 drivers/net/usb/qmi_wwan.c | 1 drivers/net/vxlan.c | 10 - drivers/pinctrl/intel/pinctrl-cherryview.c | 4 drivers/ptp/ptp_clock.c | 42 ++--- drivers/ptp/ptp_private.h | 9 - drivers/ptp/ptp_sysfs.c | 162 +++++++------------ drivers/scsi/sg.c | 4 drivers/spi/spi-dw.c | 15 + drivers/spi/spi-dw.h | 1 drivers/usb/gadget/configfs.c | 3 drivers/usb/gadget/legacy/audio.c | 4 drivers/usb/gadget/legacy/cdc2.c | 4 drivers/usb/gadget/legacy/ncm.c | 4 drivers/usb/gadget/udc/net2272.c | 2 drivers/usb/host/xhci-ring.c | 4 drivers/usb/serial/garmin_gps.c | 4 drivers/usb/serial/qcserial.c | 1 drivers/usb/storage/unusual_uas.h | 7 fs/binfmt_elf.c | 12 + fs/char_dev.c | 86 ++++++++++ fs/cifs/cifssmb.c | 12 + fs/cifs/connect.c | 11 - fs/cifs/smb2pdu.c | 12 + fs/exec.c | 4 fs/ext4/block_validity.c | 1 include/linux/blkdev.h | 3 include/linux/blktrace_api.h | 18 +- include/linux/cdev.h | 5 include/linux/compiler.h | 7 include/linux/fs.h | 2 include/linux/pnp.h | 29 +-- include/linux/posix-clock.h | 19 +- include/linux/tty.h | 2 include/net/addrconf.h | 6 include/net/ipv6.h | 2 include/net/netfilter/nf_conntrack.h | 2 include/sound/rawmidi.h | 1 init/main.c | 2 ipc/util.c | 12 - kernel/time/posix-clock.c | 31 +-- kernel/trace/blktrace.c | 191 +++++++++++++++++------ kernel/trace/trace.c | 13 + mm/page_alloc.c | 1 mm/shmem.c | 7 net/batman-adv/bat_v_ogm.c | 2 net/batman-adv/network-coding.c | 9 - net/batman-adv/sysfs.c | 3 net/core/dev.c | 4 net/core/drop_monitor.c | 11 - net/core/netprio_cgroup.c | 2 net/dccp/ipv6.c | 6 net/ipv4/cipso_ipv4.c | 6 net/ipv4/route.c | 2 net/ipv6/addrconf_core.c | 11 - net/ipv6/af_inet6.c | 4 net/ipv6/calipso.c | 3 net/ipv6/datagram.c | 2 net/ipv6/inet6_connection_sock.c | 4 net/ipv6/ip6_output.c | 8 net/ipv6/raw.c | 2 net/ipv6/route.c | 6 net/ipv6/syncookies.c | 2 net/ipv6/tcp_ipv6.c | 4 net/l2tp/l2tp_ip6.c | 2 net/mpls/af_mpls.c | 7 net/netfilter/nf_conntrack_core.c | 4 net/netlabel/netlabel_kapi.c | 6 net/sched/sch_choke.c | 3 net/sched/sch_fq_codel.c | 2 net/sched/sch_sfq.c | 9 + net/sctp/ipv6.c | 4 net/tipc/udp_media.c | 9 - scripts/decodecode | 2 sound/core/rawmidi.c | 35 +++- sound/pci/hda/patch_hdmi.c | 2 sound/pci/hda/patch_realtek.c | 12 + sound/usb/quirks.c | 9 - tools/objtool/check.c | 2 106 files changed, 746 insertions(+), 391 deletions(-)
Arnd Bergmann (2):
drop_monitor: work around gcc-10 stringop-overflow warning
netfilter: conntrack: avoid gcc-10 zero-length-bounds warning
Borislav Petkov (1):
x86: Fix early boot crash on gcc-10, third try
Cengiz Can (1):
blktrace: fix dereference after null check
Christophe JAILLET (4):
net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()'
net: moxa: Fix a potential double 'free_irq()'
usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'
usb: gadget: audio: Fix a missing error return value in audio_bind()
Cong Wang (1):
net: fix a potential recursive NETDEV_FEAT_CHANGE
Dan Carpenter (1):
i40iw: Fix error handling in i40iw_manage_arp_cache()
David Hildenbrand (1):
mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous()
Dmitry Torokhov (3):
ptp: do not explicitly set drvdata in ptp_clock_register()
ptp: use is_visible method to hide unused attributes
ptp: create "pins" together with the rest of attributes
Eric Dumazet (3):
fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
sch_choke: avoid potential panic in choke_reset()
sch_sfq: validate silly quantum values
Eric W. Biederman (1):
exec: Move would_dump into flush_old_exec
Fabio Estevam (1):
ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries
Florian Fainelli (1):
net: phy: micrel: Use strlcpy() for ethtool::get_strings
Geert Uytterhoeven (2):
ARM: dts: r8a73a4: Add missing CMT1 interrupts
ARM: dts: r8a7740: Add missing extal2 to CPG node
George Spelvin (1):
batman-adv: fix batadv_nc_random_weight_tq
Grace Kao (1):
pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler
Greg Kroah-Hartman (1):
Linux 4.9.224
Hans de Goede (1):
Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6"
Hugh Dickins (1):
shmem: fix possible deadlocks on shmlock_user_lock
Ivan Delalande (1):
scripts/decodecode: fix trapping instruction formatting
Jack Morgenstein (1):
IB/mlx4: Test return value of calls to ib_get_cached_pkey
Jan Kara (1):
blktrace: Protect q->blk_trace with RCU
Jason Gunthorpe (1):
pnp: Use list_for_each_entry() instead of open coding
Jens Axboe (2):
blktrace: fix unlocked access to init/start-stop/teardown
blktrace: fix trace mutex deadlock
Jesus Ramos (1):
ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset
Jim Mattson (1):
KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce
Josh Poimboeuf (1):
objtool: Fix stack offset tracking for indirect CFAs
Julia Lawall (1):
dp83640: reverse arguments to list_add_tail
Kai Vehmanen (1):
ALSA: hda/hdmi: fix race in monitor detection during probe
Kai-Heng Feng (1):
Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
Kees Cook (2):
binfmt_elf: move brk out of mmap when doing direct loader exec
binfmt_elf: Do not move brk for INTERP-less ET_EXEC
Kyungtae Kim (1):
USB: gadget: fix illegal array access in binding with UDC
Linus Torvalds (7):
gcc-10 warnings: fix low-hanging fruit
Stop the ad-hoc games with -Wno-maybe-initialized
gcc-10: avoid shadowing standard library 'free()' in crypto
gcc-10: disable 'zero-length-bounds' warning for now
gcc-10: disable 'array-bounds' warning for now
gcc-10: disable 'stringop-overflow' warning for now
gcc-10: disable 'restrict' warning for now
Logan Gunthorpe (1):
chardev: add helper function to register char devs with a struct device
Lubomir Rintel (1):
dmaengine: mmp_tdma: Reset channel error on release
Maciej Żenczykowski (1):
Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu"
Madhuparna Bhowmik (1):
dmaengine: pch_dma.c: Avoid data race between probe and irq handler
Masahiro Yamada (1):
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
Matt Jolly (2):
USB: serial: qcserial: Add DW5816e support
net: usb: qmi_wwan: add support for DW5816e
Michael Chan (2):
bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features().
bnxt_en: Improve AER slot reset.
Moshe Shemesh (2):
net/mlx5: Fix forced completion access non initialized command entry net/mlx5: Fix command entry leak in Internal Error State
Oliver Neukum (2):
USB: uas: add quirk for LaCie 2Big Quadra
USB: serial: garmin_gps: add sanity checking for data length
Paolo Abeni (2):
netlabel: cope with NULL catmap
net: ipv4: really enforce backoff for redirects
Ronnie Sahlberg (1):
cifs: Fix a race condition with cifs_echo_request
Sabrina Dubroca (2):
net: ipv6: add net argument to ip6_dst_lookup_flow
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
Samuel Cabrero (1):
cifs: Check for timeout on Negotiate stage
Scott Dial (1):
net: macsec: preserve ingress frame ordering
Sergei Trofimovich (1):
Makefile: disallow data races on gcc-10 as well
Shijie Luo (1):
ext4: add cond_resched() to ext4_protect_reserved_inode
Sriharsha Allenki (1):
usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list
Steven Rostedt (VMware) (1):
tracing: Add a vmalloc_sync_mappings() for safe measure
Takashi Iwai (3):
ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
ALSA: rawmidi: Initialize allocated buffers
ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
Tariq Toukan (1):
net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc()
Vasily Averin (2):
drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
Vladis Dronov (2):
ptp: fix the race between the release of ptp_clock and cdev
ptp: free ptp device pin descriptors properly
Waiman Long (1):
blktrace: Fix potential deadlock between delete & sysfs ops
Wei Yongjun (2):
usb: gadget: legacy: fix error return code in gncm_bind()
usb: gadget: legacy: fix error return code in cdc_bind()
Wu Bo (1):
scsi: sg: add sg_remove_request in sg_write
Xiyu Yang (3):
batman-adv: Fix refcnt leak in batadv_show_throughput_override
batman-adv: Fix refcnt leak in batadv_store_throughput_override
batman-adv: Fix refcnt leak in batadv_v_ogm_process
YueHaibing (1):
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
Zefan Li (1):
netprio_cgroup: Fix unlimited memory leak of v2 cgroups
wuxu.wu (1):
spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
Greg Kroah-Hartman
maintainerMakefile +14 -9
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 223 +SUBLEVEL = 224 EXTRAVERSION = NAME = Roaring Lionus
@@ -658,20 +658,14 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) -else -ifdef CONFIG_PROFILE_ALL_BRANCHES -KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += -Os else KBUILD_CFLAGS += -O2 endif -endif - -KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ - $(call cc-disable-warning,maybe-uninitialized,)) # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) +KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races) # check for 'asm goto' ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
@@ -804,6 +798,17 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) # disable stringop warnings in gcc 8+ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) +# We'll want to enable this eventually, but it's not going away for 5.7 at least +KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds) +KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds) +KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) + +# Another good warning that we'll want to enable eventually +KBUILD_CFLAGS += $(call cc-disable-warning, restrict) + +# Enabled with W=2, disabled by default as noisy +KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts +2 -2
@@ -81,8 +81,8 @@ imx27-phycard-s-rdk { pinctrl_i2c1: i2c1grp { fsl,pins = < - MX27_PAD_I2C2_SDA__I2C2_SDA 0x0 - MX27_PAD_I2C2_SCL__I2C2_SCL 0x0 + MX27_PAD_I2C_DATA__I2C_DATA 0x0 + MX27_PAD_I2C_CLK__I2C_CLK 0x0 >; };
arch/arm/boot/dts/r8a73a4.dtsi +8 -1
@@ -135,7 +135,14 @@ cmt1: timer@e6130000 { compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2"; reg = <0 0xe6130000 0 0x1004>; - interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A73A4_CLK_CMT1>; clock-names = "fck"; power-domains = <&pd_c5>;
arch/arm/boot/dts/r8a7740.dtsi +1 -1
@@ -467,7 +467,7 @@ cpg_clocks: cpg_clocks@e6150000 { compatible = "renesas,r8a7740-cpg-clocks"; reg = <0xe6150000 0x10000>; - clocks = <&extal1_clk>, <&extalr_clk>; + clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>; #clock-cells = <1>; clock-output-names = "system", "pllc0", "pllc1", "pllc2", "r",
arch/x86/include/asm/stackprotector.h +6 -1
@@ -54,8 +54,13 @@/* * Initialize the stackprotector canary value. * -* NOTE: this must only be called from functions that never return, +* NOTE: this must only be called from functions that never return * and it must always be inlined. +* +* In addition, it should be called from a compilation unit for which +* stack protector is disabled. Alternatively, the caller should not end +* with a function call which gets tail-call optimized as that would +* lead to checking a modified canary value. */ static __always_inline void boot_init_stack_canary(void) {
arch/x86/kernel/smpboot.c +8 -0
@@ -249,6 +249,14 @@ static void notrace start_secondary(void *unused)wmb ();cpu_startup_entry (CPUHP_AP_ONLINE_IDLE ); + +/* +* Prevent tail call to cpu_startup_entry() because the stack protector +* guard has been changed a couple of function calls up, in +* boot_init_stack_canary() and must not be checked before tail calling +* another function. +*/ +prevent_tail_call_optimization (); }/**
arch/x86/kvm/x86.c +1 -1
@@ -3128,7 +3128,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,unsigned bank_num = mcg_cap &0xff , bank; r = -EINVAL ; -if (!bank_num || bank_num >=KVM_MAX_MCE_BANKS ) +if (!bank_num || bank_num >KVM_MAX_MCE_BANKS ) goto out;if (mcg_cap & ~(kvm_mce_cap_supported |0xff |0xff0000 )) goto out;
arch/x86/xen/smp.c +1 -0
@@ -116,6 +116,7 @@ asmlinkage __visible void cpu_bringup_and_idle(int cpu)#endif cpu_bringup ();cpu_startup_entry (CPUHP_AP_ONLINE_IDLE ); +prevent_tail_call_optimization (); }void xen_smp_intr_free (unsigned int cpu)
block/blk-core.c +3 -0
@@ -729,6 +729,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)kobject_init (&q->kobj, &blk_queue_ktype); +#ifdef CONFIG_BLK_DEV_IO_TRACE +mutex_init (&q->blk_trace_mutex); +#endif mutex_init (&q->sysfs_lock);spin_lock_init (&q->__queue_lock);
crypto/lrw.c +2 -2
@@ -377,7 +377,7 @@ static struct crypto_instance *alloc(struct rtattr **tb)return inst; } -static void free (struct crypto_instance *inst) +static void free_inst (struct crypto_instance *inst) {crypto_drop_spawn (crypto_instance_ctx (inst));kfree (inst);
@@ -386,7 +386,7 @@ static void free(struct crypto_instance *inst)static struct crypto_template crypto_tmpl = { .name ="lrw" , .alloc = alloc, - .free = free, + .free = free_inst, .module =THIS_MODULE , };
crypto/xts.c +2 -2
@@ -329,7 +329,7 @@ static struct crypto_instance *alloc(struct rtattr **tb)return inst; } -static void free (struct crypto_instance *inst) +static void free_inst (struct crypto_instance *inst) {crypto_drop_spawn (crypto_instance_ctx (inst));kfree (inst);
@@ -338,7 +338,7 @@ static void free(struct crypto_instance *inst)static struct crypto_template crypto_tmpl = { .name ="xts" , .alloc = alloc, - .free = free, + .free = free_inst, .module =THIS_MODULE , };
drivers/acpi/video_detect.c +0 -11
@@ -314,17 +314,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), }, }, - { - /* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */ - /* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */ - .callback = video_detect_force_native, - .ident = "HP Pavilion dv6", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"), - }, - }, - { }, };
drivers/dma/mmp_tdma.c +2 -0
@@ -362,6 +362,8 @@ static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac)gen_pool_free (gpool, (unsigned long )tdmac->desc_arr, size); tdmac->desc_arr =NULL ; +if (tdmac->status ==DMA_ERROR ) + tdmac->status =DMA_COMPLETE ;return ; }
drivers/dma/pch_dma.c +1 -1
@@ -876,6 +876,7 @@ static int pch_dma_probe(struct pci_dev *pdev, }pci_set_master (pdev); + pd->dma.dev = &pdev->dev; err =request_irq (pdev->irq, pd_irq,IRQF_SHARED ,DRV_NAME , pd);if (err) {
@@ -891,7 +892,6 @@ static int pch_dma_probe(struct pci_dev *pdev, goto err_free_irq; } - pd->dma.dev = &pdev->dev;INIT_LIST_HEAD (&pd->dma.channels);
drivers/gpu/drm/qxl/qxl_image.c +2 -1
@@ -210,7 +210,8 @@ qxl_image_init_helper(struct qxl_device *qdev,break ;default :DRM_ERROR ("unsupported image bit depth\n" ); -return -EINVAL ;/* TODO: cleanup */ +qxl_bo_kunmap_atomic_page (qdev, image_bo, ptr); +return -EINVAL ; } image->u.bitmap.flags =QXL_BITMAP_TOP_DOWN ; image->u.bitmap.x = width;
drivers/infiniband/core/addr.c +4 -4
@@ -453,16 +453,15 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,struct flowi6 fl6;struct dst_entry *dst;struct rt6_info *rt; -int ret;memset (&fl6,0 ,sizeof fl6); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr; fl6.flowi6_oif = addr->bound_dev_if; - ret = ipv6_stub->ipv6_dst_lookup (addr->net,NULL , &dst, &fl6); -if (ret <0 ) -return ret; + dst = ipv6_stub->ipv6_dst_lookup_flow (addr->net,NULL , &fl6,NULL ); +if (IS_ERR (dst)) +return PTR_ERR (dst); rt = (struct rt6_info *)dst;if (ipv6_addr_any (&src_in->sin6_addr)) {
@@ -552,6 +551,7 @@ static int addr_resolve(struct sockaddr *src_in,const struct sockaddr_in6 *dst_in6 = (const struct sockaddr_in6 *)dst_in; + dst =NULL ; ret =addr6_resolve ((struct sockaddr_in6 *)src_in, dst_in6, addr, &dst);
drivers/infiniband/hw/i40iw/i40iw_hw.c +1 -1
@@ -479,7 +479,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,int arp_index; arp_index =i40iw_arp_table (iwdev, ip_addr, ipv4, mac_addr, action); -if (arp_index ==-1 ) +if (arp_index <0 )return ; cqp_request =i40iw_get_cqp_request (&iwdev->cqp, false);if (!cqp_request)
drivers/infiniband/hw/mlx4/qp.c +11 -3
@@ -2307,6 +2307,7 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,int send_size;int header_size;int spc; +int err;int i;if (wr->wr.opcode !=IB_WR_SEND )
@@ -2341,7 +2342,9 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp, sqp->ud_header.lrh.virtual_lane =0 ; sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags &IB_SEND_SOLICITED ); -ib_get_cached_pkey (ib_dev, sqp->qp.port,0 , &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port,0 , &pkey); +if (err) +return err; sqp->ud_header.bth.pkey =cpu_to_be16 (pkey);if (sqp->qp.mlx4_ib_qp_type ==MLX4_IB_QPT_TUN_SMI_OWNER ) sqp->ud_header.bth.destination_qpn =cpu_to_be32 (wr->remote_qpn);
@@ -2618,9 +2621,14 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr, } sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags &IB_SEND_SOLICITED );if (!sqp->qp.ibqp.qp_num) -ib_get_cached_pkey (ib_dev, sqp->qp.port, sqp->pkey_index, &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port, sqp->pkey_index, + &pkey);else -ib_get_cached_pkey (ib_dev, sqp->qp.port, wr->pkey_index, &pkey); + err =ib_get_cached_pkey (ib_dev, sqp->qp.port, wr->pkey_index, + &pkey); +if (err) +return err; + sqp->ud_header.bth.pkey =cpu_to_be16 (pkey); sqp->ud_header.bth.destination_qpn =cpu_to_be32 (wr->remote_qpn); sqp->ud_header.bth.psn =cpu_to_be32 ((sqp->send_psn++) & ((1 <<24 ) -1 ));
drivers/infiniband/sw/rxe/rxe_net.c +5 -3
@@ -182,10 +182,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,memcpy (&fl6.daddr, daddr,sizeof (*daddr)); fl6.flowi6_proto =IPPROTO_UDP ; -if (unlikely (ipv6_stub->ipv6_dst_lookup (sock_net (recv_sockets.sk6->sk), - recv_sockets.sk6->sk, &ndst, &fl6))) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (sock_net (recv_sockets.sk6->sk), + recv_sockets.sk6->sk, &fl6, +NULL ); +if (unlikely (IS_ERR (ndst))) {pr_err_ratelimited ("no route to %pI6\n" , daddr); - goto put; +return NULL ; }if (unlikely (ndst->error)) {
drivers/net/ethernet/broadcom/bnxt/bnxt.c +12 -6
@@ -5997,6 +5997,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev, netdev_features_t features) {struct bnxt *bp =netdev_priv (dev); +netdev_features_t vlan_features;if ((features &NETIF_F_NTUPLE ) && !bnxt_rfs_capable (bp)) features &= ~NETIF_F_NTUPLE ;
@@ -6004,12 +6005,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,/* Both CTAG and STAG VLAN accelaration on the RX side have to be * turned on or off together. */ -if ((features & (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) != - (NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX )) { + vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX ); +if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX | +NETIF_F_HW_VLAN_STAG_RX )) {if (dev->features &NETIF_F_HW_VLAN_CTAG_RX ) features &= ~(NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ); -else +else if (vlan_features) features |=NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_STAG_RX ; }
@@ -7163,8 +7166,11 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) result =PCI_ERS_RESULT_RECOVERED ; } -if (result !=PCI_ERS_RESULT_RECOVERED &&netif_running (netdev)) -dev_close (netdev); +if (result !=PCI_ERS_RESULT_RECOVERED ) { +if (netif_running (netdev)) +dev_close (netdev); +pci_disable_device (pdev); + }rtnl_unlock ();
@@ -7175,7 +7181,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) err); /* non-fatal, continue */ } -return PCI_ERS_RESULT_RECOVERED ; +return result; }/**
drivers/net/ethernet/mellanox/mlx4/main.c +3 -1
@@ -2478,6 +2478,7 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev)if (!err || err == -ENOSPC ) { priv->def_counter[port] = idx; + err =0 ; }else if (err == -ENOENT ) { err =0 ;continue ;
@@ -2527,7 +2528,8 @@ int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx) MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);if (!err) *idx =get_param_l (&out_param); - +if (WARN_ON (err == -ENOSPC )) + err = -EINVAL ;return err; }return __mlx4_counter_alloc (dev, idx);
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +5 -1
@@ -813,7 +813,6 @@ static void cmd_work_handler(struct work_struct *work) } cmd->ent_arr[ent->idx] = ent; -set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state); lay =get_inst (cmd, ent->idx); ent->lay = lay;memset (lay,0 ,sizeof (*lay));
@@ -835,6 +834,7 @@ static void cmd_work_handler(struct work_struct *work)if (ent->callback)schedule_delayed_work (&ent->cb_timeout_work, cb_timeout); +set_bit (MLX5_CMD_ENT_STATE_PENDING_COMP , &ent->state);/* Skip sending command to fw if internal error */ if (pci_channel_offline(dev->pdev) ||
@@ -847,6 +847,10 @@ static void cmd_work_handler(struct work_struct *work)MLX5_SET (mbox_out, ent->out, syndrome, drv_synd);mlx5_cmd_comp_handler (dev,1UL << ent->idx, true); +/* no doorbell, no need to keep the entry */ +free_ent (cmd, ent->idx); +if (ent->callback) +free_cmd (ent);return ; }
drivers/net/ethernet/moxa/moxart_ether.c +1 -1
@@ -571,7 +571,7 @@ static int moxart_remove(struct platform_device *pdev)struct net_device *ndev =platform_get_drvdata (pdev);unregister_netdev (ndev); -free_irq (ndev->irq, ndev); +devm_free_irq (&pdev->dev, ndev->irq, ndev);moxart_mac_free_memory (ndev);free_netdev (ndev);
drivers/net/ethernet/natsemi/jazzsonic.c +4 -2
@@ -247,13 +247,15 @@ static int jazz_sonic_probe(struct platform_device *pdev) goto out; err =register_netdev (dev);if (err) - goto out1; + goto undo_probe1;printk ("%s: MAC %pM IRQ %d\n" , dev->name, dev->dev_addr, dev->irq);return 0 ; -out1: +undo_probe1: +dma_free_coherent (lp->device,SIZEOF_SONIC_DESC *SONIC_BUS_SCALE (lp->dma_bitmode), + lp->descriptors, lp->descriptors_laddr);release_mem_region (dev->base_addr,SONIC_MEM_SIZE ); out:free_netdev (dev);
drivers/net/geneve.c +3 -1
@@ -835,7 +835,9 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,return dst; } -if (ipv6_stub->ipv6_dst_lookup (geneve->net, gs6->sock->sk, &dst, fl6)) { + dst = ipv6_stub->ipv6_dst_lookup_flow (geneve->net, gs6->sock->sk, fl6, +NULL ); +if (IS_ERR (dst)) {netdev_dbg (dev,"no route to %pI6\n" , &fl6->daddr);return ERR_PTR (-ENETUNREACH ); }
drivers/net/macsec.c +2 -1
@@ -1315,7 +1315,8 @@ static struct crypto_aead *macsec_alloc_tfm(char *key, int key_len, int icv_len)struct crypto_aead *tfm;int ret; - tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,0 ); +/* Pick a sync gcm(aes) cipher to ensure order is preserved. */ + tfm =crypto_alloc_aead ("gcm(aes)" ,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR (tfm))return tfm;
drivers/net/phy/dp83640.c +1 -1
@@ -1108,7 +1108,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus) goto out; }dp83640_clock_init (clock, bus); -list_add_tail (&phyter_clocks, &clock->list); +list_add_tail (&clock->list, &phyter_clocks); out:mutex_unlock (&phyter_clocks_lock);
drivers/net/phy/micrel.c +2 -2
@@ -677,8 +677,8 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)int i;for (i =0 ; i <ARRAY_SIZE (kszphy_hw_stats); i++) { -memcpy (data + i *ETH_GSTRING_LEN , - kszphy_hw_stats[i].string,ETH_GSTRING_LEN ); +strlcpy (data + i *ETH_GSTRING_LEN , + kszphy_hw_stats[i].string,ETH_GSTRING_LEN ); } }
drivers/net/usb/qmi_wwan.c +1 -0
@@ -950,6 +950,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ + {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
drivers/net/vxlan.c +4 -6
@@ -1881,7 +1881,6 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,bool use_cache =ip_tunnel_dst_cache_usable (skb, info);struct dst_entry *ndst;struct flowi6 fl6; -int err;if (!sock6)return ERR_PTR (-EIO );
@@ -1902,11 +1901,10 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan, fl6.flowi6_mark = skb->mark; fl6.flowi6_proto =IPPROTO_UDP ; - err = ipv6_stub->ipv6_dst_lookup (vxlan->net, - sock6->sock->sk, - &ndst, &fl6); -if (err <0 ) -return ERR_PTR (err); + ndst = ipv6_stub->ipv6_dst_lookup_flow (vxlan->net, sock6->sock->sk, + &fl6,NULL ); +if (unlikely (IS_ERR (ndst))) +return ERR_PTR (-ENETUNREACH ); *saddr = fl6.saddr;if (use_cache)
drivers/pinctrl/intel/pinctrl-cherryview.c +4 -0
@@ -1509,11 +1509,15 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)struct chv_pinctrl *pctrl =gpiochip_get_data (gc);struct irq_chip *chip =irq_desc_get_chip (desc);unsigned long pending; +unsigned long flags;u32 intr_line;chained_irq_enter (chip, desc); +raw_spin_lock_irqsave (&chv_lock, flags); pending =readl (pctrl->regs +CHV_INTSTAT ); +raw_spin_unlock_irqrestore (&chv_lock, flags); +for_each_set_bit (intr_line, &pending, pctrl->community->nirqs) {unsigned irq, offset;
drivers/ptp/ptp_clock.c +21 -21
88 lines not on this page · raw message
drivers/ptp/ptp_private.h +5 -4
@@ -40,7 +40,7 @@ struct timestamp_event_queue {struct ptp_clock {struct posix_clock clock; -struct device *dev; +struct device dev;struct ptp_clock_info *info;dev_t devid;int index;/* index into clocks.map */
@@ -54,6 +54,8 @@ struct ptp_clock {struct device_attribute *pin_dev_attr;struct attribute **pin_attr;struct attribute_group pin_attr_group; +/* 1st entry is a pointer to the real group, 2nd is NULL terminator */ +const struct attribute_group *pin_attr_groups[2 ]; };/*
@@ -94,8 +96,7 @@ uint ptp_poll(struct posix_clock *pc,extern const struct attribute_group *ptp_groups[]; -int ptp_cleanup_sysfs (struct ptp_clock *ptp); - -int ptp_populate_sysfs (struct ptp_clock *ptp); +int ptp_populate_pin_groups (struct ptp_clock *ptp); +void ptp_cleanup_pin_groups (struct ptp_clock *ptp);#endif
drivers/ptp/ptp_sysfs.c +63 -99
215 lines not on this page · raw message
drivers/scsi/sg.c +3 -1
@@ -695,8 +695,10 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) hp->flags = input_size;/* structure abuse ... */ hp->pack_id = old_hdr.pack_id; hp->usr_ptr =NULL ; -if (__copy_from_user (cmnd, buf, cmd_size)) +if (__copy_from_user (cmnd, buf, cmd_size)) { +sg_remove_request (sfp, srp);return -EFAULT ; + }/* * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV, * but is is possible that the app intended SG_DXFER_TO_DEV, because there
drivers/spi/spi-dw.c +12 -3
@@ -180,9 +180,11 @@ static inline u32 rx_max(struct dw_spi *dws)static void dw_writer (struct dw_spi *dws) { -u32 max =tx_max (dws); +u32 max;u16 txw =0 ; +spin_lock (&dws->buf_lock); + max =tx_max (dws);while (max--) {/* Set the tx word if the transfer's original "tx" is not null */ if (dws->tx_end - dws->len) {
@@ -194,13 +196,16 @@ static void dw_writer(struct dw_spi *dws)dw_write_io_reg (dws,DW_SPI_DR , txw); dws->tx += dws->n_bytes; } +spin_unlock (&dws->buf_lock); }static void dw_reader (struct dw_spi *dws) { -u32 max =rx_max (dws); +u32 max;u16 rxw; +spin_lock (&dws->buf_lock); + max =rx_max (dws);while (max--) { rxw =dw_read_io_reg (dws,DW_SPI_DR );/* Care rx only if the transfer's original "rx" is not null */
@@ -212,6 +217,7 @@ static void dw_reader(struct dw_spi *dws) } dws->rx += dws->n_bytes; } +spin_unlock (&dws->buf_lock); }static void int_error_stop (struct dw_spi *dws,const char *msg)
@@ -284,18 +290,20 @@ static int dw_spi_transfer_one(struct spi_master *master, {struct dw_spi *dws =spi_master_get_devdata (master);struct chip_data *chip =spi_get_ctldata (spi); +unsigned long flags;u8 imask =0 ;u16 txlevel =0 ;u32 cr0;int ret; dws->dma_mapped =0 ; - +spin_lock_irqsave (&dws->buf_lock, flags); dws->tx = (void *)transfer->tx_buf; dws->tx_end = dws->tx + transfer->len; dws->rx = transfer->rx_buf; dws->rx_end = dws->rx + transfer->len; dws->len = transfer->len; +spin_unlock_irqrestore (&dws->buf_lock, flags);spi_enable_chip (dws,0 );
@@ -487,6 +495,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) dws->dma_inited =0 ; dws->dma_addr = (dma_addr_t)(dws->paddr +DW_SPI_DR );snprintf (dws->name,sizeof (dws->name),"dw_spi%d" , dws->bus_num); +spin_lock_init (&dws->buf_lock); ret =request_irq (dws->irq, dw_spi_irq,IRQF_SHARED , dws->name, master);if (ret <0 ) {
drivers/spi/spi-dw.h +1 -0
@@ -117,6 +117,7 @@ struct dw_spi {size_t len;void *tx;void *tx_end; +spinlock_t buf_lock;void *rx;void *rx_end;int dma_mapped;
drivers/usb/gadget/configfs.c +3 -0
@@ -259,6 +259,9 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,char *name;int ret; +if (strlen (page) < len) +return -EOVERFLOW ; + name =kstrdup (page,GFP_KERNEL );if (!name)return -ENOMEM ;
drivers/usb/gadget/legacy/audio.c +3 -1
@@ -249,8 +249,10 @@ static int audio_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (cdev->gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail; + }usb_otg_descriptor_init (cdev->gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/legacy/cdc2.c +3 -1
@@ -183,8 +183,10 @@ static int cdc_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail1; + }usb_otg_descriptor_init (gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/legacy/ncm.c +3 -1
@@ -162,8 +162,10 @@ static int gncm_bind(struct usb_composite_dev *cdev)struct usb_descriptor_header *usb_desc; usb_desc =usb_otg_descriptor_alloc (gadget); -if (!usb_desc) +if (!usb_desc) { + status = -ENOMEM ; goto fail; + }usb_otg_descriptor_init (gadget, usb_desc); otg_desc[0 ] = usb_desc; otg_desc[1 ] =NULL ;
drivers/usb/gadget/udc/net2272.c +2 -0
@@ -2666,6 +2666,8 @@ net2272_plat_probe(struct platform_device *pdev) err_req:release_mem_region (base, len); err: +kfree (dev); +return ret; }
drivers/usb/host/xhci-ring.c +2 -2
@@ -3347,8 +3347,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,/* New sg entry */ --num_sgs; sent_len -= block_len; -if (num_sgs !=0 ) { - sg =sg_next (sg); + sg =sg_next (sg); +if (num_sgs !=0 && sg) { block_len =sg_dma_len (sg); addr = (u64 )sg_dma_address (sg); addr += sent_len;
drivers/usb/serial/garmin_gps.c +2 -2
@@ -1161,8 +1161,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,send it directly to the tty port */ if (garmin_data_p->flags &FLAGS_QUEUING ) {pkt_add (garmin_data_p, data, data_length); - }else if (bulk_data || -getLayerId (data) ==GARMIN_LAYERID_APPL ) { + }else if (bulk_data || (data_length >=sizeof (u32) && +getLayerId (data) ==GARMIN_LAYERID_APPL )) {spin_lock_irqsave (&garmin_data_p->lock, flags); garmin_data_p->flags |=APP_RESP_SEEN ;
drivers/usb/serial/qcserial.c +1 -0
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ + {DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */ {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
drivers/usb/storage/unusual_uas.h +7 -0
@@ -41,6 +41,13 @@* and don't forget to CC: the USB development list <[email protected]> */ +/* Reported-by: Julian Groß <[email protected]> */ +UNUSUAL_DEV (0x059f ,0x105f ,0x0000 ,0x9999 , +"LaCie" , +"2Big Quadra USB3" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , + US_FL_NO_REPORT_OPCODES), +/* * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI * commands in UAS mode. Observed with the 1.28 firmware; are there others?
fs/binfmt_elf.c +12 -0
@@ -1100,6 +1100,18 @@ static int load_elf_binary(struct linux_binprm *bprm) current->mm->start_stack = bprm->p;if ((current->flags &PF_RANDOMIZE ) && (randomize_va_space >1 )) { +/* +* For architectures with ELF randomization, when executing +* a loader directly (i.e. no interpreter listed in ELF +* headers), move the brk area out of the mmap region +* (since it grows up, and may collide early with the stack +* growing down), and into the unused ELF_ET_DYN_BASE region. +*/ +if (IS_ENABLED (CONFIG_ARCH_HAS_ELF_RANDOMIZE ) && + loc->elf_ex.e_type ==ET_DYN && !interpreter) + current->mm->brk = current->mm->start_brk = +ELF_ET_DYN_BASE ; + current->mm->brk = current->mm->start_brk =arch_randomize_brk (current->mm);#ifdef compat_brk_randomized
fs/char_dev.c +86 -0
103 lines not on this page · raw message
fs/cifs/cifssmb.c +12 -0
@@ -184,6 +184,18 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)* reconnect the same SMB session */ mutex_lock (&ses->session_mutex); + +/* +* Recheck after acquire mutex. If another thread is negotiating +* and the server never sends an answer the socket will be closed +* and tcpStatus set to reconnect. +*/ +if (server->tcpStatus == CifsNeedReconnect) { + rc = -EHOSTDOWN ; +mutex_unlock (&ses->session_mutex); + goto out; + } + rc =cifs_negotiate_protocol (0 , ses);if (rc ==0 && ses->need_reconnect) rc =cifs_setup_session (0 , ses, nls_codepage);
fs/cifs/connect.c +6 -5
@@ -551,20 +551,21 @@ static bool server_unresponsive(struct TCP_Server_Info *server) {/* -* We need to wait 2 echo intervals to make sure we handle such +* We need to wait 3 echo intervals to make sure we handle such * situations right: * 1s client sends a normal SMB request -* 2s client gets a response +* 3s client gets a response * 30s echo workqueue job pops, and decides we got a response recently * and don't need to send another * ... * 65s kernel_recvmsg times out, and we see that we haven't gotten * a response in >60s. */ -if (server->tcpStatus == CifsGood && -time_after (jiffies, server->lstrp +2 * server->echo_interval)) { +if ((server->tcpStatus == CifsGood || + server->tcpStatus == CifsNeedNegotiate) && +time_after (jiffies, server->lstrp +3 * server->echo_interval)) {cifs_dbg (VFS ,"Server %s has not responded in %lu seconds. Reconnecting...\n" , - server->hostname, (2 * server->echo_interval) /HZ ); + server->hostname, (3 * server->echo_interval) /HZ );cifs_reconnect (server);wake_up (&server->response_q);return true;
fs/cifs/smb2pdu.c +12 -0
@@ -246,6 +246,18 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)* the same SMB session */ mutex_lock (&tcon->ses->session_mutex); + +/* +* Recheck after acquire mutex. If another thread is negotiating +* and the server never sends an answer the socket will be closed +* and tcpStatus set to reconnect. +*/ +if (server->tcpStatus == CifsNeedReconnect) { + rc = -EHOSTDOWN ; +mutex_unlock (&tcon->ses->session_mutex); + goto out; + } + rc =cifs_negotiate_protocol (0 , tcon->ses);if (!rc && tcon->ses->need_reconnect) { rc =cifs_setup_session (0 , tcon->ses, nls_codepage);
fs/exec.c +2 -2
@@ -1270,6 +1270,8 @@ int flush_old_exec(struct linux_binprm * bprm)*/ set_mm_exe_file (bprm->mm, bprm->file); +would_dump (bprm, bprm->file); +/* * Release all of the old mmap stuff */
@@ -1780,8 +1782,6 @@ static int do_execveat_common(int fd, struct filename *filename,if (retval <0 ) goto out; -would_dump (bprm, bprm->file); - retval =exec_binprm (bprm);if (retval <0 ) goto out;
fs/ext4/block_validity.c +1 -0
@@ -152,6 +152,7 @@ static int ext4_protect_reserved_inode(struct super_block *sb, u32 ino)return PTR_ERR (inode); num = (inode->i_size + sb->s_blocksize -1 ) >> sb->s_blocksize_bits;while (i < num) { +cond_resched (); map.m_lblk = i; map.m_len = num - i; n =ext4_map_blocks (NULL , inode, &map,0 );
include/linux/blkdev.h +2 -1
@@ -445,7 +445,8 @@ struct request_queue {unsigned int sg_reserved_size;int node;#ifdef CONFIG_BLK_DEV_IO_TRACE -struct blk_trace *blk_trace; +struct blk_trace __rcu *blk_trace; +struct mutex blk_trace_mutex;#endif /* * for flush operations
include/linux/blktrace_api.h +13 -5
@@ -51,18 +51,26 @@ void __trace_note_message(struct blk_trace *, const char *fmt, ...);**/ #define blk_add_trace_msg (q, fmt, ...) \ do { \ - struct blk_trace *bt = (q)->blk_trace; \ + struct blk_trace *bt; \ + \ + rcu_read_lock(); \ + bt = rcu_dereference((q)->blk_trace); \ if (unlikely(bt)) \ __trace_note_message(bt, fmt, ##__VA_ARGS__); \ + rcu_read_unlock(); \ } while (0)#define BLK_TN_MAX_MSG 128static inline bool blk_trace_note_message_enabled (struct request_queue *q) { -struct blk_trace *bt = q->blk_trace; -if (likely (!bt)) -return false; -return bt->act_mask &BLK_TC_NOTIFY ; +struct blk_trace *bt; +bool ret; + +rcu_read_lock (); + bt =rcu_dereference (q->blk_trace); + ret = bt && (bt->act_mask &BLK_TC_NOTIFY ); +rcu_read_unlock (); +return ret; } extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
include/linux/cdev.h +5 -0
@@ -4,6 +4,7 @@#include <linux/kobject.h> #include <linux/kdev_t.h> #include <linux/list.h> +#include <linux/device.h> struct file_operations ;struct inode ;
@@ -26,6 +27,10 @@ void cdev_put(struct cdev *p);int cdev_add (struct cdev *,dev_t ,unsigned ); +void cdev_set_parent (struct cdev *p,struct kobject *kobj); +int cdev_device_add (struct cdev *cdev,struct device *dev); +void cdev_device_del (struct cdev *cdev,struct device *dev); +void cdev_del (struct cdev *);void cd_forget (struct inode *);
include/linux/compiler.h +7 -0
@@ -605,4 +605,11 @@ unsigned long read_word_at_a_time(const void *addr)# define __kprobes# define nokprobe_inline inline#endif + +/* +* This is needed in functions which generate the stack canary, see +* arch/x86/kernel/smpboot.c::start_secondary() for an example. +*/ +#define prevent_tail_call_optimization () mb() +#endif /* __LINUX_COMPILER_H */
include/linux/fs.h +1 -1
@@ -931,7 +931,7 @@ struct file_handle {__u32 handle_bytes;int handle_type;/* file identifier */ -unsigned char f_handle[0 ]; +unsigned char f_handle[]; };static inline struct file *get_file (struct file *f)
include/linux/pnp.h +9 -20
@@ -219,10 +219,8 @@ struct pnp_card {#define global_to_pnp_card (n) list_entry(n, struct pnp_card, global_list)#define protocol_to_pnp_card (n) list_entry(n, struct pnp_card, protocol_list)#define to_pnp_card (n) container_of(n, struct pnp_card, dev) -#define pnp_for_each_card (card) \ - for((card) = global_to_pnp_card(pnp_cards.next); \ - (card) != global_to_pnp_card(&pnp_cards); \ - (card) = global_to_pnp_card((card)->global_list.next)) +#define pnp_for_each_card (card) \ + list_for_each_entry(card, &pnp_cards, global_list)struct pnp_card_link {struct pnp_card *card;
@@ -275,14 +273,9 @@ struct pnp_dev {#define card_to_pnp_dev (n) list_entry(n, struct pnp_dev, card_list)#define protocol_to_pnp_dev (n) list_entry(n, struct pnp_dev, protocol_list)#define to_pnp_dev (n) container_of(n, struct pnp_dev, dev) -#define pnp_for_each_dev (dev) \ - for((dev) = global_to_pnp_dev(pnp_global.next); \ - (dev) != global_to_pnp_dev(&pnp_global); \ - (dev) = global_to_pnp_dev((dev)->global_list.next)) -#define card_for_each_dev (card,dev) \ - for((dev) = card_to_pnp_dev((card)->devices.next); \ - (dev) != card_to_pnp_dev(&(card)->devices); \ - (dev) = card_to_pnp_dev((dev)->card_list.next)) +#define pnp_for_each_dev (dev) list_for_each_entry(dev, &pnp_global, global_list) +#define card_for_each_dev (card, dev) \ + list_for_each_entry(dev, &(card)->devices, card_list)#define pnp_dev_name (dev) (dev)->namestatic inline void *pnp_get_drvdata (struct pnp_dev *pdev)
@@ -436,14 +429,10 @@ struct pnp_protocol { };#define to_pnp_protocol (n) list_entry(n, struct pnp_protocol, protocol_list) -#define protocol_for_each_card (protocol,card) \ - for((card) = protocol_to_pnp_card((protocol)->cards.next); \ - (card) != protocol_to_pnp_card(&(protocol)->cards); \ - (card) = protocol_to_pnp_card((card)->protocol_list.next)) -#define protocol_for_each_dev (protocol,dev) \ - for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \ - (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ - (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) +#define protocol_for_each_card (protocol, card) \ + list_for_each_entry(card, &(protocol)->cards, protocol_list) +#define protocol_for_each_dev (protocol, dev) \ + list_for_each_entry(dev, &(protocol)->devices, protocol_list)extern struct bus_type pnp_bus_type;
include/linux/posix-clock.h +11 -8
@@ -104,29 +104,32 @@ struct posix_clock_operations {* * @ops: Functional interface to the clock * @cdev: Character device instance for this clock -* @kref: Reference count. +* @dev: Pointer to the clock's device. * @rwsem: Protects the 'zombie' field from concurrent access. * @zombie: If 'zombie' is true, then the hardware has disappeared. -* @release: A function to free the structure when the reference count reaches -* zero. May be NULL if structure is statically allocated. * * Drivers should embed their struct posix_clock within a private * structure, obtaining a reference to it during callbacks using * container_of(). +* +* Drivers should supply an initialized but not exposed struct device +* to posix_clock_register(). It is used to manage lifetime of the +* driver's private structure. It's 'release' field should be set to +* a release function for this private structure. */ struct posix_clock {struct posix_clock_operations ops;struct cdev cdev; -struct kref kref; +struct device *dev;struct rw_semaphore rwsem;bool zombie; -void (*release)(struct posix_clock *clk); };/** * posix_clock_register() - register a new clock -* @clk: Pointer to the clock. Caller must provide 'ops' and 'release' -* @devid: Allocated device id +* @clk: Pointer to the clock. Caller must provide 'ops' field +* @dev: Pointer to the initialized device. Caller must provide +* 'release' field * * A clock driver calls this function to register itself with the * clock device subsystem. If 'clk' points to dynamically allocated
@@ -135,7 +138,7 @@ struct posix_clock {* * Returns zero on success, non-zero otherwise. */ -int posix_clock_register (struct posix_clock *clk,dev_t devid); +int posix_clock_register (struct posix_clock *clk,struct device *dev);/** * posix_clock_unregister() - unregister a clock
include/linux/tty.h +1 -1
@@ -64,7 +64,7 @@ struct tty_buffer {int read;int flags;/* Data points here */ -unsigned long data[0 ]; +unsigned long data[]; };/* Values for .flags field of tty_buffer */
include/net/addrconf.h +4 -2
@@ -206,8 +206,10 @@ struct ipv6_stub { const struct in6_addr *addr);int (*ipv6_sock_mc_drop)(struct sock *sk,int ifindex,const struct in6_addr *addr); -int (*ipv6_dst_lookup)(struct net *net,struct sock *sk, -struct dst_entry **dst,struct flowi6 *fl6); +struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst);void (*udpv6_encap_enable)(void ); void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr, const struct in6_addr *solicited_addr,
include/net/ipv6.h +1 -1
@@ -856,7 +856,7 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)int ip6_dst_lookup (struct net *net,struct sock *sk,struct dst_entry **dst,struct flowi6 *fl6); -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst);struct dst_entry *ip6_sk_dst_lookup_flow (struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst);
include/net/netfilter/nf_conntrack.h +1 -1
@@ -103,7 +103,7 @@ struct nf_conn {struct hlist_node nat_bysource;#endif /* all members below initialized via memset */ -u8 __nfct_init_offset[0 ]; +struct { } __nfct_init_offset;/* If we were expected by an expectation, this will be it */ struct nf_conn *master;
include/sound/rawmidi.h +1 -0
@@ -76,6 +76,7 @@ struct snd_rawmidi_runtime {size_t avail_min;/* min avail for wakeup */ size_t avail;/* max used buffer for wakeup */ size_t xruns;/* over/underruns counter */ +int buffer_ref;/* buffer reference count */ /* misc */ spinlock_t lock;wait_queue_head_t sleep;
init/main.c +2 -0
@@ -662,6 +662,8 @@ asmlinkage __visible void __init start_kernel(void)/* Do the rest non-__init'ed, we're now alive */ rest_init (); + +prevent_tail_call_optimization (); }/* Call all constructor functions linked into the kernel. */
ipc/util.c +6 -6
@@ -751,21 +751,21 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos, total++; } - *new_pos = pos +1 ; + ipc =NULL ;if (total >= ids->in_use) -return NULL ; + goto out;for (; pos <IPCMNI ; pos++) { ipc =idr_find (&ids->ipcs_idr, pos);if (ipc !=NULL ) {rcu_read_lock ();ipc_lock_object (ipc); -return ipc; +break ; } } - -/* Out of range - return NULL to terminate iteration */ -return NULL ; +out: + *new_pos = pos +1 ; +return ipc; }static void *sysvipc_proc_next (struct seq_file *s,void *it,loff_t *pos)
kernel/time/posix-clock.c +13 -18
@@ -25,8 +25,6 @@#include <linux/syscalls.h> #include <linux/uaccess.h> -static void delete_clock (struct kref *kref); -/* * Returns NULL if the posix_clock instance attached to 'fp' is old and stale. */
@@ -168,7 +166,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp) err =0 ;if (!err) { -kref_get (&clk->kref); +get_device (clk->dev); fp->private_data = clk; } out:
@@ -184,7 +182,7 @@ static int posix_clock_release(struct inode *inode, struct file *fp)if (clk->ops.release) err = clk->ops.release (clk); -kref_put (&clk->kref, delete_clock); +put_device (clk->dev); fp->private_data =NULL ;
@@ -206,38 +204,35 @@ static const struct file_operations posix_clock_file_operations = {#endif }; -int posix_clock_register (struct posix_clock *clk,dev_t devid) +int posix_clock_register (struct posix_clock *clk,struct device *dev) {int err; -kref_init (&clk->kref);init_rwsem (&clk->rwsem);cdev_init (&clk->cdev, &posix_clock_file_operations); + err =cdev_device_add (&clk->cdev, dev); +if (err) { +pr_err ("%s unable to add device %d:%d\n" , +dev_name (dev),MAJOR (dev->devt),MINOR (dev->devt)); +return err; + } clk->cdev.owner = clk->ops.owner; - err =cdev_add (&clk->cdev, devid,1 ); + clk->dev = dev; -return err; +return 0 ; }EXPORT_SYMBOL_GPL (posix_clock_register); -static void delete_clock (struct kref *kref) -{ - struct posix_clock *clk = container_of(kref, struct posix_clock, kref); - -if (clk->release) - clk->release (clk); -} -void posix_clock_unregister (struct posix_clock *clk) { -cdev_del (&clk->cdev); +cdev_device_del (&clk->cdev, clk->dev);down_write (&clk->rwsem); clk->zombie = true;up_write (&clk->rwsem); -kref_put (&clk->kref, delete_clock); +put_device (clk->dev); }EXPORT_SYMBOL_GPL (posix_clock_unregister);
kernel/trace/blktrace.c +144 -47
459 lines not on this page · raw message
kernel/trace/trace.c +13 -0
@@ -7032,6 +7032,19 @@ static int allocate_trace_buffers(struct trace_array *tr, int size)*/ allocate_snapshot = false;#endif + +/* +* Because of some magic with the way alloc_percpu() works on +* x86_64, we need to synchronize the pgd of all the tables, +* otherwise the trace events that happen in x86_64 page fault +* handlers can't cope with accessing the chance that a +* alloc_percpu()'d memory might be touched in the page fault trace +* event. Oh, and we need to audit all other alloc_percpu() and vmalloc() +* calls in tracing, because something might get triggered within a +* page fault trace event! +*/ +vmalloc_sync_mappings (); +return 0 ; }
mm/page_alloc.c +1 -0
@@ -1408,6 +1408,7 @@ void set_zone_contiguous(struct zone *zone)if (!__pageblock_pfn_to_page (block_start_pfn, block_end_pfn, zone))return ; +cond_resched (); }/* We confirm that there is no hole */
mm/shmem.c +5 -2
@@ -2082,7 +2082,11 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)struct shmem_inode_info *info =SHMEM_I (inode);int retval = -ENOMEM ; -spin_lock_irq (&info->lock); +/* +* What serializes the accesses to info->flags? +* ipc_lock_object() when called from shmctl_do_lock(), +* no serialization needed when called from shm_destroy(). +*/ if (lock && !(info->flags &VM_LOCKED )) {if (!user_shm_lock (inode->i_size, user)) goto out_nomem;
@@ -2097,7 +2101,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) retval =0 ; out_nomem: -spin_unlock_irq (&info->lock);return retval; }
net/batman-adv/bat_v_ogm.c +1 -1
@@ -709,7 +709,7 @@ static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset, orig_node =batadv_v_ogm_orig_get (bat_priv, ogm_packet->orig);if (!orig_node) -return ; + goto out; neigh_node =batadv_neigh_node_get_or_create (orig_node, if_incoming, ethhdr->h_source);
net/batman-adv/network-coding.c +1 -8
@@ -1012,15 +1012,8 @@ static struct batadv_nc_path *batadv_nc_get_path(struct batadv_priv *bat_priv,*/ static u8 batadv_nc_random_weight_tq (u8 tq) { -u8 rand_val, rand_tq; - -get_random_bytes (&rand_val,sizeof (rand_val)); -/* randomize the estimated packet loss (max TQ - estimated TQ) */ - rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq); - -/* normalize the randomized packet loss */ - rand_tq /=BATADV_TQ_MAX_VALUE ; +u8 rand_tq =prandom_u32_max (BATADV_TQ_MAX_VALUE +1 - tq);/* convert to (randomized) estimated tq again */ return BATADV_TQ_MAX_VALUE - rand_tq;
net/batman-adv/sysfs.c +2 -1
@@ -1087,7 +1087,7 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj, ret =batadv_parse_throughput (net_dev, buff,"throughput_override" , &tp_override);if (!ret) -return count; + goto out; old_tp_override =atomic_read (&hard_iface->bat_v.throughput_override);if (old_tp_override == tp_override)
@@ -1120,6 +1120,7 @@ static ssize_t batadv_show_throughput_override(struct kobject *kobj, tp_override =atomic_read (&hard_iface->bat_v.throughput_override); +batadv_hardif_put (hard_iface);return sprintf (buff,"%u.%u MBit\n" , tp_override /10 , tp_override %10 ); }
net/core/dev.c +3 -1
@@ -6939,11 +6939,13 @@ static void netdev_sync_lower_features(struct net_device *upper,netdev_dbg (upper,"Disabling feature %pNF on lower dev %s.\n" , &feature, lower->name); lower->wanted_features &= ~feature; -netdev_update_features (lower); +__netdev_update_features (lower);if (unlikely (lower->features & feature))netdev_WARN (upper,"failed to disable %pNF on %s!\n" , &feature, lower->name); +else +netdev_features_change (lower); } } }
net/core/drop_monitor.c +7 -4
@@ -159,6 +159,7 @@ static void sched_send_work(unsigned long _data)static void trace_drop_common (struct sk_buff *skb,void *location) {struct net_dm_alert_msg *msg; +struct net_dm_drop_point *point;struct nlmsghdr *nlh;struct nlattr *nla;int i;
@@ -177,11 +178,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location) nlh = (struct nlmsghdr *)dskb->data; nla =genlmsg_data (nlmsg_data (nlh)); msg =nla_data (nla); + point = msg->points;for (i =0 ; i < msg->entries; i++) { -if (!memcmp (&location, msg->points[i].pc,sizeof (void *))) { - msg->points[i].count++; +if (!memcmp (&location, &point->pc,sizeof (void *))) { + point->count++; goto out; } + point++; }if (msg->entries == dm_hit_limit) goto out;
@@ -190,8 +193,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)*/ __nla_reserve_nohdr (dskb,sizeof (struct net_dm_drop_point )); nla->nla_len +=NLA_ALIGN (sizeof (struct net_dm_drop_point )); -memcpy (msg->points[msg->entries].pc, &location,sizeof (void *)); - msg->points[msg->entries].count =1 ; +memcpy (point->pc, &location,sizeof (void *)); + point->count =1 ; msg->entries++;if (!timer_pending (&data->send_timer)) {
net/core/netprio_cgroup.c +2 -0
@@ -237,6 +237,8 @@ static void net_prio_attach(struct cgroup_taskset *tset)struct task_struct *p;struct cgroup_subsys_state *css; +cgroup_sk_alloc_disable (); +cgroup_taskset_for_each (p, css, tset) {void *v = (void *)(unsigned long )css->cgroup->id;
net/dccp/ipv6.c +3 -3
@@ -209,7 +209,7 @@ static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req final_p =fl6_update_dst (&fl6,rcu_dereference (np->opt), &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); dst =NULL ;
@@ -280,7 +280,7 @@ static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb)security_skb_classify_flow (rxskb,flowi6_to_flowi (&fl6));/* sk = NULL, but it is safe for now. RST socket required. */ - dst =ip6_dst_lookup_flow (ctl_sk, &fl6,NULL ); + dst =ip6_dst_lookup_flow (sock_net (ctl_sk), ctl_sk, &fl6,NULL );if (!IS_ERR (dst)) {skb_dst_set (skb, dst);ip6_xmit (ctl_sk, skb, &fl6,0 ,NULL ,0 );
@@ -889,7 +889,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, opt =rcu_dereference_protected (np->opt,lockdep_sock_is_held (sk)); final_p =fl6_update_dst (&fl6, opt, &final); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto failure;
net/ipv4/cipso_ipv4.c +4 -2
@@ -1272,7 +1272,8 @@ static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def,return ret_val; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; }return 0 ;
@@ -1453,7 +1454,8 @@ static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def,return ret_val; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; }return 0 ;
net/ipv4/route.c +1 -1
@@ -898,7 +898,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)/* Check for load limit; set rate_last to the latest sent * redirect. */ -if (peer->rate_tokens ==0 || +if (peer->n_redirects ==0 ||time_after (jiffies, (peer->rate_last + (ip_rt_redirect_load << peer->n_redirects)))) {
net/ipv6/addrconf_core.c +6 -5
@@ -107,15 +107,16 @@ int inet6addr_notifier_call_chain(unsigned long val, void *v) }EXPORT_SYMBOL (inet6addr_notifier_call_chain); -static int eafnosupport_ipv6_dst_lookup (struct net *net,struct sock *u1, -struct dst_entry **u2, -struct flowi6 *u3) +static struct dst_entry *eafnosupport_ipv6_dst_lookup_flow (struct net *net, +const struct sock *sk, +struct flowi6 *fl6, +const struct in6_addr *final_dst) { -return -EAFNOSUPPORT ; +return ERR_PTR (-EAFNOSUPPORT ); }const struct ipv6_stub *ipv6_stub__read_mostly = &(struct ipv6_stub ) { - .ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup, + .ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow, };EXPORT_SYMBOL_GPL (ipv6_stub);
net/ipv6/af_inet6.c +2 -2
@@ -702,7 +702,7 @@ int inet6_sk_rebuild_header(struct sock *sk) &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { sk->sk_route_caps =0 ; sk->sk_err_soft = -PTR_ERR (dst);
@@ -860,7 +860,7 @@ static struct pernet_operations inet6_net_ops = {static const struct ipv6_stub ipv6_stub_impl = { .ipv6_sock_mc_join = ipv6_sock_mc_join, .ipv6_sock_mc_drop = ipv6_sock_mc_drop, - .ipv6_dst_lookup = ip6_dst_lookup, + .ipv6_dst_lookup_flow = ip6_dst_lookup_flow, .udpv6_encap_enable = udpv6_encap_enable, .ndisc_send_na = ndisc_send_na, .nd_tbl = &nd_tbl,
net/ipv6/calipso.c +2 -1
@@ -1061,7 +1061,8 @@ static int calipso_opt_getattr(const unsigned char *calipso, goto getattr_return; } - secattr->flags |=NETLBL_SECATTR_MLS_CAT ; +if (secattr->attr.mls.cat) + secattr->flags |=NETLBL_SECATTR_MLS_CAT ; } secattr->type =NETLBL_NLTYPE_CALIPSO ;
net/ipv6/datagram.c +1 -1
@@ -87,7 +87,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr) final_p =fl6_update_dst (&fl6, opt, &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/ipv6/inet6_connection_sock.c +2 -2
@@ -90,7 +90,7 @@ struct dst_entry *inet6_csk_route_req(const struct sock *sk, fl6->fl6_sport =htons (ireq->ir_num);security_req_classify_flow (req,flowi6_to_flowi (fl6)); - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (IS_ERR (dst))return NULL ;
@@ -144,7 +144,7 @@ static struct dst_entry *inet6_csk_route_socket(struct sock *sk, dst =__inet6_csk_dst_check (sk, np->dst_cookie);if (!dst) { - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (!IS_ERR (dst))ip6_dst_store (sk, dst,NULL ,NULL );
net/ipv6/ip6_output.c +4 -4
@@ -1075,19 +1075,19 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup);* It returns a valid dst pointer on success, or a pointer encoded * error code. */ -struct dst_entry *ip6_dst_lookup_flow (const struct sock *sk,struct flowi6 *fl6, +struct dst_entry *ip6_dst_lookup_flow (struct net *net,const struct sock *sk,struct flowi6 *fl6,const struct in6_addr *final_dst) {struct dst_entry *dst =NULL ;int err; - err =ip6_dst_lookup_tail (sock_net (sk), sk, &dst, fl6); + err =ip6_dst_lookup_tail (net, sk, &dst, fl6);if (err)return ERR_PTR (err);if (final_dst) fl6->daddr = *final_dst; -return xfrm_lookup_route (sock_net (sk), dst,flowi6_to_flowi (fl6), sk,0 ); +return xfrm_lookup_route (net, dst,flowi6_to_flowi (fl6), sk,0 ); }EXPORT_SYMBOL_GPL (ip6_dst_lookup_flow);
@@ -1112,7 +1112,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, dst =ip6_sk_dst_check (sk, dst, fl6);if (!dst) - dst =ip6_dst_lookup_flow (sk, fl6, final_dst); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_dst);return dst; }
net/ipv6/raw.c +1 -1
@@ -920,7 +920,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/ipv6/route.c +4 -2
@@ -1373,8 +1373,10 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk, {struct rt6_info *rt6 = (struct rt6_info *)dst; -if (dst_metric_locked (dst,RTAX_MTU )) -return ; +/* Note: do *NOT* check dst_metric_locked(dst, RTAX_MTU) +* IPv6 pmtu discovery isn't optional, so 'mtu lock' cannot disable it. +* [see also comment in rt6_mtu_change_route()] +*/ dst_confirm (dst); mtu =max_t (u32, mtu,IPV6_MIN_MTU );
net/ipv6/syncookies.c +1 -1
@@ -230,7 +230,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) fl6.fl6_sport =inet_sk (sk)->inet_sport;security_req_classify_flow (req,flowi6_to_flowi (&fl6)); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) goto out_free; }
net/ipv6/tcp_ipv6.c +2 -2
@@ -244,7 +244,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,security_sk_classify_flow (sk,flowi6_to_flowi (&fl6)); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto failure;
@@ -841,7 +841,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32* Underlying function will use this to retrieve the network * namespace */ - dst =ip6_dst_lookup_flow (ctl_sk, &fl6,NULL ); + dst =ip6_dst_lookup_flow (sock_net (ctl_sk), ctl_sk, &fl6,NULL );if (!IS_ERR (dst)) {skb_dst_set (buff, dst);ip6_xmit (ctl_sk, buff, &fl6, fl6.flowi6_mark,NULL , tclass);
net/l2tp/l2tp_ip6.c +1 -1
@@ -620,7 +620,7 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); - dst =ip6_dst_lookup_flow (sk, &fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, &fl6, final_p);if (IS_ERR (dst)) { err =PTR_ERR (dst); goto out;
net/mpls/af_mpls.c +3 -4
@@ -497,16 +497,15 @@ static struct net_device *inet6_fib_lookup_dev(struct net *net,struct net_device *dev;struct dst_entry *dst;struct flowi6 fl6; -int err;if (!ipv6_stub)return ERR_PTR (-EAFNOSUPPORT );memset (&fl6,0 ,sizeof (fl6));memcpy (&fl6.daddr, addr,sizeof (struct in6_addr )); - err = ipv6_stub->ipv6_dst_lookup (net,NULL , &dst, &fl6); -if (err) -return ERR_PTR (err); + dst = ipv6_stub->ipv6_dst_lookup_flow (net,NULL , &fl6,NULL ); +if (IS_ERR (dst)) +return ERR_CAST (dst); dev = dst->dev;dev_hold (dev);
net/netfilter/nf_conntrack_core.c +2 -2
@@ -1124,9 +1124,9 @@ __nf_conntrack_alloc(struct net *net, *(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY ].hnnode.pprev) = hash; ct->status =0 ;write_pnet (&ct->ct_net, net); -memset (&ct->__nfct_init_offset[0 ],0 , +memset (&ct->__nfct_init_offset,0 , offsetof(struct nf_conn , proto) - - offsetof(struct nf_conn, __nfct_init_offset[0])); + offsetof(struct nf_conn , __nfct_init_offset));nf_ct_zone_add (ct, zone);
net/netlabel/netlabel_kapi.c +6 -0
@@ -748,6 +748,12 @@ int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap,if ((off & (BITS_PER_LONG -1 )) !=0 )return -EINVAL ; +/* a null catmap is equivalent to an empty one */ +if (!catmap) { + *offset = (u32)-1 ; +return 0 ; + } +if (off < catmap->startbit) { off = catmap->startbit; *offset = off;
net/sched/sch_choke.c +2 -1
@@ -382,7 +382,8 @@ static void choke_reset(struct Qdisc *sch) sch->q.qlen =0 ; sch->qstats.backlog =0 ; -memset (q->tab,0 , (q->tab_mask +1 ) *sizeof (struct sk_buff *)); +if (q->tab) +memset (q->tab,0 , (q->tab_mask +1 ) *sizeof (struct sk_buff *)); q->head = q->tail =0 ;red_restart (&q->vars); }
net/sched/sch_fq_codel.c +1 -1
@@ -428,7 +428,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt) q->quantum =max (256U ,nla_get_u32 (tb[TCA_FQ_CODEL_QUANTUM ]));if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]) - q->drop_batch_size =min (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ])); + q->drop_batch_size =max (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]));if (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]) q->memory_limit =min (1U <<31 ,nla_get_u32 (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]));
net/sched/sch_sfq.c +9 -0
@@ -635,6 +635,15 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)if (ctl->divisor && (!is_power_of_2 (ctl->divisor) || ctl->divisor >65536 ))return -EINVAL ; + +/* slot->allot is a short, make sure quantum is not too big. */ +if (ctl->quantum) { +unsigned int scaled =SFQ_ALLOT_SIZE (ctl->quantum); + +if (scaled <=0 || scaled >SHRT_MAX ) +return -EINVAL ; + } +if (ctl_v1 && !red_check_params (ctl_v1->qth_min, ctl_v1->qth_max, ctl_v1->Wlog))return -EINVAL ;
net/sctp/ipv6.c +2 -2
@@ -269,7 +269,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, final_p =fl6_update_dst (fl6,rcu_dereference (np->opt), &final);rcu_read_unlock (); - dst =ip6_dst_lookup_flow (sk, fl6, final_p); + dst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (!asoc || saddr) { t->dst = dst;memcpy (fl, &_fl,sizeof (_fl));
@@ -327,7 +327,7 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, fl6->saddr = laddr->a.v6.sin6_addr; fl6->fl6_sport = laddr->a.v6.sin6_port; final_p =fl6_update_dst (fl6,rcu_dereference (np->opt), &final); - bdst =ip6_dst_lookup_flow (sk, fl6, final_p); + bdst =ip6_dst_lookup_flow (sock_net (sk), sk, fl6, final_p);if (IS_ERR (bdst))continue ;
net/tipc/udp_media.c +6 -3
@@ -187,10 +187,13 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, .saddr = src->ipv6, .flowi6_proto = IPPROTO_UDP }; - err = ipv6_stub->ipv6_dst_lookup (net, ub->ubsock->sk, &ndst, - &fl6); -if (err) + ndst = ipv6_stub->ipv6_dst_lookup_flow (net, + ub->ubsock->sk, + &fl6,NULL ); +if (IS_ERR (ndst)) { + err =PTR_ERR (ndst); goto tx_error; + } ttl =ip6_dst_hoplimit (ndst); err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL, &src->ipv6, &dst->ipv6, 0, ttl, 0,
scripts/decodecode +1 -1
@@ -98,7 +98,7 @@ faultlinenum=$(( $(wc -l $T.oo | cut -d" " -f1) - \ faultline=`cat $T.dis | head -1 | cut -d":" -f2-` faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` -cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" +cat $T.oo | sed -e "${faultlinenum}s/^\([^:]*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" echo cat $T.aa cleanup
sound/core/rawmidi.c +29 -6
@@ -108,6 +108,17 @@ static void snd_rawmidi_input_event_work(struct work_struct *work) runtime->event (runtime->substream); } +/* buffer refcount management: call with runtime->lock held */ +static inline void snd_rawmidi_buffer_ref (struct snd_rawmidi_runtime *runtime) +{ + runtime->buffer_ref++; +} + +static inline void snd_rawmidi_buffer_unref (struct snd_rawmidi_runtime *runtime) +{ + runtime->buffer_ref--; +} +static int snd_rawmidi_runtime_create (struct snd_rawmidi_substream *substream) {struct snd_rawmidi_runtime *runtime;
@@ -125,7 +136,7 @@ static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) runtime->avail =0 ; else runtime->avail = runtime->buffer_size; -if ((runtime->buffer =kmalloc (runtime->buffer_size,GFP_KERNEL )) ==NULL ) { +if ((runtime->buffer =kzalloc (runtime->buffer_size,GFP_KERNEL )) ==NULL ) {kfree (runtime);return -ENOMEM ; }
@@ -650,10 +661,15 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,return -EINVAL ; }if (params->buffer_size != runtime->buffer_size) { - newbuf =kmalloc (params->buffer_size,GFP_KERNEL ); + newbuf =kzalloc (params->buffer_size,GFP_KERNEL );if (!newbuf)return -ENOMEM ;spin_lock_irq (&runtime->lock); +if (runtime->buffer_ref) { +spin_unlock_irq (&runtime->lock); +kfree (newbuf); +return -EBUSY ; + } oldbuf = runtime->buffer; runtime->buffer = newbuf; runtime->buffer_size = params->buffer_size;
@@ -962,8 +978,10 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,long result =0 , count1;struct snd_rawmidi_runtime *runtime = substream->runtime;unsigned long appl_ptr; +int err =0 ;spin_lock_irqsave (&runtime->lock, flags); +snd_rawmidi_buffer_ref (runtime);while (count >0 && runtime->avail) { count1 = runtime->buffer_size - runtime->appl_ptr;if (count1 > count)
@@ -982,16 +1000,19 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,if (userbuf) {spin_unlock_irqrestore (&runtime->lock, flags);if (copy_to_user (userbuf + result, - runtime->buffer + appl_ptr, count1)) { -return result >0 ? result : -EFAULT ; - } + runtime->buffer + appl_ptr, count1)) + err = -EFAULT ;spin_lock_irqsave (&runtime->lock, flags); +if (err) + goto out; } result += count1; count -= count1; } + out: +snd_rawmidi_buffer_unref (runtime);spin_unlock_irqrestore (&runtime->lock, flags); -return result; +return result >0 ? result : err; } long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
@@ -1262,6 +1283,7 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream,return -EAGAIN ; } } +snd_rawmidi_buffer_ref (runtime);while (count >0 && runtime->avail >0 ) { count1 = runtime->buffer_size - runtime->appl_ptr;if (count1 > count)
@@ -1293,6 +1315,7 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, } __end: count1 = runtime->avail < runtime->buffer_size; +snd_rawmidi_buffer_unref (runtime);spin_unlock_irqrestore (&runtime->lock, flags);if (count1)snd_rawmidi_output_trigger (substream,1 );
sound/pci/hda/patch_hdmi.c +2 -0
@@ -2044,7 +2044,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)for (pin_idx =0 ; pin_idx < spec->num_pins; pin_idx++) {struct hdmi_spec_per_pin *per_pin =get_pin (spec, pin_idx); +struct hdmi_eld *pin_eld = &per_pin->sink_eld; + pin_eld->eld_valid = false;hdmi_present_sense (per_pin,0 ); }
sound/pci/hda/patch_realtek.c +9 -3
@@ -4212,8 +4212,6 @@ static void alc_determine_headset_type(struct hda_codec *codec) is_ctia = (val &0x1c02 ) ==0x1c02 ;break ;case 0x10ec0225 : - codec->power_save_node =1 ; -/* fall through */ case 0x10ec0295 :case 0x10ec0299 :alc_process_coef_fw (codec, coef0225);
@@ -4890,6 +4888,7 @@ enum {ALC269_FIXUP_HP_LINE1_MIC1_LED ,ALC269_FIXUP_INV_DMIC ,ALC269_FIXUP_LENOVO_DOCK , +ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST ,ALC269_FIXUP_NO_SHUTUP ,ALC286_FIXUP_SONY_MIC_NO_PRESENCE , ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
@@ -5157,6 +5156,12 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT }, + [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc269_fixup_limit_int_mic_boost, + .chained = true, + .chain_id = ALC269_FIXUP_LENOVO_DOCK, + }, [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { .type = HDA_FIXUP_FUNC, .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
@@ -5820,7 +5825,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x17aa ,0x21b8 ,"Thinkpad Edge 14" ,ALC269_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x17aa ,0x21ca ,"Thinkpad L412" ,ALC269_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x17aa ,0x21e9 ,"Thinkpad Edge 15" ,ALC269_FIXUP_SKU_IGNORE ), -SND_PCI_QUIRK (0x17aa ,0x21f6 ,"Thinkpad T530" ,ALC269_FIXUP_LENOVO_DOCK ), +SND_PCI_QUIRK (0x17aa ,0x21f6 ,"Thinkpad T530" ,ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST ),SND_PCI_QUIRK (0x17aa ,0x21fa ,"Thinkpad X230" ,ALC269_FIXUP_LENOVO_DOCK ),SND_PCI_QUIRK (0x17aa ,0x21f3 ,"Thinkpad T430" ,ALC269_FIXUP_LENOVO_DOCK ), SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
@@ -5945,6 +5950,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, + {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
sound/usb/quirks.c +5 -4
@@ -1316,13 +1316,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)mdelay (20 ); -/* Zoom R16/24, Logitech H650e, Jabra 550a needs a tiny delay here, -* otherwise requests like get/set frequency return as failed despite -* actually succeeding. +/* Zoom R16/24, Logitech H650e, Jabra 550a, Kingston HyperX needs a tiny +* delay here, otherwise requests like get/set frequency return as +* failed despite actually succeeding. */ if ((chip->usb_id ==USB_ID (0x1686 ,0x00dd ) || chip->usb_id ==USB_ID (0x046d ,0x0a46 ) || - chip->usb_id ==USB_ID (0x0b0e ,0x0349 )) && + chip->usb_id ==USB_ID (0x0b0e ,0x0349 ) || + chip->usb_id ==USB_ID (0x0951 ,0x16ad )) && (requesttype &USB_TYPE_MASK ) ==USB_TYPE_CLASS )mdelay (1 ); }
tools/objtool/check.c +1 -1
@@ -1264,7 +1264,7 @@ static int update_insn_state_regs(struct instruction *insn, struct insn_state *sstruct cfi_reg *cfa = &state->cfa;struct stack_op *op = &insn->stack_op; -if (cfa->base !=CFI_SP ) +if (cfa->base !=CFI_SP && cfa->base !=CFI_SP_INDIRECT )return 0 ;/* push */