Linux 4.14.143
Greg KH
maintainerI'm announcing the release of the 4.14.143 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/x86/include/asm/bootparam_utils.h | 1 arch/x86/kernel/apic/apic.c | 4 - drivers/bluetooth/btqca.c | 3 drivers/gpu/drm/mediatek/mtk_drm_drv.c | 49 ++++++++++++- drivers/gpu/drm/mediatek/mtk_drm_drv.h | 2 drivers/hid/hid-cp2112.c | 8 +- drivers/infiniband/hw/mlx4/mad.c | 4 - drivers/input/serio/hyperv-keyboard.c | 35 +-------- drivers/net/ethernet/cavium/liquidio/request_manager.c | 4 - drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 4 - drivers/net/ethernet/ibm/ibmveth.c | 9 +- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 drivers/net/ethernet/renesas/ravb_main.c | 8 +- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 - drivers/net/ethernet/toshiba/tc35815.c | 2 drivers/net/ethernet/tundra/tsi108_eth.c | 5 - drivers/net/hyperv/netvsc_drv.c | 9 +- drivers/net/usb/cx82310_eth.c | 3 drivers/net/usb/kalmia.c | 6 - drivers/net/usb/lan78xx.c | 8 +- drivers/net/wimax/i2400m/fw.c | 4 - drivers/spi/spi-bcm2835aux.c | 62 +++++------------ fs/ceph/caps.c | 5 + fs/ceph/inode.c | 7 + fs/ceph/snap.c | 4 - fs/ceph/super.h | 2 fs/ceph/xattr.c | 19 +++-- fs/read_write.c | 49 +++++++++++-- include/linux/ceph/buffer.h | 3 include/linux/gpio.h | 24 ------ include/net/act_api.h | 4 - include/net/psample.h | 1 kernel/kprobes.c | 8 +- net/core/netpoll.c | 6 - net/ipv4/tcp.c | 29 +++++-- net/ipv4/tcp_output.c | 3 net/ipv6/mcast.c | 5 - net/psample/psample.c | 2 net/sched/act_bpf.c | 2 net/sched/act_connmark.c | 2 net/sched/act_csum.c | 2 net/sched/act_gact.c | 2 net/sched/act_ife.c | 2 net/sched/act_ipt.c | 11 +-- net/sched/act_mirred.c | 2 net/sched/act_nat.c | 2 net/sched/act_pedit.c | 2 net/sched/act_police.c | 2 net/sched/act_sample.c | 7 + net/sched/act_simple.c | 2 net/sched/act_skbedit.c | 2 net/sched/act_skbmod.c | 2 net/sched/act_tunnel_key.c | 2 net/sched/act_vlan.c | 2 tools/hv/hv_kvp_daemon.c | 2 virt/kvm/arm/mmio.c | 7 + 57 files changed, 270 insertions(+), 196 deletions(-)
Alexandre Courbot (2):
drm/mediatek: use correct device to import PRIME buffers drm/mediatek: set DMA max segment size
Andrea Righi (1):
kprobes: Fix potential deadlock in kprobe_optimizer()
Andrew Jones (1):
KVM: arm/arm64: Only skip MMIO insn once
Benjamin Tissoires (1):
HID: cp2112: prevent sleeping function called from invalid context
Chen-Yu Tsai (1):
net: stmmac: dwmac-rk: Don't fail if phy regulator is absent
Cong Wang (1):
net_sched: fix a NULL pointer deref in ipt action
Darrick J. Wong (1):
vfs: fix page locking deadlocks when deduping files
Dexuan Cui (2):
hv_netvsc: Fix a warning of suspicious RCU usage
Input: hyperv-keyboard: Use in-place iterator API in the channel callback
Eric Dumazet (2):
tcp: remove empty skb from write queue in error cases
mld: fix memory leak in mld_del_delrec()
Feng Sun (1):
net: fix skb use after free in netpoll
Fuqian Huang (1):
net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
Greg Kroah-Hartman (1):
Linux 4.14.143
John S. Gruber (1):
x86/boot: Preserve boot_params.secure_boot from sanitizing
Linus Torvalds (1):
Revert "x86/apic: Include the LDR when clearing out APIC registers"
Luis Henriques (4):
ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()
ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattrs_blob()
ceph: fix buffer free while holding i_ceph_lock in fill_inode()
libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
Martin Sperl (3):
spi: bcm2835aux: unifying code between polling and interrupt driven code
spi: bcm2835aux: remove dangerous uncontrolled read of fifo
spi: bcm2835aux: fix corruptions for longer spi transfers
Matthias Kaehlcke (1):
Bluetooth: btqca: Add a short delay before downloading the NVM
Nathan Chancellor (1):
net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx
Tho Vu (1):
ravb: Fix use-after-free ravb_tstamp_skb
Thomas Falcon (1):
ibmveth: Convert multicast list size for little-endian system
Vitaly Kuznetsov (1):
Tools: hv: kvp: eliminate 'may be used uninitialized' warning
Vlad Buslov (1):
net: sched: act_sample: fix psample group handling on overwrite
Wenwen Wang (8):
cxgb4: fix a memory leak bug
liquidio: add cleanup in octeon_setup_iq()
net: myri10ge: fix memory leaks
lan78xx: Fix memory leaks
cx82310_eth: fix a memory leak bug
net: kalmia: fix memory leaks
wimax/i2400m: fix a memory leak bug
IB/mlx4: Fix memory leaks
Willem de Bruijn (1):
tcp: inherit timestamp on mtu probe
YueHaibing (1):
gpio: Fix build error of function redefinition
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 142 +SUBLEVEL = 143 EXTRAVERSION = NAME = Petit Gorille
arch/x86/include/asm/bootparam_utils.h +1 -0
@@ -71,6 +71,7 @@ static void sanitize_boot_params(struct boot_params *boot_params)BOOT_PARAM_PRESERVE (eddbuf_entries),BOOT_PARAM_PRESERVE (edd_mbr_sig_buf_entries),BOOT_PARAM_PRESERVE (edd_mbr_sig_buffer), +BOOT_PARAM_PRESERVE (secure_boot),BOOT_PARAM_PRESERVE (hdr),BOOT_PARAM_PRESERVE (e820_table), BOOT_PARAM_PRESERVE(eddbuf),
arch/x86/kernel/apic/apic.c +0 -4
@@ -1148,10 +1148,6 @@ void clear_local_APIC(void)apic_write (APIC_LVT0 , v |APIC_LVT_MASKED ); v =apic_read (APIC_LVT1 );apic_write (APIC_LVT1 , v |APIC_LVT_MASKED ); -if (!x2apic_enabled ()) { - v =apic_read (APIC_LDR ) & ~APIC_LDR_MASK ; -apic_write (APIC_LDR , v); - }if (maxlvt >=4 ) { v =apic_read (APIC_LVTPC );apic_write (APIC_LVTPC , v |APIC_LVT_MASKED );
drivers/bluetooth/btqca.c +3 -0
@@ -363,6 +363,9 @@ int qca_uart_setup_rome(struct hci_dev *hdev, uint8_t baudrate)return err; } +/* Give the controller some time to get ready to receive the NVM */ +msleep (10 ); +/* Download NVM configuration */ config.type =TLV_TYPE_NVM ; snprintf(config.fwname, sizeof(config.fwname), "qca/nvm_%08x.bin",
drivers/gpu/drm/mediatek/mtk_drm_drv.c +46 -3
94 lines not on this page · raw message
drivers/gpu/drm/mediatek/mtk_drm_drv.h +2 -0
@@ -56,6 +56,8 @@ struct mtk_drm_private { } commit;struct drm_atomic_state *suspend_state; + +bool dma_parms_allocated; };extern struct platform_driver mtk_ddp_driver;
drivers/hid/hid-cp2112.c +6 -2
@@ -1149,8 +1149,6 @@ static unsigned int cp2112_gpio_irq_startup(struct irq_data *d)INIT_DELAYED_WORK (&dev->gpio_poll_worker, cp2112_gpio_poll_callback); -cp2112_gpio_direction_input (gc, d->hwirq); -if (!dev->gpio_poll) { dev->gpio_poll = true;schedule_delayed_work (&dev->gpio_poll_worker,0 );
@@ -1198,6 +1196,12 @@ static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev,return PTR_ERR (dev->desc[pin]); } + ret =cp2112_gpio_direction_input (&dev->gc, pin); +if (ret <0 ) { +dev_err (dev->gc.parent,"Failed to set GPIO to input dir\n" ); + goto err_desc; + } + ret =gpiochip_lock_as_irq (&dev->gc, pin);if (ret) {dev_err (dev->gc.parent,"Failed to lock GPIO as interrupt\n" );
drivers/infiniband/hw/mlx4/mad.c +2 -2
@@ -1680,8 +1680,6 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, tx_buf_size, DMA_TO_DEVICE);kfree (tun_qp->tx_ring[i].buf.addr); } -kfree (tun_qp->tx_ring); - tun_qp->tx_ring =NULL ; i =MLX4_NUM_TUNNEL_BUFS ; err:while (i >0 ) {
@@ -1690,6 +1688,8 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, rx_buf_size, DMA_FROM_DEVICE);kfree (tun_qp->ring[i].addr); } +kfree (tun_qp->tx_ring); + tun_qp->tx_ring =NULL ;kfree (tun_qp->ring); tun_qp->ring =NULL ;return -ENOMEM ;
drivers/input/serio/hyperv-keyboard.c +6 -29
@@ -245,40 +245,17 @@ static void hv_kbd_handle_received_packet(struct hv_device *hv_dev,static void hv_kbd_on_channel_callback (void *context) { +struct vmpacket_descriptor *desc;struct hv_device *hv_dev = context; -void *buffer; -int bufferlen =0x100 ;/* Start with sensible size */ u32 bytes_recvd;u64 req_id; -int error; - buffer =kmalloc (bufferlen,GFP_ATOMIC ); -if (!buffer) -return ; - -while (1 ) { - error =vmbus_recvpacket_raw (hv_dev->channel, buffer, bufferlen, - &bytes_recvd, &req_id); -switch (error) { -case 0 : -if (bytes_recvd ==0 ) { -kfree (buffer); -return ; - } - -hv_kbd_handle_received_packet (hv_dev, buffer, - bytes_recvd, req_id); -break ; + foreach_vmbus_pkt(desc, hv_dev->channel) { + bytes_recvd = desc->len8 *8 ; + req_id = desc->trans_id; -case -ENOBUFS : -kfree (buffer); -/* Handle large packet */ - bufferlen = bytes_recvd; - buffer =kmalloc (bytes_recvd,GFP_ATOMIC ); -if (!buffer) -return ; -break ; - } +hv_kbd_handle_received_packet (hv_dev, desc, bytes_recvd, + req_id); } }
drivers/net/ethernet/cavium/liquidio/request_manager.c +3 -1
@@ -232,8 +232,10 @@ int octeon_setup_iq(struct octeon_device *oct, } oct->num_iqs++; -if (oct->fn_list.enable_io_queues (oct)) +if (oct->fn_list.enable_io_queues (oct)) { +octeon_delete_instr_queue (oct, iq_no);return 1 ; + }return 0 ; }
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +3 -1
@@ -2777,8 +2777,10 @@ static ssize_t blocked_fl_write(struct file *filp, const char __user *ubuf,return -ENOMEM ; err =bitmap_parse_user (ubuf, count, t, adap->sge.egr_sz); -if (err) +if (err) { +kvfree (t);return err; + }bitmap_copy (adap->sge.blocked_fl, t, adap->sge.egr_sz);kvfree (t);
drivers/net/ethernet/ibm/ibmveth.c +5 -4
@@ -1618,7 +1618,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)struct net_device *netdev;struct ibmveth_adapter *adapter;unsigned char *mac_addr_p; -unsigned int *mcastFilterSize_p; +__be32 *mcastFilterSize_p;long ret;unsigned long ret_attr;
@@ -1640,8 +1640,9 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)return -EINVAL ; } - mcastFilterSize_p = (unsigned int *)vio_get_attribute (dev, -VETH_MCAST_FILTER_SIZE ,NULL ); + mcastFilterSize_p = (__be32 *)vio_get_attribute (dev, +VETH_MCAST_FILTER_SIZE , +NULL );if (!mcastFilterSize_p) {dev_err (&dev->dev,"Can't find VETH_MCAST_FILTER_SIZE " "attribute\n" );
@@ -1658,7 +1659,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) adapter->vdev = dev; adapter->netdev = netdev; - adapter->mcastFilterSize = *mcastFilterSize_p; + adapter->mcastFilterSize =be32_to_cpu (*mcastFilterSize_p); adapter->pool_config =0 ;netif_napi_add (netdev, &adapter->napi, ibmveth_poll,16 );
drivers/net/ethernet/myricom/myri10ge/myri10ge.c +1 -1
@@ -3922,7 +3922,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)* setup (if available). */ status =myri10ge_request_irq (mgp);if (status !=0 ) - goto abort_with_firmware; + goto abort_with_slices;myri10ge_free_irq (mgp);/* Save configuration space to be restored if the
drivers/net/ethernet/renesas/ravb_main.c +6 -2
@@ -1,6 +1,6 @@/* Renesas Ethernet AVB device driver * -* Copyright (C) 2014-2015 Renesas Electronics Corporation +* Copyright (C) 2014-2019 Renesas Electronics Corporation * Copyright (C) 2015 Renesas Solutions Corp. * Copyright (C) 2015-2016 Cogent Embedded, Inc. <[email protected]> *
@@ -513,7 +513,10 @@ static void ravb_get_tx_tstamp(struct net_device *ndev)kfree (ts_skb);if (tag == tfa_tag) {skb_tstamp_tx (skb, &shhwtstamps); +dev_consume_skb_any (skb);break ; + }else { +dev_kfree_skb_any (skb); } }ravb_modify (ndev,TCCR ,TCCR_TFR ,TCCR_TFR );
@@ -1576,7 +1579,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) DMA_TO_DEVICE); goto unmap; } - ts_skb->skb = skb; + ts_skb->skb =skb_get (skb); ts_skb->tag = priv->ts_skb_tag++; priv->ts_skb_tag &=0x3ff ;list_add_tail (&ts_skb->list, &priv->ts_skb_list);
@@ -1704,6 +1707,7 @@ static int ravb_close(struct net_device *ndev)/* Clear the timestamp list */ list_for_each_entry_safe (ts_skb, ts_skb2, &priv->ts_skb_list, list) {list_del (&ts_skb->list); +kfree_skb (ts_skb->skb);kfree (ts_skb); }
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +2 -4
@@ -1145,10 +1145,8 @@ static int phy_power_on(struct rk_priv_data *bsp_priv, bool enable)int ret;struct device *dev = &bsp_priv->pdev->dev; -if (!ldo) { -dev_err (dev,"no regulator found\n" ); -return -1 ; - } +if (!ldo) +return 0 ;if (enable) { ret =regulator_enable (ldo);
drivers/net/ethernet/toshiba/tc35815.c +1 -1
@@ -1497,7 +1497,7 @@ tc35815_rx(struct net_device *dev, int limit)pci_unmap_single (lp->pci_dev, lp->rx_skbs[cur_bd].skb_dma,RX_BUF_SIZE ,PCI_DMA_FROMDEVICE ); -if (!HAVE_DMA_RXALIGN (lp) &&NET_IP_ALIGN ) +if (!HAVE_DMA_RXALIGN (lp) &&NET_IP_ALIGN !=0 )memmove (skb->data, skb->data -NET_IP_ALIGN , pkt_len); data =skb_put (skb, pkt_len);
drivers/net/ethernet/tundra/tsi108_eth.c +3 -2
@@ -381,9 +381,10 @@ tsi108_stat_carry_one(int carry, int carry_bit, int carry_shift,static void tsi108_stat_carry (struct net_device *dev) {struct tsi108_prv_data *data =netdev_priv (dev); +unsigned long flags;u32 carry1, carry2; -spin_lock_irq (&data->misclock); +spin_lock_irqsave (&data->misclock, flags); carry1 =TSI_READ (TSI108_STAT_CARRY1 ); carry2 =TSI_READ (TSI108_STAT_CARRY2 );
@@ -451,7 +452,7 @@ static void tsi108_stat_carry(struct net_device *dev)TSI108_STAT_TXPAUSEDROP_CARRY , &data->tx_pause_drop); -spin_unlock_irq (&data->misclock); +spin_unlock_irqrestore (&data->misclock, flags); }/* Read a stat counter atomically with respect to carries.
drivers/net/hyperv/netvsc_drv.c +7 -2
@@ -1170,12 +1170,15 @@ static void netvsc_get_stats64(struct net_device *net, struct rtnl_link_stats64 *t) {struct net_device_context *ndev_ctx =netdev_priv (net); -struct netvsc_device *nvdev =rcu_dereference_rtnl (ndev_ctx->nvdev); +struct netvsc_device *nvdev;struct netvsc_vf_pcpu_stats vf_tot;int i; +rcu_read_lock (); + + nvdev =rcu_dereference (ndev_ctx->nvdev);if (!nvdev) -return ; + goto out;netdev_stats_to_stats64 (t, &net->stats);
@@ -1214,6 +1217,8 @@ static void netvsc_get_stats64(struct net_device *net, t->rx_packets += packets; t->multicast += multicast; } +out: +rcu_read_unlock (); }static int netvsc_set_mac_addr (struct net_device *ndev,void *p)
drivers/net/usb/cx82310_eth.c +2 -1
@@ -175,7 +175,8 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) }if (!timeout) {dev_err (&udev->dev,"firmware not ready in time\n" ); -return -ETIMEDOUT ; + ret = -ETIMEDOUT ; + goto err; }/* enable ethernet mode (?) */
drivers/net/usb/kalmia.c +3 -3
@@ -117,16 +117,16 @@ kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr) status =kalmia_send_init_packet (dev, usb_buf,sizeof (init_msg_1) /sizeof (init_msg_1[0 ]), usb_buf,24 );if (status !=0 ) -return status; + goto out;memcpy (usb_buf, init_msg_2,12 ); status =kalmia_send_init_packet (dev, usb_buf,sizeof (init_msg_2) /sizeof (init_msg_2[0 ]), usb_buf,28 );if (status !=0 ) -return status; + goto out;memcpy (ethernet_addr, usb_buf +10 ,ETH_ALEN ); - +out:kfree (usb_buf);return status; }
drivers/net/usb/lan78xx.c +5 -3
@@ -3645,7 +3645,7 @@ static int lan78xx_probe(struct usb_interface *intf, ret =register_netdev (netdev);if (ret !=0 ) {netif_err (dev, probe, netdev,"couldn't register the device\n" ); - goto out3; + goto out4; }usb_set_intfdata (intf, dev);
@@ -3660,12 +3660,14 @@ static int lan78xx_probe(struct usb_interface *intf, ret =lan78xx_phy_init (dev);if (ret <0 ) - goto out4; + goto out5;return 0 ; -out4: +out5:unregister_netdev (netdev); +out4: +usb_free_urb (dev->urb_intr); out3:lan78xx_unbind (dev, intf); out2:
drivers/net/wimax/i2400m/fw.c +3 -1
@@ -351,13 +351,15 @@ int i2400m_barker_db_init(const char *_options) } result =i2400m_barker_db_add (barker);if (result <0 ) - goto error_add; + goto error_parse_add; }kfree (options_orig); }return 0 ; +error_parse_add: error_parse: +kfree (options_orig); error_add:kfree (i2400m_barker_db);return result;
drivers/spi/spi-bcm2835aux.c +20 -42
99 lines not on this page · raw message
fs/ceph/caps.c +4 -1
@@ -1162,6 +1162,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, {struct ceph_inode_info *ci = cap->ci;struct inode *inode = &ci->vfs_inode; +struct ceph_buffer *old_blob =NULL ;struct cap_msg_args arg;int held, revoking, dropping;int wake =0 ;
@@ -1227,7 +1228,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, ci->i_requested_max_size = arg.max_size;if (flushing &CEPH_CAP_XATTR_EXCL ) { -__ceph_build_xattrs_blob (ci); + old_blob =__ceph_build_xattrs_blob (ci); arg.xattr_version = ci->i_xattrs.version; arg.xattr_buf = ci->i_xattrs.blob; }else {
@@ -1262,6 +1263,8 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,spin_unlock (&ci->i_ceph_lock); +ceph_buffer_put (old_blob); + ret =send_cap_msg (&arg);if (ret <0 ) {dout ("error sending cap msg, must requeue %p\n" , inode);
fs/ceph/inode.c +4 -3
@@ -730,6 +730,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,int issued =0 , implemented, new_issued;struct timespec mtime, atime, ctime;struct ceph_buffer *xattr_blob =NULL ; +struct ceph_buffer *old_blob =NULL ;struct ceph_string *pool_ns =NULL ;struct ceph_cap *new_cap =NULL ;int err =0 ;
@@ -847,7 +848,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,if ((ci->i_xattrs.version ==0 || !(issued &CEPH_CAP_XATTR_EXCL )) &&le64_to_cpu (info->xattr_version) > ci->i_xattrs.version) {if (ci->i_xattrs.blob) -ceph_buffer_put (ci->i_xattrs.blob); + old_blob = ci->i_xattrs.blob; ci->i_xattrs.blob = xattr_blob;if (xattr_blob) memcpy(ci->i_xattrs.blob->vec.iov_base,
@@ -993,8 +994,8 @@ static int fill_inode(struct inode *inode, struct page *locked_page, out:if (new_cap)ceph_put_cap (mdsc, new_cap); -if (xattr_blob) -ceph_buffer_put (xattr_blob); +ceph_buffer_put (old_blob); +ceph_buffer_put (xattr_blob);ceph_put_string (pool_ns);return err; }
fs/ceph/snap.c +3 -1
@@ -460,6 +460,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci)struct inode *inode = &ci->vfs_inode;struct ceph_cap_snap *capsnap;struct ceph_snap_context *old_snapc, *new_snapc; +struct ceph_buffer *old_blob =NULL ;int used, dirty; capsnap =kzalloc (sizeof (*capsnap),GFP_NOFS );
@@ -536,7 +537,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) capsnap->gid = inode->i_gid;if (dirty &CEPH_CAP_XATTR_EXCL ) { -__ceph_build_xattrs_blob (ci); + old_blob =__ceph_build_xattrs_blob (ci); capsnap->xattr_blob =ceph_buffer_get (ci->i_xattrs.blob); capsnap->xattr_version = ci->i_xattrs.version;
@@ -579,6 +580,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) }spin_unlock (&ci->i_ceph_lock); +ceph_buffer_put (old_blob);kfree (capsnap);ceph_put_snap_context (old_snapc); }
fs/ceph/super.h +1 -1
@@ -835,7 +835,7 @@ extern int ceph_getattr(const struct path *path, struct kstat *stat,int __ceph_setxattr (struct inode *,const char *,const void *,size_t ,int );ssize_t __ceph_getxattr (struct inode *,const char *,void *,size_t );extern ssize_t ceph_listxattr (struct dentry *,char *,size_t ); -extern void __ceph_build_xattrs_blob (struct ceph_inode_info *ci); +extern struct ceph_buffer *__ceph_build_xattrs_blob (struct ceph_inode_info *ci);extern void __ceph_destroy_xattrs (struct ceph_inode_info *ci);extern void __init ceph_xattr_init (void );extern void ceph_xattr_exit (void );
fs/ceph/xattr.c +14 -5
@@ -681,12 +681,15 @@ static int __get_required_blob_size(struct ceph_inode_info *ci, int name_size,/* * If there are dirty xattrs, reencode xattrs into the prealloc_blob -* and swap into place. +* and swap into place. It returns the old i_xattrs.blob (or NULL) so +* that it can be freed by the caller as the i_ceph_lock is likely to be +* held. */ -void __ceph_build_xattrs_blob (struct ceph_inode_info *ci) +struct ceph_buffer *__ceph_build_xattrs_blob (struct ceph_inode_info *ci) {struct rb_node *p;struct ceph_inode_xattr *xattr =NULL ; +struct ceph_buffer *old_blob =NULL ;void *dest;dout ("__build_xattrs_blob %p\n" , &ci->vfs_inode);
@@ -717,12 +720,14 @@ void __ceph_build_xattrs_blob(struct ceph_inode_info *ci) dest - ci->i_xattrs.prealloc_blob->vec.iov_base;if (ci->i_xattrs.blob) -ceph_buffer_put (ci->i_xattrs.blob); + old_blob = ci->i_xattrs.blob; ci->i_xattrs.blob = ci->i_xattrs.prealloc_blob; ci->i_xattrs.prealloc_blob =NULL ; ci->i_xattrs.dirty = false; ci->i_xattrs.version++; } + +return old_blob; }static inline int __get_request_mask (struct inode *in) {
@@ -955,6 +960,7 @@ int __ceph_setxattr(struct inode *inode, const char *name,struct ceph_inode_info *ci =ceph_inode (inode);struct ceph_mds_client *mdsc =ceph_sb_to_client (inode->i_sb)->mdsc;struct ceph_cap_flush *prealloc_cf =NULL ; +struct ceph_buffer *old_blob =NULL ;int issued;int err;int dirty =0 ;
@@ -1023,13 +1029,15 @@ int __ceph_setxattr(struct inode *inode, const char *name,struct ceph_buffer *blob;spin_unlock (&ci->i_ceph_lock); -dout (" preaallocating new blob size=%d\n" , required_blob_size); +ceph_buffer_put (old_blob);/* Shouldn't be required */ +dout (" pre-allocating new blob size=%d\n" , required_blob_size); blob =ceph_buffer_new (required_blob_size,GFP_NOFS );if (!blob) goto do_sync_unlocked;spin_lock (&ci->i_ceph_lock); +/* prealloc_blob can't be released while holding i_ceph_lock */ if (ci->i_xattrs.prealloc_blob) -ceph_buffer_put (ci->i_xattrs.prealloc_blob); + old_blob = ci->i_xattrs.prealloc_blob; ci->i_xattrs.prealloc_blob = blob; goto retry; }
@@ -1045,6 +1053,7 @@ int __ceph_setxattr(struct inode *inode, const char *name, }spin_unlock (&ci->i_ceph_lock); +ceph_buffer_put (old_blob);if (lock_snap_rwsem)up_read (&mdsc->snap_rwsem);if (dirty)
fs/read_write.c +41 -8
79 lines not on this page · raw message
include/linux/ceph/buffer.h +2 -1
@@ -30,7 +30,8 @@ static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b)static inline void ceph_buffer_put (struct ceph_buffer *b) { -kref_put (&b->kref, ceph_buffer_release); +if (b) +kref_put (&b->kref, ceph_buffer_release); }extern int ceph_decode_buffer (struct ceph_buffer **b,void **p,void *end);
include/linux/gpio.h +0 -24
@@ -230,30 +230,6 @@ static inline int irq_to_gpio(unsigned irq)return -EINVAL ; } -static inline int -gpiochip_add_pin_range (struct gpio_chip *chip,const char *pinctl_name, -unsigned int gpio_offset,unsigned int pin_offset, -unsigned int npins) -{ -WARN_ON (1 ); -return -EINVAL ; -} - -static inline int -gpiochip_add_pingroup_range (struct gpio_chip *chip, -struct pinctrl_dev *pctldev, -unsigned int gpio_offset,const char *pin_group) -{ -WARN_ON (1 ); -return -EINVAL ; -} - -static inline void -gpiochip_remove_pin_ranges (struct gpio_chip *chip) -{ -WARN_ON (1 ); -} -static inline int devm_gpio_request (struct device *dev,unsigned gpio,const char *label) {
include/net/act_api.h +3 -1
@@ -14,6 +14,7 @@struct tcf_idrinfo {spinlock_t lock;struct idr action_idr; +struct net *net; };struct tc_action_ops ;
@@ -104,7 +105,7 @@ struct tc_action_net { };static inline -int tc_action_net_init (struct tc_action_net *tn, +int tc_action_net_init (struct net *net,struct tc_action_net *tn,const struct tc_action_ops *ops) {int err =0 ;
@@ -113,6 +114,7 @@ int tc_action_net_init(struct tc_action_net *tn,if (!tn->idrinfo)return -ENOMEM ; tn->ops = ops; + tn->idrinfo->net = net;spin_lock_init (&tn->idrinfo->lock);idr_init (&tn->idrinfo->action_idr);return err;
include/net/psample.h +1 -0
@@ -12,6 +12,7 @@ struct psample_group {u32 group_num;u32 refcount;u32 seq; +struct rcu_head rcu; };struct psample_group *psample_group_get (struct net *net,u32 group_num);
kernel/kprobes.c +4 -4
@@ -483,6 +483,7 @@ static DECLARE_DELAYED_WORK(optimizing_work, kprobe_optimizer);*/ static void do_optimize_kprobes (void ) { +lockdep_assert_held (&text_mutex);/* * The optimization/unoptimization refers online_cpus via * stop_machine() and cpu-hotplug modifies online_cpus.
@@ -500,9 +501,7 @@ static void do_optimize_kprobes(void) list_empty(&optimizing_list))return ; -mutex_lock (&text_mutex);arch_optimize_kprobes (&optimizing_list); -mutex_unlock (&text_mutex); }/*
@@ -513,6 +512,7 @@ static void do_unoptimize_kprobes(void) {struct optimized_kprobe *op, *tmp; +lockdep_assert_held (&text_mutex);/* See comment in do_optimize_kprobes() */ lockdep_assert_cpus_held ();
@@ -520,7 +520,6 @@ static void do_unoptimize_kprobes(void)if (list_empty (&unoptimizing_list))return ; -mutex_lock (&text_mutex);arch_unoptimize_kprobes (&unoptimizing_list, &freeing_list);/* Loop free_list for disarming */ list_for_each_entry_safe (op, tmp, &freeing_list, list) {
@@ -537,7 +536,6 @@ static void do_unoptimize_kprobes(void) }else list_del_init (&op->list); } -mutex_unlock (&text_mutex); }/* Reclaim all kprobes on the free_list */
@@ -563,6 +561,7 @@ static void kprobe_optimizer(struct work_struct *work) {mutex_lock (&kprobe_mutex);cpus_read_lock (); +mutex_lock (&text_mutex);/* Lock modules while optimizing kprobes */ mutex_lock (&module_mutex);
@@ -590,6 +589,7 @@ static void kprobe_optimizer(struct work_struct *work)do_free_cleaned_kprobes ();mutex_unlock (&module_mutex); +mutex_unlock (&text_mutex);cpus_read_unlock ();mutex_unlock (&kprobe_mutex);
net/core/netpoll.c +3 -3
@@ -122,7 +122,7 @@ static void queue_process(struct work_struct *work) txq =netdev_get_tx_queue (dev, q_index);HARD_TX_LOCK (dev, txq,smp_processor_id ());if (netif_xmit_frozen_or_stopped (txq) || -netpoll_start_xmit (skb, dev, txq) !=NETDEV_TX_OK ) { + !dev_xmit_complete (netpoll_start_xmit (skb, dev, txq))) {skb_queue_head (&npinfo->txq, skb);HARD_TX_UNLOCK (dev, txq);local_irq_restore (flags);
@@ -357,7 +357,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,HARD_TX_UNLOCK (dev, txq); -if (status ==NETDEV_TX_OK ) +if (dev_xmit_complete (status))break ; }
@@ -374,7 +374,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, } -if (status !=NETDEV_TX_OK ) { +if (!dev_xmit_complete (status)) {skb_queue_tail (&npinfo->txq, skb);schedule_delayed_work (&npinfo->tx_work,0 ); }
net/ipv4/tcp.c +20 -9
@@ -914,6 +914,22 @@ static int tcp_send_mss(struct sock *sk, int *size_goal, int flags)return mss_now; } +/* In some cases, both sendpage() and sendmsg() could have added +* an skb to the write queue, but failed adding payload on it. +* We need to remove it to consume less memory, but more +* importantly be able to generate EPOLLOUT for Edge Trigger epoll() +* users. +*/ +static void tcp_remove_empty_skb (struct sock *sk,struct sk_buff *skb) +{ +if (skb && !skb->len) { +tcp_unlink_write_queue (skb, sk); +if (tcp_write_queue_empty (sk)) +tcp_chrono_stop (sk,TCP_CHRONO_BUSY ); +sk_wmem_free_skb (sk, skb); + } +} +ssize_t do_tcp_sendpages (struct sock *sk,struct page *page,int offset,size_t size,int flags) {
@@ -1034,6 +1050,7 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,return copied; do_error: +tcp_remove_empty_skb (sk,tcp_write_queue_tail (sk));if (copied) goto out; out_err:
@@ -1412,17 +1429,11 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)sock_zerocopy_put (uarg);return copied + copied_syn; +do_error: + skb =tcp_write_queue_tail (sk); do_fault: -if (!skb->len) { -tcp_unlink_write_queue (skb, sk); -/* It is the one place in all of TCP, except connection -* reset, where we can be unlinking the send_head. -*/ -tcp_check_send_head (sk, skb); -sk_wmem_free_skb (sk, skb); - } +tcp_remove_empty_skb (sk, skb); -do_error:if (copied + copied_syn) goto out; out_err:
net/ipv4/tcp_output.c +2 -1
@@ -2025,7 +2025,7 @@ static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len)if (len <= skb->len)break ; -if (unlikely (TCP_SKB_CB (skb)->eor)) +if (unlikely (TCP_SKB_CB (skb)->eor) ||tcp_has_tx_tstamp (skb))return false; len -= skb->len;
@@ -2148,6 +2148,7 @@ static int tcp_mtu_probe(struct sock *sk)* we need to propagate it to the new skb. */ TCP_SKB_CB (nskb)->eor =TCP_SKB_CB (skb)->eor; +tcp_skb_collapse_tstamp (nskb, skb);tcp_unlink_write_queue (skb, sk);sk_wmem_free_skb (sk, skb); }else {
net/ipv6/mcast.c +3 -2
@@ -772,12 +772,13 @@ static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) im->idev = pmc->idev; im->mca_crcount = idev->mc_qrv;if (im->mca_sfmode ==MCAST_INCLUDE ) { - im->mca_tomb = pmc->mca_tomb; - im->mca_sources = pmc->mca_sources; +swap (im->mca_tomb, pmc->mca_tomb); +swap (im->mca_sources, pmc->mca_sources);for (psf = im->mca_sources; psf; psf = psf->sf_next) psf->sf_crcount = im->mca_crcount; }in6_dev_put (pmc->idev); +ip6_mc_clear_src (pmc);kfree (pmc); }spin_unlock_bh (&im->mca_lock);
net/psample/psample.c +1 -1
@@ -156,7 +156,7 @@ static void psample_group_destroy(struct psample_group *group) {psample_group_notify (group,PSAMPLE_CMD_DEL_GROUP );list_del (&group->list); -kfree (group); +kfree_rcu (group, rcu); } static struct psample_group *
net/sched/act_bpf.c +1 -1
@@ -402,7 +402,7 @@ static __net_init int bpf_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, bpf_net_id); -return tc_action_net_init (tn, &act_bpf_ops); +return tc_action_net_init (net, tn, &act_bpf_ops); } static void __net_exit bpf_exit_net(struct net *net)
net/sched/act_connmark.c +1 -1
@@ -206,7 +206,7 @@ static __net_init int connmark_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, connmark_net_id); -return tc_action_net_init (tn, &act_connmark_ops); +return tc_action_net_init (net, tn, &act_connmark_ops); } static void __net_exit connmark_exit_net(struct net *net)
net/sched/act_csum.c +1 -1
@@ -632,7 +632,7 @@ static __net_init int csum_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, csum_net_id); -return tc_action_net_init (tn, &act_csum_ops); +return tc_action_net_init (net, tn, &act_csum_ops); } static void __net_exit csum_exit_net(struct net *net)
net/sched/act_gact.c +1 -1
@@ -232,7 +232,7 @@ static __net_init int gact_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, gact_net_id); -return tc_action_net_init (tn, &act_gact_ops); +return tc_action_net_init (net, tn, &act_gact_ops); } static void __net_exit gact_exit_net(struct net *net)
net/sched/act_ife.c +1 -1
@@ -837,7 +837,7 @@ static __net_init int ife_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, ife_net_id); -return tc_action_net_init (tn, &act_ife_ops); +return tc_action_net_init (net, tn, &act_ife_ops); } static void __net_exit ife_exit_net(struct net *net)
net/sched/act_ipt.c +6 -5
@@ -65,12 +65,13 @@ static int ipt_init_target(struct net *net, struct xt_entry_target *t,return 0 ; } -static void ipt_destroy_target (struct xt_entry_target *t) +static void ipt_destroy_target (struct xt_entry_target *t,struct net *net) {struct xt_tgdtor_param par = { .target = t->u.kernel.target, .targinfo = t->data, .family =NFPROTO_IPV4 , + .net = net, };if (par.target->destroy !=NULL ) par.target->destroy (&par);
@@ -82,7 +83,7 @@ static void tcf_ipt_release(struct tc_action *a, int bind)struct tcf_ipt *ipt =to_ipt (a);if (ipt->tcfi_t) { -ipt_destroy_target (ipt->tcfi_t); +ipt_destroy_target (ipt->tcfi_t, a->idrinfo->net);kfree (ipt->tcfi_t); }kfree (ipt->tcfi_tname);
@@ -172,7 +173,7 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla,spin_lock_bh (&ipt->tcf_lock);if (ret !=ACT_P_CREATED ) { -ipt_destroy_target (ipt->tcfi_t); +ipt_destroy_target (ipt->tcfi_t, net);kfree (ipt->tcfi_tname);kfree (ipt->tcfi_t); }
@@ -337,7 +338,7 @@ static __net_init int ipt_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, ipt_net_id); -return tc_action_net_init (tn, &act_ipt_ops); +return tc_action_net_init (net, tn, &act_ipt_ops); } static void __net_exit ipt_exit_net(struct net *net)
@@ -387,7 +388,7 @@ static __net_init int xt_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, xt_net_id); -return tc_action_net_init (tn, &act_xt_ops); +return tc_action_net_init (net, tn, &act_xt_ops); } static void __net_exit xt_exit_net(struct net *net)
net/sched/act_mirred.c +1 -1
@@ -343,7 +343,7 @@ static __net_init int mirred_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, mirred_net_id); -return tc_action_net_init (tn, &act_mirred_ops); +return tc_action_net_init (net, tn, &act_mirred_ops); } static void __net_exit mirred_exit_net(struct net *net)
net/sched/act_nat.c +1 -1
@@ -307,7 +307,7 @@ static __net_init int nat_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, nat_net_id); -return tc_action_net_init (tn, &act_nat_ops); +return tc_action_net_init (net, tn, &act_nat_ops); } static void __net_exit nat_exit_net(struct net *net)
net/sched/act_pedit.c +1 -1
@@ -458,7 +458,7 @@ static __net_init int pedit_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, pedit_net_id); -return tc_action_net_init (tn, &act_pedit_ops); +return tc_action_net_init (net, tn, &act_pedit_ops); } static void __net_exit pedit_exit_net(struct net *net)
net/sched/act_police.c +1 -1
@@ -331,7 +331,7 @@ static __net_init int police_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, police_net_id); -return tc_action_net_init (tn, &act_police_ops); +return tc_action_net_init (net, tn, &act_police_ops); } static void __net_exit police_exit_net(struct net *net)
net/sched/act_sample.c +5 -2
@@ -92,13 +92,16 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,tcf_idr_release (*a, bind);return -ENOMEM ; } -RCU_INIT_POINTER (s->psample_group, psample_group); +rcu_swap_protected (s->psample_group, psample_group, +lockdep_is_held (&s->tcf_lock));if (tb[TCA_SAMPLE_TRUNC_SIZE ]) { s->truncate = true; s->trunc_size =nla_get_u32 (tb[TCA_SAMPLE_TRUNC_SIZE ]); } +if (psample_group) +psample_group_put (psample_group);if (ret ==ACT_P_CREATED )tcf_idr_insert (tn, *a);return ret;
@@ -249,7 +252,7 @@ static __net_init int sample_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, sample_net_id); -return tc_action_net_init (tn, &act_sample_ops); +return tc_action_net_init (net, tn, &act_sample_ops); } static void __net_exit sample_exit_net(struct net *net)
net/sched/act_simple.c +1 -1
@@ -198,7 +198,7 @@ static __net_init int simp_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, simp_net_id); -return tc_action_net_init (tn, &act_simp_ops); +return tc_action_net_init (net, tn, &act_simp_ops); } static void __net_exit simp_exit_net(struct net *net)
net/sched/act_skbedit.c +1 -1
@@ -239,7 +239,7 @@ static __net_init int skbedit_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, skbedit_net_id); -return tc_action_net_init (tn, &act_skbedit_ops); +return tc_action_net_init (net, tn, &act_skbedit_ops); } static void __net_exit skbedit_exit_net(struct net *net)
net/sched/act_skbmod.c +1 -1
@@ -267,7 +267,7 @@ static __net_init int skbmod_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, skbmod_net_id); -return tc_action_net_init (tn, &act_skbmod_ops); +return tc_action_net_init (net, tn, &act_skbmod_ops); } static void __net_exit skbmod_exit_net(struct net *net)
net/sched/act_tunnel_key.c +1 -1
@@ -324,7 +324,7 @@ static __net_init int tunnel_key_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, tunnel_key_net_id); -return tc_action_net_init (tn, &act_tunnel_key_ops); +return tc_action_net_init (net, tn, &act_tunnel_key_ops); } static void __net_exit tunnel_key_exit_net(struct net *net)
net/sched/act_vlan.c +1 -1
@@ -271,7 +271,7 @@ static __net_init int vlan_init_net(struct net *net) {struct tc_action_net *tn =net_generic (net, vlan_net_id); -return tc_action_net_init (tn, &act_vlan_ops); +return tc_action_net_init (net, tn, &act_vlan_ops); } static void __net_exit vlan_exit_net(struct net *net)
tools/hv/hv_kvp_daemon.c +1 -1
@@ -867,7 +867,7 @@ kvp_get_ip_info(int family, char *if_name, int op,int sn_offset =0 ;int error =0 ;char *buffer; -struct hv_kvp_ipaddr_value *ip_buffer; +struct hv_kvp_ipaddr_value *ip_buffer =NULL ;char cidr_mask[5 ];/* /xyz */ int weight;int i;
virt/kvm/arm/mmio.c +7 -0
@@ -98,6 +98,12 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)unsigned int len;int mask; +/* Detect an already handled MMIO return */ +if (unlikely (!vcpu->mmio_needed)) +return 0 ; + + vcpu->mmio_needed =0 ; +if (!run->mmio.is_write) { len = run->mmio.len;if (len >sizeof (unsigned long ))
@@ -200,6 +206,7 @@ int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run, run->mmio.is_write = is_write; run->mmio.phys_addr = fault_ipa; run->mmio.len = len; + vcpu->mmio_needed =1 ;if (!ret) {/* We handled the access successfully in the kernel. */