Linux 3.18.116
Greg KH
maintainerI'm announcing the release of the 3.18.116 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 drivers/block/loop.c | 79 ++++++++++++++------------ drivers/block/loop.h | 1 drivers/crypto/amcc/crypto4xx_core.c | 23 +++---- drivers/infiniband/Kconfig | 12 +++ drivers/infiniband/core/Makefile | 4 - drivers/misc/ibmasm/ibmasmfs.c | 27 -------- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 34 ++++++++--- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 8 +- drivers/net/ethernet/sun/sungem.c | 22 +++---- drivers/usb/core/quirks.c | 4 + drivers/usb/host/xhci-mem.c | 2 drivers/usb/misc/yurex.c | 23 +------ drivers/usb/serial/keyspan_pda.c | 4 - drivers/usb/serial/mos7840.c | 3 drivers/vhost/net.c | 3 fs/inode.c | 6 + kernel/power/user.c | 5 + net/bridge/netfilter/ebtables.c | 15 ++++ net/dccp/ccids/ccid3.c | 16 ++--- net/dns_resolver/dns_key.c | 28 +++++---- net/ipv4/netfilter/ip_tables.c | 1 net/ipv4/sysctl_net_ipv4.c | 18 ++++- net/ipv4/tcp_input.c | 9 ++ net/ipv6/netfilter/ip6_tables.c | 1 net/nfc/llcp_commands.c | 9 +- net/rds/loop.c | 1 net/rds/rds.h | 5 + net/rds/recv.c | 5 + net/sched/sch_blackhole.c | 2 30 files changed, 227 insertions(+), 145 deletions(-)
Alex Vesker (2):
net/mlx5: Fix incorrect raw command length parsing net/mlx5: Fix command interface race in polling mode
Christian Lamparter (2):
crypto: crypto4xx - remove bad list_del
crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak
Dan Carpenter (1):
xhci: xhci-mem: off by one in xhci_stream_id_to_ring()
Eric Biggers (1):
KEYS: DNS: fix parsing multiple options
Eric Dumazet (3):
net: dccp: avoid crash in ccid3_hc_rx_send_feedback()
net: dccp: switch rx_tstamp_last_feedback to monotonic clock
net: sungem: fix rx checksum support
Florian Westphal (2):
netfilter: x_tables: initialise match/target check parameter struct
netfilter: ebtables: reject non-bridge targets
Greg Kroah-Hartman (1):
Linux 3.18.116
Ilpo Järvinen (1):
tcp: prevent bogus FRTO undos with non-SACK flows
Jann Horn (2):
ibmasm: don't write out of bounds in read handler
USB: yurex: fix out-of-bounds uaccess in read handler
Jason Wang (1):
vhost_net: validate sock before trying to put its fd
Johan Hovold (2):
USB: serial: keyspan_pda: fix modem-status error handling
USB: serial: mos7840: fix status-register error handling
Jonas Gorski (2):
bcm63xx_enet: correct clock usage
bcm63xx_enet: do not write to random DMA channel on BCM6345
Konstantin Khlebnikov (1):
net_sched: blackhole: tell upper qdisc about dropped packets
Leon Romanovsky (1):
RDMA/ucm: Mark UCM interface as BROKEN
Linus Torvalds (1):
Fix up non-directory creation in SGID directories
Nico Sneck (1):
usb: quirks: add delay quirks for Corsair Strafe
Santosh Shilimkar (1):
rds: avoid unenecessary cong_update in loop transport
Tetsuo Handa (3):
PM / hibernate: Fix oops at snapshot_write()
loop: remember whether sysfs_create_group() was done net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL.
Theodore Ts'o (1):
loop: add recursion validation to LOOP_CHANGE_FD
Yuchung Cheng (1):
tcp: fix Fast Open key endianness
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 115 +SUBLEVEL = 116 EXTRAVERSION = NAME = Diseased Newt
drivers/block/loop.c +44 -35
129 lines not on this page · raw message
drivers/block/loop.h +1 -0
@@ -60,6 +60,7 @@ struct loop_device {wait_queue_head_t lo_event;/* wait queue for incoming requests */ wait_queue_head_t lo_req_wait; +bool sysfs_inited;struct request_queue *lo_queue;struct gendisk *lo_disk;
drivers/crypto/amcc/crypto4xx_core.c +11 -12
@@ -207,7 +207,7 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev) dev->pdr_pa);return -ENOMEM ; } -memset (dev->pdr,0 ,sizeof (struct ce_pd ) *PPC4XX_NUM_PD ); +memset (dev->pdr,0 ,sizeof (struct ce_pd ) *PPC4XX_NUM_PD ); dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, &dev->shadow_sa_pool_pa,
@@ -240,13 +240,15 @@ static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev)static void crypto4xx_destroy_pdr (struct crypto4xx_device *dev) { -if (dev->pdr !=NULL ) +if (dev->pdr)dma_free_coherent (dev->core_dev->device,sizeof (struct ce_pd ) *PPC4XX_NUM_PD , dev->pdr, dev->pdr_pa); +if (dev->shadow_sa_pool)dma_free_coherent (dev->core_dev->device,256 *PPC4XX_NUM_PD , dev->shadow_sa_pool, dev->shadow_sa_pool_pa); +if (dev->shadow_sr_pool) dma_free_coherent(dev->core_dev->device, sizeof(struct sa_state_record) * PPC4XX_NUM_PD,
@@ -416,12 +418,12 @@ static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev)static void crypto4xx_destroy_sdr (struct crypto4xx_device *dev) { -if (dev->sdr !=NULL ) +if (dev->sdr)dma_free_coherent (dev->core_dev->device,sizeof (struct ce_sd ) *PPC4XX_NUM_SD , dev->sdr, dev->sdr_pa); -if (dev->scatter_buffer_va !=NULL ) +if (dev->scatter_buffer_va) dma_free_coherent(dev->core_dev->device, dev->scatter_buffer_size * PPC4XX_NUM_SD, dev->scatter_buffer_va,
@@ -1049,12 +1051,10 @@ int crypto4xx_register_alg(struct crypto4xx_device *sec_dev,break ; } -if (rc) { -list_del (&alg->entry); +if (rc)kfree (alg); - }else { +else list_add_tail (&alg->entry, &sec_dev->alg_list); - } }return 0 ;
@@ -1208,7 +1208,7 @@ static int __init crypto4xx_probe(struct platform_device *ofdev) rc =crypto4xx_build_gdr (core_dev->dev);if (rc) - goto err_build_gdr; + goto err_build_pdr; rc =crypto4xx_build_sdr (core_dev->dev);if (rc)
@@ -1250,12 +1250,11 @@ err_iomap: err_request_irq:irq_dispose_mapping (core_dev->irq);tasklet_kill (&core_dev->tasklet); -crypto4xx_destroy_sdr (core_dev->dev); err_build_sdr: +crypto4xx_destroy_sdr (core_dev->dev);crypto4xx_destroy_gdr (core_dev->dev); -err_build_gdr: -crypto4xx_destroy_pdr (core_dev->dev); err_build_pdr: +crypto4xx_destroy_pdr (core_dev->dev);kfree (core_dev->dev); err_alloc_dev:kfree (core_dev);
drivers/infiniband/Kconfig +12 -0
@@ -33,6 +33,18 @@ config INFINIBAND_USER_ACCESS libibverbs, libibcm and a hardware driver library from <http://www.openfabrics.org/git/>. +config INFINIBAND_USER_ACCESS_UCM + bool "Userspace CM (UCM, DEPRECATED)" + depends on BROKEN + depends on INFINIBAND_USER_ACCESS + help + The UCM module has known security flaws, which no one is + interested to fix. The user-space part of this code was + dropped from the upstream a long time ago. + + This option is DEPRECATED and planned to be removed. + + config INFINIBAND_USER_MEM bool depends on INFINIBAND_USER_ACCESS != n
drivers/infiniband/core/Makefile +2 -2
@@ -5,8 +5,8 @@ obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \ ib_cm.o iw_cm.o ib_addr.o \ $(infiniband-y) obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o -obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \ - $(user_access-y) +obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o $(user_access-y) +obj-$(CONFIG_INFINIBAND_USER_ACCESS_UCM) += ib_ucm.o $(user_access-y) ib_core-y := packer.o ud_header.o verbs.o sysfs.o \ device.o fmr_pool.o cache.o netlink.o
drivers/misc/ibmasm/ibmasmfs.c +3 -24
@@ -507,35 +507,14 @@ static int remote_settings_file_close(struct inode *inode, struct file *file)static ssize_t remote_settings_file_read (struct file *file,char __user *buf,size_t count,loff_t *offset) {void __iomem *address = (void __iomem *)file->private_data; -unsigned char *page; -int retval;int len =0 ;unsigned int value; - -if (*offset <0 ) -return -EINVAL ; -if (count ==0 || count >1024 ) -return 0 ; -if (*offset !=0 ) -return 0 ; - - page = (unsigned char *)__get_free_page (GFP_KERNEL ); -if (!page) -return -ENOMEM ; +char lbuf[20 ]; value =readl (address); - len =sprintf (page,"%d\n" , value); - -if (copy_to_user (buf, page, len)) { - retval = -EFAULT ; - goto exit; - } - *offset += len; - retval = len; + len =snprintf (lbuf,sizeof (lbuf),"%d\n" , value); -exit: -free_page ((unsigned long )page); -return retval; +return simple_read_from_buffer (buf, count, offset, lbuf, len); }static ssize_t remote_settings_file_write (struct file *file,const char __user *ubuff,size_t count,loff_t *offset)
drivers/net/ethernet/broadcom/bcm63xx_enet.c +25 -9
@@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_device *dev) val =enet_readl (priv,ENET_CTL_REG ); val |=ENET_CTL_ENABLE_MASK ;enet_writel (priv, val,ENET_CTL_REG ); -enet_dma_writel (priv,ENETDMA_CFG_EN_MASK ,ENETDMA_CFG_REG ); +if (priv->dma_has_sram) +enet_dma_writel (priv,ENETDMA_CFG_EN_MASK ,ENETDMA_CFG_REG );enet_dmac_writel (priv, priv->dma_chan_en_mask,ENETDMAC_CHANCFG , priv->rx_chan);
@@ -1788,7 +1789,9 @@ static int bcm_enet_probe(struct platform_device *pdev) ret =PTR_ERR (priv->mac_clk); goto out; } -clk_prepare_enable (priv->mac_clk); + ret =clk_prepare_enable (priv->mac_clk); +if (ret) + goto out_put_clk_mac;/* initialize default and fetch platform data */ priv->rx_ring_size =BCMENET_DEF_RX_DESC ;
@@ -1820,9 +1823,11 @@ static int bcm_enet_probe(struct platform_device *pdev)if (IS_ERR (priv->phy_clk)) { ret =PTR_ERR (priv->phy_clk); priv->phy_clk =NULL ; - goto out_put_clk_mac; + goto out_disable_clk_mac; } -clk_prepare_enable (priv->phy_clk); + ret =clk_prepare_enable (priv->phy_clk); +if (ret) + goto out_put_clk_phy; }/* do minimal hardware init to be able to probe mii bus */
@@ -1922,13 +1927,16 @@ out_free_mdio: out_uninit_hw:/* turn off mdc clock */ enet_writel (priv,0 ,ENET_MIISC_REG ); -if (priv->phy_clk) { +if (priv->phy_clk)clk_disable_unprepare (priv->phy_clk); + +out_put_clk_phy: +if (priv->phy_clk)clk_put (priv->phy_clk); - } -out_put_clk_mac: +out_disable_clk_mac:clk_disable_unprepare (priv->mac_clk); +out_put_clk_mac:clk_put (priv->mac_clk); out:free_netdev (dev);
@@ -2769,7 +2777,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev) ret =PTR_ERR (priv->mac_clk); goto out_unmap; } -clk_enable (priv->mac_clk); + ret =clk_prepare_enable (priv->mac_clk); +if (ret) + goto out_put_clk; priv->rx_chan =0 ; priv->tx_chan =1 ;
@@ -2790,7 +2800,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev) ret =register_netdev (dev);if (ret) - goto out_put_clk; + goto out_disable_clk;netif_carrier_off (dev);platform_set_drvdata (pdev, dev);
@@ -2799,6 +2809,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev)return 0 ; +out_disable_clk: +clk_disable_unprepare (priv->mac_clk); + out_put_clk:clk_put (priv->mac_clk);
@@ -2830,6 +2843,9 @@ static int bcm_enetsw_remove(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );release_mem_region (res->start,resource_size (res)); +clk_disable_unprepare (priv->mac_clk); +clk_put (priv->mac_clk); +free_netdev (dev);return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 -4
@@ -480,6 +480,7 @@ static void cmd_work_handler(struct work_struct *work) struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, cmd);struct mlx5_cmd_layout *lay;struct semaphore *sem; +int cmd_mode; sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;down (sem);
@@ -513,13 +514,14 @@ static void cmd_work_handler(struct work_struct *work)set_signature (ent, !cmd->checksum_disabled);dump_command (dev, ent,1 ); ent->ts1 =ktime_get_ns (); + cmd_mode = cmd->mode;/* ring doorbell after the descriptor is valid */ wmb ();iowrite32be (1 << ent->idx, &dev->iseg->cmd_dbell);mlx5_core_dbg (dev,"write 0x%x to command doorbell\n" ,1 << ent->idx);mmiowb (); -if (cmd->mode ==CMD_MODE_POLLING ) { +if (cmd_mode ==CMD_MODE_POLLING ) {poll_timeout (ent);/* make sure we read the descriptor after ownership is SW */ rmb ();
@@ -933,7 +935,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, {struct mlx5_core_dev *dev = filp->private_data;struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; -char outlen_str[8 ]; +char outlen_str[8 ] = {0 };int outlen;void *ptr;int err;
@@ -948,8 +950,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,if (copy_from_user (outlen_str, buf, count))return -EFAULT ; - outlen_str[7 ] =0 ; - err =sscanf (outlen_str,"%d" , &outlen);if (err <0 )return err;
drivers/net/ethernet/sun/sungem.c +12 -10
@@ -60,8 +60,7 @@#include <linux/sungem_phy.h> #include "sungem.h" -/* Stripping FCS is causing problems, disabled for now */ -#undef STRIP_FCS +#define STRIP_FCS #define DEFAULT_MSG (NETIF_MSG_DRV | \ NETIF_MSG_PROBE | \
@@ -435,7 +434,7 @@ static int gem_rxmac_reset(struct gem *gp)writel (desc_dma &0xffffffff , gp->regs +RXDMA_DBLOW );writel (RX_RING_SIZE -4 , gp->regs +RXDMA_KICK ); val = (RXDMA_CFG_BASE | (RX_OFFSET <<10 ) | - ((14 /2 ) <<13 ) |RXDMA_CFG_FTHRESH_128 ); + (ETH_HLEN <<13 ) |RXDMA_CFG_FTHRESH_128 );writel (val, gp->regs +RXDMA_CFG );if (readl (gp->regs +GREG_BIFCFG ) &GREG_BIFCFG_M66EN ) writel(((5 & RXDMA_BLANK_IPKTS) |
@@ -760,7 +759,6 @@ static int gem_rx(struct gem *gp, int work_to_do)struct net_device *dev = gp->dev;int entry, drops, work_done =0 ;u32 done; -__sum16 csum;if (netif_msg_rx_status (gp)) printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
@@ -855,9 +853,13 @@ static int gem_rx(struct gem *gp, int work_to_do) skb = copy_skb; } - csum = (__force __sum16 )htons ((status &RXDCTRL_TCPCSUM ) ^0xffff ); - skb->csum =csum_unfold (csum); - skb->ip_summed =CHECKSUM_COMPLETE ; +if (likely (dev->features &NETIF_F_RXCSUM )) { +__sum16 csum; + + csum = (__force __sum16 )htons ((status &RXDCTRL_TCPCSUM ) ^0xffff ); + skb->csum =csum_unfold (csum); + skb->ip_summed =CHECKSUM_COMPLETE ; + } skb->protocol =eth_type_trans (skb, gp->dev);napi_gro_receive (&gp->napi, skb);
@@ -1755,7 +1757,7 @@ static void gem_init_dma(struct gem *gp)writel (0 , gp->regs +TXDMA_KICK ); val = (RXDMA_CFG_BASE | (RX_OFFSET <<10 ) | - ((14 /2 ) <<13 ) |RXDMA_CFG_FTHRESH_128 ); + (ETH_HLEN <<13 ) |RXDMA_CFG_FTHRESH_128 );writel (val, gp->regs +RXDMA_CFG );writel (desc_dma >>32 , gp->regs +RXDMA_DBHI );
@@ -2973,8 +2975,8 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)pci_set_drvdata (pdev, dev);/* We can do scatter/gather and HW checksum */ - dev->hw_features =NETIF_F_SG |NETIF_F_HW_CSUM ; - dev->features |= dev->hw_features |NETIF_F_RXCSUM ; + dev->hw_features =NETIF_F_SG |NETIF_F_HW_CSUM |NETIF_F_RXCSUM ; + dev->features = dev->hw_features;if (pci_using_dac) dev->features |=NETIF_F_HIGHDMA ;
drivers/usb/core/quirks.c +4 -0
@@ -221,6 +221,10 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x1a0a, 0x0200), .driver_info = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + /* Corsair Strafe */ + { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT | + USB_QUIRK_DELAY_CTRL_MSG }, + /* Corsair Strafe RGB */ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT | USB_QUIRK_DELAY_CTRL_MSG },
drivers/usb/host/xhci-mem.c +1 -1
@@ -638,7 +638,7 @@ struct xhci_ring *xhci_stream_id_to_ring(if (!ep->stream_info)return NULL ; -if (stream_id > ep->stream_info->num_streams) +if (stream_id >= ep->stream_info->num_streams)return NULL ;return ep->stream_info->stream_rings[stream_id]; }
drivers/usb/misc/yurex.c +6 -17
@@ -413,8 +413,7 @@ static int yurex_release(struct inode *inode, struct file *file)static ssize_t yurex_read (struct file *file,char *buffer,size_t count,loff_t *ppos) {struct usb_yurex *dev; -int retval =0 ; -int bytes_read =0 ; +int len =0 ;char in_buffer[20 ];unsigned long flags;
@@ -422,26 +421,16 @@ static ssize_t yurex_read(struct file *file, char *buffer, size_t count, loff_tmutex_lock (&dev->io_mutex);if (!dev->interface) {/* already disconnected */ - retval = -ENODEV ; - goto exit; +mutex_unlock (&dev->io_mutex); +return -ENODEV ; }spin_lock_irqsave (&dev->lock, flags); - bytes_read =snprintf (in_buffer,20 ,"%lld\n" , dev->bbu); + len =snprintf (in_buffer,20 ,"%lld\n" , dev->bbu);spin_unlock_irqrestore (&dev->lock, flags); - -if (*ppos < bytes_read) { -if (copy_to_user (buffer, in_buffer + *ppos, bytes_read - *ppos)) - retval = -EFAULT ; -else { - retval = bytes_read - *ppos; - *ppos += bytes_read; - } - } - -exit:mutex_unlock (&dev->io_mutex); -return retval; + +return simple_read_from_buffer (buffer, count, ppos, in_buffer, len); }static ssize_t yurex_write (struct file *file,const char *user_buffer,size_t count,loff_t *ppos)
drivers/usb/serial/keyspan_pda.c +3 -1
@@ -373,8 +373,10 @@ static int keyspan_pda_get_modem_info(struct usb_serial *serial,3 ,/* get pins */ USB_TYPE_VENDOR |USB_RECIP_INTERFACE |USB_DIR_IN , 0, 0, data, 1, 2000); -if (rc >=0 ) +if (rc ==1 ) *value = *data; +else if (rc >=0 ) + rc = -EIO ;kfree (data);return rc;
drivers/usb/serial/mos7840.c +3 -0
@@ -482,6 +482,9 @@ static void mos7840_control_callback(struct urb *urb) }dev_dbg (dev,"%s urb buffer size is %d\n" , __func__, urb->actual_length); +if (urb->actual_length <1 ) + goto out; +dev_dbg (dev,"%s mos7840_port->MsrLsr is %d port %d\n" , __func__, mos7840_port->MsrLsr, mos7840_port->port_num); data = urb->transfer_buffer;
drivers/vhost/net.c +2 -1
@@ -983,7 +983,8 @@ err_used:if (ubufs)vhost_net_ubuf_put_wait_and_free (ubufs); err_ubufs: -sockfd_put (sock); +if (sock) +sockfd_put (sock); err_vq:mutex_unlock (&vq->mutex); err:
fs/inode.c +6 -0
@@ -1821,8 +1821,14 @@ void inode_init_owner(struct inode *inode, const struct inode *dir, inode->i_uid =current_fsuid ();if (dir && dir->i_mode &S_ISGID ) { inode->i_gid = dir->i_gid; + +/* Directories are special, and always inherit S_ISGID */ if (S_ISDIR (mode)) mode |=S_ISGID ; +else if ((mode & (S_ISGID |S_IXGRP )) == (S_ISGID |S_IXGRP ) && + !in_group_p (inode->i_gid) && + !capable_wrt_inode_uidgid (dir,CAP_FSETID )) + mode &= ~S_ISGID ; }else inode->i_gid =current_fsgid (); inode->i_mode = mode;
kernel/power/user.c +5 -0
@@ -184,6 +184,11 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf, res =PAGE_SIZE - pg_offp; } +if (!data_of (data->handle)) { + res = -EINVAL ; + goto unlock; + } + res =simple_write_to_buffer (data_of (data->handle), res, &pg_offp, buf, count);if (res >0 )
net/bridge/netfilter/ebtables.c +15 -0
@@ -402,6 +402,12 @@ ebt_check_watcher(struct ebt_entry_watcher *w, struct xt_tgchk_param *par, watcher =xt_request_find_target (NFPROTO_BRIDGE , w->u.name,0 );if (IS_ERR (watcher))return PTR_ERR (watcher); + +if (watcher->family !=NFPROTO_BRIDGE ) { +module_put (watcher->me); +return -ENOENT ; + } + w->u.watcher = watcher; par->target = watcher;
@@ -699,6 +705,8 @@ ebt_check_entry(struct ebt_entry *e, struct net *net, } i =0 ; +memset (&mtpar,0 ,sizeof (mtpar)); +memset (&tgpar,0 ,sizeof (tgpar)); mtpar.net = tgpar.net = net; mtpar.table = tgpar.table = name; mtpar.entryinfo = tgpar.entryinfo = e;
@@ -720,6 +728,13 @@ ebt_check_entry(struct ebt_entry *e, struct net *net, goto cleanup_watchers; } +/* Reject UNSPEC, xtables verdicts/return values are incompatible */ +if (target->family !=NFPROTO_BRIDGE ) { +module_put (target->me); + ret = -ENOENT ; + goto cleanup_watchers; + } + t->u.target = target;if (t->u.target == &ebt_standard_target) {if (gap <sizeof (struct ebt_standard_target )) {
net/dccp/ccids/ccid3.c +9 -7
@@ -599,7 +599,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, {struct ccid3_hc_rx_sock *hc =ccid3_hc_rx_sk (sk);struct dccp_sock *dp =dccp_sk (sk); -ktime_t now =ktime_get_real (); +ktime_t now =ktime_get ();s64 delta =0 ;switch (fbtype) {
@@ -624,15 +624,14 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk,case CCID3_FBACK_PERIODIC : delta =ktime_us_delta (now, hc->rx_tstamp_last_feedback);if (delta <=0 ) -DCCP_BUG ("delta (%ld) <= 0" , (long )delta); -else - hc->rx_x_recv =scaled_div32 (hc->rx_bytes_recv, delta); + delta =1 ; + hc->rx_x_recv =scaled_div32 (hc->rx_bytes_recv, delta);break ;default :return ; } -ccid3_pr_debug ("Interval %ldusec, X_recv=%u, 1/p=%u\n" , (long )delta, +ccid3_pr_debug ("Interval %lldusec, X_recv=%u, 1/p=%u\n" , delta, hc->rx_x_recv, hc->rx_pinv); hc->rx_tstamp_last_feedback = now;
@@ -679,7 +678,8 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb)static u32 ccid3_first_li (struct sock *sk) {struct ccid3_hc_rx_sock *hc =ccid3_hc_rx_sk (sk); -u32 x_recv, p, delta; +u32 x_recv, p; +s64 delta;u64 fval;if (hc->rx_rtt ==0 ) {
@@ -687,7 +687,9 @@ static u32 ccid3_first_li(struct sock *sk) hc->rx_rtt =DCCP_FALLBACK_RTT ; } - delta =ktime_to_us (net_timedelta (hc->rx_tstamp_last_feedback)); + delta =ktime_us_delta (ktime_get (), hc->rx_tstamp_last_feedback); +if (delta <=0 ) + delta =1 ; x_recv =scaled_div32 (hc->rx_bytes_recv, delta);if (x_recv ==0 ) {/* would also trigger divide-by-zero */ DCCP_WARN ("X_recv==0\n" );
net/dns_resolver/dns_key.c +16 -12
@@ -87,35 +87,39 @@ dns_resolver_preparse(struct key_preparsed_payload *prep) opt++;kdebug ("options: '%s'" , opt); do { + int opt_len, opt_nlen; const char *eq; - int opt_len, opt_nlen, opt_vlen, tmp; + char optval[128]; next_opt = memchr(opt, '#', end - opt) ?: end; opt_len = next_opt - opt; - if (opt_len <= 0 || opt_len > 128) { + if (opt_len <= 0 || opt_len > sizeof(optval)) { pr_warn_ratelimited("Invalid option length (%d) for dns_resolver key\n", opt_len); return -EINVAL; } - eq = memchr(opt, '=', opt_len) ?: end; - opt_nlen = eq - opt; - eq++; - opt_vlen = next_opt - eq; /* will be -1 if no value */ + eq = memchr(opt, '=', opt_len); + if (eq) { + opt_nlen = eq - opt; + eq++; + memcpy(optval, eq, next_opt - eq); + optval[next_opt - eq] = '\0'; + } else { + opt_nlen = opt_len; + optval[0] = '\0'; + } - tmp = opt_vlen >= 0 ? opt_vlen : 0; - kdebug("option '%*.*s' val '%*.*s'", - opt_nlen, opt_nlen, opt, tmp, tmp, eq); + kdebug("option '%*.*s' val '%s'", + opt_nlen, opt_nlen, opt, optval); /* see if it's an error number representing a DNS error * that's to be recorded as the result in this key */ if (opt_nlen == sizeof(DNS_ERRORNO_OPTION) - 1 && memcmp(opt, DNS_ERRORNO_OPTION, opt_nlen) == 0) { kdebug("dns error number option"); - if (opt_vlen <= 0) - goto bad_option_value; - ret = kstrtoul(eq, 10, &derrno); + ret = kstrtoul(optval, 10, &derrno); if (ret < 0) goto bad_option_value;
net/ipv4/netfilter/ip_tables.c +1 -0
@@ -651,6 +651,7 @@ find_check_entry(struct ipt_entry *e, struct net *net, const char *name,struct xt_entry_match *ematch; j =0 ; +memset (&mtpar,0 ,sizeof (mtpar)); mtpar.net = net; mtpar.table = name; mtpar.entryinfo = &e->ip;
net/ipv4/sysctl_net_ipv4.c +13 -5
@@ -206,8 +206,9 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write, {struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH *2 +10 ) };struct tcp_fastopen_context *ctxt; -int ret;u32 user_key[4 ];/* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ +__le32 key[4 ]; +int ret, i; tbl.data =kmalloc (tbl.maxlen,GFP_KERNEL );if (!tbl.data)
@@ -216,11 +217,14 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,rcu_read_lock (); ctxt =rcu_dereference (tcp_fastopen_ctx);if (ctxt) -memcpy (user_key, ctxt->key,TCP_FASTOPEN_KEY_LENGTH ); +memcpy (key, ctxt->key,TCP_FASTOPEN_KEY_LENGTH );else -memset (user_key,0 ,sizeof (user_key)); +memset (key,0 ,sizeof (key));rcu_read_unlock (); +for (i =0 ; i <ARRAY_SIZE (key); i++) + user_key[i] =le32_to_cpu (key[i]); +snprintf (tbl.data, tbl.maxlen,"%08x-%08x-%08x-%08x" , user_key[0 ], user_key[1 ], user_key[2 ], user_key[3 ]); ret =proc_dostring (&tbl, write, buffer, lenp, ppos);
@@ -236,12 +240,16 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,* first invocation of tcp_fastopen_cookie_gen */ tcp_fastopen_init_key_once (false); -tcp_fastopen_reset_cipher (user_key,TCP_FASTOPEN_KEY_LENGTH ); + +for (i =0 ; i <ARRAY_SIZE (user_key); i++) + key[i] =cpu_to_le32 (user_key[i]); + +tcp_fastopen_reset_cipher (key,TCP_FASTOPEN_KEY_LENGTH ); } bad_key:pr_debug ("proc FO key set 0x%x-%x-%x-%x <- 0x%s: %u\n" , - user_key[0 ], user_key[1 ], user_key[2 ], user_key[3 ], + user_key[0 ], user_key[1 ], user_key[2 ], user_key[3 ], (char *)tbl.data, ret);kfree (tbl.data);return ret;
net/ipv4/tcp_input.c +9 -0
@@ -3170,6 +3170,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,if (tcp_is_reno (tp)) {tcp_remove_reno_sacks (sk, pkts_acked); + +/* If any of the cumulatively ACKed segments was +* retransmitted, non-SACK case cannot confirm that +* progress was due to original transmission due to +* lack of TCPCB_SACKED_ACKED bits even if some of +* the packets may have been never retransmitted. +*/ +if (flag &FLAG_RETRANS_DATA_ACKED ) + flag &= ~FLAG_ORIG_SACK_ACKED ; }else {int delta;
net/ipv6/netfilter/ip6_tables.c +1 -0
@@ -662,6 +662,7 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name,struct xt_entry_match *ematch; j =0 ; +memset (&mtpar,0 ,sizeof (mtpar)); mtpar.net = net; mtpar.table = name; mtpar.entryinfo = &e->ipv6;
net/nfc/llcp_commands.c +6 -3
@@ -752,11 +752,14 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,pr_debug ("Fragment %zd bytes remaining %zd" , frag_len, remaining_len); - pdu =nfc_alloc_send_skb (sock->dev, &sock->sk,MSG_DONTWAIT , + pdu =nfc_alloc_send_skb (sock->dev, &sock->sk,0 , frag_len +LLCP_HEADER_SIZE , &err);if (pdu ==NULL ) { -pr_err ("Could not allocate PDU\n" ); -continue ; +pr_err ("Could not allocate PDU (error=%d)\n" , err); + len -= remaining_len; +if (len ==0 ) + len = err; +break ; } pdu =llcp_add_header (pdu, dsap, ssap,LLCP_PDU_UI );
net/rds/loop.c +1 -0
@@ -191,4 +191,5 @@ struct rds_transport rds_loop_transport = { .inc_copy_to_user = rds_message_inc_copy_to_user, .inc_free = rds_loop_inc_free, .t_name = "loopback", + .t_type = RDS_TRANS_LOOP, };
net/rds/rds.h +5 -0
@@ -381,6 +381,11 @@ struct rds_notifier {int n_status; }; +/* Available as part of RDS core, so doesn't need to participate +* in get_preferred transport etc +*/ +#define RDS_TRANS_LOOP 3 +/** * struct rds_transport - transport specific behavioural hooks *
net/rds/recv.c +5 -0
@@ -76,6 +76,11 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,return ; rs->rs_rcv_bytes += delta; + +/* loop transport doesn't send/recv congestion updates */ +if (rs->rs_transport->t_type ==RDS_TRANS_LOOP ) +return ; + now_congested = rs->rs_rcv_bytes >rds_sk_rcvbuf (rs); rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d "
net/sched/sch_blackhole.c +1 -1
@@ -20,7 +20,7 @@static int blackhole_enqueue (struct sk_buff *skb,struct Qdisc *sch) {qdisc_drop (skb, sch); -return NET_XMIT_SUCCESS ; +return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; }static struct sk_buff *blackhole_dequeue (struct Qdisc *sch)