Linux 4.14.265
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.265 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/powerpc/kernel/Makefile | 1 arch/powerpc/lib/Makefile | 3 arch/s390/hypfs/hypfs_vm.c | 6 - block/bio-integrity.c | 2 drivers/edac/altera_edac.c | 2 drivers/edac/xgene_edac.c | 2 drivers/gpu/drm/i915/intel_overlay.c | 3 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 drivers/gpu/drm/msm/msm_drv.c | 2 drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 drivers/hwmon/lm90.c | 2 drivers/infiniband/hw/mlx4/main.c | 2 drivers/iommu/amd_iommu_init.c | 2 drivers/iommu/intel_irq_remapping.c | 13 ++- drivers/misc/Makefile | 2 drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 +++ drivers/net/ethernet/ibm/ibmvnic.c | 6 - drivers/net/ethernet/intel/i40e/i40e.h | 8 - drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 2 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +-- drivers/net/hamradio/yam.c | 4 drivers/net/ieee802154/ca8210.c | 1 drivers/net/macsec.c | 9 ++ drivers/net/phy/phylink.c | 5 + drivers/net/usb/ipheth.c | 6 - drivers/rpmsg/rpmsg_char.c | 22 ----- drivers/rtc/rtc-mc146818-lib.c | 2 drivers/s390/scsi/zfcp_fc.c | 13 ++- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 41 ++++----- drivers/spi/spi-bcm-qspi.c | 2 drivers/spi/spi-meson-spicc.c | 5 + drivers/spi/spi-mt65xx.c | 2 drivers/staging/typec/tcpm.c | 3 drivers/tty/n_gsm.c | 4 drivers/tty/serial/8250/8250_pci.c | 100 +++++++++++++++++++++++- drivers/tty/serial/stm32-usart.c | 2 drivers/usb/common/ulpi.c | 7 + drivers/usb/core/hcd.c | 14 +++ drivers/usb/core/urb.c | 12 ++ drivers/usb/gadget/function/f_sourcesink.c | 1 drivers/usb/storage/unusual_devs.h | 10 ++ fs/ext4/inline.c | 10 ++ fs/nfs/dir.c | 18 ++++ fs/nfsd/nfs4state.c | 4 fs/udf/inode.c | 9 -- include/linux/netdevice.h | 1 include/net/ip.h | 21 ++--- include/net/netfilter/nf_nat_l4proto.h | 2 kernel/audit.c | 62 ++++++++++---- kernel/bpf/core.c | 59 ++++++++++++-- kernel/power/wakelock.c | 12 -- net/bluetooth/hci_event.c | 10 +- net/core/filter.c | 11 ++ net/core/net-procfs.c | 38 ++++++++- net/core/rtnetlink.c | 6 - net/ieee802154/nl802154.c | 8 - net/ipv4/ip_output.c | 11 ++ net/ipv4/ping.c | 3 net/ipv4/raw.c | 5 - net/ipv6/ip6_tunnel.c | 8 - net/netfilter/nf_nat_proto_common.c | 36 ++++++-- net/netfilter/nf_nat_proto_dccp.c | 5 - net/netfilter/nf_nat_proto_sctp.c | 5 - net/netfilter/nf_nat_proto_tcp.c | 5 - net/netfilter/nf_nat_proto_udp.c | 10 -- net/netfilter/nft_payload.c | 3 net/packet/af_packet.c | 10 +- sound/soc/fsl/pcm030-audio-fabric.c | 11 +- sound/soc/soc-ops.c | 29 ++++++ tools/testing/selftests/futex/Makefile | 4 71 files changed, 561 insertions(+), 216 deletions(-)
Alan Stern (2):
usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge
USB: core: Fix hang in usb_kill_urb by adding memory barriers
Badhri Jagan Sridharan (1):
usb: typec: tcpm: Do not disconnect while receiving VBUS off
Benjamin Gaignard (1):
spi: mediatek: Avoid NULL pointer crash in interrupt
Brian Gix (1):
Bluetooth: refactor malicious adv data check
Cameron Williams (1):
tty: Add support for Brainboxes UC cards.
Christophe Leroy (2):
powerpc/32: Fix boot failure with GCC latent entropy plugin
lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
Congyu Liu (1):
net: fix information leakage in /proc/net/ptype
Dai Ngo (1):
nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
Dan Carpenter (1):
drm/i915/overlay: Prevent divide by zero bugs in scaling
Daniel Borkmann (1):
bpf: fix truncated jump targets on heavy expansions
Eric Dumazet (5):
ipv4: avoid using shared IP generator for connected sockets
ipv4: raw: lock the socket in raw_bind()
ipv4: tcp: send zero IPID in SYNACK messages
rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink()
af_packet: fix data-race in packet_setsockopt / packet_setsockopt
Florian Westphal (2):
netfilter: nat: remove l4 protocol port rovers
netfilter: nat: limit port clash resolution attempts
Georgi Valkov (1):
ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
Greg Kroah-Hartman (2):
PM: wakeup: simplify the output logic of pm_show_wakelocks() Linux 4.14.265
Guenter Roeck (1):
hwmon: (lm90) Reduce maximum conversion rate for G781
Guoqing Jiang (1):
iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()
Hangyu Hua (1):
yam: fix a memory leak in yam_siocdevprivate()
Ido Schimmel (1):
ipv6_tunnel: Rate limit warning messages
Jan Kara (2):
udf: Restore i_lenAlloc when inode expansion fails
udf: Fix NULL ptr deref when converting from inline format
Jedrzej Jagielski (1):
i40e: Increase delay to 1 s after global EMP reset
Jianguo Wu (1):
net-procfs: show net devices bound packet types
Joe Damato (1):
i40e: fix unsigned stat widths
Joerg Roedel (1):
iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()
John Meneghini (2):
scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put()
scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe
Jon Hunter (1):
usb: common: ulpi: Fix crash in ulpi_match()
José Expósito (1):
drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable
Kamal Dasu (1):
spi: bcm-qspi: check for valid cs before applying chip select
Leon Romanovsky (1):
RDMA/mlx4: Don't continue event handler after memory allocation failure
Lior Nahmanson (1):
net: macsec: Verify that send_sci is on when setting Tx sci explicitly
Marek Behún (1):
net: sfp: ignore disabled SFP node
Mark Brown (3):
ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()
ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()
ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx()
Martin K. Petersen (1):
block: bio-integrity: Advance seed correctly for larger interval sizes
Matthias Kaehlcke (1):
rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev
Miaoqian Lin (2):
spi: meson-spicc: add IRQ check in meson_spicc_probe
ASoC: fsl: Add missing error handling in pcm030_fabric_probe
Miquel Raynal (2):
net: ieee802154: ca8210: Stop leaking skb's
net: ieee802154: Return meaningful error codes from the netlink helpers
Muhammad Usama Anjum (1):
selftests: futex: Use variable MAKE instead of make
Nick Lopez (1):
drm/nouveau: fix off by one in BIOS boundary checking
Pablo Neira Ayuso (1):
netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
Paul Moore (1):
audit: improve audit queue handling when "audit=1" on cmdline
Pavankumar Kondeti (1):
usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS
Raju Rangoju (1):
net: amd-xgbe: ensure to reset the tx_timer_active flag
Ritesh Harjani (1):
ext4: fix error handling in ext4_restore_inline_data()
Riwen Lu (1):
rtc: cmos: Evaluate century appropriate
Sergey Shtylyov (2):
EDAC/altera: Fix deferred probing
EDAC/xgene: Fix deferred probing
Shyam Sundar S K (1):
net: amd-xgbe: Fix skb data length underflow
Steffen Maier (1):
scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices
Sujit Kautkar (1):
rpmsg: char: Fix race between the release of rpmsg_ctrldev and cdev
Sukadev Bhattiprolu (1):
ibmvnic: don't spin in tasklet
Trond Myklebust (2):
NFSv4: Handle case where the lookup of a directory fails
NFSv4: nfs_atomic_open() can race when looking up a non-regular file
Valentin Caron (1):
serial: stm32: fix software flow control transfer
Vasily Gorbik (1):
s390/hypfs: include z/VM guests with access control group set
Xianting Tian (1):
drm/msm: Fix wrong size calculation
Xin Long (1):
ping: fix the sk_bound_dev_if match in ping_lookup
[email protected] (1):
tty: n_gsm: fix SW flow control encoding/handling
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 264 +SUBLEVEL = 265 EXTRAVERSION = NAME = Petit Gorille
arch/powerpc/kernel/Makefile +1 -0
@@ -15,6 +15,7 @@ CFLAGS_prom_init.o += -fPIC CFLAGS_btext.o += -fPIC endif +CFLAGS_setup_32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) CFLAGS_cputable.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) CFLAGS_prom_init.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) CFLAGS_btext.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
arch/powerpc/lib/Makefile +3 -0
@@ -10,6 +10,9 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE) +CFLAGS_code-patching.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) +CFLAGS_feature-fixups.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) + obj-y += string.o alloc.o code-patching.o feature-fixups.o obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o
arch/s390/hypfs/hypfs_vm.c +4 -2
@@ -20,6 +20,7 @@static char local_guest[] =" " ;static char all_guests[] ="* " ; +static char *all_groups = all_guests;static char *guest_query;struct diag2fc_data {
@@ -62,10 +63,11 @@ static int diag2fc(int size, char* query, void *addr)memcpy (parm_list.userid, query,NAME_LEN );ASCEBC (parm_list.userid,NAME_LEN ); - parm_list.addr = (unsigned long ) addr ; +memcpy (parm_list.aci_grp, all_groups,NAME_LEN ); +ASCEBC (parm_list.aci_grp,NAME_LEN ); + parm_list.addr = (unsigned long )addr; parm_list.size = size; parm_list.fmt =0x02 ; -memset (parm_list.aci_grp,0x40 ,NAME_LEN ); rc =-1 ;diag_stat_inc (DIAG_STAT_X2FC );
block/bio-integrity.c +1 -1
@@ -417,7 +417,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done)struct blk_integrity *bi =blk_get_integrity (bio->bi_disk);unsigned bytes =bio_integrity_bytes (bi, bytes_done >>9 ); - bip->bip_iter.bi_sector += bytes_done >>9 ; + bip->bip_iter.bi_sector +=bio_integrity_intervals (bi, bytes_done >>9 );bvec_iter_advance (bip->bip_vec, &bip->bip_iter, bytes); }EXPORT_SYMBOL (bio_integrity_advance);
drivers/edac/altera_edac.c +1 -1
@@ -357,7 +357,7 @@ static int altr_sdram_probe(struct platform_device *pdev)if (irq <0 ) {edac_printk (KERN_ERR ,EDAC_MC ,"No irq %d in DT\n" , irq); -return -ENODEV ; +return irq; }/* Arria10 has a 2nd IRQ */
drivers/edac/xgene_edac.c +1 -1
@@ -1934,7 +1934,7 @@ static int xgene_edac_probe(struct platform_device *pdev) irq =platform_get_irq (pdev, i);if (irq <0 ) {dev_err (&pdev->dev,"No IRQ resource\n" ); - rc = -EINVAL ; + rc = irq; goto out_err; } rc = devm_request_irq(&pdev->dev, irq,
drivers/gpu/drm/i915/intel_overlay.c +3 -0
@@ -965,6 +965,9 @@ static int check_overlay_dst(struct intel_overlay *overlay,const struct intel_crtc_state *pipe_config = overlay->crtc->config; +if (rec->dst_height ==0 || rec->dst_width ==0 ) +return -EINVAL ; + if (rec->dst_x < pipe_config->pipe_src_w && rec->dst_x + rec->dst_width <= pipe_config->pipe_src_w && rec->dst_y < pipe_config->pipe_src_h &&
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +3 -1
@@ -554,12 +554,14 @@ void __exit msm_dsi_phy_driver_unregister(void)int msm_dsi_phy_enable (struct msm_dsi_phy *phy,int src_pll_id,struct msm_dsi_phy_clk_request *clk_req) { -struct device *dev = &phy->pdev->dev; +struct device *dev;int ret;if (!phy || !phy->cfg->ops.enable)return -EINVAL ; + dev = &phy->pdev->dev; + ret =dsi_phy_enable_resource (phy);if (ret) { dev_err(dev, "%s: resource enable failed, %d\n",
drivers/gpu/drm/msm/msm_drv.c +1 -1
@@ -321,7 +321,7 @@ static int msm_init_vram(struct drm_device *dev)of_node_put (node);if (ret)return ret; - size = r.end - r.start; + size = r.end - r.start +1 ;DRM_INFO ("using VRAM carveout: %lx@%pa\n" , size, &r.start);/* if we have no IOMMU, then we need to use carveout allocator.
drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +1 -1
@@ -38,7 +38,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size) *addr += bios->imaged_addr; } -if (unlikely (*addr + size >= bios->size)) { +if (unlikely (*addr + size > bios->size)) {nvkm_error (&bios->subdev,"OOB %d %08x %08x\n" , size, p, *addr);return false; }
drivers/hwmon/lm90.c +1 -1
@@ -359,7 +359,7 @@ static const struct lm90_params lm90_params[] = { .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_BROKEN_ALERT, .alert_alarms = 0x7c, - .max_convrate = 8, + .max_convrate = 7, }, [lm86] = { .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT,
drivers/infiniband/hw/mlx4/main.c +1 -1
@@ -3346,7 +3346,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,case MLX4_DEV_EVENT_PORT_MGMT_CHANGE : ew =kmalloc (sizeof *ew,GFP_ATOMIC );if (!ew) -break ; +return ;INIT_WORK (&ew->work, handle_port_mgmt_change_event);memcpy (&ew->ib_eqe, eqe,sizeof *eqe);
drivers/iommu/amd_iommu_init.c +2 -0
@@ -30,6 +30,7 @@#include <linux/iommu.h> #include <linux/kmemleak.h> #include <linux/mem_encrypt.h> +#include <linux/iopoll.h> #include <asm/pci-direct.h> #include <asm/iommu.h> #include <asm/gart.h>
@@ -770,6 +771,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) status =readl (iommu->mmio_base +MMIO_STATUS_OFFSET );if (status & (MMIO_STATUS_GALOG_RUN_MASK ))break ; +udelay (10 ); }if (i >=LOOP_TIMEOUT )
drivers/iommu/intel_irq_remapping.c +10 -3
@@ -543,9 +543,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) fn, &intel_ir_domain_ops, iommu);if (!iommu->ir_domain) { -irq_domain_free_fwnode (fn);pr_err ("IR%d: failed to allocate irqdomain\n" , iommu->seq_id); - goto out_free_bitmap; + goto out_free_fwnode; } iommu->ir_msi_domain = arch_create_remap_msi_irq_domain(iommu->ir_domain,
@@ -569,7 +568,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)if (dmar_enable_qi (iommu)) {pr_err ("Failed to enable queued invalidation\n" ); - goto out_free_bitmap; + goto out_free_ir_domain; } }
@@ -593,6 +592,14 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)return 0 ; +out_free_ir_domain: +if (iommu->ir_msi_domain) +irq_domain_remove (iommu->ir_msi_domain); + iommu->ir_msi_domain =NULL ; +irq_domain_remove (iommu->ir_domain); + iommu->ir_domain =NULL ; +out_free_fwnode: +irq_domain_free_fwnode (fn); out_free_bitmap:kfree (bitmap); out_free_pages:
drivers/misc/Makefile +1 -1
@@ -69,7 +69,7 @@ KCOV_INSTRUMENT_lkdtm_rodata.o := n OBJCOPYFLAGS := OBJCOPYFLAGS_lkdtm_rodata_objcopy.o := \ - --rename-section .text=.rodata,alloc,readonly,load + --rename-section .text=.rodata,alloc,readonly,load,contents targets += lkdtm_rodata.o lkdtm_rodata_objcopy.o $(obj)/lkdtm_rodata_objcopy.o: $(obj)/lkdtm_rodata.o FORCE $(call if_changed,objcopy)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +13 -1
@@ -724,7 +724,9 @@ static void xgbe_stop_timers(struct xgbe_prv_data *pdata)if (!channel->tx_ring)break ; +/* Deactivate the Tx timer */ del_timer_sync (&channel->tx_timer); + channel->tx_timer_active =0 ; } }
@@ -2720,6 +2722,14 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) buf2_len =xgbe_rx_buf2_len (rdata, packet, len); len += buf2_len; +if (buf2_len > rdata->rx.buf.dma_len) { +/* Hardware inconsistency within the descriptors +* that has resulted in a length underflow. +*/ + error =1 ; + goto skip_data; + } +if (!skb) { skb =xgbe_create_skb (pdata, napi, rdata, buf1_len);
@@ -2749,8 +2759,10 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)if (!last || context_next) goto read_again; -if (!skb) +if (!skb || error) { +dev_kfree_skb (skb); goto next_packet; + }/* Be sure we don't exceed the configured MTU */ max_len = netdev->mtu +ETH_HLEN ;
drivers/net/ethernet/ibm/ibmvnic.c +0 -6
@@ -3691,12 +3691,6 @@ static void ibmvnic_tasklet(void *data)ibmvnic_handle_crq (crq, adapter); crq->generic.first =0 ; } - -/* remain in tasklet until all -* capabilities responses are received -*/ -if (!adapter->wait_capability) - done = true; }/* if capabilities CRQ's were sent in this tasklet, the following * tasklet must wait until all responses are received
drivers/net/ethernet/intel/i40e/i40e.h +4 -4
@@ -627,12 +627,12 @@ struct i40e_vsi {struct rtnl_link_stats64 net_stats_offsets;struct i40e_eth_stats eth_stats;struct i40e_eth_stats eth_stats_offsets; -u32 tx_restart; -u32 tx_busy; +u64 tx_restart; +u64 tx_busy;u64 tx_linearize;u64 tx_force_wb; -u32 rx_buf_failed; -u32 rx_page_failed; +u64 rx_buf_failed; +u64 rx_page_failed;/* These are containers of ring pointers, allocated at run-time */ struct i40e_ring **rx_rings;
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +1 -1
@@ -259,7 +259,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid) (unsigned long int )vsi->net_stats_offsets.rx_compressed, (unsigned long int)vsi->net_stats_offsets.tx_compressed);dev_info (&pf->pdev->dev, -" tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n" , +" tx_restart = %llu, tx_busy = %llu, rx_buf_failed = %llu, rx_page_failed = %llu\n" , vsi->tx_restart, vsi->tx_busy, vsi->rx_buf_failed, vsi->rx_page_failed);rcu_read_lock ();
drivers/net/ethernet/intel/i40e/i40e_main.c +5 -11
@@ -778,9 +778,9 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)struct rtnl_link_stats64 *ns;/* netdev stats */ struct i40e_eth_stats *oes;struct i40e_eth_stats *es;/* device's eth stats */ -u32 tx_restart, tx_busy; +u64 tx_restart, tx_busy;struct i40e_ring *p; -u32 rx_page, rx_buf; +u64 rx_page, rx_buf;u64 bytes, packets;unsigned int start;u64 tx_linearize;
@@ -7245,15 +7245,9 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) }i40e_get_oem_version (&pf->hw); -if (test_bit (__I40E_EMP_RESET_INTR_RECEIVED, pf->state) && - ((hw->aq.fw_maj_ver ==4 && hw->aq.fw_min_ver <=33 ) || - hw->aq.fw_maj_ver <4 ) && hw->mac.type ==I40E_MAC_XL710 ) { -/* The following delay is necessary for 4.33 firmware and older -* to recover after EMP reset. 200 ms should suffice but we -* put here 300 ms to be sure that FW is ready to operate -* after reset. -*/ -mdelay (300 ); +if (test_and_clear_bit (__I40E_EMP_RESET_INTR_RECEIVED, pf->state)) { +/* The following delay is necessary for firmware update. */ +mdelay (1000 ); }/* re-verify the eeprom if we just had an EMP reset */
drivers/net/hamradio/yam.c +1 -3
@@ -980,9 +980,7 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) sizeof(struct yamdrv_ioctl_mcs));if (IS_ERR (ym))return PTR_ERR (ym); -if (ym->cmd !=SIOCYAMSMCS ) -return -EINVAL ; -if (ym->bitrate >YAM_MAXBITRATE ) { +if (ym->cmd !=SIOCYAMSMCS || ym->bitrate >YAM_MAXBITRATE ) {kfree (ym);return -EINVAL ; }
drivers/net/ieee802154/ca8210.c +1 -0
@@ -1770,6 +1770,7 @@ static int ca8210_async_xmit_complete(status );if (status !=MAC_TRANSACTION_OVERFLOW ) { +dev_kfree_skb_any (priv->tx_skb);ieee802154_wake_queue (priv->hw);return 0 ; }
drivers/net/macsec.c +9 -0
@@ -3230,6 +3230,15 @@ static int macsec_newlink(struct net *net, struct net_device *dev, macsec->real_dev = real_dev; +/* send_sci must be set to true when transmit sci explicitly is set */ +if ((data && data[IFLA_MACSEC_SCI ]) && + (data && data[IFLA_MACSEC_INC_SCI ])) { +u8 send_sci = !!nla_get_u8 (data[IFLA_MACSEC_INC_SCI ]); + +if (!send_sci) +return -EINVAL ; + } +if (data && data[IFLA_MACSEC_ICV_LEN ]) icv_len =nla_get_u8 (data[IFLA_MACSEC_ICV_LEN ]); mtu = real_dev->mtu - icv_len -macsec_extra_len (true);
drivers/net/phy/phylink.c +5 -0
@@ -514,6 +514,11 @@ static int phylink_register_sfp(struct phylink *pl, struct device_node *np)if (!sfp_np)return 0 ; +if (!of_device_is_available (sfp_np)) { +of_node_put (sfp_np); +return 0 ; + } + pl->sfp_bus =sfp_register_upstream (sfp_np, pl->netdev, pl, &sfp_phylink_ops);if (!pl->sfp_bus)
drivers/net/usb/ipheth.c +3 -3
@@ -173,7 +173,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)if (tx_buf ==NULL ) goto free_rx_urb; - rx_buf =usb_alloc_coherent (iphone->udev,IPHETH_BUF_SIZE , + rx_buf =usb_alloc_coherent (iphone->udev,IPHETH_BUF_SIZE +IPHETH_IP_ALIGN ,GFP_KERNEL , &rx_urb->transfer_dma);if (rx_buf ==NULL ) goto free_tx_buf;
@@ -198,7 +198,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)static void ipheth_free_urbs (struct ipheth_device *iphone) { -usb_free_coherent (iphone->udev,IPHETH_BUF_SIZE , iphone->rx_buf, +usb_free_coherent (iphone->udev,IPHETH_BUF_SIZE +IPHETH_IP_ALIGN , iphone->rx_buf, iphone->rx_urb->transfer_dma);usb_free_coherent (iphone->udev,IPHETH_BUF_SIZE , iphone->tx_buf, iphone->tx_urb->transfer_dma);
@@ -371,7 +371,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)usb_fill_bulk_urb (dev->rx_urb, udev,usb_rcvbulkpipe (udev, dev->bulk_in), - dev->rx_buf,IPHETH_BUF_SIZE , + dev->rx_buf,IPHETH_BUF_SIZE +IPHETH_IP_ALIGN , ipheth_rcvbulk_callback, dev); dev->rx_urb->transfer_flags |=URB_NO_TRANSFER_DMA_MAP ;
drivers/rpmsg/rpmsg_char.c +4 -18
@@ -100,7 +100,7 @@ static int rpmsg_eptdev_destroy(struct device *dev, void *data)/* wake up any blocked readers */ wake_up_interruptible (&eptdev->readq); -device_del (&eptdev->dev); +cdev_device_del (&eptdev->cdev, &eptdev->dev);put_device (&eptdev->dev);return 0 ;
@@ -336,7 +336,6 @@ static void rpmsg_eptdev_release_device(struct device *dev)ida_simple_remove (&rpmsg_ept_ida, dev->id);ida_simple_remove (&rpmsg_minor_ida,MINOR (eptdev->dev.devt)); -cdev_del (&eptdev->cdev);kfree (eptdev); }
@@ -381,19 +380,13 @@ static int rpmsg_eptdev_create(struct rpmsg_ctrldev *ctrldev, dev->id = ret;dev_set_name (dev,"rpmsg%d" , ret); - ret =cdev_add (&eptdev->cdev, dev->devt,1 ); + ret =cdev_device_add (&eptdev->cdev, &eptdev->dev);if (ret) goto free_ept_ida;/* We can now rely on the release function for cleanup */ dev->release = rpmsg_eptdev_release_device; - ret =device_add (dev); -if (ret) { -dev_err (dev,"device_add failed: %d\n" , ret); -put_device (dev); - } -return ret; free_ept_ida:
@@ -461,7 +454,6 @@ static void rpmsg_ctrldev_release_device(struct device *dev)ida_simple_remove (&rpmsg_ctrl_ida, dev->id);ida_simple_remove (&rpmsg_minor_ida,MINOR (dev->devt)); -cdev_del (&ctrldev->cdev);kfree (ctrldev); }
@@ -496,19 +488,13 @@ static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev) dev->id = ret;dev_set_name (&ctrldev->dev,"rpmsg_ctrl%d" , ret); - ret =cdev_add (&ctrldev->cdev, dev->devt,1 ); + ret =cdev_device_add (&ctrldev->cdev, &ctrldev->dev);if (ret) goto free_ctrl_ida;/* We can now rely on the release function for cleanup */ dev->release = rpmsg_ctrldev_release_device; - ret =device_add (dev); -if (ret) { -dev_err (&rpdev->dev,"device_add failed: %d\n" , ret); -put_device (dev); - } -dev_set_drvdata (&rpdev->dev, ctrldev);return ret;
@@ -534,7 +520,7 @@ static void rpmsg_chrdev_remove(struct rpmsg_device *rpdev)if (ret)dev_warn (&rpdev->dev,"failed to nuke endpoints: %d\n" , ret); -device_del (&ctrldev->dev); +cdev_device_del (&ctrldev->cdev, &ctrldev->dev);put_device (&ctrldev->dev); }
drivers/rtc/rtc-mc146818-lib.c +1 -1
@@ -82,7 +82,7 @@ unsigned int mc146818_get_time(struct rtc_time *time) time->tm_year += real_year -72 ;#endif -if (century >20 ) +if (century >19 ) time->tm_year += (century -19 ) *100 ;/*
drivers/s390/scsi/zfcp_fc.c +12 -1
@@ -521,6 +521,8 @@ static void zfcp_fc_adisc_handler(void *data) goto out; } +/* re-init to undo drop from zfcp_fc_adisc() */ + port->d_id =ntoh24 (adisc_resp->adisc_port_id);/* port is good, unblock rport without going through erp */ zfcp_scsi_schedule_rport_register (port); out:
@@ -534,6 +536,7 @@ static int zfcp_fc_adisc(struct zfcp_port *port)struct zfcp_fc_req *fc_req;struct zfcp_adapter *adapter = port->adapter;struct Scsi_Host *shost = adapter->scsi_host; +u32 d_id;int ret; fc_req =kmem_cache_zalloc (zfcp_fc_req_cache,GFP_ATOMIC );
@@ -558,7 +561,15 @@ static int zfcp_fc_adisc(struct zfcp_port *port) fc_req->u.adisc.req.adisc_cmd =ELS_ADISC ;hton24 (fc_req->u.adisc.req.adisc_port_id,fc_host_port_id (shost)); - ret =zfcp_fsf_send_els (adapter, port->d_id, &fc_req->ct_els, + d_id = port->d_id;/* remember as destination for send els below */ +/* +* Force fresh GID_PN lookup on next port recovery. +* Must happen after request setup and before sending request, +* to prevent race with port->d_id re-init in zfcp_fc_adisc_handler(). +*/ + port->d_id =0 ; + + ret =zfcp_fsf_send_els (adapter, d_id, &fc_req->ct_els,ZFCP_FC_CTELS_TMO );if (ret)kmem_cache_free (zfcp_fc_req_cache, fc_req);
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +18 -23
110 lines not on this page · raw message
drivers/spi/spi-bcm-qspi.c +1 -1
@@ -522,7 +522,7 @@ static void bcm_qspi_chip_select(struct bcm_qspi *qspi, int cs)u32 rd =0 ;u32 wr =0 ; -if (qspi->base[CHIP_SELECT ]) { +if (cs >=0 && qspi->base[CHIP_SELECT ]) { rd =bcm_qspi_read (qspi,CHIP_SELECT ,0 ); wr = (rd & ~0xff ) | (1 << cs);if (rd == wr)
drivers/spi/spi-meson-spicc.c +5 -0
@@ -529,6 +529,11 @@ static int meson_spicc_probe(struct platform_device *pdev)writel_relaxed (0 , spicc->base +SPICC_INTREG ); irq =platform_get_irq (pdev,0 ); +if (irq <0 ) { + ret = irq; + goto out_master; + } + ret =devm_request_irq (&pdev->dev, irq, meson_spicc_irq,0 ,NULL , spicc);if (ret) {
drivers/spi/spi-mt65xx.c +1 -1
@@ -498,7 +498,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)else mdata->state =MTK_SPI_IDLE ; -if (!master->can_dma (master, master->cur_msg->spi, trans)) { +if (!master->can_dma (master,NULL , trans)) {if (trans->rx_buf) { cnt = mdata->xfer_len /4 ; ioread32_rep(mdata->base + SPI_RX_DATA_REG,
drivers/staging/typec/tcpm.c +2 -1
@@ -3103,7 +3103,8 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)case SNK_TRYWAIT_DEBOUNCE :break ;case SNK_ATTACH_WAIT : -tcpm_set_state (port,SNK_UNATTACHED ,0 ); +case SNK_DEBOUNCED : +/* Do nothing, as TCPM is still waiting for vbus to reaach VSAFE5V to connect */ break ;case SNK_NEGOTIATE_CAPABILITIES :
drivers/tty/n_gsm.c +3 -1
@@ -325,6 +325,7 @@ static struct tty_driver *gsm_tty_driver;#define GSM1_ESCAPE_BITS 0x20#define XON 0x11#define XOFF 0x13 +#define ISO_IEC_646_MASK 0x7Fstatic const struct tty_port_operations gsm_port_ops;
@@ -543,7 +544,8 @@ static int gsm_stuff_frame(const u8 *input, u8 *output, int len)int olen =0 ;while (len--) {if (*input ==GSM1_SOF || *input ==GSM1_ESCAPE - || *input ==XON || *input ==XOFF ) { + || (*input &ISO_IEC_646_MASK ) ==XON + || (*input &ISO_IEC_646_MASK ) ==XOFF ) { *output++ =GSM1_ESCAPE ; *output++ = *input++ ^GSM1_ESCAPE_BITS ; olen++;
drivers/tty/serial/8250/8250_pci.c +98 -2
113 lines not on this page · raw message
drivers/tty/serial/stm32-usart.c +1 -1
@@ -402,7 +402,7 @@ static void stm32_start_tx(struct uart_port *port) {struct circ_buf *xmit = &port->state->xmit; -if (uart_circ_empty (xmit)) +if (uart_circ_empty (xmit) && !port->x_char)return ;stm32_transmit_chars (port);
drivers/usb/common/ulpi.c +5 -2
@@ -42,8 +42,11 @@ static int ulpi_match(struct device *dev, struct device_driver *driver)struct ulpi *ulpi =to_ulpi_dev (dev);const struct ulpi_device_id *id; -/* Some ULPI devices don't have a vendor id so rely on OF match */ -if (ulpi->id.vendor ==0 ) +/* +* Some ULPI devices don't have a vendor id +* or provide an id_table so rely on OF match. +*/ +if (ulpi->id.vendor ==0 || !drv->id_table)return of_driver_match_device (dev, driver);for (id = drv->id_table; id->vendor; id++)
drivers/usb/core/hcd.c +14 -0
@@ -1679,6 +1679,13 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) urb->hcpriv =NULL ;INIT_LIST_HEAD (&urb->urb_list);atomic_dec (&urb->use_count); +/* +* Order the write of urb->use_count above before the read +* of urb->reject below. Pairs with the memory barriers in +* usb_kill_urb() and usb_poison_urb(). +*/ +smp_mb__after_atomic (); +atomic_dec (&urb->dev->urbnum);if (atomic_read (&urb->reject))wake_up (&usb_kill_urb_queue);
@@ -1788,6 +1795,13 @@ static void __usb_hcd_giveback_urb(struct urb *urb)usb_anchor_resume_wakeups (anchor);atomic_dec (&urb->use_count); +/* +* Order the write of urb->use_count above before the read +* of urb->reject below. Pairs with the memory barriers in +* usb_kill_urb() and usb_poison_urb(). +*/ +smp_mb__after_atomic (); +if (unlikely (atomic_read (&urb->reject)))wake_up (&usb_kill_urb_queue);usb_put_urb (urb);
drivers/usb/core/urb.c +12 -0
@@ -686,6 +686,12 @@ void usb_kill_urb(struct urb *urb)if (!(urb && urb->dev && urb->ep))return ;atomic_inc (&urb->reject); +/* +* Order the write of urb->reject above before the read +* of urb->use_count below. Pairs with the barriers in +* __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). +*/ +smp_mb__after_atomic ();usb_hcd_unlink_urb (urb, -ENOENT );wait_event (usb_kill_urb_queue,atomic_read (&urb->use_count) ==0 );
@@ -727,6 +733,12 @@ void usb_poison_urb(struct urb *urb)if (!urb)return ;atomic_inc (&urb->reject); +/* +* Order the write of urb->reject above before the read +* of urb->use_count below. Pairs with the barriers in +* __usb_hcd_giveback_urb() and usb_hcd_submit_urb(). +*/ +smp_mb__after_atomic ();if (!urb->dev || !urb->ep)return ;
drivers/usb/gadget/function/f_sourcesink.c +1 -0
@@ -587,6 +587,7 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in,if (is_iso) {switch (speed) { +case USB_SPEED_SUPER_PLUS :case USB_SPEED_SUPER : size = ss->isoc_maxpacket * (ss->isoc_mult + 1) *
drivers/usb/storage/unusual_devs.h +10 -0
@@ -2320,6 +2320,16 @@ UNUSUAL_DEV( 0x2027, 0xa001, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, US_FL_SCM_MULT_TARG ), +/* +* Reported by DocMAX <[email protected]> +* and Thomas Weißschuh <[email protected]> +*/ +UNUSUAL_DEV (0x2109 ,0x0715 ,0x9999 ,0x9999 , +"VIA Labs, Inc." , +"VL817 SATA Bridge" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_IGNORE_UAS ), + UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001, "ST", "2A",
fs/ext4/inline.c +9 -1
@@ -1131,7 +1131,15 @@ static void ext4_restore_inline_data(handle_t *handle, struct inode *inode,struct ext4_iloc *iloc, void *buf, int inline_size) { -ext4_create_inline_data (handle ,inode ,inline_size ); + int ret; + + ret =ext4_create_inline_data (handle, inode, inline_size); +if (ret) { +ext4_msg (inode->i_sb,KERN_EMERG , +"error restoring inline_data for inode -- potential data loss! (inode %lu, error %d)" , + inode->i_ino, ret); +return ; + }ext4_write_inline_data (inode, iloc, buf,0 , inline_size);ext4_set_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA ); }
fs/nfs/dir.c +18 -0
@@ -1607,6 +1607,24 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, no_open: res =nfs_lookup (dir, dentry, lookup_flags); +if (!res) { + inode =d_inode (dentry); +if ((lookup_flags &LOOKUP_DIRECTORY ) && inode && + !S_ISDIR (inode->i_mode)) + res =ERR_PTR (-ENOTDIR ); +else if (inode &&S_ISREG (inode->i_mode)) + res =ERR_PTR (-EOPENSTALE ); + }else if (!IS_ERR (res)) { + inode =d_inode (res); +if ((lookup_flags &LOOKUP_DIRECTORY ) && inode && + !S_ISDIR (inode->i_mode)) { +dput (res); + res =ERR_PTR (-ENOTDIR ); + }else if (inode &&S_ISREG (inode->i_mode)) { +dput (res); + res =ERR_PTR (-EOPENSTALE ); + } + }if (switched) {d_lookup_done (dentry);if (!res)
fs/nfsd/nfs4state.c +3 -1
@@ -3423,8 +3423,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse;if (client_has_state (old) && !same_creds (&unconf->cl_cred, - &old->cl_cred)) + &old->cl_cred)) { + old =NULL ; goto out; + } status =mark_client_expired_locked (old);if (status) { old =NULL ;
fs/udf/inode.c +4 -5
@@ -251,10 +251,6 @@ int udf_expand_file_adinicb(struct inode *inode)char *kaddr;struct udf_inode_info *iinfo =UDF_I (inode);int err; -struct writeback_control udf_wbc = { - .sync_mode =WB_SYNC_NONE , - .nr_to_write =1 , - };WARN_ON_ONCE (!inode_is_locked (inode));if (!iinfo->i_lenAlloc) {
@@ -298,8 +294,10 @@ int udf_expand_file_adinicb(struct inode *inode) iinfo->i_alloc_type =ICBTAG_FLAG_AD_LONG ;/* from now on we have normal address_space methods */ inode->i_data.a_ops = &udf_aops; +set_page_dirty (page); +unlock_page (page);up_write (&iinfo->i_data_sem); - err = inode->i_data.a_ops->writepage (page, &udf_wbc); + err =filemap_fdatawrite (inode->i_mapping);if (err) {/* Restore everything back so that we don't lose data... */ lock_page (page);
@@ -311,6 +309,7 @@ int udf_expand_file_adinicb(struct inode *inode)unlock_page (page); iinfo->i_alloc_type =ICBTAG_FLAG_AD_IN_ICB ; inode->i_data.a_ops = &udf_adinicb_aops; + iinfo->i_lenAlloc = inode->i_size;up_write (&iinfo->i_data_sem); }put_page (page);
include/linux/netdevice.h +1 -0
@@ -2206,6 +2206,7 @@ struct packet_type { struct net_device *);bool (*id_match)(struct packet_type *ptype,struct sock *sk); +struct net *af_packet_net;void *af_packet_priv;struct list_head list; };
include/net/ip.h +10 -11
@@ -399,19 +399,18 @@ static inline void ip_select_ident_segs(struct net *net, struct sk_buff *skb, {struct iphdr *iph =ip_hdr (skb); +/* We had many attacks based on IPID, use the private +* generator as much as we can. +*/ +if (sk &&inet_sk (sk)->inet_daddr) { + iph->id =htons (inet_sk (sk)->inet_id); +inet_sk (sk)->inet_id += segs; +return ; + }if ((iph->frag_off &htons (IP_DF )) && !skb->ignore_df) { -/* This is only to work around buggy Windows95/2000 -* VJ compression implementations. If the ID field -* does not change, they drop every other packet in -* a TCP stream using header compression. -*/ -if (sk &&inet_sk (sk)->inet_daddr) { - iph->id =htons (inet_sk (sk)->inet_id); -inet_sk (sk)->inet_id += segs; - }else { - iph->id =0 ; - } + iph->id =0 ; }else { +/* Unfortunately we need the big hammer to get a suitable IPID */ __ip_select_ident (net, iph, segs); } }
include/net/netfilter/nf_nat_l4proto.h +1 -1
@@ -74,7 +74,7 @@ void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,struct nf_conntrack_tuple *tuple, const struct nf_nat_range *range, enum nf_nat_manip_type maniptype, - const struct nf_conn *ct, u16 *rover); + const struct nf_conn *ct);int nf_nat_l4proto_nlattr_to_range (struct nlattr *tb[],struct nf_nat_range *range);
kernel/audit.c +43 -19
143 lines not on this page · raw message
kernel/bpf/core.c +51 -8
91 lines not on this page · raw message
kernel/power/wakelock.c +4 -8
@@ -39,23 +39,19 @@ ssize_t pm_show_wakelocks(char *buf, bool show_active) {struct rb_node *node;struct wakelock *wl; -char *str = buf; -char *end = buf +PAGE_SIZE ; +int len =0 ;mutex_lock (&wakelocks_lock);for (node =rb_first (&wakelocks_tree); node; node =rb_next (node)) { wl = rb_entry(node, struct wakelock, node);if (wl->ws.active == show_active) - str +=scnprintf (str, end - str,"%s " , wl->name); + len +=sysfs_emit_at (buf, len,"%s " , wl->name); } -if (str > buf) - str--; - - str +=scnprintf (str, end - str,"\n" ); + len +=sysfs_emit_at (buf, len,"\n" );mutex_unlock (&wakelocks_lock); -return (str - buf); +return len; }#if CONFIG_PM_WAKELOCKS_LIMIT >0
net/bluetooth/hci_event.c +5 -5
@@ -4967,6 +4967,11 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)struct hci_ev_le_advertising_info *ev = ptr;s8 rssi; +if (ptr > (void *)skb_tail_pointer (skb) -sizeof (*ev)) { +bt_dev_err (hdev,"Malicious advertising data." ); +break ; + } +if (ev->length <=HCI_MAX_AD_LENGTH && ev->data + ev->length <=skb_tail_pointer (skb)) { rssi = ev->data[ev->length];
@@ -4978,11 +4983,6 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) } ptr +=sizeof (*ev) + ev->length +1 ; - -if (ptr > (void *)skb_tail_pointer (skb) -sizeof (*ev)) { -bt_dev_err (hdev,"Malicious advertising data. Stopping processing" ); -break ; - } }hci_dev_unlock (hdev);
net/core/filter.c +9 -2
@@ -472,11 +472,18 @@ static int bpf_convert_filter(struct sock_filter *prog, int len,#define BPF_EMIT_JMP \ do { \ + const s32 off_min = S16_MIN, off_max = S16_MAX; \ + s32 off; \ + \ if (target >= len || target < 0) \ goto err; \ - insn->off = addrs ? addrs[target] - addrs[i] - 1 : 0; \ + off = addrs ? addrs[target] - addrs[i] - 1 : 0; \/* Adjust pc relative offset for 2nd or 3rd insn. */ \ - insn->off -= insn - tmp_insns; \ + off -= insn - tmp_insns; \ +/* Reject anything not fitting into insn->off. */ \ +if (off < off_min || off > off_max) \ + goto err; \ + insn->off = off; \ }while (0 )case BPF_JMP |BPF_JA :
net/core/net-procfs.c +34 -4
@@ -209,12 +209,23 @@ static const struct file_operations softnet_seq_fops = { .release = seq_release, }; -static void *ptype_get_idx (loff_t pos) +static void *ptype_get_idx (struct seq_file *seq,loff_t pos) { +struct list_head *ptype_list =NULL ;struct packet_type *pt =NULL ; +struct net_device *dev;loff_t i =0 ;int t; +for_each_netdev_rcu (seq_file_net (seq), dev) { + ptype_list = &dev->ptype_all; +list_for_each_entry_rcu (pt, ptype_list, list) { +if (i == pos) +return pt; + ++i; + } + } +list_for_each_entry_rcu (pt, &ptype_all, list) {if (i == pos)return pt;
@@ -235,22 +246,40 @@ static void *ptype_seq_start(struct seq_file *seq, loff_t *pos)__acquires (RCU ) {rcu_read_lock (); -return *pos ?ptype_get_idx (*pos -1 ) :SEQ_START_TOKEN ; +return *pos ?ptype_get_idx (seq, *pos -1 ) :SEQ_START_TOKEN ; }static void *ptype_seq_next (struct seq_file *seq,void *v,loff_t *pos) { +struct net_device *dev;struct packet_type *pt;struct list_head *nxt;int hash; ++*pos;if (v ==SEQ_START_TOKEN ) -return ptype_get_idx (0 ); +return ptype_get_idx (seq,0 ); pt = v; nxt = pt->list.next; +if (pt->dev) { +if (nxt != &pt->dev->ptype_all) + goto found; + + dev = pt->dev; +for_each_netdev_continue_rcu (seq_file_net (seq), dev) { +if (!list_empty (&dev->ptype_all)) { + nxt = dev->ptype_all.next; + goto found; + } + } + + nxt = ptype_all.next; + goto ptype_all; + } +if (pt->type ==htons (ETH_P_ALL )) { +ptype_all:if (nxt != &ptype_all) goto found; hash =0 ;
@@ -279,7 +308,8 @@ static int ptype_seq_show(struct seq_file *seq, void *v)if (v ==SEQ_START_TOKEN )seq_puts (seq,"Type Device Function\n" ); -else if (pt->dev ==NULL ||dev_net (pt->dev) ==seq_file_net (seq)) { +else if ((!pt->af_packet_net ||net_eq (pt->af_packet_net,seq_file_net (seq))) && + (!pt->dev ||net_eq (dev_net (pt->dev),seq_file_net (seq)))) {if (pt->type ==htons (ETH_P_ALL ))seq_puts (seq,"ALL " );else
net/core/rtnetlink.c +4 -2
@@ -2523,9 +2523,9 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, {struct net *net =sock_net (skb->sk);const struct rtnl_link_ops *ops; -const struct rtnl_link_ops *m_ops =NULL ; +const struct rtnl_link_ops *m_ops;struct net_device *dev; -struct net_device *master_dev =NULL ; +struct net_device *master_dev;struct ifinfomsg *ifm;char kind[MODULE_NAME_LEN ];char ifname[IFNAMSIZ ];
@@ -2556,6 +2556,8 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, dev =NULL ; } + master_dev =NULL ; + m_ops =NULL ;if (dev) { master_dev =netdev_master_upper_dev_get (dev);if (master_dev)
net/ieee802154/nl802154.c +4 -4
@@ -1459,7 +1459,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid, hdr =nl802154hdr_put (msg, portid, seq, flags, cmd);if (!hdr) -return -1 ; +return -ENOBUFS ;if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure;
@@ -1650,7 +1650,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid, hdr =nl802154hdr_put (msg, portid, seq, flags, cmd);if (!hdr) -return -1 ; +return -ENOBUFS ;if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure;
@@ -1828,7 +1828,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid, hdr =nl802154hdr_put (msg, portid, seq, flags, cmd);if (!hdr) -return -1 ; +return -ENOBUFS ;if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure;
@@ -2005,7 +2005,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid, hdr =nl802154hdr_put (msg, portid, seq, flags, cmd);if (!hdr) -return -1 ; +return -ENOBUFS ;if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure;
net/ipv4/ip_output.c +9 -2
@@ -160,12 +160,19 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk, iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); iph->saddr = saddr; iph->protocol = sk->sk_protocol; -if (ip_dont_fragment (sk, &rt->dst)) { +/* Do not bother generating IPID for small packets (eg SYNACK) */ +if (skb->len <=IPV4_MIN_MTU ||ip_dont_fragment (sk, &rt->dst)) { iph->frag_off =htons (IP_DF ); iph->id =0 ; }else { iph->frag_off =0 ; -__ip_select_ident (net, iph,1 ); +/* TCP packets here are SYNACK with fat IPv4/TCP options. +* Avoid using the hashed IP ident generator. +*/ +if (sk->sk_protocol ==IPPROTO_TCP ) + iph->id = (__force __be16 )prandom_u32 (); +else +__ip_select_ident (net, iph,1 ); }if (opt && opt->opt.optlen) {
net/ipv4/ping.c +2 -1
@@ -225,7 +225,8 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)continue ; } -if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) +if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif && + sk->sk_bound_dev_if !=inet_sdif (skb))continue ;sock_hold (sk);
net/ipv4/raw.c +4 -1
@@ -721,6 +721,7 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)int ret = -EINVAL ;int chk_addr_ret; +lock_sock (sk);if (sk->sk_state !=TCP_CLOSE || addr_len <sizeof (struct sockaddr_in )) goto out;
@@ -740,7 +741,9 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) inet->inet_saddr =0 ;/* Use device */ sk_dst_reset (sk); ret =0 ; -out:return ret; +out: +release_sock (sk); +return ret; }/*
net/ipv6/ip6_tunnel.c +4 -4
@@ -1008,12 +1008,12 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t, ldev =dev_get_by_index_rcu (net, p->link);if (unlikely (!ipv6_chk_addr (net, laddr, ldev,0 ))) -pr_warn ("%s xmit: Local address not yet configured!\n" , - p->name); +pr_warn_ratelimited ("%s xmit: Local address not yet configured!\n" , + p->name);else if (!ipv6_addr_is_multicast (raddr) &&unlikely (ipv6_chk_addr (net, raddr,NULL ,0 ))) -pr_warn ("%s xmit: Routing loop! Remote address found on this node!\n" , - p->name); +pr_warn_ratelimited ("%s xmit: Routing loop! Remote address found on this node!\n" , + p->name);else ret =1 ;rcu_read_unlock ();
net/netfilter/nf_nat_proto_common.c +25 -11
@@ -38,12 +38,12 @@ void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,struct nf_conntrack_tuple *tuple, const struct nf_nat_range *range, enum nf_nat_manip_type maniptype, - const struct nf_conn *ct, - u16 *rover) + const struct nf_conn *ct) { - unsigned int range_size, min, max, i; + unsigned int range_size, min, max, i, attempts;__be16 *portptr; -u_int16_t off; +u16 off; +static const unsigned int max_attempts =128 ;if (maniptype ==NF_NAT_MANIP_SRC ) portptr = &tuple->src.u.all;
@@ -84,17 +84,31 @@ void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto, }else if (range->flags &NF_NAT_RANGE_PROTO_RANDOM_FULLY ) { off =prandom_u32 (); }else { - off = *rover; + off =prandom_u32 (); } -for (i =0 ; ; ++off) { + attempts = range_size; +if (attempts > max_attempts) + attempts = max_attempts; + +/* We are in softirq; doing a search of the entire range risks +* soft lockup when all tuples are already used. +* +* If we can't find any free port from first offset, pick a new +* one and try again, with ever smaller search window. +*/ +another_round: +for (i =0 ; i < attempts; i++, off++) { *portptr =htons (min + off % range_size); -if (++i != range_size &&nf_nat_used_tuple (tuple, ct)) -continue ; -if (!(range->flags &NF_NAT_RANGE_PROTO_RANDOM_ALL )) - *rover = off; -return ; +if (!nf_nat_used_tuple (tuple, ct)) +return ; } + +if (attempts >= range_size || attempts <16 ) +return ; + attempts /=2 ; + off =prandom_u32 (); + goto another_round; }EXPORT_SYMBOL_GPL (nf_nat_l4proto_unique_tuple);
net/netfilter/nf_nat_proto_dccp.c +1 -4
@@ -18,8 +18,6 @@#include <net/netfilter/nf_nat_l3proto.h> #include <net/netfilter/nf_nat_l4proto.h> -static u_int16_t dccp_port_rover; - static void dccp_unique_tuple(const struct nf_nat_l3proto *l3proto, struct nf_conntrack_tuple *tuple,
@@ -27,8 +25,7 @@ dccp_unique_tuple(const struct nf_nat_l3proto *l3proto,enum nf_nat_manip_type maniptype, const struct nf_conn *ct) { -nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct , - &dccp_port_rover); +nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct ); } static bool
net/netfilter/nf_nat_proto_sctp.c +1 -4
@@ -12,8 +12,6 @@#include <net/netfilter/nf_nat_l4proto.h> -static u_int16_t nf_sctp_port_rover; - static void sctp_unique_tuple(const struct nf_nat_l3proto *l3proto, struct nf_conntrack_tuple *tuple,
@@ -21,8 +19,7 @@ sctp_unique_tuple(const struct nf_nat_l3proto *l3proto,enum nf_nat_manip_type maniptype, const struct nf_conn *ct) { -nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct , - &nf_sctp_port_rover); +nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct ); } static bool
net/netfilter/nf_nat_proto_tcp.c +1 -4
@@ -18,8 +18,6 @@#include <net/netfilter/nf_nat_l4proto.h> #include <net/netfilter/nf_nat_core.h> -static u16 tcp_port_rover; - static void tcp_unique_tuple(const struct nf_nat_l3proto *l3proto, struct nf_conntrack_tuple *tuple,
@@ -27,8 +25,7 @@ tcp_unique_tuple(const struct nf_nat_l3proto *l3proto,enum nf_nat_manip_type maniptype, const struct nf_conn *ct) { -nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct , - &tcp_port_rover); +nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct ); } static bool
net/netfilter/nf_nat_proto_udp.c +2 -8
@@ -17,8 +17,6 @@#include <net/netfilter/nf_nat_l3proto.h> #include <net/netfilter/nf_nat_l4proto.h> -static u16 udp_port_rover; - static void udp_unique_tuple(const struct nf_nat_l3proto *l3proto, struct nf_conntrack_tuple *tuple,
@@ -26,8 +24,7 @@ udp_unique_tuple(const struct nf_nat_l3proto *l3proto,enum nf_nat_manip_type maniptype, const struct nf_conn *ct) { -nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct , - &udp_port_rover); +nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct ); } static void
@@ -78,8 +75,6 @@ static bool udp_manip_pkt(struct sk_buff *skb, }#ifdef CONFIG_NF_NAT_PROTO_UDPLITE -static u16 udplite_port_rover; - static bool udplite_manip_pkt(struct sk_buff *skb, const struct nf_nat_l3proto *l3proto, unsigned int iphdroff, unsigned int hdroff,
@@ -103,8 +98,7 @@ udplite_unique_tuple(const struct nf_nat_l3proto *l3proto,enum nf_nat_manip_type maniptype, const struct nf_conn *ct) { -nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct , - &udplite_port_rover); +nf_nat_l4proto_unique_tuple (l3proto ,tuple ,range ,maniptype ,ct ); } const struct nf_nat_l4proto nf_nat_l4proto_udplite = {
net/netfilter/nft_payload.c +3 -0
@@ -194,6 +194,9 @@ static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt, struct sk_buff *skb, unsigned int *l4csum_offset) { +if (pkt->xt.fragoff) +return -1 ; +switch (pkt->tprot) {case IPPROTO_TCP : *l4csum_offset = offsetof(struct tcphdr , check);
net/packet/af_packet.c +8 -2
@@ -1756,6 +1756,7 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags) match->prot_hook.dev = po->prot_hook.dev; match->prot_hook.func = packet_rcv_fanout; match->prot_hook.af_packet_priv = match; + match->prot_hook.af_packet_net =read_pnet (&match->net); match->prot_hook.id_match = match_fanout_group;list_add (&match->list, &fanout_list); }
@@ -1769,7 +1770,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags) err = -ENOSPC ;if (refcount_read (&match->sk_ref) <PACKET_FANOUT_MAX ) {__dev_remove_pack (&po->prot_hook); - po->fanout = match; + +/* Paired with packet_setsockopt(PACKET_FANOUT_DATA) */ +WRITE_ONCE (po->fanout, match); + po->rollover = rollover; rollover =NULL ;refcount_set (&match->sk_ref,refcount_read (&match->sk_ref) +1 );
@@ -3330,6 +3334,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol, po->prot_hook.func = packet_rcv_spkt; po->prot_hook.af_packet_priv = sk; + po->prot_hook.af_packet_net =sock_net (sk);if (proto) { po->prot_hook.type = proto;
@@ -3913,7 +3918,8 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv }case PACKET_FANOUT_DATA : { -if (!po->fanout) +/* Paired with the WRITE_ONCE() in fanout_add() */ +if (!READ_ONCE (po->fanout))return -EINVAL ;return fanout_set_data (po, optval, optlen);
sound/soc/fsl/pcm030-audio-fabric.c +8 -3
@@ -90,16 +90,21 @@ static int pcm030_fabric_probe(struct platform_device *op)dev_err (&op->dev,"platform_device_alloc() failed\n" ); ret =platform_device_add (pdata->codec_device); -if (ret) +if (ret) {dev_err (&op->dev,"platform_device_add() failed: %d\n" , ret); +platform_device_put (pdata->codec_device); + } ret =snd_soc_register_card (card); -if (ret) +if (ret) {dev_err (&op->dev,"snd_soc_register_card() failed: %d\n" , ret); +platform_device_del (pdata->codec_device); +platform_device_put (pdata->codec_device); + }platform_set_drvdata (op, pdata); -return ret; + }static int pcm030_fabric_remove (struct platform_device *op)
sound/soc/soc-ops.c +26 -3
@@ -327,13 +327,27 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,if (sign_bit) mask =BIT (sign_bit +1 ) -1 ; - val = ((ucontrol->value.integer.value[0 ] + min) & mask); + val = ucontrol->value.integer.value[0 ]; +if (mc->platform_max && val > mc->platform_max) +return -EINVAL ; +if (val > max - min) +return -EINVAL ; +if (val <0 ) +return -EINVAL ; + val = (val + min) & mask;if (invert) val = max - val; val_mask = mask << shift; val = val << shift;if (snd_soc_volsw_is_stereo (mc)) { - val2 = ((ucontrol->value.integer.value[1 ] + min) & mask); + val2 = ucontrol->value.integer.value[1 ]; +if (mc->platform_max && val2 > mc->platform_max) +return -EINVAL ; +if (val2 > max - min) +return -EINVAL ; +if (val2 <0 ) +return -EINVAL ; + val2 = (val2 + min) & mask;if (invert) val2 = max - val2;if (reg == reg2) {
@@ -427,8 +441,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,int err =0 ;unsigned int val, val_mask, val2 =0 ; + val = ucontrol->value.integer.value[0 ]; +if (mc->platform_max && val > mc->platform_max) +return -EINVAL ; +if (val > max - min) +return -EINVAL ; +if (val <0 ) +return -EINVAL ; val_mask = mask << shift; - val = (ucontrol->value.integer.value[0 ] + min) & mask; + val = (val + min) & mask; val = val << shift; err =snd_soc_component_update_bits (component, reg, val_mask, val);
@@ -894,6 +915,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,unsigned int i, regval, regmask;int err; +if (val < mc->min || val > mc->max) +return -EINVAL ;if (invert) val = max - val; val &= mask;
tools/testing/selftests/futex/Makefile +2 -2
@@ -11,7 +11,7 @@ all: @for DIR in $(SUBDIRS); do \ BUILD_TARGET=$(OUTPUT)/$$DIR; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ if [ -e $$DIR/$(TEST_PROGS) ]; then \ rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \ fi \
@@ -40,6 +40,6 @@ override define CLEAN @for DIR in $(SUBDIRS); do \ BUILD_TARGET=$(OUTPUT)/$$DIR; \ mkdir $$BUILD_TARGET -p; \ - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ done endef