3.16.50-rc1 review
Subsystems (4)
PATCH 2/294 iio: light: tsl2563: use correct event code
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Akinobu Mita <[email protected]>
commit a3507e48d3f99a93a3056a34a5365f310434570f upstream.
The TSL2563 driver provides three iio channels, two of which are raw ADC channels (channel 0 and channel 1) in the device and the remaining one is calculated by the two. The ADC channel 0 only supports programmable interrupt with threshold settings and this driver supports the event but the generated event code does not contain the corresponding iio channel type.
This is going to change userspace ABI. Hopefully fixing this to be what it should always have been won't break any userspace code.
--- drivers/iio/light/tsl2563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/tsl2563.c +1 -1
@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handlerstruct tsl2563_chip *chip =iio_priv (dev_info); iio_push_event(dev_info, - IIO_UNMOD_EVENT_CODE(IIO_LIGHT, + IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_EITHER),
PATCH 4/294 Raid5 should update rdev->sectors after reshape
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Xiao Ni <[email protected]>
commit b5d27718f38843a74552e9a93d32e2391fd3999f upstream.
The raid5 md device is created by the disks which we don't use the total size. For example, the size of the device is 5G and it just uses 3G of the devices to create one raid5 device. Then change the chunksize and wait reshape to finish. After reshape finishing stop the raid and assemble it again. It fails.
mdadm -CR /dev/md0 -l5 -n3 /dev/loop[0-2] --size=3G --chunk=32 --assume-clean mdadm /dev/md0 --grow --chunk=64
wait reshape to finish
mdadm -S /dev/md0
mdadm -As
The error messages:
[197519.814302] md: loop1 does not have a valid v1.2 superblock, not importing! [197519.821686] md: md_import_device returned -22
After reshape the data offset is changed. It selects backwards direction in this condition. In function super_1_load it compares the available space of the underlying device with sb->data_size. The new data offset gets bigger after reshape. So super_1_load returns -EINVAL. rdev->sectors is updated in md_finish_reshape. Then sb->data_size is set in super_1_sync based on rdev->sectors. So add md_finish_reshape in end_reshape.
--- drivers/md/raid5.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/md/raid5.c +1 -3
@@ -6741,12 +6741,10 @@ static void end_reshape(struct r5conf *c {if (!test_bit (MD_RECOVERY_INTR , &conf->mddev->recovery)) { -struct md_rdev *rdev;spin_lock_irq (&conf->device_lock); conf->previous_raid_disks = conf->raid_disks; -rdev_for_each (rdev, conf->mddev) - rdev->data_offset = rdev->new_data_offset; +md_finish_reshape (conf->mddev);smp_wmb (); conf->reshape_progress = MaxSector;spin_unlock_irq (&conf->device_lock);
PATCH 7/294 net/packet: Fix Tx queue selection for AF_PACKET
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Iván Briano <[email protected]>
commit ccd4eb49f3392ebf989d58bd013a7bf44cdca4d6 upstream.
When PACKET_QDISC_BYPASS is not used, Tx queue selection will be done before the packet is enqueued, taking into account any mappings set by a queuing discipline such as mqprio without hardware offloading. This selection may be affected by a previously saved queue_mapping, either on the Rx path, or done before the packet reaches the device, as it's currently the case for AF_PACKET.
In order for queue selection to work as expected when using traffic control, there can't be another selection done before that point is reached, so move the call to packet_pick_tx_queue to packet_direct_xmit, leaving the default xmit path as it was before PACKET_QDISC_BYPASS was introduced.
A forward declaration of packet_pick_tx_queue() is introduced to avoid the need to reorder the functions within the file.
--- net/packet/af_packet.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/packet/af_packet.c +2 -4
@@ -214,6 +214,7 @@ static void prb_clear_rxhash(struct tpacstatic void prb_fill_vlan_info (struct tpacket_kbdq_core *,struct tpacket3_hdr *);static void packet_flush_mclist (struct sock *sk); +static void packet_pick_tx_queue (struct net_device *dev,struct sk_buff *skb);struct packet_skb_cb {unsigned int origlen;
@@ -266,6 +267,7 @@ static int packet_direct_xmit(struct sk_ goto drop; } +packet_pick_tx_queue (dev, skb); queue_map =skb_get_queue_mapping (skb); txq =netdev_get_tx_queue (dev, queue_map);
@@ -2343,8 +2345,6 @@ static int tpacket_snd(struct packet_soc } } -packet_pick_tx_queue (dev, skb); - skb->destructor = tpacket_destruct_skb;__packet_set_status (po, ph,TP_STATUS_SENDING );packet_inc_pending (&po->tx_ring);
@@ -2551,8 +2551,6 @@ static int packet_snd(struct socket *soc skb->priority = sk->sk_priority; skb->mark = sk->sk_mark; -packet_pick_tx_queue (dev, skb); - if (po->has_vnet_hdr) { if (vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { if (!skb_partial_csum_set(skb, vnet_hdr.csum_start,
PATCH 12/294 net: bcmgenet: rewrite bcmgenet_rx_refill()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Petri Gynther <[email protected]>
commit d6707bec598649450ee0887bf11896e525777874 upstream.
Currently, bcmgenet_desc_rx() calls bcmgenet_rx_refill() at the end of Rx packet processing loop, after the current Rx packet has already been passed to napi_gro_receive(). However, bcmgenet_rx_refill() might fail to allocate a new Rx skb, thus leaving a hole on the Rx queue where no valid Rx buffer exists.
To eliminate this situation:
1. Rewrite bcmgenet_rx_refill() to retain the current Rx skb on the Rx queue if a new replacement Rx skb can't be allocated and DMA-mapped. In this case, the data on the current Rx skb is effectively dropped.
2. Modify bcmgenet_desc_rx() to call bcmgenet_rx_refill() at the top of Rx packet processing loop, so that the new replacement Rx skb is already in place before the current Rx skb is processed.
[bwh: Backported to 3.16:
- There's no alloc_rx_buff_failed statistic
- Adjust context]
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c +42 -56
@@ -1275,33 +1275,41 @@ out:return ret; } - -static int bcmgenet_rx_refill (struct bcmgenet_priv *priv, -struct enet_cb *cb) +static struct sk_buff *bcmgenet_rx_refill (struct bcmgenet_priv *priv, +struct enet_cb *cb) {struct device *kdev = &priv->pdev->dev;struct sk_buff *skb; +struct sk_buff *rx_skb;dma_addr_t mapping; -int ret; +/* Allocate a new Rx skb */ skb =netdev_alloc_skb (priv->dev, priv->rx_buf_len +SKB_ALIGNMENT ); -if (!skb) -return -ENOMEM ; +if (!skb) { +netif_err (priv, rx_err, priv->dev, +"%s: Rx skb allocation failed\n" , __func__); +return NULL ; + } -/* a caller did not release this control block */ -WARN_ON (cb->skb !=NULL ); - cb->skb = skb; - mapping =dma_map_single (kdev, skb->data, - priv->rx_buf_len,DMA_FROM_DEVICE ); - ret =dma_mapping_error (kdev, mapping); -if (ret) { -bcmgenet_free_cb (cb); +/* DMA-map the new Rx skb */ + mapping =dma_map_single (kdev, skb->data, priv->rx_buf_len, +DMA_FROM_DEVICE ); +if (dma_mapping_error (kdev, mapping)) { +dev_kfree_skb_any (skb);netif_err (priv, rx_err, priv->dev, -"%s DMA map failed\n" , __func__); -return ret; +"%s: Rx skb DMA mapping failed\n" , __func__); +return NULL ; } +/* Grab the current Rx skb from the ring and DMA-unmap it */ + rx_skb = cb->skb; +if (likely (rx_skb)) +dma_unmap_single (kdev,dma_unmap_addr (cb, dma_addr), + priv->rx_buf_len,DMA_FROM_DEVICE ); + +/* Put the new Rx skb on the ring */ + cb->skb = skb;dma_unmap_addr_set (cb, dma_addr, mapping);/* assign packet, prepare descriptor, and advance pointer */
@@ -1314,7 +1322,8 @@ static int bcmgenet_rx_refill(struct bcm priv->rx_bd_assign_ptr = priv->rx_bds + (priv->rx_bd_assign_index *DMA_DESC_SIZE ); -return 0 ; +/* Return the current Rx skb to caller */ +return rx_skb; }/* bcmgenet_desc_rx - descriptor based rx process.
@@ -1329,7 +1338,7 @@ static unsigned int bcmgenet_desc_rx(strstruct sk_buff *skb;u32 dma_length_status;unsigned long dma_flag; -int len, err; +int len;unsigned int rxpktprocessed =0 , rxpkttoprocess;unsigned int p_index;unsigned int chksum_ok =0 ;
@@ -1351,26 +1360,14 @@ static unsigned int bcmgenet_desc_rx(str (rxpktprocessed < budget)) { cb = &priv->rx_cbs[priv->rx_read_ptr]; - skb = cb->skb; + skb =bcmgenet_rx_refill (priv, cb); -/* We do not have a backing SKB, so we do not have a -* corresponding DMA mapping for this incoming packet since -* bcmgenet_rx_refill always either has both skb and mapping or -* none. -*/ if (unlikely (!skb)) { dev->stats.rx_dropped++; dev->stats.rx_errors++; - goto refill; + goto next; } -/* Unmap the packet contents such that we can use the -* RSV from the 64 bytes descriptor when enabled and save -* a 32-bits register read -*/ -dma_unmap_single (kdev,dma_unmap_addr (cb, dma_addr), - priv->rx_buf_len,DMA_FROM_DEVICE ); -if (!priv->desc_64b_en) { dma_length_status = dmadesc_get_length_status(priv, priv->rx_bds +
@@ -1398,10 +1395,10 @@ static unsigned int bcmgenet_desc_rx(str "Droping fragmented packet!\n"); dev->stats.rx_dropped++; dev->stats.rx_errors++; -dev_kfree_skb_any (cb->skb); - cb->skb =NULL ; - goto refill; +dev_kfree_skb_any (skb); + goto next; } +/* report errors */ if (unlikely(dma_flag & (DMA_RX_CRC_ERROR | DMA_RX_OV |
@@ -1420,11 +1417,8 @@ static unsigned int bcmgenet_desc_rx(str dev->stats.rx_length_errors++; dev->stats.rx_dropped++; dev->stats.rx_errors++; - -/* discard the packet and advance consumer index.*/ -dev_kfree_skb_any (cb->skb); - cb->skb =NULL ; - goto refill; +dev_kfree_skb_any (skb); + goto next; }/* error packet */ chksum_ok = (dma_flag & priv->dma_rx_chk_bit) &&
@@ -1457,15 +1451,9 @@ static unsigned int bcmgenet_desc_rx(str/* Notify kernel */ napi_gro_receive (&priv->napi, skb); - cb->skb =NULL ;netif_dbg (priv, rx_status, dev,"pushed up to kernel\n" ); -/* refill RX path on the current control block */ -refill: - err =bcmgenet_rx_refill (priv, cb); -if (err) -netif_err (priv, rx_err, dev,"Rx refill failed\n" ); - +next: rxpktprocessed++; priv->rx_read_ptr++; priv->rx_read_ptr &= (priv->num_rx_bds -1 );
@@ -1478,7 +1466,7 @@ refill:static int bcmgenet_alloc_rx_buffers (struct bcmgenet_priv *priv) {struct enet_cb *cb; -int ret =0 ; +struct sk_buff *skb;int i;netif_dbg (priv, hw, priv->dev,"%s:\n" , __func__);
@@ -1486,16 +1474,14 @@ static int bcmgenet_alloc_rx_buffers(str/* loop here for each buffer needing assign */ for (i =0 ; i < priv->num_rx_bds; i++) { cb = &priv->rx_cbs[priv->rx_bd_assign_index]; -if (cb->skb) -continue ; - - ret =bcmgenet_rx_refill (priv, cb); -if (ret) -break ; - + skb =bcmgenet_rx_refill (priv, cb); +if (skb) +dev_kfree_skb_any (skb); +if (!cb->skb) +return -ENOMEM ; } -return ret; +return 0 ; }static void bcmgenet_free_rx_buffers (struct bcmgenet_priv *priv)
PATCH 17/294 net: bcmgenet: Free skb after last Tx frag
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Doug Berger <[email protected]>
commit f48bed16a756f5bc0244acd581f61968f7d7c2a4 upstream.
Since the skb is attached to the first control block of a fragmented skb it is possible that the skb could be freed when reclaiming that control block before all fragments of the skb have been consumed by the hardware and unmapped.
This commit introduces first_cb and last_cb pointers to the skb control block used by the driver to keep track of which transmit control blocks within a transmit ring are the first and last ones associated with the skb.
It then splits the bcmgenet_free_cb() function into transmit (bcmgenet_free_tx_cb) and receive (bcmgenet_free_rx_cb) versions that can handle the unmapping of dma mapped memory and cleaning up the corresponding control block structure so that the skb is only freed after the last associated transmit control block is reclaimed.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 142 ++++++++++++++----------- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 + 2 files changed, 84 insertions(+), 60 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +81 -59
@@ -917,14 +917,6 @@ static struct enet_cb *bcmgenet_put_txcbreturn tx_cb_ptr; } -/* Simple helper to free a control block's resources */ -static void bcmgenet_free_cb (struct enet_cb *cb) -{ -dev_kfree_skb_any (cb->skb); - cb->skb =NULL ; -dma_unmap_addr_set (cb, dma_addr,0 ); -} -static inline void bcmgenet_tx_ring16_int_disable (struct bcmgenet_priv *priv,struct bcmgenet_tx_ring *ring) {
@@ -957,19 +949,73 @@ static inline void bcmgenet_tx_ring_int_ priv->int1_mask |= (1 << ring->index); } +/* Simple helper to free a transmit control block's resources +* Returns an skb when the last transmit control block associated with the +* skb is freed. The skb should be freed by the caller if necessary. +*/ +static struct sk_buff *bcmgenet_free_tx_cb (struct device *dev, +struct enet_cb *cb) +{ +struct sk_buff *skb; + + skb = cb->skb; + +if (skb) { + cb->skb =NULL ; +if (cb ==GENET_CB (skb)->first_cb) +dma_unmap_single (dev,dma_unmap_addr (cb, dma_addr), +dma_unmap_len (cb, dma_len), +DMA_TO_DEVICE ); +else +dma_unmap_page (dev,dma_unmap_addr (cb, dma_addr), +dma_unmap_len (cb, dma_len), +DMA_TO_DEVICE ); +dma_unmap_addr_set (cb, dma_addr,0 ); + +if (cb ==GENET_CB (skb)->last_cb) +return skb; + + }else if (dma_unmap_addr (cb, dma_addr)) { +dma_unmap_page (dev, +dma_unmap_addr (cb, dma_addr), +dma_unmap_len (cb, dma_len), +DMA_TO_DEVICE ); +dma_unmap_addr_set (cb, dma_addr,0 ); + } + +return 0 ; +} + +/* Simple helper to free a receive control block's resources */ +static struct sk_buff *bcmgenet_free_rx_cb (struct device *dev, +struct enet_cb *cb) +{ +struct sk_buff *skb; + + skb = cb->skb; + cb->skb =NULL ; + +if (dma_unmap_addr (cb, dma_addr)) { +dma_unmap_single (dev,dma_unmap_addr (cb, dma_addr), +dma_unmap_len (cb, dma_len),DMA_FROM_DEVICE ); +dma_unmap_addr_set (cb, dma_addr,0 ); + } + +return skb; +} +/* Unlocked version of the reclaim routine */ static void __bcmgenet_tx_reclaim (struct net_device *dev,struct bcmgenet_tx_ring *ring) {struct bcmgenet_priv *priv =netdev_priv (dev); -struct device *kdev = &priv->pdev->dev; -struct enet_cb *tx_cb_ptr;struct netdev_queue *txq; -unsigned int pkts_compl =0 ; +unsigned int txbds_processed =0 ;unsigned int bytes_compl =0 ; -unsigned int c_index; +unsigned int pkts_compl =0 ;unsigned int txbds_ready; -unsigned int txbds_processed =0 ; +unsigned int c_index; +struct sk_buff *skb;/* Compute how many buffers are transmited since last xmit call */ c_index =bcmgenet_tdma_ring_readl (priv, ring->index,TDMA_CONS_INDEX );
@@ -986,21 +1032,12 @@ static void __bcmgenet_tx_reclaim(struct/* Reclaim transmitted buffers */ while (txbds_processed < txbds_ready) { - tx_cb_ptr = &priv->tx_cbs[ring->clean_ptr]; -if (tx_cb_ptr->skb) { + skb =bcmgenet_free_tx_cb (&priv->pdev->dev, + &priv->tx_cbs[ring->clean_ptr]); +if (skb) { pkts_compl++; - bytes_compl +=GENET_CB (tx_cb_ptr->skb)->bytes_sent; -dma_unmap_single (kdev, -dma_unmap_addr (tx_cb_ptr, dma_addr), -dma_unmap_len (tx_cb_ptr, dma_len), -DMA_TO_DEVICE ); -bcmgenet_free_cb (tx_cb_ptr); - }else if (dma_unmap_addr (tx_cb_ptr, dma_addr)) { -dma_unmap_page (kdev, -dma_unmap_addr (tx_cb_ptr, dma_addr), -dma_unmap_len (tx_cb_ptr, dma_len), -DMA_TO_DEVICE ); -dma_unmap_addr_set (tx_cb_ptr, dma_addr,0 ); + bytes_compl +=GENET_CB (skb)->bytes_sent; +dev_kfree_skb_any (skb); } txbds_processed++;
@@ -1178,13 +1215,12 @@ static netdev_tx_t bcmgenet_xmit(structif (!i) {/* Transmit single SKB or head of fragment list */ - tx_cb_ptr->skb = skb; +GENET_CB (skb)->first_cb = tx_cb_ptr; size =skb_headlen (skb); mapping =dma_map_single (kdev, skb->data, size,DMA_TO_DEVICE ); }else {/* xmit fragment */ - tx_cb_ptr->skb =NULL ; frag = &skb_shinfo (skb)->frags[i -1 ]; size =skb_frag_size (frag); mapping = skb_frag_dma_map(kdev, frag, 0, size,
@@ -1200,6 +1236,8 @@ static netdev_tx_t bcmgenet_xmit(structdma_unmap_addr_set (tx_cb_ptr, dma_addr, mapping);dma_unmap_len_set (tx_cb_ptr, dma_len, size); + tx_cb_ptr->skb = skb; + len_stat = (size <<DMA_BUFLENGTH_SHIFT ) | (priv->hw_params->qtag_mask <<DMA_TX_QTAG_SHIFT );
@@ -1214,6 +1252,7 @@ static netdev_tx_t bcmgenet_xmit(structdmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, len_stat); } +GENET_CB (skb)->last_cb = tx_cb_ptr;skb_tx_timestamp (skb);/* Decrement total BD count and advance our write pointer */
@@ -1241,18 +1280,7 @@ out_unmap_frags:/* Unmap successfully mapped control blocks */ while (i-- >0 ) { tx_cb_ptr =bcmgenet_put_txcb (priv, ring); -if (tx_cb_ptr->skb) -dma_unmap_single (kdev, -dma_unmap_addr (tx_cb_ptr, dma_addr), -dma_unmap_len (tx_cb_ptr, dma_len), -DMA_TO_DEVICE ); -else -dma_unmap_page (kdev, -dma_unmap_addr (tx_cb_ptr, dma_addr), -dma_unmap_len (tx_cb_ptr, dma_len), -DMA_TO_DEVICE ); -dma_unmap_addr_set (tx_cb_ptr, dma_addr,0 ); - tx_cb_ptr->skb =NULL ; +bcmgenet_free_tx_cb (kdev, tx_cb_ptr); }dev_kfree_skb (skb);
@@ -1287,14 +1315,12 @@ static struct sk_buff *bcmgenet_rx_refil }/* Grab the current Rx skb from the ring and DMA-unmap it */ - rx_skb = cb->skb; -if (likely (rx_skb)) -dma_unmap_single (kdev,dma_unmap_addr (cb, dma_addr), - priv->rx_buf_len,DMA_FROM_DEVICE ); + rx_skb =bcmgenet_free_rx_cb (kdev, cb);/* Put the new Rx skb on the ring */ cb->skb = skb;dma_unmap_addr_set (cb, dma_addr, mapping); +dma_unmap_len_set (cb, dma_len, priv->rx_buf_len);/* assign packet, prepare descriptor, and advance pointer */ dmadesc_set_addr (priv, priv->rx_bd_assign_ptr, mapping);
@@ -1470,22 +1496,16 @@ static int bcmgenet_alloc_rx_buffers(strstatic void bcmgenet_free_rx_buffers (struct bcmgenet_priv *priv) { -struct device *kdev = &priv->pdev->dev; +struct sk_buff *skb;struct enet_cb *cb;int i;for (i =0 ; i < priv->num_rx_bds; i++) { cb = &priv->rx_cbs[i]; -if (dma_unmap_addr (cb, dma_addr)) { -dma_unmap_single (kdev, -dma_unmap_addr (cb, dma_addr), - priv->rx_buf_len,DMA_FROM_DEVICE ); -dma_unmap_addr_set (cb, dma_addr,0 ); - } - -if (cb->skb) -bcmgenet_free_cb (cb); + skb =bcmgenet_free_rx_cb (&priv->pdev->dev, cb); +if (skb) +dev_kfree_skb_any (skb); } }
@@ -1762,6 +1782,8 @@ static void bcmgenet_init_multiq(structstatic void bcmgenet_fini_dma (struct bcmgenet_priv *priv) { +struct sk_buff *skb; +struct enet_cb *cb;int i;/* disable DMA */
@@ -1769,10 +1791,10 @@ static void bcmgenet_fini_dma(struct bcmbcmgenet_tdma_writel (priv,0 ,DMA_CTRL );for (i =0 ; i < priv->num_tx_bds; i++) { -if (priv->tx_cbs[i].skb !=NULL ) { -dev_kfree_skb (priv->tx_cbs[i].skb); - priv->tx_cbs[i].skb =NULL ; - } + cb = priv->tx_cbs + i; + skb =bcmgenet_free_tx_cb (&priv->pdev->dev, cb); +if (skb) +dev_kfree_skb (skb); }bcmgenet_free_rx_buffers (priv);
drivers/net/ethernet/broadcom/genet/bcmgenet.h +2 -0
@@ -505,6 +505,8 @@ struct bcmgenet_hw_params { };struct bcmgenet_skb_cb { +struct enet_cb *first_cb;/* First control block of SKB */ +struct enet_cb *last_cb;/* Last control block of SKB */ unsigned int bytes_sent;/* bytes on the wire (no TSB) */ };
PATCH 18/294 i2c: mux: pinctrl: mention correct module name in Kconfig help text
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chris Gorman <[email protected]>
commit d1510a2e5ab6cb3a67f1c55ca5e7a6d2c6dec340 upstream.
Kconfig says the resulting module is pinctrl-i2cmux, but the module when built is i2c-mux-pinctrl.
--- drivers/i2c/muxes/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/muxes/Kconfig +1 -1
@@ -58,6 +58,6 @@ config I2C_MUX_PINCTRL different sets of pins at run-time. This driver can also be built as a module. If so, the module will be - called pinctrl-i2cmux. + called i2c-mux-pinctrl. endmenu
PATCH 23/294 of: device: Export of_device_{get_modalias, uvent_modalias} to modules
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit 7a3b7cd332db08546f3cdd984f11773e0d1999e7 upstream.
The ULPI bus can be built as a module, and it will soon be calling these functions when it supports probing devices from DT. Export them so they can be used by the ULPI module.
--- drivers/of/device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/of/device.c +2 -0
@@ -128,6 +128,7 @@ ssize_t of_device_get_modalias(struct dereturn tsize; } +EXPORT_SYMBOL_GPL (of_device_get_modalias);/** * of_device_uevent - Display OF related uevent information
@@ -190,3 +191,4 @@ int of_device_uevent_modalias(struct devreturn 0 ; } +EXPORT_SYMBOL_GPL (of_device_uevent_modalias);
PATCH 26/294 drm/vmwgfx: Fix gcc-7.1.1 warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sinclair Yeh <[email protected]>
commit fcfffdd8f98ac305285dca568b5065ef86be6458 upstream.
The current code does not look correct, and the reason for it is probably lost. Since this now generates a compiler warning, fix it to what makes sense.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +1 -1
@@ -285,7 +285,7 @@ static int vmw_cmd_invalid(struct vmw_prstruct vmw_sw_context *sw_context, SVGA3dCmdHeader *header) { - return capable(CAP_SYS_ADMIN) ? : -EINVAL; + return -EINVAL; } static int vmw_cmd_ok(struct vmw_private *dev_priv,
PATCH 44/294 cxgb4: Fix error codes in c4iw_create_cq()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 6ebedacbb44602d4dec3348dee5ec31dd9b09521 upstream.
If one of these kmalloc() calls fails then we return ERR_PTR(0) which is NULL. It results in a NULL dereference in the callers.
--- drivers/infiniband/hw/cxgb4/cq.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/cxgb4/cq.c +1 -0
@@ -938,6 +938,7 @@ struct ib_cq *c4iw_create_cq(struct ib_d goto err2;if (ucontext) { + ret = -ENOMEM ; mm =kmalloc (sizeof *mm,GFP_KERNEL );if (!mm) goto err3;
PATCH 50/294 RDMA/uverbs: Fix the check for port number
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Ismail, Mustafa" <[email protected]>
commit 5a7a88f1b488e4ee49eb3d5b82612d4d9ffdf2c3 upstream.
The port number is only valid if IB_QP_PORT is set in the mask. So only check port number if it is valid to prevent modify_qp from failing due to an invalid port number.
--- drivers/infiniband/core/uverbs_cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/uverbs_cmd.c +2 -1
@@ -1915,7 +1915,8 @@ ssize_t ib_uverbs_modify_qp(struct ib_uv goto out; } -if (!rdma_is_port_valid (qp->device, cmd.port_num)) { +if ((cmd.attr_mask &IB_QP_PORT ) && + !rdma_is_port_valid (qp->device, cmd.port_num)) { ret = -EINVAL ; goto release_qp; }
PATCH 74/294 USB: hcd: Mark secondary HCD as dead if the primary one died
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
commit cd5a6a4fdaba150089af2afc220eae0fef74878a upstream.
Make usb_hc_died() clear the HCD_FLAG_RH_RUNNING flag for the shared HCD and set HCD_FLAG_DEAD for it, in analogy with what is done for the primary one.
Among other thigs, this prevents check_root_hub_suspended() from returning -EBUSY for dead HCDs which helps to work around system suspend issues in some situations.
This actually fixes occasional suspend failures on one of my test machines.
--- drivers/usb/core/hcd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/core/hcd.c +2 -0
@@ -2402,6 +2402,8 @@ void usb_hc_died (struct usb_hcd *hcd) }if (usb_hcd_is_primary_hcd (hcd) && hcd->shared_hcd) { hcd = hcd->shared_hcd; +clear_bit (HCD_FLAG_RH_RUNNING , &hcd->flags); +set_bit (HCD_FLAG_DEAD , &hcd->flags);if (hcd->rh_registered) {clear_bit (HCD_FLAG_POLL_RH , &hcd->flags);
PATCH 80/294 xtensa: mm/cache: add missing EXPORT_SYMBOLs
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Max Filippov <[email protected]>
commit bc652eb6a0d5cffaea7dc8e8ad488aab2a1bf1ed upstream.
Functions clear_user_highpage, copy_user_highpage, flush_dcache_page, local_flush_cache_range and local_flush_cache_page may be used from modules. Export them.
---
arch/xtensa/mm/cache.c +3 -1
@@ -116,7 +116,7 @@ void flush_dcache_page(struct page *page/* There shouldn't be an entry in the cache for this page anymore. */ } - +EXPORT_SYMBOL (flush_dcache_page);/* * For now, flush the whole cache. FIXME??
@@ -128,6 +128,7 @@ void local_flush_cache_range(struct vm_a__flush_invalidate_dcache_all ();__invalidate_icache_all (); } +EXPORT_SYMBOL (local_flush_cache_range);/* * Remove any entry in the cache for this page.
@@ -147,6 +148,7 @@ void local_flush_cache_page(struct vm_ar__flush_invalidate_dcache_page_alias (virt, phys); __invalidate_icache_page_alias(virt, phys); } +EXPORT_SYMBOL (local_flush_cache_page);#endif /* DCACHE_WAY_SIZE > PAGE_SIZE */
PATCH 94/294 IB/uverbs: Fix device cleanup
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <[email protected]>
commit efdd6f53b10aead0f5cf19a93dd3eb268ac0d991 upstream.
Uverbs device should be cleaned up only when there is no potential usage of.
As part of ib_uverbs_remove_one which might be triggered upon reset flow the device reference count is decreased as expected and leave the final cleanup to the FDs that were opened.
Current code increases reference count upon opening a new command FD and decreases it upon closing the file. The event FD is opened internally and rely on the command FD by taking on it a reference count.
In case that the command FD was closed and just later the event FD we may ensure that the device resources as of srcu are still alive as they are still in use.
Fixing the above by moving the reference count decreasing to the place where the command FD is really freed instead of doing that when it was just closed.
--- drivers/infiniband/core/uverbs_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/core/uverbs_main.c +1 -2
@@ -315,6 +315,7 @@ static void ib_uverbs_release_file(strucif (atomic_dec_and_test (&file->device->refcount))ib_uverbs_comp_dev (file->device); +kobject_put (&file->device->kobj);kfree (file); }
@@ -784,7 +785,6 @@ err:static int ib_uverbs_close (struct inode *inode,struct file *filp) {struct ib_uverbs_file *file = filp->private_data; -struct ib_uverbs_device *dev = file->device;ib_uverbs_cleanup_ucontext (file, file->ucontext);
@@ -792,7 +792,6 @@ static int ib_uverbs_close(struct inodekref_put (&file->async_file->ref, ib_uverbs_release_event_file);kref_put (&file->ref, ib_uverbs_release_file); -kobject_put (&dev->kobj);return 0 ; }
PATCH 96/294 ext4: fix overflow caused by missing cast in ext4_resize_fs()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jerry Lee <[email protected]>
commit aec51758ce10a9c847a62a48a168f8c804c6e053 upstream.
On a 32-bit platform, the value of n_blcoks_count may be wrong during the file system is resized to size larger than 2^32 blocks. This may caused the superblock being corrupted with zero blocks count.
--- fs/ext4/resize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/resize.c +2 -1
@@ -1929,7 +1929,8 @@ retry: n_desc_blocks = o_desc_blocks +le16_to_cpu (es->s_reserved_gdt_blocks); n_group = n_desc_blocks *EXT4_DESC_PER_BLOCK (sb); - n_blocks_count = n_group *EXT4_BLOCKS_PER_GROUP (sb); + n_blocks_count = (ext4_fsblk_t )n_group * +EXT4_BLOCKS_PER_GROUP (sb); n_group--;/* set to last group number */ }
PATCH 99/294 s390/qeth: fix L3 next-hop in xmit qeth hdr
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Julian Wiedmann <[email protected]>
commit ec2c6726322f0d270bab477e4904bf9496f70ee5 upstream.
On L3, the qeth_hdr struct needs to be filled with the next-hop IP address.
The current code accesses rtable->rt_gateway without checking that rtable is a valid address. The accidental access to a lowcore area results in a random next-hop address in the qeth_hdr. rtable (or more precisely, skb_dst(skb)) can be NULL in rare cases (for instance together with AF_PACKET sockets).
This patch adds the missing NULL-ptr checks.
--- drivers/s390/net/qeth_l3_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_l3_main.c +2 -2
@@ -2816,7 +2816,7 @@ static void qeth_l3_fill_header(struct qstruct rtable *rt = (struct rtable *) dst;__be32 *pkey = &ip_hdr (skb)->daddr; -if (rt->rt_gateway) +if (rt && rt->rt_gateway) pkey = &rt->rt_gateway;/* IPv4 */
@@ -2827,7 +2827,7 @@ static void qeth_l3_fill_header(struct qstruct rt6_info *rt = (struct rt6_info *) dst;struct in6_addr *pkey = &ipv6_hdr (skb)->daddr; -if (!ipv6_addr_any (&rt->rt6i_gateway)) +if (rt && !ipv6_addr_any (&rt->rt6i_gateway)) pkey = &rt->rt6i_gateway;/* IPv6 */
PATCH 114/294 dst: Increase alignment of metrics to allow extra flag on pointers
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
For the backport of "ipv4: add reference counting to metrics", we will need a third flag on metrics pointers. This was not needed upstream as the DST_METRICS_FORCE_OVERWRITE flag has been eliminated there. In order to use three flag bits we need to increase the alignment of metrics from 4 to 8 bytes.
---
include/net/dst.h +4 -1
@@ -105,12 +105,15 @@ struct dst_entry { }; }; +void *dst_alloc_metrics (gfp_t flags); +void dst_free_metrics (void *metrics);u32 *dst_cow_metrics_generic (struct dst_entry *dst,unsigned long old);extern const u32 dst_default_metrics[];#define DST_METRICS_READ_ONLY 0x1UL#define DST_METRICS_FORCE_OVERWRITE 0x2UL -#define DST_METRICS_FLAGS 0x3UL +#define DST_METRICS_FLAGS 0x7UL +#define DST_METRICS_ALIGNMENT 0x8UL#define __DST_METRICS_PTR (Y ) \ ((u32 *)((Y) & ~DST_METRICS_FLAGS))#define DST_METRICS_PTR (X ) __DST_METRICS_PTR((X)->_metrics)
net/bridge/br_netfilter.c +1 -1
@@ -155,7 +155,7 @@ static struct dst_ops fake_dst_ops = {* ipt_REJECT needs it. Future netfilter modules might * require us to fill additional fields. */ -static const u32 br_dst_default_metrics[RTAX_MAX ] = { +static const u32 br_dst_default_metrics[RTAX_MAX ]__aligned(DST_METRICS_ALIGNMENT) = { [RTAX_MTU -1 ] =1500 , };
net/core/dst.c +22 -4
@@ -149,7 +149,7 @@ int dst_discard_sk(struct sock *sk, stru }EXPORT_SYMBOL (dst_discard_sk); -const u32 dst_default_metrics[RTAX_MAX +1 ] = { +const u32 dst_default_metrics[RTAX_MAX +1 ]__aligned(DST_METRICS_ALIGNMENT) = {/* This initializer is needed to force linker to place this variable * into const section. Otherwise it might end into bss section. * We really want to avoid false sharing on this variable, and catch
@@ -292,9 +292,23 @@ void dst_release(struct dst_entry *dst) }EXPORT_SYMBOL (dst_release); +static struct kmem_cache *metrics_cache; + +void *dst_alloc_metrics (gfp_t flags) +{ +return kmem_cache_alloc (metrics_cache, flags); +} +EXPORT_SYMBOL (dst_alloc_metrics); + +void dst_free_metrics (void *metrics) +{ +kmem_cache_free (metrics_cache, metrics); +} +EXPORT_SYMBOL (dst_free_metrics); +u32 *dst_cow_metrics_generic (struct dst_entry *dst,unsigned long old) { -u32 *p =kmalloc (sizeof (u32) *RTAX_MAX ,GFP_ATOMIC ); +u32 *p =dst_alloc_metrics (GFP_ATOMIC );if (p) {u32 *old_p =__DST_METRICS_PTR (old);
@@ -306,7 +320,7 @@ u32 *dst_cow_metrics_generic(struct dst_ prev =cmpxchg (&dst->_metrics, old, new);if (prev != old) { -kfree (p); +dst_free_metrics (p); p =__DST_METRICS_PTR (prev);if (prev &DST_METRICS_READ_ONLY ) p =NULL ;
@@ -324,7 +338,7 @@ void __dst_destroy_metrics_generic(struc new = ((unsigned long ) dst_default_metrics) |DST_METRICS_READ_ONLY ; prev =cmpxchg (&dst->_metrics, old, new);if (prev == old) -kfree (__DST_METRICS_PTR (old)); +dst_free_metrics (__DST_METRICS_PTR (old)); }EXPORT_SYMBOL (__dst_destroy_metrics_generic);
@@ -419,4 +433,8 @@ static struct notifier_block dst_dev_notvoid __init dst_init (void ) {register_netdevice_notifier (&dst_dev_notifier); + metrics_cache =kmem_cache_create ("dst_metrics" , +sizeof (u32) *RTAX_MAX , +DST_METRICS_ALIGNMENT , +SLAB_PANIC ,NULL ); }
net/core/pktgen.c +1 -1
@@ -2502,7 +2502,7 @@ static void mod_cur_headers(struct pktge#ifdef CONFIG_XFRM -static u32 pktgen_dst_metrics[RTAX_MAX +1 ] = { +static u32 pktgen_dst_metrics[RTAX_MAX +1 ]__aligned(DST_METRICS_ALIGNMENT) = { [RTAX_HOPLIMIT ] =0x5 ,/* Set a static hoplimit */ };
net/ipv4/fib_semantics.c +2 -2
@@ -213,7 +213,7 @@ static void free_fib_info_rcu(struct rcurelease_net (fi->fib_net);if (fi->fib_metrics != (u32 *) dst_default_metrics) -kfree (fi->fib_metrics); +dst_free_metrics (fi->fib_metrics);kfree (fi); }
@@ -823,7 +823,7 @@ struct fib_info *fib_create_info(struct goto failure; fib_info_cnt++;if (cfg->fc_mx) { - fi->fib_metrics =kzalloc (sizeof (u32) *RTAX_MAX ,GFP_KERNEL ); + fi->fib_metrics =dst_alloc_metrics (GFP_KERNEL | __GFP_ZERO);if (!fi->fib_metrics) goto failure; }else
net/ipv6/route.c +1 -1
@@ -247,7 +247,7 @@ static struct dst_ops ip6_dst_blackhole_ .neigh_lookup = ip6_neigh_lookup, }; -static const u32 ip6_template_metrics[RTAX_MAX ] = { +static const u32 ip6_template_metrics[RTAX_MAX ]__aligned(DST_METRICS_ALIGNMENT) = { [RTAX_HOPLIMIT -1 ] =0 , };
net/ipv6/ip6_fib.c +1 -1
@@ -643,7 +643,7 @@ static int fib6_commit_metrics(struct dsif (dst->flags &DST_HOST ) { mp =dst_metrics_write_ptr (dst); }else { - mp =kzalloc (sizeof (u32) *RTAX_MAX ,GFP_ATOMIC ); + mp =dst_alloc_metrics (GFP_ATOMIC | __GFP_ZERO);if (!mp)return -ENOMEM ;dst_init_metrics (dst, mp,0 );
PATCH 119/294 ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 0f174b3525a43bd51f9397394763925e0ebe7bc7 upstream.
C-Media devices (at least some models) mute the playback stream when volumes are set to the minimum value. But this isn't informed via TLV and the user-space, typically PulseAudio, gets confused as if it's still played in a low volume.
This patch adds the new flag, min_mute, to struct usb_mixer_elem_info for indicating that the mixer element is with the minimum-mute volume. This flag is set for known C-Media devices in snd_usb_mixer_fu_apply_quirk() in turn.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196669
--- sound/usb/mixer.c | 2 ++ sound/usb/mixer.h | 1 + sound/usb/mixer_quirks.c | 6 ++++++ 3 files changed, 9 insertions(+)
sound/usb/mixer.c +2 -0
@@ -533,6 +533,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcoif (size <sizeof (scale))return -ENOMEM ; +if (cval->min_mute) + scale[0 ] =SNDRV_CTL_TLVT_DB_MINMAX_MUTE ; scale[2 ] = cval->dBmin; scale[3 ] = cval->dBmax;if (copy_to_user (_tlv, scale,sizeof (scale)))
sound/usb/mixer.h +1 -0
@@ -53,6 +53,7 @@ struct usb_mixer_elem_info {int cached;int cache_val[MAX_CHANNELS ];u8 initialized; +u8 min_mute; }; int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
sound/usb/mixer_quirks.c +6 -0
@@ -1759,6 +1759,12 @@ void snd_usb_mixer_fu_apply_quirk(structif (unitid ==7 && cval->control ==UAC_FU_VOLUME )snd_dragonfly_quirk_db_scale (mixer, cval, kctl);break ; +/* lowest playback value is muted on C-Media devices */ +case USB_ID (0x0d8c ,0x000c ): +case USB_ID (0x0d8c ,0x0014 ): +if (strstr (kctl->id.name,"Playback" )) + cval->min_mute =1 ; +break ; } }
PATCH 126/294 net_sched: fix order of queue length updates in qdisc_replace()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <[email protected]>
commit 68a66d149a8c78ec6720f268597302883e48e9fa upstream.
This important to call qdisc_tree_reduce_backlog() after changing queue length. Parent qdisc should deactivate class in ->qlen_notify() called from qdisc_tree_reduce_backlog() but this happens only if qdisc->q.qlen in zero.
Missed class deactivations leads to crashes/warnings at picking packets from empty qdisc and corrupting state at reactivating this class in future.
--- include/net/sch_generic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/net/sch_generic.h +4 -1
@@ -618,8 +618,11 @@ static inline struct Qdisc *qdisc_replac old = *pold; *pold = new;if (old !=NULL ) { -qdisc_tree_reduce_backlog (old, old->q.qlen, old->qstats.backlog); +unsigned int qlen = old->q.qlen; +unsigned int backlog = old->qstats.backlog; +qdisc_reset (old); +qdisc_tree_reduce_backlog (old, qlen, backlog); }sch_tree_unlock (sch);
PATCH 128/294 ALSA: core: Fix unexpected error at replacing user TLV
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 88c54cdf61f508ebcf8da2d819f5dfc03e954d1d upstream.
When user tries to replace the user-defined control TLV, the kernel checks the change of its content via memcmp(). The problem is that the kernel passes the return value from memcmp() as is. memcmp() gives a non-zero negative value depending on the comparison result, and this shall be recognized as an error code.
The patch covers that corner-case, return 1 properly for the changed TLV.
--- sound/core/control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control.c +1 -1
@@ -1087,7 +1087,7 @@ static int snd_ctl_elem_user_tlv(structmutex_lock (&ue->card->user_ctl_lock); change = ue->tlv_data_size != size;if (!change) - change =memcmp (ue->tlv_data, new_data, size); + change =memcmp (ue->tlv_data, new_data, size) !=0 ;kfree (ue->tlv_data); ue->tlv_data = new_data; ue->tlv_data_size = size;
PATCH 134/294 cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ronnie Sahlberg <[email protected]>
commit d3edede29f74d335f81d95a4588f5f136a9f7dcf upstream.
Add checking for the path component length and verify it is <= the maximum that the server advertizes via FileFsAttributeInformation.
With this patch cifs.ko will now return ENAMETOOLONG instead of ENOENT when users to access an overlong path.
To test this, try to cd into a (non-existing) directory on a CIFS share that has a too long name:
cd /mnt/aaaaaaaaaaaaaaa...
and it now should show a good error message from the shell:
bash: cd: /mnt/aaaaaaaaaaaaaaaa...aaaaaa: File name too long
rh bz 1153996
--- fs/cifs/dir.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
fs/cifs/dir.c +12 -6
@@ -183,15 +183,20 @@ cifs_bp_rename_retry: }/* +* Don't allow path components longer than the server max. * Don't allow the separator character in a path component. * The VFS will not allow "/", but "\" is allowed by posix. */ static int -check_name (struct dentry *direntry) +check_name (struct dentry *direntry,struct cifs_tcon *tcon) {struct cifs_sb_info *cifs_sb =CIFS_SB (direntry->d_sb);int i; +if (unlikely (direntry->d_name.len > + tcon->fsAttrInfo.MaxPathNameComponentLength)) +return -ENAMETOOLONG ; +if (!(cifs_sb->mnt_cifs_flags &CIFS_MOUNT_POSIX_PATHS )) {for (i =0 ; i < direntry->d_name.len; i++) {if (direntry->d_name.name[i] =='\\' ) {
@@ -489,10 +494,6 @@ cifs_atomic_open(struct inode *inode, streturn finish_no_open (file, res); } - rc =check_name (direntry); -if (rc) -return rc; - xid =get_xid (); cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
@@ -505,6 +506,11 @@ cifs_atomic_open(struct inode *inode, st } tcon =tlink_tcon (tlink); + + rc =check_name (direntry, tcon); +if (rc) + goto out_free_xid; + server = tcon->ses->server;if (server->ops->new_lease_key)
@@ -752,7 +758,7 @@ cifs_lookup(struct inode *parent_dir_ino } pTcon =tlink_tcon (tlink); - rc =check_name (direntry); + rc =check_name (direntry, pTcon);if (rc) goto lookup_out;
PATCH 139/294 net: bcmgenet: Be drop monitor friendly
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit d4fec855905fa8bd5fb1c59f73ad2d74a944876a upstream.
There are 3 spots where we call dev_kfree_skb() but we are actually just doing a normal SKB consumption: __bcmgenet_tx_reclaim() for normal TX reclamation, bcmgenet_alloc_rx_buffers() during the initial RX ring setup and bcmgenet_free_rx_buffers() during RX ring cleanup.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -3
@@ -1037,7 +1037,7 @@ static void __bcmgenet_tx_reclaim(structif (skb) { pkts_compl++; bytes_compl +=GENET_CB (skb)->bytes_sent; -dev_kfree_skb_any (skb); +dev_consume_skb_any (skb); } txbds_processed++;
@@ -1486,7 +1486,7 @@ static int bcmgenet_alloc_rx_buffers(str cb = &priv->rx_cbs[priv->rx_bd_assign_index]; skb =bcmgenet_rx_refill (priv, cb);if (skb) -dev_kfree_skb_any (skb); +dev_consume_skb_any (skb);if (!cb->skb)return -ENOMEM ; }
@@ -1505,7 +1505,7 @@ static void bcmgenet_free_rx_buffers(str skb =bcmgenet_free_rx_cb (&priv->pdev->dev, cb);if (skb) -dev_kfree_skb_any (skb); +dev_consume_skb_any (skb); } }
PATCH 141/294 mtd: nandsim: remove debugfs entries in error path
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
commit b974696da1cfc5aa0c29ed97dc8f6c239899e64b upstream.
The debugfs entries must be removed before an error is returned in the probe function. Otherwise another try to load the module fails and when the debugfs files are accessed without the module loaded, the kernel still tries to call a function in that module.
--- drivers/mtd/nand/nandsim.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/nandsim.c +1 -0
@@ -2387,6 +2387,7 @@ static int __init ns_init_module(void)return 0 ; err_exit: +nandsim_debugfs_remove (nand);free_nandsim (nand);nand_release (nsmtd);for (i =0 ;i <ARRAY_SIZE (nand->partitions); ++i)
PATCH 142/294 netvsc: fix deadlock betwen link status and removal
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: stephen hemminger <[email protected]>
commit 9b4e946ce14e20d7addbfb7d9139e604f9fda107 upstream.
There is a deadlock possible when canceling the link status delayed work queue. The removal process is run with RTNL held, and the link status callback is acquring RTNL.
Resolve the issue by using trylock and rescheduling. If cancel is in process, that block it from happening.
[bwh: Backported to 3.16:
- Move assignment of ndev_ctx before this new use
- LINKCHANGE_INT is not defined; substitute its upstream definition]
---
drivers/net/hyperv/netvsc_drv.c +7 -2
@@ -777,9 +777,14 @@ static void netvsc_link_change(struct wostruct rndis_device *rdev;bool notify; -rtnl_lock (); - ndev_ctx = container_of(w, struct net_device_context, dwork.work); + +/* if changes are happening, comeback later */ +if (!rtnl_trylock ()) { +schedule_delayed_work (&ndev_ctx->dwork,2 *HZ ); +return ; + } + net_device =hv_get_drvdata (ndev_ctx->device_ctx); rdev = net_device->extension; net = net_device->ndev;
PATCH 145/294 ipv6: Add rt6_get_cookie() function
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Martin KaFai Lau <[email protected]>
commit b197df4f0f3782782e9ea8996e91b65ae33e8dd9 upstream.
Instead of doing the rt6->rt6i_node check whenever we need to get the route's cookie. Refactor it into rt6_get_cookie(). It is a prep work to handle FLOWI_FLAG_KNOWN_NH and also percpu rt6_info later.
--- include/net/ip6_fib.h | 5 +++++ include/net/ip6_route.h | 2 +- net/ipv6/ip6_tunnel.c | 2 +- net/ipv6/tcp_ipv6.c | 3 +-- net/ipv6/xfrm6_policy.c | 6 ++---- net/netfilter/ipvs/ip_vs_xmit.c | 2 +- net/sctp/ipv6.c | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-)
include/net/ip6_fib.h +5 -0
@@ -193,6 +193,11 @@ static inline void rt6_set_from(struct r rt->dst.from = new; } +static inline u32 rt6_get_cookie (const struct rt6_info *rt) +{ +return rt->rt6i_node ? rt->rt6i_node->fn_sernum :0 ; +} +static inline void ip6_rt_put (struct rt6_info *rt) {/* dst_release() accepts a NULL parameter.
include/net/ip6_route.h +1 -1
@@ -146,7 +146,7 @@ static inline void __ip6_dst_store(struc#ifdef CONFIG_IPV6_SUBTREES np->saddr_cache = saddr;#endif - np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum :0 ; + np->dst_cookie =rt6_get_cookie (rt); } static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
net/ipv6/ip6_tunnel.c +1 -1
@@ -157,7 +157,7 @@ EXPORT_SYMBOL_GPL(ip6_tnl_dst_reset);void ip6_tnl_dst_store (struct ip6_tnl *t,struct dst_entry *dst) {struct rt6_info *rt = (struct rt6_info *) dst; - t->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum :0 ; + t->dst_cookie =rt6_get_cookie (rt);dst_release (t->dst_cache); t->dst_cache = dst; }
net/ipv6/tcp_ipv6.c +1 -2
@@ -98,8 +98,7 @@ static void inet6_sk_rx_dst_set(struct sdst_hold (dst); sk->sk_rx_dst = dst;inet_sk (sk)->rx_dst_ifindex = skb->skb_iif; -if (rt->rt6i_node) -inet6_sk (sk)->rx_dst_cookie = rt->rt6i_node->fn_sernum; +inet6_sk (sk)->rx_dst_cookie =rt6_get_cookie (rt); }static void tcp_v6_hash (struct sock *sk)
net/ipv6/xfrm6_policy.c +2 -4
@@ -85,8 +85,7 @@ static int xfrm6_init_path(struct xfrm_d {if (dst->ops->family ==AF_INET6 ) {struct rt6_info *rt = (struct rt6_info *)dst; -if (rt->rt6i_node) - path->path_cookie = rt->rt6i_node->fn_sernum; + path->path_cookie =rt6_get_cookie (rt); } path->u.rt6.rt6i_nfheader_len = nfheader_len;
@@ -116,8 +115,7 @@ static int xfrm6_fill_dst(struct xfrm_ds RTF_LOCAL); xdst->u.rt6.rt6i_metric = rt->rt6i_metric; xdst->u.rt6.rt6i_node = rt->rt6i_node; -if (rt->rt6i_node) - xdst->route_cookie = rt->rt6i_node->fn_sernum; + xdst->route_cookie =rt6_get_cookie (rt); xdst->u.rt6.rt6i_gateway = rt->rt6i_gateway; xdst->u.rt6.rt6i_dst = rt->rt6i_dst; xdst->u.rt6.rt6i_src = rt->rt6i_src;
net/netfilter/ipvs/ip_vs_xmit.c +1 -1
@@ -373,7 +373,7 @@ __ip_vs_get_out_rt_v6(struct sk_buff *sk goto err_unreach; } rt = (struct rt6_info *) dst; - cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum :0 ; + cookie =rt6_get_cookie (rt);__ip_vs_dst_set (dest, dest_dst, &rt->dst, cookie);spin_unlock_bh (&dest->dst_lock); IP_VS_DBG(10, "new dst %pI6, src %pI6, refcnt=%d\n",
net/sctp/ipv6.c +1 -1
@@ -331,7 +331,7 @@ out: rt = (struct rt6_info *)dst; t->dst = dst; - t->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum :0 ; + t->dst_cookie =rt6_get_cookie (rt);pr_debug ("rt6_dst:%pI6 rt6_src:%pI6\n" , &rt->rt6i_dst.addr, &fl6->saddr); }else {
PATCH 148/294 r8169: Do not increment tx_dropped in TX ring cleaning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 1089650d8837095f63e001bbf14d7b48043d67ad upstream.
rtl8169_tx_clear_range() is responsible for cleaning up the TX ring during interface shutdown, incrementing tx_dropped for every SKB that we left at the time in the ring is misleading.
--- drivers/net/ethernet/realtek/r8169.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/realtek/r8169.c +0 -1
@@ -5860,7 +5860,6 @@ static void rtl8169_tx_clear_range(strucrtl8169_unmap_tx_skb (&tp->pci_dev->dev, tx_skb, tp->TxDescArray + entry);if (skb) { - tp->dev->stats.tx_dropped++;dev_kfree_skb_any (skb); tx_skb->skb =NULL ; }
PATCH 165/294 x86/ldt: Fix off by one in get_segment_base()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit eaa2f87c6b840b83827c40db6eb8481689570259 upstream.
ldt->entries[] is allocated in alloc_ldt_struct(). It has ldt->nr_entries elements and ldt->nr_entries is capped at LDT_ENTRIES. So if "idx" is = ldt->nr_entries then we're reading beyond the end of the buffer. It seems duplicative to have two limit checks when one would work just as well so I removed the check against LDT_ENTRIES.
The gdt_page.gdt[] array has GDT_ENTRIES entries.
--- arch/x86/kernel/cpu/perf_event.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -5
@@ -2009,17 +2009,14 @@ static unsigned long get_segment_base(unif ((segment &SEGMENT_TI_MASK ) =SEGMENT_LDT ) {struct ldt_struct *ldt; -if (idx >LDT_ENTRIES ) -return 0 ; -/* IRQs are off, so this synchronizes with smp_store_release */ ldt =lockless_dereference (current->active_mm->context.ldt); -if (!ldt || idx > ldt->size) +if (!ldt || idx >= ldt->size)return 0 ; desc = &ldt->entries[idx]; }else { -if (idx >GDT_ENTRIES ) +if (idx >=GDT_ENTRIES )return 0 ; desc =__this_cpu_ptr (&gdt_page.gdt[0 ]) + idx;
PATCH 167/294 i2c: ismt: Don't duplicate the receive length for block reads
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Douthit <[email protected]>
commit b6c159a9cb69c2cf0bf59d4e12c3a2da77e4d994 upstream.
According to Table 15-14 of the C2000 EDS (Intel doc #510524) the rx data pointed to by the descriptor dptr contains the byte count.
desc->rxbytes reports all bytes read on the wire, including the "byte count" byte. So if a device sends 4 bytes in response to a block read, on the wire and in the DMA buffer we see:
count data1 data2 data3 data4
0x04 0xde 0xad 0xbe 0xef
That's what we want to return in data->block to the next level.
Instead we were actually prefixing that with desc->rxbytes:
bad
count count data1 data2 data3 data4
0x05 0x04 0xde 0xad 0xbe 0xef
This was discovered while developing a BMC solution relying on the ipmi_ssif.c driver which was trying to interpret the bogus length field as part of the IPMI response.
--- drivers/i2c/busses/i2c-ismt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-ismt.c +2 -2
@@ -344,8 +344,8 @@ static int ismt_process_desc(const strucbreak ;case I2C_SMBUS_BLOCK_DATA :case I2C_SMBUS_I2C_BLOCK_DATA : -memcpy (&data->block[1 ], dma_buffer, desc->rxbytes); - data->block[0 ] = desc->rxbytes; +memcpy (data->block, dma_buffer, desc->rxbytes); + data->block[0 ] = desc->rxbytes -1 ;break ; }return 0 ;
PATCH 171/294 net_sched: fix error recovery at qdisc creation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 87b60cfacf9f17cf71933c6e33b66e68160af71d upstream.
Dmitry reported uses after free in qdisc code [1]
The problem here is that ops->init() can return an error.
qdisc_create_dflt() then call ops->destroy(),
while qdisc_create() does _not_ call it.
Four qdisc chose to call their own ops->destroy(), assuming their caller would not.
This patch makes sure qdisc_create() calls ops->destroy() and fixes the four qdisc to avoid double free.
[1]
BUG: KASAN: use-after-free in mq_destroy+0x242/0x290 net/sched/sch_mq.c:33 at addr ffff8801d415d440 Read of size 8 by task syz-executor2/5030 CPU: 0 PID: 5030 Comm: syz-executor2 Not tainted 4.3.5-smp-DEV #119 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000046 ffff8801b435b870 ffffffff81bbbed4 ffff8801db000400 ffff8801d415d440 ffff8801d415dc40 ffff8801c4988510 ffff8801b435b898 ffffffff816682b1 ffff8801b435b928 ffff8801d415d440 ffff8801c49880c0 Call Trace: [<ffffffff81bbbed4>] __dump_stack lib/dump_stack.c:15 [inline] [<ffffffff81bbbed4>] dump_stack+0x6c/0x98 lib/dump_stack.c:51 [<ffffffff816682b1>] kasan_object_err+0x21/0x70 mm/kasan/report.c:158 [<ffffffff81668524>] print_address_description mm/kasan/report.c:196 [inline] [<ffffffff81668524>] kasan_report_error+0x1b4/0x4b0 mm/kasan/report.c:285 [<ffffffff81668953>] kasan_report mm/kasan/report.c:305 [inline] [<ffffffff81668953>] __asan_report_load8_noabort+0x43/0x50 mm/kasan/report.c:326 [<ffffffff82527b02>] mq_destroy+0x242/0x290 net/sched/sch_mq.c:33 [<ffffffff82524bdd>] qdisc_destroy+0x12d/0x290 net/sched/sch_generic.c:953 [<ffffffff82524e30>] qdisc_create_dflt+0xf0/0x120 net/sched/sch_generic.c:848 [<ffffffff8252550d>] attach_default_qdiscs net/sched/sch_generic.c:1029 [inline] [<ffffffff8252550d>] dev_activate+0x6ad/0x880 net/sched/sch_generic.c:1064 [<ffffffff824b1db1>] __dev_open+0x221/0x320 net/core/dev.c:1403 [<ffffffff824b24ce>] __dev_change_flags+0x15e/0x3e0 net/core/dev.c:6858 [<ffffffff824b27de>] dev_change_flags+0x8e/0x140 net/core/dev.c:6926 [<ffffffff824f5bf6>] dev_ifsioc+0x446/0x890 net/core/dev_ioctl.c:260 [<ffffffff824f61fa>] dev_ioctl+0x1ba/0xb80 net/core/dev_ioctl.c:546 [<ffffffff82430509>] sock_do_ioctl+0x99/0xb0 net/socket.c:879 [<ffffffff82430d30>] sock_ioctl+0x2a0/0x390 net/socket.c:958 [<ffffffff816f3b68>] vfs_ioctl fs/ioctl.c:44 [inline] [<ffffffff816f3b68>] do_vfs_ioctl+0x8a8/0xe50 fs/ioctl.c:611 [<ffffffff816f41a4>] SYSC_ioctl fs/ioctl.c:626 [inline] [<ffffffff816f41a4>] SyS_ioctl+0x94/0xc0 fs/ioctl.c:617 [<ffffffff8123e357>] entry_SYSCALL_64_fastpath+0x12/0x17
--- net/sched/sch_api.c | 2 ++ net/sched/sch_hhf.c | 8 ++++++-- net/sched/sch_mq.c | 10 +++------- net/sched/sch_mqprio.c | 19 ++++++------------- net/sched/sch_sfq.c | 3 ++- 5 files changed, 19 insertions(+), 23 deletions(-)
net/sched/sch_api.c +2 -0
@@ -978,6 +978,8 @@ qdisc_create(struct net_device *dev, strreturn sch; } +/* ops->init() failed, we call ->destroy() like qdisc_create_dflt() */ + ops->destroy (sch); err_out3:dev_put (dev);kfree ((char *) sch - sch->padded);
net/sched/sch_hhf.c +6 -2
@@ -644,7 +644,9 @@ static int hhf_init(struct Qdisc *sch, s q->hhf_arrays[i] =hhf_zalloc (HHF_ARRAYS_LEN *sizeof (u32));if (!q->hhf_arrays[i]) { -hhf_destroy (sch); +/* Note: hhf_destroy() will be called +* by our caller. +*/ return -ENOMEM ; } }
@@ -655,7 +657,9 @@ static int hhf_init(struct Qdisc *sch, s q->hhf_valid_bits[i] =hhf_zalloc (HHF_ARRAYS_LEN /BITS_PER_BYTE );if (!q->hhf_valid_bits[i]) { -hhf_destroy (sch); +/* Note: hhf_destroy() will be called +* by our caller. +*/ return -ENOMEM ; } }
net/sched/sch_mq.c +3 -7
@@ -52,7 +52,7 @@ static int mq_init(struct Qdisc *sch, st/* pre-allocate qdiscs, attachment can't fail */ priv->qdiscs =kcalloc (dev->num_tx_queues,sizeof (priv->qdiscs[0 ]),GFP_KERNEL ); -if (priv->qdiscs ==NULL ) +if (!priv->qdiscs)return -ENOMEM ;for (ntx =0 ; ntx < dev->num_tx_queues; ntx++) {
@@ -60,18 +60,14 @@ static int mq_init(struct Qdisc *sch, st qdisc =qdisc_create_dflt (dev_queue, default_qdisc_ops,TC_H_MAKE (TC_H_MAJ (sch->handle),TC_H_MIN (ntx +1 ))); -if (qdisc ==NULL ) - goto err; +if (!qdisc) +return -ENOMEM ; priv->qdiscs[ntx] = qdisc; qdisc->flags |=TCQ_F_ONETXQUEUE ; } sch->flags |=TCQ_F_MQROOT ;return 0 ; - -err: -mq_destroy (sch); -return -ENOMEM ; }static void mq_attach (struct Qdisc *sch)
net/sched/sch_mqprio.c +6 -13
@@ -117,20 +117,17 @@ static int mqprio_init(struct Qdisc *sch/* pre-allocate qdisc, attachment can't fail */ priv->qdiscs =kcalloc (dev->num_tx_queues,sizeof (priv->qdiscs[0 ]),GFP_KERNEL ); -if (priv->qdiscs ==NULL ) { - err = -ENOMEM ; - goto err; - } +if (!priv->qdiscs) +return -ENOMEM ;for (i =0 ; i < dev->num_tx_queues; i++) { dev_queue =netdev_get_tx_queue (dev, i); qdisc =qdisc_create_dflt (dev_queue, default_qdisc_ops,TC_H_MAKE (TC_H_MAJ (sch->handle),TC_H_MIN (i +1 ))); -if (qdisc ==NULL ) { - err = -ENOMEM ; - goto err; - } +if (!qdisc) +return -ENOMEM ; + priv->qdiscs[i] = qdisc; qdisc->flags |=TCQ_F_ONETXQUEUE ; }
@@ -143,7 +140,7 @@ static int mqprio_init(struct Qdisc *sch priv->hw_owned =1 ; err = dev->netdev_ops->ndo_setup_tc (dev, qopt->num_tc);if (err) - goto err; +return err; }else {netdev_set_num_tc (dev, qopt->num_tc);for (i =0 ; i < qopt->num_tc; i++)
@@ -157,10 +154,6 @@ static int mqprio_init(struct Qdisc *sch sch->flags |=TCQ_F_MQROOT ;return 0 ; - -err: -mqprio_destroy (sch); -return err; }static void mqprio_attach (struct Qdisc *sch)
net/sched/sch_sfq.c +2 -1
@@ -770,9 +770,10 @@ static int sfq_init(struct Qdisc *sch, s q->ht =sfq_alloc (sizeof (q->ht[0 ]) * q->divisor); q->slots =sfq_alloc (sizeof (q->slots[0 ]) * q->maxflows);if (!q->ht || !q->slots) { -sfq_destroy (sch); +/* Note: sfq_destroy() will be called by our caller */ return -ENOMEM ; } +for (i =0 ; i < q->divisor; i++) q->ht[i] =SFQ_EMPTY_SLOT ;
PATCH 176/294 sch_cbq: fix null pointer dereferences on init failure
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit 3501d059921246ff617b43e86250a719c140bd97 upstream.
CBQ can fail on ->init by wrong nl attributes or simply for missing any, f.e. if it's set as a default qdisc then TCA_OPTIONS (opt) will be NULL when it is activated. The first thing init does is parse opt but it will dereference a null pointer if used as a default qdisc, also since init failure at default qdisc invokes ->reset() which cancels all timers then we'll also dereference two more null pointers (timer->base) as they were never initialized.
To reproduce:
$ sysctl net.core.default_qdisc=cbq $ ip l set ethX up
Crash log of the first null ptr deref:
[44727.907454] BUG: unable to handle kernel NULL pointer dereference at (null) [44727.907600] IP: cbq_init+0x27/0x205 [44727.907676] PGD 59ff4067 [44727.907677] P4D 59ff4067 [44727.907742] PUD 59c70067 [44727.907807] PMD 0 [44727.907873] [44727.907982] Oops: 0000 [#1] SMP [44727.908054] Modules linked in: [44727.908126] CPU: 1 PID: 21312 Comm: ip Not tainted 4.13.0-rc6+ #60 [44727.908235] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [44727.908477] task: ffff88005ad42700 task.stack: ffff880037214000 [44727.908672] RIP: 0010:cbq_init+0x27/0x205 [44727.908838] RSP: 0018:ffff8800372175f0 EFLAGS: 00010286 [44727.909018] RAX: ffffffff816c3852 RBX: ffff880058c53800 RCX: 0000000000000000 [44727.909222] RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffff8800372175f8 [44727.909427] RBP: ffff880037217650 R08: ffffffff81b0f380 R09: 0000000000000000 [44727.909631] R10: ffff880037217660 R11: 0000000000000020 R12: ffffffff822a44c0 [44727.909835] R13: ffff880058b92000 R14: 00000000ffffffff R15: 0000000000000001 [44727.910040] FS: 00007ff8bc583740(0000) GS:ffff88005d880000(0000) knlGS:0000000000000000 [44727.910339] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [44727.910525] CR2: 0000000000000000 CR3: 00000000371e5000 CR4: 00000000000406e0 [44727.910731] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [44727.910936] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [44727.911141] Call Trace: [44727.911291] ? lockdep_init_map+0xb6/0x1ba [44727.911461] ? qdisc_alloc+0x14e/0x187 [44727.911626] qdisc_create_dflt+0x7a/0x94 [44727.911794] ? dev_activate+0x129/0x129 [44727.911959] attach_one_default_qdisc+0x36/0x63 [44727.912132] netdev_for_each_tx_queue+0x3d/0x48 [44727.912305] dev_activate+0x4b/0x129 [44727.912468] __dev_open+0xe7/0x104 [44727.912631] __dev_change_flags+0xc6/0x15c [44727.912799] dev_change_flags+0x25/0x59 [44727.912966] do_setlink+0x30c/0xb3f [44727.913129] ? check_chain_key+0xb0/0xfd [44727.913294] ? check_chain_key+0xb0/0xfd [44727.913463] rtnl_newlink+0x3a4/0x729 [44727.913626] ? rtnl_newlink+0x117/0x729 [44727.913801] ? ns_capable_common+0xd/0xb1 [44727.913968] ? ns_capable+0x13/0x15 [44727.914131] rtnetlink_rcv_msg+0x188/0x197 [44727.914300] ? rcu_read_unlock+0x3e/0x5f [44727.914465] ? rtnl_newlink+0x729/0x729 [44727.914630] netlink_rcv_skb+0x6c/0xce [44727.914796] rtnetlink_rcv+0x23/0x2a [44727.914956] netlink_unicast+0x103/0x181 [44727.915122] netlink_sendmsg+0x326/0x337 [44727.915291] sock_sendmsg_nosec+0x14/0x3f [44727.915459] sock_sendmsg+0x29/0x2e [44727.915619] ___sys_sendmsg+0x209/0x28b [44727.915784] ? do_raw_spin_unlock+0xcd/0xf8 [44727.915954] ? _raw_spin_unlock+0x27/0x31 [44727.916121] ? __handle_mm_fault+0x651/0xdb1 [44727.916290] ? check_chain_key+0xb0/0xfd [44727.916461] __sys_sendmsg+0x45/0x63 [44727.916626] ? __sys_sendmsg+0x45/0x63 [44727.916792] SyS_sendmsg+0x19/0x1b [44727.916950] entry_SYSCALL_64_fastpath+0x23/0xc2 [44727.917125] RIP: 0033:0x7ff8bbc96690 [44727.917286] RSP: 002b:00007ffc360991e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [44727.917579] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007ff8bbc96690 [44727.917783] RDX: 0000000000000000 RSI: 00007ffc36099230 RDI: 0000000000000003 [44727.917987] RBP: ffff880037217f98 R08: 0000000000000001 R09: 0000000000000003 [44727.918190] R10: 00007ffc36098fb0 R11: 0000000000000246 R12: 0000000000000006 [44727.918393] R13: 000000000066f1a0 R14: 00007ffc360a12e0 R15: 0000000000000000 [44727.918597] ? trace_hardirqs_off_caller+0xa7/0xcf [44727.918774] Code: 41 5f 5d c3 66 66 66 66 90 55 48 8d 56 04 45 31 c9 49 c7 c0 80 f3 b0 81 48 89 e5 41 55 41 54 53 48 89 fb 48 8d 7d a8 48 83 ec 48 <0f> b7 0e be 07 00 00 00 83 e9 04 e8 e6 f7 d8 ff 85 c0 0f 88 bb [44727.919332] RIP: cbq_init+0x27/0x205 RSP: ffff8800372175f0 [44727.919516] CR2: 0000000000000000
[bwh: Backported to 3.16:
- Keep using HRTIMER_MODE_ABS
- Adjust context]
--- net/sched/sch_cbq.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
net/sched/sch_cbq.c +7 -3
@@ -1364,6 +1364,13 @@ static int cbq_init(struct Qdisc *sch, sstruct tc_ratespec *r;int err; +qdisc_watchdog_init (&q->watchdog, sch); +hrtimer_init (&q->delay_timer,CLOCK_MONOTONIC ,HRTIMER_MODE_ABS_PINNED ); + q->delay_timer.function = cbq_undelay; + +if (!opt) +return -EINVAL ; + err =nla_parse_nested (tb,TCA_CBQ_MAX , opt, cbq_policy);if (err <0 )return err;
@@ -1402,9 +1409,6 @@ static int cbq_init(struct Qdisc *sch, s q->link.avpkt = q->link.allot/2 ; q->link.minidle =-0x7FFFFFFF ; -qdisc_watchdog_init (&q->watchdog, sch); -hrtimer_init (&q->delay_timer,CLOCK_MONOTONIC ,HRTIMER_MODE_ABS ); - q->delay_timer.function = cbq_undelay; q->toplevel =TC_CBQ_MAXLEVEL ; q->now =psched_get_time (); q->now_rt = q->now;
PATCH 179/294 sch_tbf: fix two null pointer dereferences on init failure
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit c2d6511e6a4f1f3673d711569c00c3849549e9b0 upstream.
sch_tbf calls qdisc_watchdog_cancel() in both its ->reset and ->destroy callbacks but it may fail before the timer is initialized due to missing options (either not supplied by user-space or set as a default qdisc), also q->qdisc is used by ->reset and ->destroy so we need it initialized.
Reproduce:
$ sysctl net.core.default_qdisc=tbf $ ip l set ethX up
Crash log:
[ 959.160172] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018 [ 959.160323] IP: qdisc_reset+0xa/0x5c [ 959.160400] PGD 59cdb067 [ 959.160401] P4D 59cdb067 [ 959.160466] PUD 59ccb067 [ 959.160532] PMD 0 [ 959.160597] [ 959.160706] Oops: 0000 [#1] SMP [ 959.160778] Modules linked in: sch_tbf sch_sfb sch_prio sch_netem [ 959.160891] CPU: 2 PID: 1562 Comm: ip Not tainted 4.13.0-rc6+ #62 [ 959.160998] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [ 959.161157] task: ffff880059c9a700 task.stack: ffff8800376d0000 [ 959.161263] RIP: 0010:qdisc_reset+0xa/0x5c [ 959.161347] RSP: 0018:ffff8800376d3610 EFLAGS: 00010286 [ 959.161531] RAX: ffffffffa001b1dd RBX: ffff8800373a2800 RCX: 0000000000000000 [ 959.161733] RDX: ffffffff8215f160 RSI: ffffffff8215f160 RDI: 0000000000000000 [ 959.161939] RBP: ffff8800376d3618 R08: 00000000014080c0 R09: 00000000ffffffff [ 959.162141] R10: ffff8800376d3578 R11: 0000000000000020 R12: ffffffffa001d2c0 [ 959.162343] R13: ffff880037538000 R14: 00000000ffffffff R15: 0000000000000001 [ 959.162546] FS: 00007fcc5126b740(0000) GS:ffff88005d900000(0000) knlGS:0000000000000000 [ 959.162844] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 959.163030] CR2: 0000000000000018 CR3: 000000005abc4000 CR4: 00000000000406e0 [ 959.163233] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 959.163436] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 959.163638] Call Trace: [ 959.163788] tbf_reset+0x19/0x64 [sch_tbf] [ 959.163957] qdisc_destroy+0x8b/0xe5 [ 959.164119] qdisc_create_dflt+0x86/0x94 [ 959.164284] ? dev_activate+0x129/0x129 [ 959.164449] attach_one_default_qdisc+0x36/0x63 [ 959.164623] netdev_for_each_tx_queue+0x3d/0x48 [ 959.164795] dev_activate+0x4b/0x129 [ 959.164957] __dev_open+0xe7/0x104 [ 959.165118] __dev_change_flags+0xc6/0x15c [ 959.165287] dev_change_flags+0x25/0x59 [ 959.165451] do_setlink+0x30c/0xb3f [ 959.165613] ? check_chain_key+0xb0/0xfd [ 959.165782] rtnl_newlink+0x3a4/0x729 [ 959.165947] ? rtnl_newlink+0x117/0x729 [ 959.166121] ? ns_capable_common+0xd/0xb1 [ 959.166288] ? ns_capable+0x13/0x15 [ 959.166450] rtnetlink_rcv_msg+0x188/0x197 [ 959.166617] ? rcu_read_unlock+0x3e/0x5f [ 959.166783] ? rtnl_newlink+0x729/0x729 [ 959.166948] netlink_rcv_skb+0x6c/0xce [ 959.167113] rtnetlink_rcv+0x23/0x2a [ 959.167273] netlink_unicast+0x103/0x181 [ 959.167439] netlink_sendmsg+0x326/0x337 [ 959.167607] sock_sendmsg_nosec+0x14/0x3f [ 959.167772] sock_sendmsg+0x29/0x2e [ 959.167932] ___sys_sendmsg+0x209/0x28b [ 959.168098] ? do_raw_spin_unlock+0xcd/0xf8 [ 959.168267] ? _raw_spin_unlock+0x27/0x31 [ 959.168432] ? __handle_mm_fault+0x651/0xdb1 [ 959.168602] ? check_chain_key+0xb0/0xfd [ 959.168773] __sys_sendmsg+0x45/0x63 [ 959.168934] ? __sys_sendmsg+0x45/0x63 [ 959.169100] SyS_sendmsg+0x19/0x1b [ 959.169260] entry_SYSCALL_64_fastpath+0x23/0xc2 [ 959.169432] RIP: 0033:0x7fcc5097e690 [ 959.169592] RSP: 002b:00007ffd0d5c7b48 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 959.169887] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007fcc5097e690 [ 959.170089] RDX: 0000000000000000 RSI: 00007ffd0d5c7b90 RDI: 0000000000000003 [ 959.170292] RBP: ffff8800376d3f98 R08: 0000000000000001 R09: 0000000000000003 [ 959.170494] R10: 00007ffd0d5c7910 R11: 0000000000000246 R12: 0000000000000006 [ 959.170697] R13: 000000000066f1a0 R14: 00007ffd0d5cfc40 R15: 0000000000000000 [ 959.170900] ? trace_hardirqs_off_caller+0xa7/0xcf [ 959.171076] Code: 00 41 c7 84 24 14 01 00 00 00 00 00 00 41 c7 84 24 98 00 00 00 00 00 00 00 41 5c 41 5d 41 5e 5d c3 66 66 66 66 90 55 48 89 e5 53 <48> 8b 47 18 48 89 fb 48 8b 40 48 48 85 c0 74 02 ff d0 48 8b bb [ 959.171637] RIP: qdisc_reset+0xa/0x5c RSP: ffff8800376d3610 [ 959.171821] CR2: 0000000000000018
--- net/sched/sch_tbf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/sched/sch_tbf.c +3 -2
@@ -431,12 +431,13 @@ static int tbf_init(struct Qdisc *sch, s {struct tbf_sched_data *q =qdisc_priv (sch); +qdisc_watchdog_init (&q->watchdog, sch); + q->qdisc = &noop_qdisc; +if (opt ==NULL )return -EINVAL ; q->t_c =ktime_to_ns (ktime_get ()); -qdisc_watchdog_init (&q->watchdog, sch); - q->qdisc = &noop_qdisc;return tbf_change (sch, opt); }
PATCH 180/294 wl1251: add a missing spin_lock_init()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
commit f581a0dd744fe32b0a8805e279c59ec1ac676d60 upstream.
wl1251: add a missing spin_lock_init()
This fixes the following kernel warning:
[ 5668.771453] BUG: spinlock bad magic on CPU#0, kworker/u2:3/9745 [ 5668.771850] lock: 0xce63ef20, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [ 5668.772277] CPU: 0 PID: 9745 Comm: kworker/u2:3 Tainted: G W 4.12.0-03002-gec979a4-dirty #40 [ 5668.772796] Hardware name: Nokia RX-51 board [ 5668.773071] Workqueue: phy1 wl1251_irq_work [ 5668.773345] [<c010c9e4>] (unwind_backtrace) from [<c010a274>] (show_stack+0x10/0x14) [ 5668.773803] [<c010a274>] (show_stack) from [<c01545a4>] (do_raw_spin_lock+0x6c/0xa0) [ 5668.774230] [<c01545a4>] (do_raw_spin_lock) from [<c06ca578>] (_raw_spin_lock_irqsave+0x10/0x18) [ 5668.774658] [<c06ca578>] (_raw_spin_lock_irqsave) from [<c048c010>] (wl1251_op_tx+0x38/0x5c) [ 5668.775115] [<c048c010>] (wl1251_op_tx) from [<c06a12e8>] (ieee80211_tx_frags+0x188/0x1c0) [ 5668.775543] [<c06a12e8>] (ieee80211_tx_frags) from [<c06a138c>] (__ieee80211_tx+0x6c/0x130) [ 5668.775970] [<c06a138c>] (__ieee80211_tx) from [<c06a3dbc>] (ieee80211_tx+0xdc/0x104) [ 5668.776367] [<c06a3dbc>] (ieee80211_tx) from [<c06a4af0>] (__ieee80211_subif_start_xmit+0x454/0x8c8) [ 5668.776824] [<c06a4af0>] (__ieee80211_subif_start_xmit) from [<c06a4f94>] (ieee80211_subif_start_xmit+0x30/0x2fc) [ 5668.777343] [<c06a4f94>] (ieee80211_subif_start_xmit) from [<c0578848>] (dev_hard_start_xmit+0x80/0x118)
...
by adding the missing spin_lock_init().
--- drivers/net/wireless/ti/wl1251/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ti/wl1251/main.c +1 -0
@@ -1571,6 +1571,7 @@ struct ieee80211_hw *wl1251_alloc_hw(voi wl->state =WL1251_STATE_OFF ;mutex_init (&wl->mutex); +spin_lock_init (&wl->wl_lock); wl->tx_mgmt_frm_rate =DEFAULT_HW_GEN_TX_RATE ; wl->tx_mgmt_frm_mod =DEFAULT_HW_GEN_MODULATION_TYPE ;
PATCH 195/294 USB: fix out-of-bounds in usb_set_configuration
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit bd7a3fe770ebd8391d1c7d072ff88e9e76d063eb upstream.
Andrey Konovalov reported a possible out-of-bounds problem for a USB interface association descriptor. He writes:
It seems there's no proper size check of a USB_DT_INTERFACE_ASSOCIATION descriptor. It's only checked that the size is >= 2 in usb_parse_configuration(), so find_iad() might do out-of-bounds access to intf_assoc->bInterfaceCount.
And he's right, we don't check for crazy descriptors of this type very well, so resolve this problem. Yet another issue found by syzkaller...
--- drivers/usb/core/config.c | 14 +++++++++++--- include/uapi/linux/usb/ch9.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-)
drivers/usb/core/config.c +11 -3
@@ -607,15 +607,23 @@ static int usb_parse_configuration(struc }else if (header->bDescriptorType ==USB_DT_INTERFACE_ASSOCIATION ) { +struct usb_interface_assoc_descriptor *d; + + d = (struct usb_interface_assoc_descriptor *)header; +if (d->bLength <USB_DT_INTERFACE_ASSOCIATION_SIZE ) { +dev_warn (ddev, +"config %d has an invalid interface association descriptor of length %d, skipping\n" , + cfgno, d->bLength); +continue ; + } +if (iad_num ==USB_MAXIADS ) {dev_warn (ddev,"found more Interface " "Association Descriptors " "than allocated for in " "configuration %d\n" , cfgno); }else { - config->intf_assoc[iad_num] = - (struct usb_interface_assoc_descriptor - *)header; + config->intf_assoc[iad_num] = d; iad_num++; }
include/uapi/linux/usb/ch9.h +1 -0
@@ -724,6 +724,7 @@ struct usb_interface_assoc_descriptor {__u8 iFunction; } __attribute__ ((packed)); +#define USB_DT_INTERFACE_ASSOCIATION_SIZE 8/*-------------------------------------------------------------------------*/
PATCH 220/294 ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Timur Tabi <[email protected]>
commit acf2c60a60b3d6d7080854b9483f37d99ded9b23 upstream.
do_div() requires that the first parameter is a 64-bit integer, which but clkrate was defined as an unsigned long. This caused the following warnings:
CC sound/soc/fsl/fsl_ssi.osound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer types lacks a cast sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'long unsigned int *'
--- sound/soc/fsl/fsl_ssi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/fsl/fsl_ssi.c +2 -2
@@ -590,8 +590,8 @@ static int fsl_ssi_set_bclk(struct snd_pelse clkrate =clk_round_rate (ssi_private->baudclk, tmprate); -do_div (clkrate, factor); - afreq = (u32 )clkrate / (i +1 ); + clkrate /= factor; + afreq = clkrate / (i +1 );if (freq == afreq) sub =0 ;
PATCH 227/294 spi/atmel: Fix pointer to int conversion warnings on 64 bit builds
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 67f08d690aa90e47a0e793fc63e2ecbe95d29839 upstream.
On 64 bit systems integers are generally still 32 bit but long values and pointers are usually 64 bit. GCC warns when casting a 64 bit pointer into a 32 bit integer so cast to a long instead in order to avoid warnings.
--- drivers/spi/spi-atmel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-atmel.c +2 -2
@@ -1020,7 +1020,7 @@ static int atmel_spi_setup(struct spi_de csr |=SPI_BF (DLYBCT ,0 );/* chipselect must have been muxed as GPIO (e.g. in board setup) */ - npcs_pin = (unsigned int )spi->controller_data; + npcs_pin = (unsigned long )spi->controller_data;if (gpio_is_valid (spi->cs_gpio)) npcs_pin = spi->cs_gpio;
@@ -1255,7 +1255,7 @@ msg_done:static void atmel_spi_cleanup (struct spi_device *spi) {struct atmel_spi_device *asd = spi->controller_state; -unsigned gpio = (unsigned ) spi->controller_data; +unsigned gpio = (unsigned long ) spi->controller_data;if (!asd)return ;
PATCH 230/294 tty/isicom: fix big-endian compile warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit f3e2d56dce47dbd0bb3f69f84741b439542fef37 upstream.
Building an arm allmodconfig kernel triggers a lengthy but harmless warning in the isicom driver:
drvers/tty/isicom.c: In function 'isicom_send_break':uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
^uapi/linux/swab.h:107:2: note: in expansion of macro '___constant_swab16'
___constant_swab16(x) : \
^uapi/linux/byteorder/big_endian.h:34:43: note: in expansion of macro '__swab16'
#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
^
linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le16'
#define cpu_to_le16 __cpu_to_le16
^
include/asm/io.h:270:6: note: in expansion of macro 'cpu_to_le16'
cpu_to_le16(v),__io(p)); })
^drivers/tty/isicom.c:1058:2: note: in expansion of macro 'outw'
outw((length & 0xff00), base);
^
Apparently, the problem is related to the fact that the value 0xff00, when used as a 16-bit number, is negative and passed into bitwise operands of the generic byte swapping code.
Marking the input argument as unsigned in both technically correct and avoids the warning.
--- drivers/tty/isicom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/isicom.c +1 -1
@@ -1055,7 +1055,7 @@ static int isicom_send_break(struct tty_outw (0x8000 | ((port->channel) << (card->shift_count)) |0x3 , base);outw ((length &0xff ) <<8 |0x00 , base); -outw ((length &0xff00 ), base); +outw ((length &0xff00u ), base);InterruptTheCard (base);unlock_card (card);
PATCH 232/294 dm bufio: hide bogus warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
mips-gcc-5.3 warns about correct code on linux-3.18 and earlier:
In file included from ../include/linux/blkdev.h:4:0,
from ../drivers/md/dm-bufio.h:12,
from ../drivers/md/dm-bufio.c:9:
../drivers/md/dm-bufio.c: In function 'alloc_buffer':
../include/linux/sched.h:1975:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized]
current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~../drivers/md/dm-bufio.c:325:11: note: 'noio_flag' was declared here
The warning disappeared on later kernels with this commit: be0c37c985ed ("MIPS: Rearrange PTE bits into fixed positions.") I assume this only happened because it changed some inlining decisions.
On 3.18.y, we can shut up the warning by adding an extra initialization.
--- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm-bufio.c +1 -0
@@ -349,6 +349,7 @@ static void *alloc_buffer_data(struct dm* as if GFP_NOIO was specified. */ + noio_flag =0 ;if (gfp_mask & __GFP_NORETRY) noio_flag =memalloc_noio_save ();
PATCH 235/294 scsi: advansys: remove #warning message
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
The advansys driver was converted to the proper DMA API in linux-4.2, but the 3.18-stable kernel still warns about this:
drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API [-Wcpp]
The warning clearly is not helpful in 3.18 any more, it just clutters up the build log. This removes the warning instead, and clarifies the comment above it.
--- drivers/scsi/advansys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/advansys.c +1 -2
@@ -49,7 +49,7 @@#include <scsi/scsi.h> #include <scsi/scsi_host.h> -/* FIXME: +/* Fixed in linux-4.2, not backported to 3.16: * * 1. Although all of the necessary command mapping places have the * appropriate dma_map.. APIs, the driver still processes its internal
@@ -68,7 +68,6 @@* 7. advansys_info is not safe against multiple simultaneous callers * 8. Add module_param to override ISA/VLB ioport array */ -#warning this driver is still not properly converted to the DMA API/* Enable driver /proc statistics. */ #define ADVANSYS_STATS
PATCH 236/294 bfa: Fix indentation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <[email protected]>
commit b7f4d6343820af5c2dc3979e91d85e71e638cd3d upstream.
--- drivers/scsi/bfa/bfa_ioc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/scsi/bfa/bfa_ioc.c +11 -11
@@ -3665,19 +3665,19 @@ bfa_cb_sfp_state_query(struct bfa_sfp_sif (sfp->state_query_cbfn) sfp->state_query_cbfn (sfp->state_query_cbarg, sfp->status); - sfp->media =NULL ; - } + sfp->media =NULL ; + } -if (sfp->portspeed) { - sfp->status =bfa_sfp_speed_valid (sfp, sfp->portspeed); -if (sfp->state_query_cbfn) - sfp->state_query_cbfn (sfp->state_query_cbarg, - sfp->status); - sfp->portspeed =BFA_PORT_SPEED_UNKNOWN ; - } +if (sfp->portspeed) { + sfp->status =bfa_sfp_speed_valid (sfp, sfp->portspeed); +if (sfp->state_query_cbfn) + sfp->state_query_cbfn (sfp->state_query_cbarg, + sfp->status); + sfp->portspeed =BFA_PORT_SPEED_UNKNOWN ; + } - sfp->state_query_lock =0 ; - sfp->state_query_cbfn =NULL ; + sfp->state_query_lock =0 ; + sfp->state_query_cbfn =NULL ; }/*
PATCH 243/294 xilinx: Fix compiler warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Manuel Schölling <[email protected]>
commit 9f8b93cb32e088d3377c86fabb666b884bac0f12 upstream.
The time comparsion functions require arguments of type unsigned long instead of (signed) long.
--- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +- drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 2 +- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -1
@@ -72,7 +72,7 @@ void temac_iow(struct temac_local *lp, iint temac_indirect_busywait (struct temac_local *lp) { -long end = jiffies +2 ; +unsigned long end = jiffies +2 ;while (!(temac_ior (lp,XTE_RDY0_OFFSET ) &XTE_RDY0_HARD_ACS_RDY_MASK )) {if (time_before_eq (end, jiffies)) {
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +1 -1
@@ -19,7 +19,7 @@/* Wait till MDIO interface is ready to accept a new transaction.*/ int axienet_mdio_wait_until_ready (struct axienet_local *lp) { -long end = jiffies +2 ; +unsigned long end = jiffies +2 ;while (!(axienet_ior (lp,XAE_MDIO_MCR_OFFSET ) &XAE_MDIO_MCR_READY_MASK )) {if (time_before_eq (end, jiffies)) {
drivers/net/ethernet/xilinx/xilinx_emaclite.c +1 -1
@@ -707,7 +707,7 @@ static irqreturn_t xemaclite_interrupt(istatic int xemaclite_mdio_wait (struct net_local *lp) { -long end = jiffies +2 ; +unsigned long end = jiffies +2 ;/* wait for the MDIO interface to not be busy or timeout after some time.
PATCH 244/294 i40e: Reduce stack in i40e_dbg_dump_desc
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Joe Perches <[email protected]>
commit e6c97234d1b18d4751671df15d52e29daa8a7ba8 upstream.
Reduce stack use by using kmemdup and not using a very large struct on stack.
In function ‘i40e_dbg_dump_desc’:
warning: the frame size of 8192 bytes is larger than 2048 bytes [-Wframe-larger-than=]
--- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 30 +++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +17 -13
@@ -754,7 +754,7 @@ static void i40e_dbg_dump_desc(int cnt, {struct i40e_tx_desc *txd;union i40e_rx_desc *rxd; -struct i40e_ring ring; +struct i40e_ring *ring;struct i40e_vsi *vsi;int i;
@@ -773,29 +773,32 @@ static void i40e_dbg_dump_desc(int cnt, vsi_seid);return ; } -if (is_rx_ring) - ring = *vsi->rx_rings[ring_id]; -else - ring = *vsi->tx_rings[ring_id]; + + ring =kmemdup (is_rx_ring + ? vsi->rx_rings[ring_id] : vsi->tx_rings[ring_id], +sizeof (*ring),GFP_KERNEL ); +if (!ring) +return ; +if (cnt ==2 ) {dev_info (&pf->pdev->dev,"vsi = %02i %s ring = %02i\n" , vsi_seid, is_rx_ring ?"rx" :"tx" , ring_id); -for (i =0 ; i < ring.count; i++) { +for (i =0 ; i < ring->count; i++) {if (!is_rx_ring) { - txd =I40E_TX_DESC (&ring, i); + txd =I40E_TX_DESC (ring, i);dev_info (&pf->pdev->dev," d[%03i] = 0x%016llx 0x%016llx\n" , i, txd->buffer_addr, txd->cmd_type_offset_bsz); }else if (sizeof (union i40e_rx_desc ) ==sizeof (union i40e_16byte_rx_desc )) { - rxd =I40E_RX_DESC (&ring, i); + rxd =I40E_RX_DESC (ring, i);dev_info (&pf->pdev->dev," d[%03i] = 0x%016llx 0x%016llx\n" , i, rxd->read.pkt_addr, rxd->read.hdr_addr); }else { - rxd =I40E_RX_DESC (&ring, i); + rxd =I40E_RX_DESC (ring, i); dev_info(&pf->pdev->dev, " d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", i, rxd->read.pkt_addr,
@@ -804,26 +807,26 @@ static void i40e_dbg_dump_desc(int cnt, } } }else if (cnt ==3 ) { -if (desc_n >= ring.count || desc_n <0 ) { +if (desc_n >= ring->count || desc_n <0 ) {dev_info (&pf->pdev->dev,"descriptor %d not found\n" , desc_n);return ; }if (!is_rx_ring) { - txd =I40E_TX_DESC (&ring, desc_n); + txd =I40E_TX_DESC (ring, desc_n);dev_info (&pf->pdev->dev,"vsi = %02i tx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n" , vsi_seid, ring_id, desc_n, txd->buffer_addr, txd->cmd_type_offset_bsz); }else if (sizeof (union i40e_rx_desc ) ==sizeof (union i40e_16byte_rx_desc )) { - rxd =I40E_RX_DESC (&ring, desc_n); + rxd =I40E_RX_DESC (ring, desc_n);dev_info (&pf->pdev->dev,"vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n" , vsi_seid, ring_id, desc_n, rxd->read.pkt_addr, rxd->read.hdr_addr); }else { - rxd =I40E_RX_DESC (&ring, desc_n); + rxd =I40E_RX_DESC (ring, desc_n); dev_info(&pf->pdev->dev, "vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", vsi_seid, ring_id, desc_n,
@@ -833,6 +836,7 @@ static void i40e_dbg_dump_desc(int cnt, }else {dev_info (&pf->pdev->dev,"dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n" ); } +kfree (ring); }/**
PATCH 254/294 hostap: avoid uninitialized variable use in hfa384x_get_rid
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 48dc5fb3ba53b20418de8514700f63d88c5de3a3 upstream.
The driver reads a value from hfa384x_from_bap(), which may fail, and then assigns the value to a local variable. gcc detects that in in the failure case, the 'rlen' variable now contains uninitialized data:
In file included from ../drivers/net/wireless/intersil/hostap/hostap_pci.c:220:0:drivers/net/wireless/intersil/hostap/hostap_hw.c: In function 'hfa384x_get_rid':drivers/net/wireless/intersil/hostap/hostap_hw.c:842:5: warning: 'rec' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (le16_to_cpu(rec.len) == 0) {
This restructures the function as suggested by Russell King, to make it more readable and get more reliable error handling, by handling each failure mode using a goto.
--- drivers/net/wireless/hostap/hostap_hw.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/hostap/hostap_hw.c +10 -5
@@ -836,25 +836,30 @@ static int hfa384x_get_rid(struct net_despin_lock_bh (&local->baplock); res =hfa384x_setup_bap (dev,BAP0 , rid,0 ); -if (!res) - res =hfa384x_from_bap (dev,BAP0 , &rec,sizeof (rec)); +if (res) + goto unlock; + + res =hfa384x_from_bap (dev,BAP0 , &rec,sizeof (rec)); +if (res) + goto unlock;if (le16_to_cpu (rec.len) ==0 ) {/* RID not available */ res = -ENODATA ; + goto unlock; } rlen = (le16_to_cpu (rec.len) -1 ) *2 ; -if (!res && exact_len && rlen != len) { +if (exact_len && rlen != len) {printk (KERN_DEBUG "%s: hfa384x_get_rid - RID len mismatch: " "rid=0x%04x, len=%d (expected %d)\n" , dev->name, rid, rlen, len); res = -ENODATA ; } -if (!res) - res =hfa384x_from_bap (dev,BAP0 , buf, len); + res =hfa384x_from_bap (dev,BAP0 , buf, len); +unlock:spin_unlock_bh (&local->baplock);mutex_unlock (&local->rid_bap_mtx);
PATCH 255/294 iwlegacy: avoid warning about missing braces
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 2cce76c3fab410520610a7d2f52faebc3cfcf843 upstream.
gcc-6 warns about code in il3945_hw_txq_ctx_free() being somewhat ambiguous:
drivers/net/wireless/intel/iwlegacy/3945.c:1022:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
This adds a set of curly braces to avoid the warning.
--- drivers/net/wireless/iwlegacy/3945.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlegacy/3945.c +2 -1
@@ -1019,12 +1019,13 @@ il3945_hw_txq_ctx_free(struct il_priv *iint txq_id;/* Tx queues */ -if (il->txq) +if (il->txq) {for (txq_id =0 ; txq_id < il->hw_params.max_txq_num; txq_id++)if (txq_id ==IL39_CMD_QUEUE_NUM )il_cmd_queue_free (il);else il_tx_queue_free (il, txq_id); + }/* free tx queue structure */ il_free_txq_mem (il);
PATCH 260/294 video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 9c8ee3c7341393811d5be5eb61b815e76f92c799 upstream.
Commit 7edaa761ee81b ("video: mx3fb: Add backlight control support") changed the mx3fb driver so it always selects the BACKLIGHT_CLASS_DEVICE symbol, but that is hidden behind BACKLIGHT_LCD_SUPPORT in Kconfig, so we get a Kconfig warning for multi_v5_defconfig, which doesn't have that:
Warning: (DRM_RADEON && DRM_NOUVEAU && DRM_I915 && DRM_GMA500 && DRM_SHMOBILE && DRM_TILCDC && FB_BACKLIGHT && FB_MX3 && USB_APPLEDISPLAY && FB_OLPC_DCON && ASUS_LAPTOP && SONY_LAPTOP && THINKPAD_ACPI && EEEPC_LAPTOP && ACPI_CMPC && SAMSUNG_Q10) selects BACKLIGHT_CLASS_DEVICE which has unmet direct dependencies (HAS_IOMEM && BACKLIGHT_LCD_SUPPORT)
This makes sure we always enable both symbols together for mx3fb, like we do for the other drivers that can't be built without backlight support. Note that a better solution would be to ensure the driver can work with or without backlight support.
--- drivers/video/fbdev/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbdev/Kconfig +2 -1
@@ -2330,10 +2330,11 @@ config FB_MSM config FB_MX3 tristate "MX3 Framebuffer support" depends on FB && MX3_IPU + select BACKLIGHT_CLASS_DEVICE + select BACKLIGHT_LCD_SUPPORT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT - select BACKLIGHT_CLASS_DEVICE default y help This is a framebuffer device for the i.MX31 LCD Controller. So
PATCH 267/294 Staging: wlan-ng: fix sparse warning in prism2fw.c
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: A Raghavendra Rao <[email protected]>
commit 41cb65c4854e14f12b1cbb8215e509d8ad4d0c88 upstream.
Fix the following sparse warning :
In file included from drivers/staging/wlan-ng/prism2usb.c:5:0:drivers/staging/wlan-ng/prism2fw.c: In function ‘read_cardpda.constprop.43’:drivers/staging/wlan-ng/prism2fw.c:792:1: warning: the frame size of 1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]
The variable to 'struct p80211msg_p2req_readpda' was previously being created on the stack, which inturn exeeded the frame size limit, resulting in a sparse warning. This patch alloctes the memory to the structure dynamically and the operations are left unchanged.
--- drivers/staging/wlan-ng/prism2fw.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-)
drivers/staging/wlan-ng/prism2fw.c +18 -13
@@ -763,30 +763,35 @@ static int plugimage(struct imgchunk *fcstatic int read_cardpda (struct pda *pda,wlandevice_t *wlandev) {int result =0 ; -struct p80211msg_p2req_readpda msg; +struct p80211msg_p2req_readpda *msg; + + msg =kzalloc (sizeof (*msg),GFP_KERNEL ); +if (!msg) +return -ENOMEM ;/* set up the msg */ - msg.msgcode = DIDmsg_p2req_readpda; - msg.msglen =sizeof (msg); -strcpy (msg.devname, wlandev->name); - msg.pda.did = DIDmsg_p2req_readpda_pda; - msg.pda.len = HFA384x_PDA_LEN_MAX; - msg.pda.status = P80211ENUM_msgitem_status_no_value; - msg.resultcode.did = DIDmsg_p2req_readpda_resultcode; - msg.resultcode.len =sizeof (u32); - msg.resultcode.status = P80211ENUM_msgitem_status_no_value; + msg->msgcode = DIDmsg_p2req_readpda; + msg->msglen =sizeof (msg); +strcpy (msg->devname, wlandev->name); + msg->pda.did = DIDmsg_p2req_readpda_pda; + msg->pda.len = HFA384x_PDA_LEN_MAX; + msg->pda.status = P80211ENUM_msgitem_status_no_value; + msg->resultcode.did = DIDmsg_p2req_readpda_resultcode; + msg->resultcode.len =sizeof (u32); + msg->resultcode.status = P80211ENUM_msgitem_status_no_value; -if (prism2mgmt_readpda (wlandev, &msg) !=0 ) { +if (prism2mgmt_readpda (wlandev, msg) !=0 ) {/* prism2mgmt_readpda prints an errno if appropriate */ result =-1 ; - }else if (msg.resultcode.data == P80211ENUM_resultcode_success) { -memcpy (pda->buf, msg.pda.data, HFA384x_PDA_LEN_MAX); + }else if (msg->resultcode.data == P80211ENUM_resultcode_success) { +memcpy (pda->buf, msg->pda.data, HFA384x_PDA_LEN_MAX); result =mkpdrlist (pda); }else {/* resultcode must've been something other than success */ result =-1 ; } +kfree (msg);return result; }
PATCH 268/294 staging: dgnc: Fix frame size is larger than 1024B
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Zapalowicz <[email protected]>
commit ea6e9dea2e72a7abd146a2c5bab726b27f34b36c upstream.
This comit fixes the following sparse warnign:
drivers/staging/dgnc/dgnc_tty.c:572:1:
warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
This was caused by having buffer as an automatic variable. This commit moves it from the stack to the heap.
--- drivers/staging/dgnc/dgnc_tty.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +12 -4
@@ -481,13 +481,18 @@ void dgnc_sniff_nowait_nolock(struct chaint nbuf;int i;int tmpbuflen; -char tmpbuf[TMPBUFLEN ]; -char *p = tmpbuf; +char *tmpbuf; +char *p;int too_much_data; + tmpbuf =kzalloc (TMPBUFLEN ,GFP_KERNEL ); +if (!tmpbuf) +return ; + p = tmpbuf; +/* Leave if sniff not open */ if (!(ch->ch_sniff_flags &SNIFF_OPEN )) -return ; + goto exit;do_gettimeofday (&tv);
@@ -534,7 +539,7 @@ void dgnc_sniff_nowait_nolock(struct cha* function was probably called by the interrupt/timer routines! */ if (n ==0 ) -return ; + goto exit;/* * Copy as much data as will fit.
@@ -579,6 +584,9 @@ void dgnc_sniff_nowait_nolock(struct cha } }while (too_much_data); + +exit: +kfree (tmpbuf); }
PATCH 277/294 MIPS: BMIPS: Fix ".previous without corresponding .section" warnings
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Cernekee <[email protected]>
commit 4ec8f9e9b08451303253249e4e302f10ee23d565 upstream.
Commit 078a55fc824c1 ("Delete __cpuinit/__CPUINIT usage from MIPS code") removed our __CPUINIT directives, so now the ".previous" directives are superfluous. Remove them.
Patchwork: https://patchwork.linux-mips.org/patch/8156/
--- arch/mips/kernel/bmips_vec.S | 3 --- 1 file changed, 3 deletions(-)
arch/mips/kernel/bmips_vec.S +0 -3
@@ -211,7 +211,6 @@ bmips_reset_nmi_vec_end: END(bmips_reset_nmi_vec) .set pop - .previous /*********************************************************************** * CPU1 warm restart vector (used for second and subsequent boots).
@@ -286,5 +285,3 @@ LEAF(bmips_enable_xks01) jr ra END(bmips_enable_xks01) - - .previous
PATCH 283/294 MIPS: TXx9: Delete an unused variable in tx4927_pcibios_setup
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Atsushi Nemoto <[email protected]>
commit 1bc2d3e38e5bf90af4e9d64e1696f2d39757355a upstream.
Patchwork: https://patchwork.linux-mips.org/patch/7216/
--- arch/mips/pci/ops-tx4927.c | 2 -- 1 file changed, 2 deletions(-)
arch/mips/pci/ops-tx4927.c +0 -2
@@ -199,8 +199,6 @@ static struct {char *tx4927_pcibios_setup (char *str) { -unsigned long val; -if (!strncmp (str,"trdyto=" ,7 )) {u8 val =0 ;if (kstrtou8 (str +7 ,0 , &val) ==0 )
PATCH 288/294 perf: Avoid horrible stack usage
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Peter Zijlstra (Intel)" <[email protected]>
commit 86038c5ea81b519a8a1fcfcd5e4599aab0cdd119 upstream.
Both Linus (most recent) and Steve (a while ago) reported that perf related callbacks have massive stack bloat.
The problem is that software events need a pt_regs in order to properly report the event location and unwind stack. And because we could not assume one was present we allocated one on stack and filled it with minimal bits required for operation.
Now, pt_regs is quite large, so this is undesirable. Furthermore it turns out that most sites actually have a pt_regs pointer available, making this even more onerous, as the stack space is pointless waste.
This patch addresses the problem by observing that software events have well defined nesting semantics, therefore we can use static per-cpu storage instead of on-stack.
Linus made the further observation that all but the scheduler callers of perf_sw_event() have a pt_regs available, so we change the regular perf_sw_event() to require a valid pt_regs (where it used to be optional) and add perf_sw_event_sched() for the scheduler.
We have a scheduler specific call instead of a more generic _noregs() like construct because we can assume non-recursion from the scheduler and thereby simplify the code further (_noregs would have to put the recursion context call inline in order to assertain which __perf_regs element to use).
One last note on the implementation of perf_trace_buf_prepare(); we allow .regs = NULL for those cases where we already have a pt_regs pointer available and do not need another.
--- include/linux/ftrace_event.h | 2 +- include/linux/perf_event.h | 28 +++++++++++++++++++++------- include/trace/ftrace.h | 7 ++++--- kernel/events/core.c | 23 +++++++++++++++++------ kernel/sched/core.c | 2 +- kernel/trace/trace_event_perf.c | 4 +++- kernel/trace/trace_kprobe.c | 4 ++-- kernel/trace/trace_syscalls.c | 4 ++-- kernel/trace/trace_uprobe.c | 2 +- 9 files changed, 52 insertions(+), 24 deletions(-)
include/linux/ftrace_event.h +1 -1
@@ -621,7 +621,7 @@ extern int ftrace_profile_set_filter(st char *filter_str);extern void ftrace_profile_free_filter (struct perf_event *event);extern void *perf_trace_buf_prepare (int size,unsigned short type, -struct pt_regs *regs,int *rctxp); +struct pt_regs **regs,int *rctxp); static inline void perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
include/linux/perf_event.h +21 -7
@@ -642,6 +642,7 @@ static inline int is_software_event(struextern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX ]; +extern void ___perf_sw_event (u32 ,u64 ,struct pt_regs *,u64 );extern void __perf_sw_event (u32 ,u64 ,struct pt_regs *,u64 );#ifndef perf_arch_fetch_caller_regs
@@ -666,14 +667,25 @@ static inline void perf_fetch_caller_reg static __always_inline voidperf_sw_event (u32 event_id,u64 nr,struct pt_regs *regs,u64 addr) { -struct pt_regs hot_regs; +if (static_key_false (&perf_swevent_enabled[event_id])) +__perf_sw_event (event_id, nr, regs, addr); +} + +DECLARE_PER_CPU(struct pt_regs, __perf_regs[4]); +/* +* 'Special' version for the scheduler, it hard assumes no recursion, +* which is guaranteed by us not actually scheduling inside other swevents +* because those disable preemption. +*/ +static __always_inline void +perf_sw_event_sched (u32 event_id,u64 nr,u64 addr) +{if (static_key_false (&perf_swevent_enabled[event_id])) { -if (!regs) { -perf_fetch_caller_regs (&hot_regs); - regs = &hot_regs; - } -__perf_sw_event (event_id, nr, regs, addr); +struct pt_regs *regs =this_cpu_ptr (&__perf_regs[0 ]); + +perf_fetch_caller_regs (regs); +___perf_sw_event (event_id, nr, regs, addr); } }
@@ -689,7 +701,7 @@ static inline void perf_event_task_schedstatic inline void perf_event_task_sched_out (struct task_struct *prev,struct task_struct *next) { -perf_sw_event (PERF_COUNT_SW_CONTEXT_SWITCHES ,1 ,NULL ,0 ); +perf_sw_event_sched (PERF_COUNT_SW_CONTEXT_SWITCHES ,1 ,0 );if (static_key_false (&perf_sched_events.key))__perf_event_task_sched_out (prev, next);
@@ -800,6 +812,8 @@ static inline int perf_event_refresh(strstatic inline void perf_sw_event (u32 event_id,u64 nr,struct pt_regs *regs,u64 addr) { }static inline void +perf_sw_event_sched (u32 event_id,u64 nr,u64 addr) { } +static inline void perf_bp_event (struct perf_event *event,void *data) { }static inline int perf_register_guest_info_callbacks
include/trace/ftrace.h +4 -3
@@ -765,7 +765,7 @@ perf_trace_##call(void *__data, proto)struct ftrace_event_call *event_call = __data; \ struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ struct ftrace_raw_##call *entry; \ - struct pt_regs __regs; \ + struct pt_regs *__regs; \ u64 __addr = 0, __count = 1; \ struct task_struct *__task = NULL; \ struct hlist_head *head; \
@@ -784,18 +784,19 @@ perf_trace_##call(void *__data, proto) sizeof(u64)); \ __entry_size -=sizeof (u32); \ \ -perf_fetch_caller_regs (&__regs); \ entry =perf_trace_buf_prepare (__entry_size, \ event_call->event.type, &__regs, &rctx); \if (!entry) \return ; \ \ +perf_fetch_caller_regs (__regs); \ + \ tstruct \ \ { assign; } \ \perf_trace_buf_submit (entry, __entry_size, rctx, __addr, \ - __count, &__regs, head, __task); \ + __count, __regs, head, __task); \ }/*
kernel/events/core.c +17 -6
@@ -5965,6 +5965,8 @@ end:rcu_read_unlock (); } +DEFINE_PER_CPU(struct pt_regs, __perf_regs[4]); +int perf_swevent_get_recursion_context (void ) {struct swevent_htable *swhash = &__get_cpu_var (swevent_htable);
@@ -5980,21 +5982,30 @@ inline void perf_swevent_put_recursion_cput_recursion_context (swhash->recursion, rctx); } -void __perf_sw_event (u32 event_id,u64 nr,struct pt_regs *regs,u64 addr) +void ___perf_sw_event (u32 event_id,u64 nr,struct pt_regs *regs,u64 addr) {struct perf_sample_data data; -int rctx; -preempt_disable_notrace (); - rctx =perf_swevent_get_recursion_context (); -if (rctx <0 ) +if (WARN_ON_ONCE (!regs))return ;perf_sample_data_init (&data, addr,0 ); -do_perf_sw_event (PERF_TYPE_SOFTWARE , event_id, nr, &data, regs); +} + +void __perf_sw_event (u32 event_id,u64 nr,struct pt_regs *regs,u64 addr) +{ +int rctx; + +preempt_disable_notrace (); + rctx =perf_swevent_get_recursion_context (); +if (unlikely (rctx <0 )) + goto fail; + +___perf_sw_event (event_id, nr, regs, addr);perf_swevent_put_recursion_context (rctx); +fail:preempt_enable_notrace (); }
kernel/sched/core.c +1 -1
@@ -1083,7 +1083,7 @@ void set_task_cpu(struct task_struct *p,if (p->sched_class->migrate_task_rq) p->sched_class->migrate_task_rq (p, new_cpu); p->se.nr_migrations++; -perf_sw_event (PERF_COUNT_SW_CPU_MIGRATIONS ,1 ,NULL ,0 ); +perf_sw_event_sched (PERF_COUNT_SW_CPU_MIGRATIONS ,1 ,0 ); tmn.task = p; tmn.from_cpu =task_cpu (p);
kernel/trace/trace_event_perf.c +3 -1
@@ -249,7 +249,7 @@ void perf_trace_del(struct perf_event *p }void *perf_trace_buf_prepare (int size,unsigned short type, -struct pt_regs *regs,int *rctxp) +struct pt_regs **regs,int *rctxp) {struct trace_entry *entry;unsigned long flags;
@@ -268,6 +268,8 @@ void *perf_trace_buf_prepare(int size, uif (*rctxp <0 )return NULL ; +if (regs) + *regs =this_cpu_ptr (&__perf_regs[*rctxp]); raw_data =this_cpu_ptr (perf_trace_buf[*rctxp]);/* zero the dead bytes from align to not leak stack to user */
kernel/trace/trace_kprobe.c +2 -2
@@ -1155,7 +1155,7 @@ kprobe_perf_func(struct trace_kprobe *tk size =ALIGN (__size +sizeof (u32),sizeof (u64)); size -=sizeof (u32); - entry =perf_trace_buf_prepare (size, call->event.type, regs, &rctx); + entry =perf_trace_buf_prepare (size, call->event.type,NULL , &rctx);if (!entry)return ;
@@ -1186,7 +1186,7 @@ kretprobe_perf_func(struct trace_kprobe size =ALIGN (__size +sizeof (u32),sizeof (u64)); size -=sizeof (u32); - entry =perf_trace_buf_prepare (size, call->event.type, regs, &rctx); + entry =perf_trace_buf_prepare (size, call->event.type,NULL , &rctx);if (!entry)return ;
kernel/trace/trace_syscalls.c +2 -2
@@ -586,7 +586,7 @@ static void perf_syscall_enter(void *ign size -=sizeof (u32); rec = (struct syscall_trace_enter *)perf_trace_buf_prepare (size, - sys_data->enter_event->event.type, regs, &rctx); + sys_data->enter_event->event.type,NULL , &rctx);if (!rec)return ;
@@ -659,7 +659,7 @@ static void perf_syscall_exit(void *igno size -=sizeof (u32); rec = (struct syscall_trace_exit *)perf_trace_buf_prepare (size, - sys_data->exit_event->event.type, regs, &rctx); + sys_data->exit_event->event.type,NULL , &rctx);if (!rec)return ;
kernel/trace/trace_uprobe.c +1 -1
@@ -1116,7 +1116,7 @@ static void __uprobe_perf_func(struct trif (hlist_empty (head)) goto out; - entry =perf_trace_buf_prepare (size, call->event.type, regs, &rctx); + entry =perf_trace_buf_prepare (size, call->event.type,NULL , &rctx);if (!entry) goto out;
PATCH 1/294 fuse: initialize the flock flag in fuse_file on allocation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Jurczyk <[email protected]>
commit 68227c03cba84a24faf8a7277d2b1a03c8959c2c upstream.
Before the patch, the flock flag could remain uninitialized for the lifespan of the fuse_file allocation. Unless set to true in fuse_file_flock(), it would remain in an indeterminate state until read in an if statement in fuse_release_common(). This could consequently lead to taking an unexpected branch in the code.
The bug was discovered by a runtime instrumentation designed to detect use of uninitialized memory in the kernel.
--- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/file.c +1 -1
@@ -54,7 +54,7 @@ struct fuse_file *fuse_file_alloc(struct {struct fuse_file *ff; - ff =kmalloc (sizeof (struct fuse_file ),GFP_KERNEL ); + ff =kzalloc (sizeof (struct fuse_file ),GFP_KERNEL );if (unlikely (!ff))return NULL ;
cover 3.16.50-rc1 review
This is the start of the stable review cycle for the 3.16.50 release. There are 294 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri Nov 08 18:00:00 UTC 2017. Anything received after that time might be too late.
A combined patch relative to 3.16.49 will be posted as an additional response to this. A shortlog and diffstat can be found below.
Ben.
-------------
A Raghavendra Rao (1):
Staging: wlan-ng: fix sparse warning in prism2fw.c
[41cb65c4854e14f12b1cbb8215e509d8ad4d0c88]
Aaron Ma (1):
Input: trackpoint - add new trackpoint firmware ID
[ec667683c532c93fb41e100e5d61a518971060e2]
Akinobu Mita (1):
iio: light: tsl2563: use correct event code
[a3507e48d3f99a93a3056a34a5365f310434570f]
Alan Stern (4):
USB: Check for dropped connection before switching to full speed
[94c43b9897abf4ea366ed4dba027494e080c7050]
USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor()
[1c0edc3633b56000e18d82fc241e3995ca18a69e]
USB: uas: fix bug in handling of alternate settings
[786de92b3cb26012d3d0f00ee37adf14527f35c4]
usb: usbtest: fix NULL pointer dereference
[7c80f9e4a588f1925b07134bb2e3689335f6c6d8]
Alan Swanson (1):
uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069
[89f23d51defcb94a5026d4b5da13faf4e1150a6f]
Alban Bedel (1):
MIPS: Fix the build on jz4740 after removing the custom gpio.h
[5b235dc2647e4977b17b5c41d959d0f455831c3f]
Alex Vesker (1):
IB/ipoib: Prevent setting negative values to max_nonsrq_conn_qp
[11f74b40359b19f760964e71d04882a6caf530cc]
Alexander Potapenko (1):
sctp: don't dereference ptr before leaving _sctp_walk_{params, errors}()
[b1f5bfc27a19f214006b9b4db7b9126df2dfdf5a]
Andrew Morton (1):
MODULE_DEVICE_TABLE: fix some callsites
[0f989f749b51ec1fd94bb5a42f8ad10c8b9f73cb]
Andrey Ryabinin (1):
module: fix types of device tables aliases
[6301939d97d079f0d3dbe71e750f4daf5d39fc33]
Andy Lutomirski (1):
x86/asm/64: Clear AC on NMI entries
[e93c17301ac55321fc18e0f8316e924e58a83c8c]
Andy Shevchenko (1):
platform/x86: samsung-laptop: Initialize loca variable
[0d2c95354a3b63256e92d9fb865c08902d2c9b0b]
Aneesh Kumar K.V (1):
powerpc/mm/hash: Free the subpage_prot_table correctly
[0da12a7a81f1e2255e89dc783c565e84801475a2]
Anil Gurumurthy (1):
bfa: Fix indentation
[b7f4d6343820af5c2dc3979e91d85e71e638cd3d]
Ard Biesheuvel (2):
ARM: 8221/1: PJ4: allow building in Thumb-2 mode
[13d1b9575ac2c2da143cd2236b6cf0fc314570f8]
ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
[5008efc83bf85b647aa1cbc44718b1675bbb7444]
Arend Van Spriel (1):
brcmfmac: add length check in brcmf_cfg80211_escan_handler()
[17df6453d4be17910456e99c5a85025aa1b7a246]
Arnd Bergmann (36):
ARM: 8296/1: cache-l2x0: clean up aurora cache handling
[20e783e39e55c2615fb61d1b3d139ee9edcf6772]
ARM: cns3xxx: shut up frame size warning
[498a92d42596a7a32c042319eb62a4c3d8081cf1]
ARM: pxa: select both FB and FB_W100 for eseries
[1d20d8a9fce8f1e2ef00a0f3d068fa18d59ddf8f]
Disable "frame-address" warning
[124a3d88fa20e1869fc229d7d8c740cc81944264]
MIPS: ip22: Fix ip28 build for modern gcc
[23ca9b522383d3b9b7991d8586db30118992af4a]
MIPS: jz4740: fix build error in irq.h
[not upstream; error was fixed by other changes]
ata: hpt366: fix constant cast warning
[6ec0a86c645be3fce7ade42f165a6a417c3503b1]
brcmfmac: avoid gcc-5.1 warning
[22f44150aad7a1d6b074ab6cf59abee61c7187c6]
cpmac: remove hopeless #warning
[d43e6fb4ac4abfe4ef7c102833ed02330ad701e0]
dm bufio: hide bogus warning
[not upstream; warning is avoided by other changes]
gfs2: remove IS_ERR_VALUE abuse
[287980e49ffc0f6d911601e7e352a812ed27768e]
hostap: avoid uninitialized variable use in hfa384x_get_rid
[48dc5fb3ba53b20418de8514700f63d88c5de3a3]
i2o: hide unsafe ioctl on 64-bit
[not upstream; driver has been removed]
iio: adc: fix building on 64-bit
[e49d99e0ecc88191c2e51a6535b1d0df635f1f3b]
infiniband: mlx5: avoid a compile-time warning
[7835bfb5261501590a508b3de3379e2231cb4853]
iwlegacy: avoid warning about missing braces
[2cce76c3fab410520610a7d2f52faebc3cfcf843]
mISDN: avoid arch specific __builtin_return_address call
[3e7a8716e20b759eec0ad88145255bb33174f0c8]
mlx5: avoid build warnings on 32-bit
[065bd8c28ba37d04c9a5b732173c1508954b1f58]
mtd: cfi: reduce stack size
[d09957fbb4d0b059b3176b510540df69048ad170]
mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
[906b268477bc03daaa04f739844c120fe4dbc991]
net/xen-netback: disable on 64KB page granularity
[d0089e8a0e4c9723d85b01713671358e3d6960df]
net: am2150: fix nmclan_cs.c shared interrupt handling
[96a30175f927facfb421655ef08b7a0fe546fbed]
net: caif: fix misleading indentation
[8e0cc8c326d99e41468c96fea9785ab78883a281]
net: tulip: turn compile-time warning into dev_warn()
[de92718883ddbcd11b738d36ffcf57617b97fa12]
net: vxge: avoid unused function warnings
[57e7c8cef224af166b8ec932b5e383641418c005]
qlge: avoid memcpy buffer overflow
[e58f95831e7468d25eb6e41f234842ecfe6f014f]
scsi-tgt: fix type conversion warning
[not upstream; driver has been removed]
scsi: advansys: remove #warning message
[6571fb3f8b7f7e9595174e01b7e7f1b1ba0427d4]
staging: bcm: add 32-bit host dependency
[not upstream; driver has been removed]
staging: imx-drm: fix indentation warning
[d083c312cba2735566af9598cb281ea2ae6b729a]
staging: r8192ee: prorperly format warning message
[not upstream; driver has been removed]
staging: vt6655: fix overly large stack usage
[67013f2c0e5811a4fd60c51e3233e1f027d1c1e0]
staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
[105967ad68d2eb1a041bc041f9cf96af2a653b65]
tty/isicom: fix big-endian compile warning
[f3e2d56dce47dbd0bb3f69f84741b439542fef37]
tty: nozomi: avoid a harmless gcc warning
[a4f642a8a3c2838ad09fe8313d45db46600e1478]
video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT
[9c8ee3c7341393811d5be5eb61b815e76f92c799]
Atsushi Nemoto (2):
MIPS: TXx9: Delete an unused variable in tx4927_pcibios_setup
[1bc2d3e38e5bf90af4e9d64e1696f2d39757355a]
mtd: maps: rbtx4939-flash: delete an unused variable in rbtx4939_flash_remove
[e4c4c9c15ebe8ec03b7f5bf36e079052cc88217c]
Banajit Goswami (1):
ASoC: do not close shared backend dailink
[b1cd2e34c69a2f3988786af451b6e17967c293a0]
Bart Van Assche (2):
IB/cma: Fix a race condition in iboe_addr_get_sgid()
[fba332b079029c2f4f7e84c1c1cd8e3867310c90]
dm: fix printk() rate limiting code
[604407890ecf624c2fb41013c82b22aade59b455]
Ben Hutchings (3):
ALSA: seq: Enable 'use' locking in all configurations
[8009d506a1dd00cf436b0c4cca0dcec130580a21]
alpha: uapi: Add support for __SANE_USERSPACE_TYPES__
[cec80d82142ab25c71eee24b529cfeaf17c43062]
dst: Increase alignment of metrics to allow extra flag on pointers
[not upstream; only needed in older branches]
Bjorn Andersson (1):
spmi: Include OF based modalias in device uevent
[d50daa2af2618dab6d21634e65a5fbcf4ae437d6]
Bodo Stroesser (1):
scsi: st: fix blk_get_queue usage
[180efde0a3f43dbe533e4be203c2918793482d4e]
Charles Milette (1):
staging: rtl8188eu: add RNX-N150NUB support
[f299aec6ebd747298e35934cff7709c6b119ca52]
Chen Yu (1):
PM/hibernate: touch NMI watchdog when creating snapshot
[556b969a1cfe2686aae149137fa1dfcac0eefe54]
Chris Gorman (1):
i2c: mux: pinctrl: mention correct module name in Kconfig help text
[d1510a2e5ab6cb3a67f1c55ca5e7a6d2c6dec340]
Chris Wilson (1):
drm: Release driver tracking before making the object available again
[fe4600a548f2763dec91b3b27a1245c370ceee2a]
Chuck Lever (1):
nfsd: Limit end of page list when decoding NFSv4 WRITE
[fc788f64f1f3eb31e87d4f53bcf1ab76590d5838]
Chunyu Hu (1):
tracing: Fix kmemleak in instance_rmdir
[db9108e054700c96322b0f0028546aa4e643cf0b]
Colin Ian King (3):
Staging: iio: adc: fix indent on break statement
[b6acb0cfc21293a1bfc283e9217f58f7474ef728]
netxen: fix incorrect loop counter decrement
[a120d9ab65354727559b9db75ded8071b7ef19e2]
usb: storage: return on error to avoid a null pointer dereference
[446230f52a5bef593554510302465eabab45a372]
Cong Wang (1):
wl1251: add a missing spin_lock_init()
[f581a0dd744fe32b0a8805e279c59ec1ac676d60]
Dan Carpenter (11):
IB/cxgb3: Fix error codes in iwch_alloc_mr()
[9064d6055c14f700aa13f7c72fd3e63d12bee643]
RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()
[dd75cfa6d3216c79c695f5af13e52208afe374ad]
RDMA/ocrdma: Fix error codes in ocrdma_create_srq()
[f0c6e88288d65c93bbc7da4fb6f7d51b2733228a]
Staging: lustre: missing curly braces in ll_setattr_raw()
[53bd4a004ee5ff0f71a858de78faac98924b4a87]
cxgb4: Fix error codes in c4iw_create_cq()
[6ebedacbb44602d4dec3348dee5ec31dd9b09521]
drm/i915: cleanup some indenting
[ba0635ffb7665d76715b43ae8144e014a90c1e63]
drm/msm: fix an integer overflow test
[65e93108891e571f177c202add9288eda9ac4100]
libata: array underflow in ata_find_dev()
[59a5e266c3f5c1567508888dd61a45b86daed0fa]
libceph: potential NULL dereference in ceph_msg_data_create()
[7c40b22f6f84c98a1d36e6d0a4346e58f05e45d8]
paride: fix the "verbose" module param
[946e87981942552e526aca9cb6204f02a6c847cb]
x86/ldt: Fix off by one in get_segment_base()
[eaa2f87c6b840b83827c40db6eb8481689570259]
Dave Martin (1):
arm64: fpsimd: Prevent registers leaking across exec
[096622104e14d8a1db4860bd557717067a0515d2]
David Howells (2):
KEYS: don't let add_key() update an uninstantiated key
[60ff5b2f547af3828aebafd54daded44cfb0807a]
assoc_array: Fix a buggy node-splitting case
[ea6789980fdaa610d7eb63602c746bf6ec70cd2b]
David Malcolm (1):
drivers/net/ethernet/dec/tulip/uli526x.c: fix misleading indentation in uli526x_timer
[e1395a321eab1a7833d82e952eb8255e0a1f03cb]
David Miller (1):
netfilter: Fix switch statement warnings with recent gcc.
[c1f866767777d1c6abae0ec57effffcb72017c00]
David S. Miller (1):
netfilter; Add some missing default cases to switch statements in nft_reject.
[129d23a56623eea0947a05288158d76dc7f2f0ac]
Doug Berger (2):
net: bcmgenet: Fix unmapping of fragments in bcmgenet_xmit()
[876dbadd53a7102e2a84afc84ea2bd3ee6dc5636]
net: bcmgenet: Free skb after last Tx frag
[f48bed16a756f5bc0244acd581f61968f7d7c2a4]
Dragos Bogdan (1):
iio: imu: adis16480: Fix acceleration scale factor for adis16480
[fdd0d32eb95f135041236a6885d9006315aa9a1d]
Emmanuel Grumbach (1):
iwlwifi: dvm: prevent an out of bounds access
[0b0f934e92a8eaed2e6c48a50eae6f84661f74f3]
Eric Biggers (1):
KEYS: prevent KEYCTL_READ on negative key
[37863c43b2c6464f252862bf2e9768264e961678]
Eric Dumazet (6):
af_key: do not use GFP_KERNEL in atomic contexts
[36f41f8fc6d8aa9f8c9072d66ff7cf9055f5e69b]
ipv4: add reference counting to metrics
[3fb07daff8e99243366a081e5129560734de4ada]
ipv4: fix NULL dereference in free_fib_info_rcu()
[187e5b3ac84d3421d2de3aca949b2791fbcad554]
net: reduce skb_warn_bad_offload() noise
[b2504a5dbef3305ef41988ad270b0e8ec289331c]
net: skb_needs_check() accepts CHECKSUM_NONE for tx
[6e7bc478c9a006c701c14476ec9d389a484b4864]
net_sched: fix error recovery at qdisc creation
[87b60cfacf9f17cf71933c6e33b66e68160af71d]
Feras Daoud (1):
IB/ipoib: Set IPOIB_NEIGH_TBL_FLUSH after flushed completion initialization
[d2e46fccc3e3d73a741efe433f00960331280696]
Florian Fainelli (12):
b44: Initialize 64-bit stats seqcount
[e43c9f23efadade684773a855675c99da278c862]
i40e: Initialize 64-bit statistics TX ring seqcount
[7d6d067790289e4f61f59fa60550ca5918aa25bd]
irqchip: brcmstb-l2: Define an irq_pm_shutdown function
[c017d21147848fe017772764a77a7f32c5b017f9]
ixgbe: Initialize 64-bit stats seqcounts
[7c3a4626eb65e78ebe208f48ffa21a5002f7f38e]
net: bcmgenet: Be drop monitor friendly
[d4fec855905fa8bd5fb1c59f73ad2d74a944876a]
net: bcmgenet: check harder for out of memory conditions
[b629be5c8399d7c423b92135eb43a86c924d1cbc]
net: bcmgenet: fix off-by-one in incrementing read pointer
[cf377d886f7944a5ccdbd164b89949e13617b096]
net: bcmgenet: update ring producer index and buffer count in xmit
[ae67bf0188cbb9d1786bdfcca9e1976cb36ee327]
net: systemport: Be drop monitor friendly
[c45182eb967af11e9482168be5be41aa22e5d321]
net: systemport: Free DMA coherent descriptors on errors
[c2062ee3d9615828109ffe8089fbf69bed394d05]
r8169: Be drop monitor friendly
[7a4b813cb739ce598ffbad2e84d19d13fa23e25d]
r8169: Do not increment tx_dropped in TX ring cleaning
[1089650d8837095f63e001bbf14d7b48043d67ad]
FrançOis Romieu (1):
net: remove open-coded skb_cow_head.
[a40e0a664bce465a3b8ad1d792153cef8ded9f7d]
Geert Uytterhoeven (2):
Input: gscps2 - fix MODULE_DEVICE_TABLE invocation
[6c8afa88adce613c23f27e719f805cc2a6441b07]
spi: rspi: Remove unused variable in rspi_rz_transfer_one()
[95029a00886f0c8d79e700cb8983b881c75af0f1]
Gerald Schaefer (1):
mm/hugetlb: improve locking in dissolve_free_huge_pages()
[eb03aa008561004257900983193d024e57abdd96]
Greg Kroah-Hartman (1):
USB: fix out-of-bounds in usb_set_configuration
[bd7a3fe770ebd8391d1c7d072ff88e9e76d063eb]
Guillaume Nault (8):
l2tp: define parameters of l2tp_session_get*() as "const"
[9aaef50c44f132e040dcd7686c8e78a3390037c5]
l2tp: hold tunnel used while creating sessions with netlink
[e702c1204eb57788ef189c839c8c779368267d70]
l2tp: hold tunnel while handling genl TUNNEL_GET commands
[4e4b21da3acc68a7ea55f850cacc13706b7480e9]
l2tp: hold tunnel while handling genl tunnel updates
[8c0e421525c9eb50d68e8f633f703ca31680b746]
l2tp: hold tunnel while looking up sessions in l2tp_netlink
[54652eb12c1b72e9602d09cb2821d5760939190f]
l2tp: hold tunnel while processing genl delete command
[bb0a32ce4389e17e47e198d2cddaf141561581ad]
l2tp: initialise session's refcount before making it reachable
[9ee369a405c57613d7c83a3967780c3e30c52ecc]
l2tp: remove useless duplicate session detection in l2tp_netlink
[af87ae465abdc070de0dc35d6c6a9e7a8cd82987]
Hannes Reinecke (1):
aic94xx: Skip reading user settings if flash is not found
[36dd5acd196574d41de3e81d8264df475bbb7123]
Hector Martin (1):
USB: serial: option: add D-Link DWM-222 device ID
[fd1b8668af59a11bb754a6c9b0051c6c5ce73b74]
Icenowy Zheng (1):
pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver
[d81ece747d8727bb8b1cfc9a20dbe62f09a4e35a]
Inbar Karmy (1):
net/mlx4_en: Fix wrong indication of Wake-on-LAN (WoL) support
[c994f778bb1cca8ebe7a4e528cefec233e93b5cc]
Ingo Molnar (1):
x86/boot: Add CONFIG_PARAVIRT_SPINLOCKS quirk to arch/x86/boot/compressed/misc.h
[927392d73a97d8d235bb65400e2e3c7f0bec2b6f]
Iván Briano (1):
net/packet: Fix Tx queue selection for AF_PACKET
[ccd4eb49f3392ebf989d58bd013a7bf44cdca4d6]
Jaejoong Kim (1):
HID: usbhid: fix out-of-bounds bug
[f043bfc98c193c284e2cd768fefabe18ac2fed9b]
James Bottomley (1):
ips: remove pointless #warning
[e03c2da6574223081b786960e39c1e5ecf5d492d]
Jan Kara (3):
audit: Fix use after free in audit_remove_watch_rule()
[d76036ab47eafa6ce52b69482e91ca3ba337d6d6]
ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
[fcf5ea10992fbac3c7473a1db33d56a139333cd1]
ocfs2: don't clear SGID when inheriting ACLs
[19ec8e48582670c021e998b9deb88e39a842ff45]
Jeff Kirsher (2):
am2150: Update nmclan_cs.c to use update PCMCIA API
[5f5316fcd08ef74b282adf6774956431fac62663]
e1000e: fix call to do_div() to use u64 arg
[30544af5483755b11bb5924736e9e0b45ef0644a]
Jerry Lee (1):
ext4: fix overflow caused by missing cast in ext4_resize_fs()
[aec51758ce10a9c847a62a48a168f8c804c6e053]
Jiahau Chang (1):
xhci: Bad Ethernet performance plugged in ASM1042A host
[9da5a1092b13468839b1a864b126cacfb72ad016]
Jin Yao (1):
perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target
[80f62589fa52f530cffc50e78c0b5a2ae572d61e]
Jiri Olsa (1):
perf/core: Fix locking for children siblings group read
[2aeb1883547626d82c597cce2c99f0b9c62e2425]
Joe Perches (2):
dm: convert DM printk macros to pr_<level> macros
[d2c3c8dcb5987b8352e82089c79a41b6e17e28d2]
i40e: Reduce stack in i40e_dbg_dump_desc
[e6c97234d1b18d4751671df15d52e29daa8a7ba8]
Joerg Roedel (1):
iommu/amd: Fix schedule-while-atomic BUG in initialization code
[74ddda71f44c84af62f736a77fb9fcebe5bb436a]
Johan Hovold (1):
USB: cdc-acm: add device-id for quirky printer
[fe855789d605590e57f9cd968d85ecce46f5c3fd]
Johannes Berg (1):
mac80211: accept key reinstall without changing anything
[fdf7cb4185b60c68e1a75e61691c4afdc15dea0e]
Juergen Gross (1):
x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
[1cf38741308c64d08553602b3374fb39224eeb5a]
Julian Wiedmann (1):
s390/qeth: fix L3 next-hop in xmit qeth hdr
[ec2c6726322f0d270bab477e4904bf9496f70ee5]
Kai-Heng Feng (1):
usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter
[7496cfe5431f21da5d27a8388c326397e3f0a5db]
Kasin Li (1):
drm/msm: Fix potential buffer overflow issue
[4a630fadbb29d9efaedb525f1a8f7449ad107641]
Kevin Cernekee (1):
MIPS: BMIPS: Fix ".previous without corresponding .section" warnings
[4ec8f9e9b08451303253249e4e302f10ee23d565]
Konrad Zapalowicz (1):
staging: dgnc: Fix frame size is larger than 1024B
[ea6e9dea2e72a7abd146a2c5bab726b27f34b36c]
Konstantin Khlebnikov (2):
net_sched/sfq: update hierarchical backlog when drop packet
[325d5dc3f7e7c2840b65e4a2988c082c2c0025c5]
net_sched: fix order of queue length updates in qdisc_replace()
[68a66d149a8c78ec6720f268597302883e48e9fa]
Lars Ellenberg (1):
drbd: avoid redefinition of BITS_PER_PAGE
[2630628b2dbc3fc320aafaf84836119e4e3d62f1]
Laurent Vivier (1):
powerpc/pseries: Fix of_node_put() underflow during reconfig remove
[4fd1bd443e80b12f0a01a45fb9a793206b41cb72]
Lee Jones (1):
mfd: arizona: Rid data size incompatibility warn when building for 64bit
[942786e6e647cef94cf96dcd836d343be55fc452]
Leon Romanovsky (2):
IB/ipoib: Remove double pointer assigning
[1b355094b308f3377c8f574ce86135ee159c6285]
RDMA/uverbs: Prevent leak of reserved field
[f7a6cb7b38c6845b26aaa8bbdf519ff6e3090831]
Linus Lüssing (1):
batman-adv: fix TT sync flag inconsistencies
[54e22f265e872ae140755b3318521d400a094605]
Linus Torvalds (1):
Clarify (and fix) MAX_LFS_FILESIZE macros
[0cc3b0ec23ce4c69e1e890ed2b8d2fa932b14aad]
Linus Walleij (1):
gpio: drop retval check enforcing from gpiochip_remove()
[14c8a620ba436511b1347c592633befa49535176]
Luis de Bethencourt (2):
mvsas: fix misleading indentation
[7789cd39274c51bf475411fe22a8ee7255082809]
staging: rtl8723au: core: rtw_wlan_util: fix misleading indentation
[8c182ae20791d638c07ff499709c4a1d4697bd7c]
Maciej W. Rozycki (1):
MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression
[68fe55680d0f3342969f49412fceabb90bdfadba]
Mahesh Bandewar (1):
ipv4: initialize fib_trie prior to register_netdev_notifier call.
[8799a221f5944a7d74516ecf46d58c28ec1d1f75]
Manuel Schölling (1):
xilinx: Fix compiler warning
[9f8b93cb32e088d3377c86fabb666b884bac0f12]
Mark Brown (7):
ASoC: adau1977: Fix truncation warning on 64 bit architectures
[d8df26bb57d2a86365de46a5421b97417401e39a]
ASoC: imx-audmux: Use uintptr_t for port numbers
[e5f89768e9bc1f441d18e2299518a2907e5017c9]
Input: joystick - use get_cycles on ARMv8
[a6b48699ae50ccce700506ced863ba1f5ce2af11]
dma: pl08x: Use correct specifier for size_t values
[6fc8ae787c589245ee3395630d2c428a1afab26c]
power/reset: xgene-reset: Fix prototype of xgene_restart()
[d3ed534cca703b2aaeee9277a5b8063ae6eab1d1]
spi/atmel: Fix pointer to int conversion warnings on 64 bit builds
[67f08d690aa90e47a0e793fc63e2ecbe95d29839]
spi/pl022: Explicitly truncate large bitmask
[d555ea05f9d8ebf567eaa6b4e4cb5776aacf2940]
Mark Rutland (2):
arm64: mm: abort uaccess retries upon fatal signal
[289d07a2dc6c6b6f3e4b8a62669320d99dbe6c3d]
perf/core: Fix group {cpu,task} validation
[64aee2a965cf2954a038b5522f11d2cd2f0f8f3e]
Martin KaFai Lau (1):
ipv6: Add rt6_get_cookie() function
[b197df4f0f3782782e9ea8996e91b65ae33e8dd9]
Masami Hiramatsu (1):
kprobes/x86: Release insn_slot in failure path
[38115f2f8cec8087d558c062e779c443a01f87d6]
Mateusz Jurczyk (1):
fuse: initialize the flock flag in fuse_file on allocation
[68227c03cba84a24faf8a7277d2b1a03c8959c2c]
Mathias Krause (2):
xfrm_user: fix info leak in build_aevent()
[931e79d7a7ddee4709c56b39de169a36804589a1]
xfrm_user: fix info leak in xfrm_notify_sa()
[50329c8a340c9dea60d837645fcf13fc36bfb84d]
Mathias Nyman (2):
xhci: Fix NULL pointer dereference when cleaning up streams for removed host
[4b895868bb2da60a386a17cde3bf9ecbc70c79f4]
xhci: fix 20000ms port resume timeout
[a54408d0a004757789863d74e29c2297edae0b4d]
Max Filippov (3):
xtensa: don't limit csum_partial export by CONFIG_NET
[7f81e55c737a8fa82c71f290945d729a4902f8d2]
xtensa: fix cache aliasing handling code for WT cache
[6d0f581d1768d3eaba15776e7dd1fdfec10cfe36]
xtensa: mm/cache: add missing EXPORT_SYMBOLs
[bc652eb6a0d5cffaea7dc8e8ad488aab2a1bf1ed]
[email protected] (1):
crypto: x86/sha1 - Fix reads beyond the number of blocks passed
[8861249c740fc4af9ddc5aee321eafefb960d7c6]
Michael Ellerman (1):
powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler
[65c5ec11c25eff6ba6e9b1cbfff014875fddd1e0]
Michael Gugino (1):
staging: rtl8188eu: add TL-WN722N v2 support
[5a1d4c5dd4eb2f1f8a9b30e61762f3b3b564df70]
Michal Kalderon (1):
IB/cma: Fix reference count leak when no ipv4 addresses are set
[963916fdb3e5ad4af57ac959b5a03bf23f7568ca]
Michał Mirosław (1):
gpio: tegra: fix unbalanced chained_irq_enter/exit
[9e9509e38fbe034782339eb09c915f0b5765ff69]
Moshe Shemesh (1):
net/mlx5: Fix command bad flow on command entry allocation failure
[219c81f7d1d5a89656cb3b53d3b4e11e93608d80]
Mustafa Ismail (2):
RDMA/core: Initialize port_num in qp_attr
[a62ab66b13a0f9bcb17b7b761f6670941ed5cd62]
RDMA/uverbs: Fix the check for port number
[5a7a88f1b488e4ee49eb3d5b82612d4d9ffdf2c3]
Nadav Amit (1):
mm: migrate: prevent racy access to tlb_flush_pending
[16af97dc5a8975371a83d9e30a64038b48f40a2d]
Naftali Goldstein (1):
iwlwifi: mvm: set the RTS_MIMO_PROT bit in flag mask when sending sta to fw
[8addabf8e6e299f790038fdc92ddceaaf76adab8]
Nicholas Bellinger (1):
iscsi-target: Fix iscsi_np reset hung task during parallel delete
[978d13d60c34818a41fc35962602bdfa5c03f214]
Nicolin Chen (1):
ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous Mode
[855675f6e6a65688a7f4cf45b9b5a98cf6c6f5c3]
Nikolay Aleksandrov (9):
net: bridge: fix dest lookup when vlan proto doesn't match
[31a4562d7408493c6377933ff2f7d7302dbdea80]
sch_cbq: fix null pointer dereferences on init failure
[3501d059921246ff617b43e86250a719c140bd97]
sch_fq_codel: avoid double free on init failure
[30c31d746d0eb458ae327f522bc8e4c44cbea0f0]
sch_hfsc: fix null pointer deref and double free on init failure
[3bdac362a2f89ed3e148fa6f38c5f5d858f50b1a]
sch_hhf: fix null pointer dereference on init failure
[32db864d33c21fd70a217ba53cb7224889354ffb]
sch_htb: fix crash on init failure
[88c2ace69dbef696edba77712882af03879abc9c]
sch_multiq: fix double free on init failure
[e89d469e3be3ed3d7124a803211a463ff83d0964]
sch_netem: avoid null pointer deref on init failure
[634576a1844dba15bc5e6fc61d72f37e13a21615]
sch_tbf: fix two null pointer dereferences on init failure
[c2d6511e6a4f1f3673d711569c00c3849549e9b0]
Nikolay Borisov (1):
ARM: kexec: Make .text R/W in machine_kexec
[42d720d1731a9d7035c2812437c35e271ec4dd78]
Ofer Heifetz (1):
md/raid5: add thread_group worker async_tx_issue_pending_all
[7e96d559634b73a8158ee99a7abece2eacec2668]
Oleg Nesterov (1):
epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove()
[138e4ad67afd5c6c318b056b4d17c17f2c0ca5c0]
Oliver O'Halloran (1):
mm/init: fix zone boundary creation
[90cae1fe1c3540f791d5b8e025985fa5e699b2bb]
Omar Sandoval (1):
xfs: fix inobt inode allocation search optimization
[c44245b3d5435f533ca8346ece65918f84c057f9]
Paul Burton (1):
net: ti: cpmac: Fix compiler warning due to type confusion
[2f5281ba2a8feaf6f0aee93356f350855bb530fc]
Paul Gortmaker (2):
modpost: don't emit section mismatch warnings for compiler optimizations
[4a3893d069b788f3570c19c12d9e986e8e15870f]
modpost: expand pattern matching to support substring matches
[09c20c032b0f753969ae778d9783d946f054d7fe]
Paul Mackerras (1):
KVM: PPC: Book3S HV: Enable TM before accessing TM registers
[e47057151422a67ce08747176fa21cb3b526a2c9]
Pavel Shilovsky (1):
CIFS: Fix maximum SMB2 header size
[9e37b1784f2be9397a903307574ee565bbadfd75]
Peter Zijlstra (2):
perf/core: Invert perf_read_group() loops
[fa8c269353d560b7c28119ad7617029f92e40b15]
perf: Avoid horrible stack usage
[86038c5ea81b519a8a1fcfcd5e4599aab0cdd119]
Petri Gynther (4):
net: bcmgenet: cleanup for bcmgenet_xmit_frag()
[824ba603573d910e32df75fe6a5e7d7ec2a0a6a7]
net: bcmgenet: fix dev->stats.tx_bytes accounting
[55868120a3e5420bf5aa26a816c07d691579c9e6]
net: bcmgenet: rewrite bcmgenet_rx_refill()
[d6707bec598649450ee0887bf11896e525777874]
net: bcmgenet: simplify __bcmgenet_tx_reclaim()
[66d06757d9eb74a29775737b8c770e3b57e536d9]Prabhakar Lad (1):
media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl
[da05d52d2f0f6bd61094a0cd045fed94bf7d673a]
Rafael J. Wysocki (1):
USB: hcd: Mark secondary HCD as dead if the primary one died
[cd5a6a4fdaba150089af2afc220eae0fef74878a]
Ralf Baechle (3):
MIPS: DEC: Avoid la pseudo-instruction in delay slots
[3021773c7c3e75e20b693931a19362681e744ea9]
MIPS: elf2ecoff: Fix warning due to dead code.
[2d76e9633b572ae5a64150b638eed77f4afc12db]
MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers.
[26f7c4bd05cf34e63a4a794150ab66a40a5a84a9]
Ronnie Sahlberg (2):
cifs: check MaxPathNameComponentLength != 0 before using it
[f74bc7c6679200a4a83156bb89cbf6c229fe8ec0]
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
[d3edede29f74d335f81d95a4588f5f136a9f7dcf]Russell King (1):
ARM: kexec: fix failure to boot crash kernel
[0d70262a2d60886da6fe5b1fc8bbcd76cbbc306d]
Rusty Russell (1):
cpumask_set_cpu_local_first => cpumask_local_spread, lament
[f36963c9d3f6f415732710da3acdd8608a9fa0e]
Ryusuke Konishi (1):
nilfs2: fix gcc uninitialized-variable warnings in powerpc build
[4f05028f8d1af782cfd03d09e0a052e9745dc5ad]
Sabrina Dubroca (1):
netfilter: ipt_CLUSTERIP: fix use-after-free of proc entry
[3840538ad384fb7891adeeaf36624f870c51fc0e]
Sachin Prabhu (1):
cifs: Fix df output for users with quota limits
[42bec214d8bd432be6d32a1acb0a9079ecd4d142]
Sandeep Singh (1):
usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume
[e788787ef4f9c24aafefc480a8da5f92b914e5e6]
Sean Young (1):
media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds
[9f5039ba440e499d85c29b1ddbc3cbc9dc90e44b]
Sergei A. Trusov (1):
ALSA: hda - Fix speaker output from VAIO VPCL14M1R
[3f3c371421e601fa93b6cb7fb52da9ad59ec90b4]
Sergey Ryazanov (1):
MIPS: MSP71xx: remove odd locking in PCI config space access code
[c4a305374bbf36414515d2ae00d588c67051e67d]
Seunghun Han (1):
x86/acpi: Prevent out of bound access caused by broken ACPI tables
[dad5ab0db8deac535d03e3fe3d8f2892173fa6a4]
Shu Wang (1):
xhci: fix memleak in xhci_run()
[d6f5f071f1e13cadecf8aef1faa7e5d6fbc9f33b]
Sinclair Yeh (1):
drm/vmwgfx: Fix gcc-7.1.1 warning
[fcfffdd8f98ac305285dca568b5065ef86be6458]
Stefan Triller (1):
USB: serial: cp210x: add support for Qivicon USB ZigBee dongle
[9585e340db9f6cc1c0928d82c3a23cc4460f0a3f]Stefan-Gabriel Mirea (1):
iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits
[d466d3c1217406b14b834335b5b4b33c0d45bd09]
Stefano Brivio (1):
ipv6: accept 64k - 1 packet length in ip6_find_1stfragopt()
[3de33e1ba0506723ab25734e098cf280ecc34756]
Steffen Klassert (1):
ipv6: Fix may be used uninitialized warning in rt6_check
[3614364527daa870264f6dde77f02853cdecd02c]
Stephen Boyd (1):
of: device: Export of_device_{get_modalias, uvent_modalias} to modules
[7a3b7cd332db08546f3cdd984f11773e0d1999e7]
Stephen Douthit (2):
i2c: ismt: Don't duplicate the receive length for block reads
[b6c159a9cb69c2cf0bf59d4e12c3a2da77e4d994]
i2c: ismt: Return EMSGSIZE for block reads with bogus length
[ba201c4f5ebe13d7819081756378777d8153f23e]
Stephen Hemminger (1):
netvsc: fix deadlock betwen link status and removal
[9b4e946ce14e20d7addbfb7d9139e604f9fda107]
Steve Dickson (1):
mount: copy the port field into the cloned nfs_server structure.
[89a6814d9b665b196aa3a102f96b6dc7e8cb669e]
Steve French (1):
CIFS: remove endian related sparse warning
[6e3c1529c39e92ed64ca41d53abadabbaa1d5393]
Steven Rostedt (1):
tracing: Fix freeing of filter in create_filter() when set_str is false
[8b0db1a5bdfcee0dbfa89607672598ae203c9045]
Takashi Iwai (6):
ALSA: core: Fix unexpected error at replacing user TLV
[88c54cdf61f508ebcf8da2d819f5dfc03e954d1d]
ALSA: hda - Add stereo mic quirk for Lenovo G50-70 (17aa:3978)
[bbba6f9d3da357bbabc6fda81e99ff5584500e76]
ALSA: seq: Fix use-after-free at creating a port
[71105998845fb012937332fe2e806d443c09e026]
ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices
[0f174b3525a43bd51f9397394763925e0ebe7bc7]
ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
[bfc81a8bc18e3c4ba0cbaa7666ff76be2f998991]
ALSA: usb-audio: Kill stray URB at exiting
[124751d5e63c823092060074bd0abaae61aaa9c4]Tejun Heo (3):
cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs
[b339752d054fb32863418452dff350a1086885b1]
workqueue: implicit ordered attribute should be overridable
[0a94efb5acbb6980d7c9ab604372d93cd507e4d8]
workqueue: restore WQ_UNBOUND/max_active==1 to be ordered
[5c0338c68706be53b3dc472e4308961c36e4ece1]Thomas Bogendoerfer (1):
parisc: pci memory bar assignment fails with 64bit kernels on dino/cujo
[4098116039911e8870d84c975e2ec22dab65a909]
Tim Gardner (1):
be2iscsi: Fix bogus WARN_ON length check
[dd29dae00d39186890a5eaa2fe4ad8768bfd41a9]
Timur Tabi (1):
ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()
[acf2c60a60b3d6d7080854b9483f37d99ded9b23]
Tony Lindgren (1):
ARM: OMAP: Fix Kconfig warning for omap1
[52aaac5ae52ad9a7016410ffeedbaf24b722f3a2]
Uwe Kleine-König (3):
ARM: 8160/1: drop warning about return_address not using unwind tables
[e16343c47e4276f5ebc77ca16feb5e50ca1918f9]
clk/efm32gg: fix dt init prototype
[8ce8ebeb572d70e672a8d158e93ffaac80ea7576]
mtd: nandsim: remove debugfs entries in error path
[b974696da1cfc5aa0c29ed97dc8f6c239899e64b]
Varka Bhadram (1):
ethernet: amd: fix pci device ids
[ba69a3d78e4f51e65933a86b8b107c86709bb2f5]
Vitaly Mayatskikh (1):
fix unbalanced page refcounting in bio_map_user_iov
[95d78c28b5a85bacbc29b8dba7c04babb9b0d467]
Wanpeng Li (1):
KVM: async_pf: make rcu irq exit if not triggered from idle task
[337c017ccdf2653d0040099433fc1a2b1beb5926]
Wei Wang (3):
ipv6: add rcu grace period before freeing fib6_node
[c5cff8561d2d0006e972bd114afd51f082fee77c]
ipv6: fix sparse warning on rt6i_node
[4e587ea71bf924f7dac621f1351653bd41e446cb]
ipv6: reset fn->rr_ptr when replacing route
[383143f31d7d3525a1dbff733d52fff917f82f15]Willem de Bruijn (3):
net: avoid skb_warn_bad_offload false positives on UFO
[8d63bee643f1fb53e472f0e135cae4eb99d62d19]
packet: hold bind lock when rebinding to fanout hook
[008ba2a13f2d04c947adc536d19debb8fe66f110]
packet: in packet_do_bind, test fanout with bind_lock held
[4971613c1639d8e5f102c4e797c3bf8f83a5a69e]
Xiao Ni (1):
Raid5 should update rdev->sectors after reshape
[b5d27718f38843a74552e9a93d32e2391fd3999f]Xin Long (2):
ipv6: set rt6i_protocol properly in the route when it is installed
[b91d532928dff2141ea9c107c3e73104d9843767]
sctp: fix the check for _sctp_walk_params and _sctp_walk_errors
[6b84202c946cd3da3a8daa92c682510e9ed80321]
Yishai Hadas (1):
IB/uverbs: Fix device cleanup
[efdd6f53b10aead0f5cf19a93dd3eb268ac0d991]
Yoshihiro Shimoda (4):
usb: renesas_usbhs: fix usbhsc_resume() for !USBHSF_RUNTIME_PWCTRL
[59a0879a0e17b2e43ecdc5e3299da85b8410d7ce]
usb: renesas_usbhs: gadget: Fix NULL pointer dereference in usbhsg_ep_dequeue()
[c9eb29503e9655e70448bbbf3697d08a56d24854]
usb: renesas_usbhs: gadget: disable all eps when the driver stops
[b8b9c974afee685789fcbb191b52d1790be3608c]
usb: renesas_usbhs: gadget: fix re-enabling pipe without re-connecting
[dfb87b8bfe09f933abaf387693992089f6f9053e]
Zhong Jiang (1):
mm/mempolicy: fix use after free when calling get_mempolicy
[73223e4e2e3867ebf033a5a8eb2e5df0158ccc99]
Zubair Lutfullah Kakakhel (1):
MIPS: Fix a warning for virt_to_page
[4d5b3bdc0ecb0cf5b1e1598eeaaac4b5cb33868d]
Documentation/video4linux/v4l2-pci-skeleton.c | 2 +- Makefile | 5 +- arch/alpha/include/asm/types.h | 1 - arch/alpha/include/uapi/asm/types.h | 12 +- arch/arm/include/asm/kexec.h | 5 + arch/arm/kernel/iwmmxt.S | 13 + arch/arm/kernel/machine_kexec.c | 11 +- arch/arm/kernel/pj4-cp0.c | 4 + arch/arm/kernel/return_address.c | 4 - arch/arm/mach-cns3xxx/Makefile | 1 + arch/arm/mach-omap2/Kconfig | 3 - arch/arm/mach-pxa/Kconfig | 1 + arch/arm/mm/cache-l2x0.c | 111 ++--- arch/arm/plat-omap/Kconfig | 3 + arch/arm64/kernel/fpsimd.c | 2 + arch/arm64/mm/fault.c | 5 +- arch/mips/boot/elf2ecoff.c | 10 +- arch/mips/dec/int-handler.S | 18 +- arch/mips/include/asm/page.h | 3 +- arch/mips/jz4740/board-qi_lb60.c | 1 + arch/mips/jz4740/gpio.c | 1 + arch/mips/jz4740/irq.h | 2 + arch/mips/kernel/bmips_vec.S | 3 - arch/mips/pci/ops-pmcmsp.c | 12 - arch/mips/pci/ops-tx4927.c | 2 - arch/mips/sgi-ip22/Platform | 2 +- arch/powerpc/boot/Makefile | 16 +- arch/powerpc/kvm/book3s_hv.c | 2 + arch/powerpc/mm/subpage-prot.c | 2 +- arch/powerpc/platforms/pseries/reconfig.c | 1 - arch/x86/boot/compressed/misc.h | 11 +- arch/x86/crypto/sha1_avx2_x86_64_asm.S | 67 +-- arch/x86/crypto/sha1_ssse3_glue.c | 2 +- arch/x86/kernel/acpi/boot.c | 8 + arch/x86/kernel/cpu/perf_event.c | 7 +- arch/x86/kernel/entry_64.S | 2 + arch/x86/kernel/kprobes/core.c | 10 +- arch/x86/kernel/kvm.c | 6 +- arch/x86/xen/mmu.c | 2 +- arch/xtensa/kernel/xtensa_ksyms.c | 2 - arch/xtensa/mm/cache.c | 12 +- block/bio.c | 8 + drivers/ata/libata-scsi.c | 6 +- drivers/ata/pata_hpt366.c | 4 +- drivers/block/drbd/drbd_bitmap.c | 6 + drivers/block/paride/pg.c | 4 +- drivers/clk/clk-efm32gg.c | 6 +- drivers/dma/amba-pl08x.c | 4 +- drivers/gpio/gpio-tegra.c | 6 +- drivers/gpu/drm/drm_gem.c | 6 +- drivers/gpu/drm/i915/i915_debugfs.c | 5 +- drivers/gpu/drm/msm/msm_gem_submit.c | 7 +- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- drivers/hid/usbhid/hid-core.c | 12 +- drivers/i2c/busses/i2c-ismt.c | 6 +- drivers/i2c/muxes/Kconfig | 2 +- drivers/iio/adc/exynos_adc.c | 2 +- drivers/iio/adc/vf610_adc.c | 2 +- drivers/iio/imu/adis16480.c | 2 +- drivers/iio/light/tsl2563.c | 2 +- drivers/infiniband/core/cma.c | 2 + drivers/infiniband/core/uverbs_cmd.c | 5 +- drivers/infiniband/core/uverbs_main.c | 3 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 5 +- drivers/infiniband/hw/cxgb4/cq.c | 1 + drivers/infiniband/hw/mlx5/mem.c | 2 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 1 - drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +- drivers/input/joystick/analog.c | 2 +- drivers/input/mouse/trackpoint.c | 3 +- drivers/input/mouse/trackpoint.h | 3 +- drivers/input/serio/gscps2.c | 2 +- drivers/iommu/amd_iommu_init.c | 2 +- drivers/irqchip/irq-brcmstb-l2.c | 1 + drivers/isdn/hardware/mISDN/mISDNipac.c | 12 +- drivers/isdn/hardware/mISDN/w6692.c | 6 +- drivers/md/dm-bufio.c | 1 + drivers/md/dm.c | 10 - drivers/md/raid5.c | 6 +- drivers/media/platform/davinci/vpfe_capture.c | 22 +- drivers/media/rc/ir-lirc-codec.c | 2 +- drivers/message/i2o/i2o_config.c | 4 +- drivers/mfd/arizona-core.c | 4 +- drivers/mfd/arizona-i2c.c | 5 +- drivers/mfd/arizona-spi.c | 3 +- drivers/mfd/arizona.h | 4 +- drivers/mtd/maps/pmcmsp-flash.c | 4 +- drivers/mtd/maps/rbtx4939-flash.c | 2 - drivers/mtd/nand/nandsim.c | 1 + drivers/net/Kconfig | 3 + drivers/net/ethernet/amd/amd8111e.c | 19 +- drivers/net/ethernet/amd/nmclan_cs.c | 4 +- drivers/net/ethernet/broadcom/b44.c | 1 + drivers/net/ethernet/broadcom/bcmsysport.c | 4 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 456 ++++++++++----------- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 9 + drivers/net/ethernet/dec/tulip/tulip_core.c | 9 +- drivers/net/ethernet/dec/tulip/uli526x.c | 2 +- drivers/net/ethernet/dec/tulip/winbond-840.c | 2 +- drivers/net/ethernet/emulex/benet/be_main.c | 1 - drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 +- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 30 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 + drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 15 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 10 +- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 +- drivers/net/ethernet/mellanox/mlx4/fw.c | 4 + drivers/net/ethernet/mellanox/mlx4/fw.h | 1 + drivers/net/ethernet/mellanox/mlx4/main.c | 2 + drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 19 +- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 6 +- drivers/net/ethernet/neterion/vxge/vxge-main.c | 31 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +- drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 2 +- drivers/net/ethernet/realtek/r8169.c | 5 +- drivers/net/ethernet/ti/cpmac.c | 7 +- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +- drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 2 +- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +- drivers/net/hyperv/netvsc_drv.c | 9 +- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 2 +- .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 18 +- drivers/net/wireless/hostap/hostap_hw.c | 15 +- drivers/net/wireless/iwlegacy/3945.c | 3 +- drivers/net/wireless/iwlwifi/dvm/tx.c | 2 +- drivers/net/wireless/iwlwifi/mvm/sta.c | 3 +- drivers/net/wireless/ti/wl1251/main.c | 1 + drivers/of/device.c | 2 + drivers/parisc/dino.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 1 + drivers/platform/x86/samsung-laptop.c | 2 +- drivers/power/reset/xgene-reboot.c | 2 +- drivers/s390/net/qeth_l3_main.c | 4 +- drivers/scsi/advansys.c | 3 +- drivers/scsi/aic94xx/aic94xx_sds.c | 5 +- drivers/scsi/be2iscsi/be_main.c | 3 +- drivers/scsi/bfa/bfa_ioc.c | 22 +- drivers/scsi/ips.c | 9 +- drivers/scsi/mvsas/mv_sas.c | 4 +- drivers/scsi/scsi_tgt_if.c | 2 +- drivers/scsi/st.c | 4 +- drivers/spi/spi-atmel.c | 4 +- drivers/spi/spi-pl022.c | 2 +- drivers/spi/spi-rspi.c | 1 - drivers/spmi/spmi.c | 12 + drivers/staging/bcm/Kconfig | 1 + drivers/staging/dgnc/dgnc_tty.c | 16 +- drivers/staging/iio/adc/ad7192.c | 2 +- drivers/staging/iio/resolver/ad2s1210.c | 2 +- drivers/staging/imx-drm/imx-hdmi.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 +- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 + drivers/staging/rtl8192ee/pci.c | 4 +- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/vt6655/device_main.c | 10 +- drivers/staging/wlan-ng/prism2fw.c | 33 +- drivers/target/iscsi/iscsi_target.c | 1 + drivers/target/iscsi/iscsi_target_core.h | 1 + drivers/target/iscsi/iscsi_target_login.c | 7 +- drivers/tty/isicom.c | 2 +- drivers/tty/nozomi.c | 2 +- drivers/usb/class/cdc-acm.c | 3 + drivers/usb/core/config.c | 20 +- drivers/usb/core/hcd.c | 2 + drivers/usb/core/hub.c | 10 +- drivers/usb/core/quirks.c | 4 + drivers/usb/host/pci-quirks.c | 71 +++- drivers/usb/host/pci-quirks.h | 2 + drivers/usb/host/xhci-hub.c | 3 + drivers/usb/host/xhci-pci.c | 6 + drivers/usb/host/xhci-ring.c | 11 +- drivers/usb/host/xhci.c | 10 +- drivers/usb/host/xhci.h | 1 + drivers/usb/misc/usbtest.c | 5 +- drivers/usb/renesas_usbhs/common.c | 4 +- drivers/usb/renesas_usbhs/mod_gadget.c | 42 +- drivers/usb/renesas_usbhs/pipe.c | 10 + drivers/usb/renesas_usbhs/pipe.h | 1 + drivers/usb/serial/cp210x.c | 1 + drivers/usb/serial/option.c | 2 + drivers/usb/storage/isd200.c | 5 +- drivers/usb/storage/uas-detect.h | 15 +- drivers/usb/storage/uas.c | 10 +- drivers/usb/storage/unusual_uas.h | 4 +- drivers/video/fbdev/Kconfig | 3 +- fs/cifs/dir.c | 19 +- fs/cifs/smb2pdu.c | 4 +- fs/cifs/smb2pdu.h | 4 +- fs/eventpoll.c | 36 +- fs/ext4/file.c | 3 + fs/ext4/resize.c | 3 +- fs/fuse/file.c | 2 +- fs/gfs2/dir.c | 11 +- fs/nfs/client.c | 1 + fs/nfsd/nfs4xdr.c | 6 +- fs/nilfs2/btree.c | 2 +- fs/nilfs2/recovery.c | 4 +- fs/nilfs2/super.c | 5 +- fs/ocfs2/acl.c | 27 +- fs/xfs/xfs_ialloc.c | 2 +- include/asm-generic/topology.h | 6 +- include/linux/cpumask.h | 6 +- include/linux/device-mapper.h | 70 ++-- include/linux/fs.h | 4 +- include/linux/ftrace_event.h | 2 +- include/linux/gpio/driver.h | 2 +- include/linux/mlx4/device.h | 1 + include/linux/mm_types.h | 31 +- include/linux/module.h | 2 +- include/linux/mtd/map.h | 12 +- include/linux/perf_event.h | 28 +- include/linux/workqueue.h | 4 +- include/net/dst.h | 13 +- include/net/ip6_fib.h | 35 +- include/net/ip6_route.h | 2 +- include/net/ip_fib.h | 10 +- include/net/sch_generic.h | 5 +- include/net/sctp/sctp.h | 4 + include/rdma/ib_addr.h | 6 +- include/trace/ftrace.h | 7 +- include/uapi/linux/usb/ch9.h | 1 + kernel/audit_watch.c | 12 +- kernel/events/core.c | 135 +++--- kernel/fork.c | 2 +- kernel/sched/core.c | 2 +- kernel/trace/trace.c | 1 + kernel/trace/trace_event_perf.c | 4 +- kernel/trace/trace_events_filter.c | 4 + kernel/trace/trace_kprobe.c | 4 +- kernel/trace/trace_syscalls.c | 4 +- kernel/trace/trace_uprobe.c | 2 +- kernel/workqueue.c | 23 +- lib/assoc_array.c | 51 +-- lib/cpumask.c | 74 ++-- mm/hugetlb.c | 12 +- mm/mempolicy.c | 5 - mm/mprotect.c | 4 +- mm/page_alloc.c | 37 +- net/batman-adv/translation-table.c | 57 ++- net/batman-adv/types.h | 2 + net/bridge/br_device.c | 3 +- net/bridge/br_input.c | 3 +- net/bridge/br_netfilter.c | 2 +- net/caif/cfpkt_skbuff.c | 2 +- net/ceph/messenger.c | 6 +- net/core/dev.c | 23 +- net/core/dst.c | 45 +- net/core/pktgen.c | 2 +- net/ipv4/fib_frontend.c | 9 +- net/ipv4/fib_semantics.c | 27 +- net/ipv4/netfilter/ipt_CLUSTERIP.c | 4 +- net/ipv4/netfilter/nft_reject_ipv4.c | 2 + net/ipv4/route.c | 10 +- net/ipv4/udp_offload.c | 2 +- net/ipv6/addrconf.c | 2 +- net/ipv6/ip6_fib.c | 37 +- net/ipv6/ip6_tunnel.c | 2 +- net/ipv6/netfilter/nft_reject_ipv6.c | 2 + net/ipv6/output_core.c | 6 +- net/ipv6/route.c | 26 +- net/ipv6/tcp_ipv6.c | 3 +- net/ipv6/udp_offload.c | 2 +- net/ipv6/xfrm6_policy.c | 6 +- net/key/af_key.c | 48 ++- net/l2tp/l2tp_core.c | 79 ++-- net/l2tp/l2tp_core.h | 18 +- net/l2tp/l2tp_netlink.c | 72 ++-- net/mac80211/key.c | 20 +- net/netfilter/ipvs/ip_vs_xmit.c | 2 +- net/netfilter/nft_compat.c | 6 +- net/netfilter/nft_ct.c | 8 + net/netfilter/nft_reject.c | 2 + net/packet/af_packet.c | 30 +- net/sched/sch_api.c | 2 + net/sched/sch_cbq.c | 10 +- net/sched/sch_fq_codel.c | 4 +- net/sched/sch_hfsc.c | 4 +- net/sched/sch_hhf.c | 11 +- net/sched/sch_htb.c | 5 +- net/sched/sch_mq.c | 10 +- net/sched/sch_mqprio.c | 19 +- net/sched/sch_multiq.c | 9 +- net/sched/sch_netem.c | 4 +- net/sched/sch_sfq.c | 8 +- net/sched/sch_tbf.c | 5 +- net/sctp/ipv6.c | 2 +- net/xfrm/xfrm_user.c | 2 + scripts/mod/modpost.c | 34 +- security/keys/key.c | 10 + security/keys/keyctl.c | 5 + sound/core/control.c | 2 +- sound/core/seq/seq_clientmgr.c | 6 +- sound/core/seq/seq_lock.c | 4 - sound/core/seq/seq_lock.h | 12 - sound/core/seq/seq_ports.c | 7 +- sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/adau1977.c | 2 +- sound/soc/fsl/fsl_sai.c | 3 +- sound/soc/fsl/fsl_ssi.c | 4 +- sound/soc/fsl/imx-audmux.c | 8 +- sound/soc/soc-pcm.c | 4 + sound/usb/card.c | 20 + sound/usb/mixer.c | 14 +- sound/usb/mixer.h | 3 + sound/usb/mixer_quirks.c | 6 + tools/perf/ui/browser.c | 2 +- 309 files changed, 1999 insertions(+), 1321 deletions(-)
Signature · 2 lines
Ben Hutchings It is a miracle that curiosity survives formal education. - Albert Einstein
PATCH 8/294 staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 105967ad68d2eb1a041bc041f9cf96af2a653b65 upstream.
gcc-7 points out an older regression:
drivers/staging/iio/resolver/ad2s1210.c: In function 'ad2s1210_read_raw':drivers/staging/iio/resolver/ad2s1210.c:515:42: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]
The original code had 'unsigned short' here, but incorrectly got converted to 'bool'. This reverts the regression and uses a normal type instead.
--- drivers/staging/iio/resolver/ad2s1210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/resolver/ad2s1210.c +1 -1
@@ -462,7 +462,7 @@ static int ad2s1210_read_raw(struct iio_ long m) {struct ad2s1210_state *st =iio_priv (indio_dev); -bool negative; +u16 negative;int ret =0 ;u16 pos;s16 vel;
PATCH 19/294 USB: serial: cp210x: add support for Qivicon USB ZigBee dongle
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Triller <[email protected]>
commit 9585e340db9f6cc1c0928d82c3a23cc4460f0a3f upstream.
The German Telekom offers a ZigBee USB Stick under the brand name Qivicon for their SmartHome Home Base in its 1. Generation. The productId is not known by the according kernel module, this patch adds support for it.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -135,6 +135,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ + { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
PATCH 208/294 Input: gscps2 - fix MODULE_DEVICE_TABLE invocation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 6c8afa88adce613c23f27e719f805cc2a6441b07 upstream.
The patch "module: fix types of device tables aliases" newly requires that invocations of
MODULE_DEVICE_TABLE(type, name);
come *after* the definition of `name'. That is reasonable, but gscps2 wasn't doing this. Fix it.
--- drivers/input/serio/gscps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/serio/gscps2.c +1 -1
@@ -40,7 +40,6 @@MODULE_AUTHOR ("Laurent Canet <[email protected]>, Thibaut Varene <[email protected]>, Helge Deller <[email protected]>" );MODULE_DESCRIPTION ("HP GSC PS2 port driver" );MODULE_LICENSE ("GPL" ); -MODULE_DEVICE_TABLE (parisc, gscps2_device_tbl);#define PFX "gscps2.c: "
@@ -439,6 +438,7 @@ static struct parisc_device_id gscps2_de#endif { 0, } /* 0 terminated list */ }; +MODULE_DEVICE_TABLE (parisc, gscps2_device_tbl);static struct parisc_driver parisc_ps2_driver = { .name ="gsc_ps2" ,
PATCH 212/294 gfs2: remove IS_ERR_VALUE abuse
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots of IS_ERR_VALUE abuses") upstream.
The original fix that was backported to 3.18 already addressed the warning in some configurations, but not in others, leaving us with the same output:
../fs/gfs2/dir.c: In function 'get_first_leaf':../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
error = get_leaf(dip, leaf_no, bh_out);
^../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20':../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
This takes the approach that we took in later versions in mainline, but does not backport the entire patch, as that would be too large for stable and IIRC caused regressions in other drivers.
--- fs/gfs2/dir.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
fs/gfs2/dir.c +7 -4
@@ -749,12 +749,15 @@ static int get_leaf_nr(struct gfs2_inode u64 *leaf_out) {__be64 *hash; +int error; hash =gfs2_dir_get_hash_table (dip); -if (IS_ERR (hash)) -return PTR_ERR (hash); - *leaf_out =be64_to_cpu (*(hash + index)); -return 0 ; + error =PTR_ERR_OR_ZERO (hash); + +if (!error) + *leaf_out =be64_to_cpu (*(hash + index)); + +return error; } static int get_first_leaf(struct gfs2_inode *dip, u32 index,
PATCH 213/294 iio: adc: fix building on 64-bit
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
On the 3.16 kernel, we get a harmless warning:
drivers/iio/adc/exynos_adc.c: In function 'exynos_adc_get_version':drivers/iio/adc/exynos_adc.c:112:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
Upstream commit e49d99e0ecc8 ("iio: adc: exynos_adc: Add exynos_adc_data structure to improve readability") in 3.17 removed the function, so we can't backport a fix from upstream, but changing the cast to use uintptr_t is the obvious fix.
--- drivers/iio/adc/exynos_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/exynos_adc.c +1 -1
@@ -109,7 +109,7 @@ static inline unsigned int exynos_adc_geconst struct of_device_id *match; match =of_match_node (exynos_adc_match, pdev->dev.of_node); -return (unsigned int )match->data; +return (uintptr_t )match->data; }static void exynos_adc_hw_init (struct exynos_adc *info)
PATCH 215/294 power/reset: xgene-reset: Fix prototype of xgene_restart()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit d3ed534cca703b2aaeee9277a5b8063ae6eab1d1 upstream.
The xgene-reset driver uses xgene_restart() as arm_pm_restart() but that function should take an enum reset_type as the first argument rather than a char. Fix this; the paramter is not referenced in the implementation.
--- drivers/power/reset/xgene-reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/reset/xgene-reboot.c +1 -1
@@ -40,7 +40,7 @@ struct xgene_reboot_context {static struct xgene_reboot_context *xgene_restart_ctx; -static void xgene_restart (char str,const char *cmd) +static void xgene_restart (enum reboot_mode mode,const char *cmd) {struct xgene_reboot_context *ctx = xgene_restart_ctx;unsigned long timeout;
PATCH 216/294 mfd: arizona: Rid data size incompatibility warn when building for 64bit
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lee Jones <[email protected]>
commit 942786e6e647cef94cf96dcd836d343be55fc452 upstream.
Extinguishes:
../drivers/mfd/arizona-core.c: In function ‘arizona_of_get_type’:../drivers/mfd/arizona-core.c:505:10:
warning: cast from pointer to integer of different size
--- drivers/mfd/arizona-core.c | 4 ++-- drivers/mfd/arizona-i2c.c | 5 +++-- drivers/mfd/arizona-spi.c | 3 ++- drivers/mfd/arizona.h | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-)
drivers/mfd/arizona-core.c +2 -2
@@ -497,12 +497,12 @@ const struct dev_pm_ops arizona_pm_ops =EXPORT_SYMBOL_GPL (arizona_pm_ops);#ifdef CONFIG_OF -int arizona_of_get_type (struct device *dev) +unsigned long arizona_of_get_type (struct device *dev) {const struct of_device_id *id =of_match_device (arizona_of_match, dev);if (id) -return (int )id->data; +return (unsigned long )id->data;else return 0 ; }
drivers/mfd/arizona-i2c.c +3 -2
@@ -24,11 +24,12 @@#include "arizona.h" static int arizona_i2c_probe (struct i2c_client *i2c, -const struct i2c_device_id *id) +const struct i2c_device_id *id) {struct arizona *arizona;const struct regmap_config *regmap_config; -int ret, type; +unsigned long type; +int ret;if (i2c->dev.of_node) type =arizona_of_get_type (&i2c->dev);
drivers/mfd/arizona-spi.c +2 -1
@@ -28,7 +28,8 @@ static int arizona_spi_probe(struct spi_const struct spi_device_id *id =spi_get_device_id (spi);struct arizona *arizona;const struct regmap_config *regmap_config; -int ret, type; +unsigned long type; +int ret;if (spi->dev.of_node) type =arizona_of_get_type (&spi->dev);
drivers/mfd/arizona.h +2 -2
@@ -46,9 +46,9 @@ int arizona_irq_init(struct arizona *ariint arizona_irq_exit (struct arizona *arizona);#ifdef CONFIG_OF -int arizona_of_get_type (struct device *dev); +unsigned long arizona_of_get_type (struct device *dev);#else -static inline int arizona_of_get_type (struct device *dev) +static inline unsigned long arizona_of_get_type (struct device *dev) {return 0 ; }
PATCH 221/294 ASoC: imx-audmux: Use uintptr_t for port numbers
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit e5f89768e9bc1f441d18e2299518a2907e5017c9 upstream.
Since we pass the port number through file private data for debugfs we cast it to and from a pointer so use uintptr_t in order to ensure that the types are compatible, avoiding warnings on 64 bit platforms where pointers are 64 bit and unsigned integers 32 bit.
--- sound/soc/fsl/imx-audmux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/fsl/imx-audmux.c +4 -4
@@ -67,7 +67,7 @@ static ssize_t audmux_read_file(struct f {ssize_t ret;char *buf; -int port = (int )file->private_data; +uintptr_t port = (uintptr_t )file->private_data;u32 pdcr, ptcr;if (audmux_clk) {
@@ -147,7 +147,7 @@ static const struct file_operations audmstatic void audmux_debugfs_init (void ) { -int i; +uintptr_t i;char buf[20 ]; audmux_debugfs_root =debugfs_create_dir ("audmux" ,NULL );
@@ -157,10 +157,10 @@ static void audmux_debugfs_init(void) }for (i =0 ; i <MX31_AUDMUX_PORT7_SSI_PINS_7 +1 ; i++) { -snprintf (buf,sizeof (buf),"ssi%d" , i); +snprintf (buf,sizeof (buf),"ssi%lu" , i);if (!debugfs_create_file (buf,0444 , audmux_debugfs_root, (void *)i, &audmux_debugfs_fops)) -pr_warning ("Failed to create AUDMUX port %d debugfs file\n" , +pr_warning ("Failed to create AUDMUX port %lu debugfs file\n" , i); } }
PATCH 3/294 iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Stefan-Gabriel Mirea <[email protected]>
commit d466d3c1217406b14b834335b5b4b33c0d45bd09 upstream.
In order to select the alternate voltage reference pair (VALTH/VALTL), the right value for the REFSEL field in the ADCx_CFG register is "01", leading to 0x800 as register mask. See section 8.2.6.4 in the reference manual[1].
[1] http://www.nxp.com/docs/en/reference-manual/VFXXXRM.pdf
--- drivers/iio/adc/vf610_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/vf610_adc.c +1 -1
@@ -71,7 +71,7 @@#define VF610_ADC_ADSTS_MASK 0x300#define VF610_ADC_ADLPC_EN 0x80#define VF610_ADC_ADHSC_EN 0x400 -#define VF610_ADC_REFSEL_VALT 0x100 +#define VF610_ADC_REFSEL_VALT 0x800#define VF610_ADC_REFSEL_VBG 0x1000#define VF610_ADC_ADTRG_HARD 0x2000#define VF610_ADC_AVGS_8 0x4000
PATCH 5/294 perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jin Yao <[email protected]>
commit 80f62589fa52f530cffc50e78c0b5a2ae572d61e upstream.
When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:
16.86 │ ┌──je 82
0.01 │ movsd (%rsp),%xmm0
│ movsd 0x8(%rsp),%xmm4
│ movsd 0x8(%rsp),%xmm1
│ movsd (%rsp),%xmm3
│ divsd %xmm4,%xmm0
│ divsd %xmm3,%xmm1
│ movsd (%rsp),%xmm2
│ addsd %xmm1,%xmm0
│ addsd %xmm2,%xmm0
│ movsd %xmm0,(%rsp)
│82: sub $0x1,%ebx
83.03 │ ↑ jne 38
│ add $0x10,%rsp
│ xor %eax,%eax
│ pop %rbx
│ ← retqThe patch increments the row number before checking with 0.
--- tools/perf/ui/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
@@ -670,7 +670,7 @@ static void __ui_browser__line_arrow_dowui_browser__gotorc (browser, row, column +1 );SLsmg_draw_hline (2 ); -if (row++ ==0 ) +if (++row ==0 ) goto out; }else row =0 ;
PATCH 6/294 net: bridge: fix dest lookup when vlan proto doesn't match
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit 31a4562d7408493c6377933ff2f7d7302dbdea80 upstream.
With 802.1ad support the vlan_ingress code started checking for vlan protocol mismatch which causes the current tag to be inserted and the bridge vlan protocol & pvid to be set. The vlan tag insertion changes the skb mac_header and thus the lookup mac dest pointer which was loaded prior to calling br_allowed_ingress in br_handle_frame_finish is VLAN_HLEN bytes off now, pointing to the last two bytes of the destination mac and the first four of the source mac causing lookups to always fail and broadcasting all such packets to all ports. Same thing happens for locally originated packets when passing via br_dev_xmit. So load the dest pointer after the vlan checks and possible skb change.
--- net/bridge/br_device.c | 3 ++- net/bridge/br_input.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
net/bridge/br_device.c +2 -1
@@ -31,10 +31,10 @@ static struct lock_class_key bridge_netdnetdev_tx_t br_dev_xmit (struct sk_buff *skb,struct net_device *dev) {struct net_bridge *br =netdev_priv (dev); -const unsigned char *dest = skb->data;struct net_bridge_fdb_entry *dst;struct net_bridge_mdb_entry *mdst;struct pcpu_sw_netstats *brstats =this_cpu_ptr (br->stats); +const unsigned char *dest;u16 vid =0 ;rcu_read_lock ();
@@ -59,6 +59,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *if (!br_allowed_ingress (br,br_get_vlan_info (br), skb, &vid)) goto out; + dest =eth_hdr (skb)->h_dest;if (is_broadcast_ether_addr (dest))br_flood_deliver (br, skb, false);else if (is_multicast_ether_addr (dest)) {
net/bridge/br_input.c +2 -1
@@ -60,11 +60,11 @@ static int br_pass_frame_up(struct sk_bu/* note: already called with rcu_read_lock */ int br_handle_frame_finish (struct sk_buff *skb) { -const unsigned char *dest =eth_hdr (skb)->h_dest;struct net_bridge_port *p =br_port_get_rcu (skb->dev);struct net_bridge *br;struct net_bridge_fdb_entry *dst;struct net_bridge_mdb_entry *mdst; +const unsigned char *dest;struct sk_buff *skb2;bool unicast = true;u16 vid =0 ;
@@ -80,6 +80,7 @@ int br_handle_frame_finish(struct sk_bufif (p->flags &BR_LEARNING )br_fdb_update (br, p,eth_hdr (skb)->h_source, vid, false); + dest =eth_hdr (skb)->h_dest;if (!is_broadcast_ether_addr (dest) &&is_multicast_ether_addr (dest) &&br_multicast_rcv (br, p, skb, vid)) goto drop;
PATCH 9/294 net: bcmgenet: check harder for out of memory conditions
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit b629be5c8399d7c423b92135eb43a86c924d1cbc upstream.
There is a potential case where we might be failing to refill a control block, leaving it with both a NULL skb pointer *and* a NULL dma_unmap_addr.
The way we process incoming packets, by first calling dma_unmap_single(), and then only checking for a potential NULL skb can lead to situations where do pass a NULL dma_unmap_addr() to dma_unmap_single(), resulting in an oops.
Fix this my moving the NULL skb check earlier, since no backing skb also means no corresponding DMA mapping for this packet.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +19 -14
@@ -1351,12 +1351,29 @@ static unsigned int bcmgenet_desc_rx(strwhile ((rxpktprocessed < rxpkttoprocess) && (rxpktprocessed < budget)) { + cb = &priv->rx_cbs[priv->rx_read_ptr]; + skb = cb->skb; + + rxpktprocessed++; + + priv->rx_read_ptr++; + priv->rx_read_ptr &= (priv->num_rx_bds -1 ); + +/* We do not have a backing SKB, so we do not have a +* corresponding DMA mapping for this incoming packet since +* bcmgenet_rx_refill always either has both skb and mapping or +* none. +*/ +if (unlikely (!skb)) { + dev->stats.rx_dropped++; + dev->stats.rx_errors++; + goto refill; + } +/* Unmap the packet contents such that we can use the * RSV from the 64 bytes descriptor when enabled and save * a 32-bits register read */ - cb = &priv->rx_cbs[priv->rx_read_ptr]; - skb = cb->skb;dma_unmap_single (kdev,dma_unmap_addr (cb, dma_addr), priv->rx_buf_len,DMA_FROM_DEVICE );
@@ -1382,18 +1399,6 @@ static unsigned int bcmgenet_desc_rx(str __func__, p_index, priv->rx_c_index, priv->rx_read_ptr, dma_length_status); - rxpktprocessed++; - - priv->rx_read_ptr++; - priv->rx_read_ptr &= (priv->num_rx_bds -1 ); - -/* out of memory, just drop packets at the hardware level */ -if (unlikely (!skb)) { - dev->stats.rx_dropped++; - dev->stats.rx_errors++; - goto refill; - } -if (unlikely (!(dma_flag &DMA_EOP ) || !(dma_flag &DMA_SOP ))) {netif_err (priv, rx_status, dev,"Droping fragmented packet!\n" );
PATCH 14/294 net: bcmgenet: fix dev->stats.tx_bytes accounting
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Petri Gynther <[email protected]>
commit 55868120a3e5420bf5aa26a816c07d691579c9e6 upstream.
1. Add bytes_compl local variable to __bcmgenet_tx_reclaim() to collect transmitted bytes. dev->stats updates can then be moved outside the while-loop. bytes_compl is also needed for future BQL support.
2. When bcmgenet device uses Tx checksum offload, each transmitted skb gets an extra 64-byte header prepended to it. Before this header is prepended to the skb, we need to save the skb "wire" length in GENET_CB(skb)->bytes_sent, so that proper Tx bytes accounting can be done in __bcmgenet_tx_reclaim().
3. skb->len covers the entire length of skb, whether it is linear or fragmented. Thus, when we clean the fragments, do not increase transmitted bytes.
[bwh: Backported to 3.16:
- Also update tx_packets accounting, as done in upstream commit 4092e6acf5cb "net: bcmgenet: fix throughtput regression"
- Adjust context]
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c +12 -4
@@ -948,6 +948,8 @@ static void __bcmgenet_tx_reclaim(structstruct device *kdev = &priv->pdev->dev;struct enet_cb *tx_cb_ptr;struct netdev_queue *txq; +unsigned int pkts_compl =0 ; +unsigned int bytes_compl =0 ;unsigned int c_index;unsigned int txbds_ready;unsigned int txbds_processed =0 ;
@@ -969,16 +971,14 @@ static void __bcmgenet_tx_reclaim(structwhile (txbds_processed < txbds_ready) { tx_cb_ptr = &priv->tx_cbs[ring->clean_ptr];if (tx_cb_ptr->skb) { - dev->stats.tx_packets++; - dev->stats.tx_bytes += tx_cb_ptr->skb->len; + pkts_compl++; + bytes_compl +=GENET_CB (tx_cb_ptr->skb)->bytes_sent;dma_unmap_single (kdev,dma_unmap_addr (tx_cb_ptr, dma_addr),dma_unmap_len (tx_cb_ptr, dma_len),DMA_TO_DEVICE );bcmgenet_free_cb (tx_cb_ptr); }else if (dma_unmap_addr (tx_cb_ptr, dma_addr)) { - dev->stats.tx_bytes += -dma_unmap_len (tx_cb_ptr, dma_len); dma_unmap_page(kdev, dma_unmap_addr(tx_cb_ptr, dma_addr), dma_unmap_len(tx_cb_ptr, dma_len),
@@ -996,6 +996,9 @@ static void __bcmgenet_tx_reclaim(struct ring->free_bds += txbds_processed; ring->c_index = (ring->c_index + txbds_processed) &DMA_C_INDEX_MASK ; + dev->stats.tx_packets += pkts_compl; + dev->stats.tx_bytes += bytes_compl; +if (ring->free_bds > (MAX_SKB_FRAGS +1 )) ring->int_disable (priv, ring);
@@ -1215,6 +1218,11 @@ static netdev_tx_t bcmgenet_xmit(struct goto out; } +/* Retain how many bytes will be sent on the wire, without TSB inserted +* by transmit checksum offload +*/ +GENET_CB (skb)->bytes_sent = skb->len; +/* set the SKB transmit checksum */ if (priv->desc_64b_en) { ret =bcmgenet_put_tx_csum (dev, skb);
drivers/net/ethernet/broadcom/genet/bcmgenet.h +6 -0
@@ -504,6 +504,12 @@ struct bcmgenet_hw_params {u32 flags; }; +struct bcmgenet_skb_cb { +unsigned int bytes_sent;/* bytes on the wire (no TSB) */ +}; + +#define GENET_CB (skb) ((struct bcmgenet_skb_cb *)((skb)->cb)) +struct bcmgenet_tx_ring {spinlock_t lock;/* ring lock */ unsigned int index;/* ring index */
PATCH 15/294 net: bcmgenet: cleanup for bcmgenet_xmit_frag()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Petri Gynther <[email protected]>
commit 824ba603573d910e32df75fe6a5e7d7ec2a0a6a7 upstream.
Add frag_size = skb_frag_size(frag) and use it when needed.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +7 -4
@@ -1086,6 +1086,7 @@ static int bcmgenet_xmit_frag(struct netstruct bcmgenet_priv *priv =netdev_priv (dev);struct device *kdev = &priv->pdev->dev;struct enet_cb *tx_cb_ptr; +unsigned int frag_size;dma_addr_t mapping;int ret;
@@ -1093,10 +1094,12 @@ static int bcmgenet_xmit_frag(struct netif (unlikely (!tx_cb_ptr))BUG (); + tx_cb_ptr->skb =NULL ; - mapping =skb_frag_dma_map (kdev, frag,0 , -skb_frag_size (frag),DMA_TO_DEVICE ); + frag_size =skb_frag_size (frag); + + mapping =skb_frag_dma_map (kdev, frag,0 , frag_size,DMA_TO_DEVICE ); ret =dma_mapping_error (kdev, mapping);if (ret) { netif_err(priv, tx_err, dev, "%s: Tx DMA map failed\n",
@@ -1105,10 +1108,10 @@ static int bcmgenet_xmit_frag(struct net }dma_unmap_addr_set (tx_cb_ptr, dma_addr, mapping); -dma_unmap_len_set (tx_cb_ptr, dma_len, frag->size); +dma_unmap_len_set (tx_cb_ptr, dma_len, frag_size);dmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, - (frag->size <<DMA_BUFLENGTH_SHIFT ) | dma_desc_flags | + (frag_size <<DMA_BUFLENGTH_SHIFT ) | dma_desc_flags | (priv->hw_params->qtag_mask <<DMA_TX_QTAG_SHIFT ));return 0 ;
PATCH 203/294 Disable "frame-address" warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
From: Linus Torvalds <[email protected]>
commit 124a3d88fa20e1869fc229d7d8c740cc81944264 upstream.
Newer versions of gcc warn about the use of __builtin_return_address() with a non-zero argument when "-Wall" is specified:
kernel/trace/trace_irqsoff.c: In function ‘stop_critical_timings’:
kernel/trace/trace_irqsoff.c:433:86: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address]
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
[ .. repeats a few times for other similar cases .. ]
It is true that a non-zero argument is somewhat dangerous, and we do not actually have very many uses of that in the kernel - but the ftrace code does use it, and as Stephen Rostedt says:
"We are well aware of the danger of using __builtin_return_address() of
Quoted 1 line
0. In fact that's part of the reason for having the "thunk" code in
x86 (See arch/x86/entry/thunk_{64,32}.S). [..] it adds extra frames when tracking irqs off sections, to prevent __builtin_return_address() from accessing bad areas. In fact the thunk_32.S states: 'Trampoline to trace irqs off. (otherwise CALLER_ADDR1 might crash)'."
For now, __builtin_return_address() with a non-zero argument is the best we can do, and the warning is not helpful and can end up making people miss other warnings for real problems.
So disable the frame-address warning on compilers that need it.
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -616,6 +616,7 @@ all: vmlinux include $(srctree)/arch/$(SRCARCH)/Makefile KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) +KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
PATCH 207/294 MODULE_DEVICE_TABLE: fix some callsites
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Morton <[email protected]>
commit 0f989f749b51ec1fd94bb5a42f8ad10c8b9f73cb upstream.
The patch "module: fix types of device tables aliases" newly requires that invocations of
MODULE_DEVICE_TABLE(type, name);
come *after* the definition of `name'. That is reasonable, but some drivers weren't doing this. Fix them.
--- Documentation/video4linux/v4l2-pci-skeleton.c | 2 +- drivers/net/ethernet/emulex/benet/be_main.c | 1 - drivers/scsi/be2iscsi/be_main.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
Documentation/video4linux/v4l2-pci-skeleton.c +1 -1
@@ -42,7 +42,6 @@MODULE_DESCRIPTION ("V4L2 PCI Skeleton Driver" );MODULE_AUTHOR ("Hans Verkuil" );MODULE_LICENSE ("GPL v2" ); -MODULE_DEVICE_TABLE (pci, skeleton_pci_tbl);/** * struct skeleton - All internal data for one instance of device
@@ -95,6 +94,7 @@ static const struct pci_device_id skelet/* { PCI_DEVICE(PCI_VENDOR_ID_, PCI_DEVICE_ID_) }, */ { 0, } }; +MODULE_DEVICE_TABLE (pci, skeleton_pci_tbl);/* * HDTV: this structure has the capabilities of the HDTV receiver.
drivers/net/ethernet/emulex/benet/be_main.c +0 -1
@@ -26,7 +26,6 @@#include <net/vxlan.h> MODULE_VERSION (DRV_VER ); -MODULE_DEVICE_TABLE (pci, be_dev_ids);MODULE_DESCRIPTION (DRV_DESC " " DRV_VER );MODULE_AUTHOR ("Emulex Corporation" );MODULE_LICENSE ("GPL" );
drivers/scsi/be2iscsi/be_main.c +0 -1
@@ -48,7 +48,6 @@ static unsigned int be_iopoll_budget = 1static unsigned int be_max_phys_size =64 ;static unsigned int enable_msix =1 ; -MODULE_DEVICE_TABLE (pci, beiscsi_pci_id_table);MODULE_DESCRIPTION (DRV_DESC " " BUILD_STR );MODULE_VERSION (BUILD_STR );MODULE_AUTHOR ("Emulex Corporation" );
PATCH 210/294 mm/hugetlb: improve locking in dissolve_free_huge_pages()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Gerald Schaefer <[email protected]>
commit eb03aa008561004257900983193d024e57abdd96 upstream.
For every pfn aligned to minimum_order, dissolve_free_huge_pages() will call dissolve_free_huge_page() which takes the hugetlb spinlock, even if the page is not huge at all or a hugepage that is in-use.
Improve this by doing the PageHuge() and page_count() checks already in dissolve_free_huge_pages() before calling dissolve_free_huge_page(). In dissolve_free_huge_page(), when holding the spinlock, those checks need to be revalidated.
--- mm/hugetlb.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
mm/hugetlb.c +9 -3
@@ -1105,14 +1105,20 @@ out:int dissolve_free_huge_pages (unsigned long start_pfn,unsigned long end_pfn) {unsigned long pfn; +struct page *page;int rc =0 ;if (!hugepages_supported ())return rc; -for (pfn = start_pfn; pfn < end_pfn; pfn +=1 << minimum_order) -if (rc =dissolve_free_huge_page (pfn_to_page (pfn))) -break ; +for (pfn = start_pfn; pfn < end_pfn; pfn +=1 << minimum_order) { + page =pfn_to_page (pfn); +if (PageHuge (page) && !page_count (page)) { + rc =dissolve_free_huge_page (page); +if (rc) +break ; + } + }return rc; }
PATCH 217/294 Input: joystick - use get_cycles on ARMv8
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit a6b48699ae50ccce700506ced863ba1f5ce2af11 upstream.
As with ARM the ARMv8 architecture provides a cycle counter which can be used to provide a high resolution time for the joystick driver and silence the build warning that results from not having a precise timer on ARMv8, making allmodconfig and allyesconfig quieter.
--- drivers/input/joystick/analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/analog.c +1 -1
@@ -158,7 +158,7 @@ static unsigned int get_time_pit(void)#define GET_TIME (x) rdtscl(x)#define DELTA (x,y) ((y)-(x))#define TIME_NAME "TSC" -#elif defined(__alpha__) || defined(CONFIG_MN10300 ) || defined(CONFIG_ARM ) || defined(CONFIG_TILE ) +#elif defined(__alpha__) || defined(CONFIG_MN10300 ) || defined(CONFIG_ARM ) || defined(CONFIG_ARM64 ) || defined(CONFIG_TILE )#define GET_TIME (x) do { x = get_cycles(); } while (0)#define DELTA (x,y) ((y)-(x))#define TIME_NAME "get_cycles"
PATCH 218/294 dma: pl08x: Use correct specifier for size_t values
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 6fc8ae787c589245ee3395630d2c428a1afab26c upstream.
When printing size_t values we should use the %zd or %zx format specifier in order to ensure the value is displayed correctly and avoid warnings from sparse.
--- drivers/dma/amba-pl08x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/amba-pl08x.c +2 -2
@@ -1040,7 +1040,7 @@ static int pl08x_fill_llis_for_desc(struif (early_bytes) {dev_vdbg (&pl08x->adev->dev, -"%s byte width LLIs (remain 0x%08x)\n" , +"%s byte width LLIs (remain 0x%08zx)\n" , __func__, bd.remainder);prep_byte_width_lli (pl08x, &bd, &cctl, early_bytes, num_llis++, &total_bytes);
@@ -1662,7 +1662,7 @@ static struct dma_async_tx_descriptor *pdma_addr_t slave_addr;dev_dbg (&pl08x->adev->dev, -"%s prepare cyclic transaction of %d/%d bytes %s %s\n" , +"%s prepare cyclic transaction of %zd/%zd bytes %s %s\n" , __func__, period_len, buf_len, direction ==DMA_MEM_TO_DEV ?"to" :"from" , plchan->name);
PATCH 219/294 gpio: drop retval check enforcing from gpiochip_remove()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 14c8a620ba436511b1347c592633befa49535176 upstream.
As we start to decomission the return value from gpiochip_remove() the compilers emit warnings due to the function being tagged __must_check. So drop this until we remove the return value altogether.
--- include/linux/gpio/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/gpio/driver.h +1 -1
@@ -141,7 +141,7 @@ extern const char *gpiochip_is_requested/* add/remove chips */ extern int gpiochip_add (struct gpio_chip *chip); -extern int __must_check gpiochip_remove (struct gpio_chip *chip); +extern int gpiochip_remove (struct gpio_chip *chip);extern struct gpio_chip *gpiochip_find (void *data,int (*match)(struct gpio_chip *chip,void *data));
PATCH 228/294 spi/pl022: Explicitly truncate large bitmask
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit d555ea05f9d8ebf567eaa6b4e4cb5776aacf2940 upstream.
When building on 64 bit architectures the use of bitwise negation generates constants larger than 32 bits which won't fit in u32s used to represent 32 bit register values on the device. Explicitly cast to let the compiler know that the higher bits are not significant and can be discarded.
--- drivers/spi/spi-pl022.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-pl022.c +1 -1
@@ -1417,7 +1417,7 @@ static void do_interrupt_dma_transfer(st* Default is to enable all interrupts except RX - * this will be enabled once TX is complete */ -u32 irqflags =ENABLE_ALL_INTERRUPTS & ~SSP_IMSC_MASK_RXIM ; +u32 irqflags = (u32)(ENABLE_ALL_INTERRUPTS & ~SSP_IMSC_MASK_RXIM );/* Enable target chip, if not already active */ if (!pl022->next_msg_cs_active)
PATCH 239/294 paride: fix the "verbose" module param
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 946e87981942552e526aca9cb6204f02a6c847cb upstream.
The verbose module parameter can be set to 2 for extremely verbose messages so the type should be int instead of bool.
--- drivers/block/paride/pg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/paride/pg.c +2 -2
@@ -137,7 +137,7 @@*/ -static bool verbose =0 ; +static int verbose;static int major =PG_MAJOR ;static char *name =PG_NAME ;static int disable =0 ;
@@ -168,7 +168,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV,#include <asm/uaccess.h> -module_param (verbose, bool,0644 ); +module_param (verbose, int,0644 );module_param (major, int,0 );module_param (name, charp,0 );module_param_array (drive0, int,NULL ,0 );
PATCH 241/294 mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 906b268477bc03daaa04f739844c120fe4dbc991 upstream.
kernelci.org reports a warning for this driver, as it copies a local variable into a 'const char *' string:
drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
Using kstrndup() simplifies the code and avoids the warning.
--- drivers/mtd/maps/pmcmsp-flash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/maps/pmcmsp-flash.c +1 -3
@@ -139,15 +139,13 @@ static int __init init_msp_flash(void) } msp_maps[i].bankwidth =1 ; - msp_maps[i].name =kmalloc (7 ,GFP_KERNEL ); + msp_maps[i].name =kstrndup (flash_name,7 ,GFP_KERNEL );if (!msp_maps[i].name) {iounmap (msp_maps[i].virt);kfree (msp_parts[i]); goto cleanup_loop; } - msp_maps[i].name =strncpy (msp_maps[i].name, flash_name,7 ); -for (j =0 ; j < pcnt; j++) { part_name[5 ] ='0' + i; part_name[7 ] ='0' + j;
PATCH 11/294 net: bcmgenet: simplify __bcmgenet_tx_reclaim()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Petri Gynther <[email protected]>
commit 66d06757d9eb74a29775737b8c770e3b57e536d9 upstream.
1. Use c_index and ring->c_index to determine how many TxCBs/TxBDs are ready for cleanup
- c_index = the current value of TDMA_CONS_INDEX
- TDMA_CONS_INDEX is HW-incremented and auto-wraparound (0x0-0xFFFF)
- ring->c_index = __bcmgenet_tx_reclaim() cleaned up to this point on the previous invocation
2. Add bcmgenet_tx_ring->clean_ptr
- index of the next TxCB to be cleaned
- incremented as TxCBs/TxBDs are processed
- value always in range [ring->cb_ptr, ring->end_ptr]
3. Fix incrementing of dev->stats.tx_packets
- should be incremented only when tx_cb_ptr->skb != NULL
These changes simplify __bcmgenet_tx_reclaim(). Furthermore, Tx ring size can now be any value.
With the old code, Tx ring size had to be a power-of-2:
num_tx_bds = ring->size;
c_index &= (num_tx_bds - 1);
last_c_index &= (num_tx_bds - 1);
[bwh: Backported to 3.16:
- __bcmgenet_tx_reclaim() did not count completions
- In bcmgenet_init_tx_ring(), use write_ptr not start_ptr
- Adjust context]
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c +21 -21
@@ -946,34 +946,30 @@ static void __bcmgenet_tx_reclaim(struct {struct bcmgenet_priv *priv =netdev_priv (dev);struct device *kdev = &priv->pdev->dev; -int last_tx_cn, last_c_index, num_tx_bds;struct enet_cb *tx_cb_ptr;struct netdev_queue *txq;unsigned int c_index; +unsigned int txbds_ready; +unsigned int txbds_processed =0 ;/* Compute how many buffers are transmited since last xmit call */ c_index =bcmgenet_tdma_ring_readl (priv, ring->index,TDMA_CONS_INDEX ); - txq =netdev_get_tx_queue (dev, ring->queue); - - last_c_index = ring->c_index; - num_tx_bds = ring->size; + c_index &=DMA_C_INDEX_MASK ; - c_index &= (num_tx_bds -1 ); - -if (c_index >= last_c_index) - last_tx_cn = c_index - last_c_index; +if (likely (c_index >= ring->c_index)) + txbds_ready = c_index - ring->c_index;else - last_tx_cn = num_tx_bds - last_c_index + c_index; + txbds_ready = (DMA_C_INDEX_MASK +1 ) - ring->c_index + c_index;netif_dbg (priv, tx_done, dev, -"%s ring=%d index=%d last_tx_cn=%d last_index=%d\n" , - __func__, ring->index, - c_index, last_tx_cn, last_c_index); +"%s ring=%d old_c_index=%u c_index=%u txbds_ready=%u\n" , + __func__, ring->index, ring->c_index, c_index, txbds_ready);/* Reclaim transmitted buffers */ -while (last_tx_cn-- >0 ) { - tx_cb_ptr = ring->cbs + last_c_index; +while (txbds_processed < txbds_ready) { + tx_cb_ptr = &priv->tx_cbs[ring->clean_ptr];if (tx_cb_ptr->skb) { + dev->stats.tx_packets++; dev->stats.tx_bytes += tx_cb_ptr->skb->len; dma_unmap_single(kdev, dma_unmap_addr(tx_cb_ptr, dma_addr),
@@ -989,20 +985,23 @@ static void __bcmgenet_tx_reclaim(struct DMA_TO_DEVICE);dma_unmap_addr_set (tx_cb_ptr, dma_addr,0 ); } - dev->stats.tx_packets++; - ring->free_bds +=1 ; - last_c_index++; - last_c_index &= (num_tx_bds -1 ); + txbds_processed++; +if (likely (ring->clean_ptr < ring->end_ptr)) + ring->clean_ptr++; +else + ring->clean_ptr = ring->cb_ptr; } + ring->free_bds += txbds_processed; + ring->c_index = (ring->c_index + txbds_processed) &DMA_C_INDEX_MASK ; +if (ring->free_bds > (MAX_SKB_FRAGS +1 )) ring->int_disable (priv, ring); + txq =netdev_get_tx_queue (dev, ring->queue);if (netif_tx_queue_stopped (txq))netif_tx_wake_queue (txq); - - ring->c_index = c_index; } static void bcmgenet_tx_reclaim(struct net_device *dev,
@@ -1644,6 +1643,7 @@ static void bcmgenet_init_tx_ring(struct } ring->cbs = priv->tx_cbs + write_ptr; ring->size = size; + ring->clean_ptr = write_ptr; ring->c_index =0 ; ring->free_bds = size; ring->write_ptr = write_ptr;
drivers/net/ethernet/broadcom/genet/bcmgenet.h +1 -0
@@ -510,6 +510,7 @@ struct bcmgenet_tx_ring {unsigned int queue;/* queue index */ struct enet_cb *cbs;/* tx ring buffer control block*/ unsigned int size;/* size of each tx ring */ +unsigned int clean_ptr;/* Tx ring clean pointer */ unsigned int c_index;/* last consumer index of each ring*/ unsigned int free_bds;/* # of free bds for each ring */ unsigned int write_ptr;/* Tx ring write pointer SW copy */
PATCH 13/294 net: bcmgenet: update ring producer index and buffer count in xmit
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit ae67bf0188cbb9d1786bdfcca9e1976cb36ee327 upstream.
There is no need to have both bcmgenet_xmit_single() and bcmgenet_xmit_frag() perform a free_bds decrement and a prod_index increment by one. In case one of these functions fails to map a SKB or fragment for transmit, we will return and exit bcmgenet_xmit() with an error.
We can therefore safely use our local copy of nr_frags to know by how much we should decrement the number of free buffers available, and by how much the producer count must be incremented and do this in the tail of bcmgenet_xmit().
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 -13
@@ -1071,11 +1071,6 @@ static int bcmgenet_xmit_single(struct ndmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, length_status); -/* Decrement total BD count and advance our write pointer */ - ring->free_bds -=1 ; - ring->prod_index +=1 ; - ring->prod_index &=DMA_P_INDEX_MASK ; -return 0 ; }
@@ -1113,11 +1108,6 @@ static int bcmgenet_xmit_frag(struct net (frag->size <<DMA_BUFLENGTH_SHIFT ) | dma_desc_flags | (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT)); - - ring->free_bds -=1 ; - ring->prod_index +=1 ; - ring->prod_index &=DMA_P_INDEX_MASK ; -return 0 ; }
@@ -1258,9 +1248,11 @@ static netdev_tx_t bcmgenet_xmit(structskb_tx_timestamp (skb); -/* we kept a software copy of how much we should advance the TDMA -* producer index, now write it down to the hardware -*/ +/* Decrement total BD count and advance our write pointer */ + ring->free_bds -= nr_frags +1 ; + ring->prod_index += nr_frags +1 ; + ring->prod_index &=DMA_P_INDEX_MASK ; +bcmgenet_tdma_ring_writel (priv, ring->index, ring->prod_index,TDMA_PROD_INDEX );
PATCH 16/294 net: bcmgenet: Fix unmapping of fragments in bcmgenet_xmit()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Doug Berger <[email protected]>
commit 876dbadd53a7102e2a84afc84ea2bd3ee6dc5636 upstream.
In case we fail to map a single fragment, we would be leaving the transmit ring populated with stale entries.
This commit introduces the helper function bcmgenet_put_txcb() which takes care of rewinding the per-ring write pointer back to where we left.
It also consolidates the functionality of bcmgenet_xmit_single() and bcmgenet_xmit_frag() into the bcmgenet_xmit() function to make the unmapping of control blocks cleaner.
[bwh: Backported to 3.16:
- There's no tx_dma_failed statistic
- Adjust context]
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 191 +++++++++++-------------- 1 file changed, 85 insertions(+), 106 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +85 -104
@@ -900,6 +900,23 @@ static struct enet_cb *bcmgenet_get_txcbreturn tx_cb_ptr; } +static struct enet_cb *bcmgenet_put_txcb (struct bcmgenet_priv *priv, +struct bcmgenet_tx_ring *ring) +{ +struct enet_cb *tx_cb_ptr; + + tx_cb_ptr = ring->cbs; + tx_cb_ptr += ring->write_ptr - ring->cb_ptr; + +/* Rewinding local write pointer */ +if (ring->write_ptr == ring->cb_ptr) + ring->write_ptr = ring->end_ptr; +else + ring->write_ptr--; + +return tx_cb_ptr; +} +/* Simple helper to free a control block's resources */ static void bcmgenet_free_cb (struct enet_cb *cb) {
@@ -1030,93 +1047,6 @@ static void bcmgenet_tx_reclaim_all(strubcmgenet_tx_reclaim (dev, &priv->tx_rings[DESC_INDEX ]); } -/* Transmits a single SKB (either head of a fragment or a single SKB) -* caller must hold priv->lock -*/ -static int bcmgenet_xmit_single (struct net_device *dev, -struct sk_buff *skb, -u16 dma_desc_flags, -struct bcmgenet_tx_ring *ring) -{ -struct bcmgenet_priv *priv =netdev_priv (dev); -struct device *kdev = &priv->pdev->dev; -struct enet_cb *tx_cb_ptr; -unsigned int skb_len; -dma_addr_t mapping; -u32 length_status; -int ret; - - tx_cb_ptr =bcmgenet_get_txcb (priv, ring); - -if (unlikely (!tx_cb_ptr)) -BUG (); - - tx_cb_ptr->skb = skb; - - skb_len =skb_headlen (skb); - - mapping =dma_map_single (kdev, skb->data, skb_len,DMA_TO_DEVICE ); - ret =dma_mapping_error (kdev, mapping); -if (ret) { -netif_err (priv, tx_err, dev,"Tx DMA map failed\n" ); -dev_kfree_skb (skb); -return ret; - } - -dma_unmap_addr_set (tx_cb_ptr, dma_addr, mapping); -dma_unmap_len_set (tx_cb_ptr, dma_len, skb_len); - length_status = (skb_len <<DMA_BUFLENGTH_SHIFT ) | dma_desc_flags | - (priv->hw_params->qtag_mask <<DMA_TX_QTAG_SHIFT ) | -DMA_TX_APPEND_CRC ; - -if (skb->ip_summed ==CHECKSUM_PARTIAL ) - length_status |=DMA_TX_DO_CSUM ; - -dmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, length_status); - -return 0 ; -} - -/* Transmit a SKB fragement */ -static int bcmgenet_xmit_frag (struct net_device *dev, -skb_frag_t *frag, -u16 dma_desc_flags, -struct bcmgenet_tx_ring *ring) -{ -struct bcmgenet_priv *priv =netdev_priv (dev); -struct device *kdev = &priv->pdev->dev; -struct enet_cb *tx_cb_ptr; -unsigned int frag_size; -dma_addr_t mapping; -int ret; - - tx_cb_ptr =bcmgenet_get_txcb (priv, ring); - -if (unlikely (!tx_cb_ptr)) -BUG (); - - tx_cb_ptr->skb =NULL ; - - frag_size =skb_frag_size (frag); - - mapping =skb_frag_dma_map (kdev, frag,0 , frag_size,DMA_TO_DEVICE ); - ret =dma_mapping_error (kdev, mapping); -if (ret) { -netif_err (priv, tx_err, dev,"%s: Tx DMA map failed\n" , - __func__); -return ret; - } - -dma_unmap_addr_set (tx_cb_ptr, dma_addr, mapping); -dma_unmap_len_set (tx_cb_ptr, dma_len, frag_size); - -dmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, - (frag_size <<DMA_BUFLENGTH_SHIFT ) | dma_desc_flags | - (priv->hw_params->qtag_mask <<DMA_TX_QTAG_SHIFT )); - -return 0 ; -} -/* Reallocate the SKB to put enough headroom in front of it and insert * the transmit checksum offsets in the descriptors */
@@ -1182,11 +1112,16 @@ static int bcmgenet_put_tx_csum(struct nstatic netdev_tx_t bcmgenet_xmit (struct sk_buff *skb,struct net_device *dev) {struct bcmgenet_priv *priv =netdev_priv (dev); +struct device *kdev = &priv->pdev->dev;struct bcmgenet_tx_ring *ring =NULL ; +struct enet_cb *tx_cb_ptr;struct netdev_queue *txq;unsigned long flags =0 ;int nr_frags, index; -u16 dma_desc_flags; +dma_addr_t mapping; +unsigned int size; +skb_frag_t *frag; +u32 len_stat;int ret;int i;
@@ -1235,26 +1170,48 @@ static netdev_tx_t bcmgenet_xmit(struct } } - dma_desc_flags =DMA_SOP ; -if (nr_frags ==0 ) - dma_desc_flags |=DMA_EOP ; - -/* Transmit single SKB or head of fragment list */ - ret =bcmgenet_xmit_single (dev, skb, dma_desc_flags, ring); -if (ret) { - ret =NETDEV_TX_OK ; - goto out; - } +for (i =0 ; i <= nr_frags; i++) { + tx_cb_ptr =bcmgenet_get_txcb (priv, ring); -/* xmit fragment */ -for (i =0 ; i < nr_frags; i++) { - ret =bcmgenet_xmit_frag (dev, - &skb_shinfo (skb)->frags[i], - (i == nr_frags -1 ) ?DMA_EOP :0 , ring); +if (unlikely (!tx_cb_ptr)) +BUG (); + +if (!i) { +/* Transmit single SKB or head of fragment list */ + tx_cb_ptr->skb = skb; + size =skb_headlen (skb); + mapping =dma_map_single (kdev, skb->data, size, +DMA_TO_DEVICE ); + }else { +/* xmit fragment */ + tx_cb_ptr->skb =NULL ; + frag = &skb_shinfo (skb)->frags[i -1 ]; + size =skb_frag_size (frag); + mapping =skb_frag_dma_map (kdev, frag,0 , size, +DMA_TO_DEVICE ); + } + + ret =dma_mapping_error (kdev, mapping);if (ret) { +netif_err (priv, tx_err, dev,"Tx DMA map failed\n" ); ret =NETDEV_TX_OK ; - goto out; + goto out_unmap_frags; } +dma_unmap_addr_set (tx_cb_ptr, dma_addr, mapping); +dma_unmap_len_set (tx_cb_ptr, dma_len, size); + + len_stat = (size <<DMA_BUFLENGTH_SHIFT ) | + (priv->hw_params->qtag_mask <<DMA_TX_QTAG_SHIFT ); + +if (!i) { + len_stat |=DMA_TX_APPEND_CRC |DMA_SOP ; +if (skb->ip_summed ==CHECKSUM_PARTIAL ) + len_stat |=DMA_TX_DO_CSUM ; + } +if (i == nr_frags) + len_stat |=DMA_EOP ; + +dmadesc_set (priv, tx_cb_ptr->bd_addr, mapping, len_stat); }skb_tx_timestamp (skb);
@@ -1276,6 +1233,30 @@ out:spin_unlock_irqrestore (&ring->lock, flags);return ret; + +out_unmap_frags: +/* Back up for failed control block mapping */ +bcmgenet_put_txcb (priv, ring); + +/* Unmap successfully mapped control blocks */ +while (i-- >0 ) { + tx_cb_ptr =bcmgenet_put_txcb (priv, ring); +if (tx_cb_ptr->skb) +dma_unmap_single (kdev, +dma_unmap_addr (tx_cb_ptr, dma_addr), +dma_unmap_len (tx_cb_ptr, dma_len), +DMA_TO_DEVICE ); +else +dma_unmap_page (kdev, +dma_unmap_addr (tx_cb_ptr, dma_addr), +dma_unmap_len (tx_cb_ptr, dma_len), +DMA_TO_DEVICE ); +dma_unmap_addr_set (tx_cb_ptr, dma_addr,0 ); + tx_cb_ptr->skb =NULL ; + } + +dev_kfree_skb (skb); + goto out; } static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv,
PATCH 202/294 mm/init: fix zone boundary creation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Oliver O'Halloran <[email protected]>
commit 90cae1fe1c3540f791d5b8e025985fa5e699b2bb upstream.
As a part of memory initialisation the architecture passes an array to free_area_init_nodes() which specifies the max PFN of each memory zone. This array is not necessarily monotonic (due to unused zones) so this array is parsed to build monotonic lists of the min and max PFN for each zone. ZONE_MOVABLE is special cased here as its limits are managed by the mm subsystem rather than the architecture. Unfortunately, this special casing is broken when ZONE_MOVABLE is the not the last zone in the zone list. The core of the issue is:
if (i == ZONE_MOVABLE) continue; arch_zone_lowest_possible_pfn[i] = arch_zone_highest_possible_pfn[i-1];
As ZONE_MOVABLE is skipped the lowest_possible_pfn of the next zone will be set to zero. This patch fixes this bug by adding explicitly tracking where the next zone should start rather than relying on the contents arch_zone_highest_possible_pfn[].
Thie is low priority. To get bitten by this you need to enable a zone that appears after ZONE_MOVABLE in the zone_type enum. As far as I can tell this means running a kernel with ZONE_DEVICE or ZONE_CMA enabled, so I can't see this affecting too many people.
I only noticed this because I've been fiddling with ZONE_DEVICE on powerpc and 4.6 broke my test kernel. This bug, in conjunction with the changes in Taku Izumi's kernelcore=mirror patch (d91749c1dda71) and powerpc being the odd architecture which initialises max_zone_pfn[] to ~0ul instead of 0 caused all of system memory to be placed into ZONE_DEVICE at boot, followed a panic since device memory cannot be used for kernel allocations. I've already submitted a patch to fix the powerpc specific bits, but I figured this should be fixed too.
--- mm/page_alloc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
mm/page_alloc.c +10 -7
@@ -5335,15 +5335,18 @@ void __init free_area_init_nodes(unsigne sizeof(arch_zone_lowest_possible_pfn));memset (arch_zone_highest_possible_pfn,0 ,sizeof (arch_zone_highest_possible_pfn)); - arch_zone_lowest_possible_pfn[0 ] =find_min_pfn_with_active_regions (); - arch_zone_highest_possible_pfn[0 ] = max_zone_pfn[0 ]; -for (i =1 ; i <MAX_NR_ZONES ; i++) { + + start_pfn =find_min_pfn_with_active_regions (); + +for (i =0 ; i <MAX_NR_ZONES ; i++) {if (i ==ZONE_MOVABLE )continue ; - arch_zone_lowest_possible_pfn[i] = - arch_zone_highest_possible_pfn[i-1 ]; - arch_zone_highest_possible_pfn[i] = -max (max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]); + + end_pfn =max (max_zone_pfn[i], start_pfn); + arch_zone_lowest_possible_pfn[i] = start_pfn; + arch_zone_highest_possible_pfn[i] = end_pfn; + + start_pfn = end_pfn; } arch_zone_lowest_possible_pfn[ZONE_MOVABLE ] =0 ; arch_zone_highest_possible_pfn[ZONE_MOVABLE ] =0 ;
PATCH 204/294 modpost: expand pattern matching to support substring matches
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Gortmaker <[email protected]>
commit 09c20c032b0f753969ae778d9783d946f054d7fe upstream.
Currently the match() function supports a leading * to match any prefix and a trailing * to match any suffix. However there currently is not a combination of both that can be used to target matches of whole families of functions that share a common substring.
Here we expand the *foo and foo* match to also support *foo* with the goal of targeting compiler generated symbol names that contain strings like ".constprop." and ".isra."
--- scripts/mod/modpost.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
scripts/mod/modpost.c +11 -1
@@ -798,6 +798,7 @@ static int number_prefix(const char *sym* where the '1' can be any number including several digits. * The $ syntax is for sections where ld append a dot number * to make section name unique. +* "*foo*" will match a string that contains "foo" */ static int match (const char *sym,const char *const pat[]) {
@@ -806,8 +807,17 @@ static int match(const char *sym, const p = *pat++;const char *endp = p +strlen (p) -1 ; +/* "*foo*" */ +if (*p =='*' && *endp =='*' ) { +char *here, *bare =strndup (p +1 ,strlen (p) -2 ); + + here =strstr (sym, bare); +free (bare); +if (here !=NULL ) +return 1 ; + }/* "*foo" */ -if (*p =='*' ) { +else if (*p =='*' ) {if (strrcmp (sym, p +1 ) ==0 )return 1 ; }
PATCH 205/294 modpost: don't emit section mismatch warnings for compiler optimizations
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Gortmaker <[email protected]>
commit 4a3893d069b788f3570c19c12d9e986e8e15870f upstream.
Currently an allyesconfig build [gcc-4.9.1] can generate the following:
WARNING: vmlinux.o(.text.unlikely+0x3864): Section mismatch in reference from the function cpumask_empty.constprop.3() to the variable .init.data:nmi_ipi_mask
which comes from the cpumask_empty usage in arch/x86/kernel/nmi_selftest.c.
Normally we would not see a symbol entry for cpumask_empty since it is:
static inline bool cpumask_empty(const struct cpumask *srcp)
however in this case, the variant of the symbol gets emitted when GCC does constant propagation optimization.
Fix things up so that any locally optimized constprop variants don't warn when accessing variables that live in the __init sections.
[arnd: adapted text_sections definition to 3.18]
--- scripts/mod/modpost.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
scripts/mod/modpost.c +22 -0
@@ -930,6 +930,10 @@ static const char *init_sections[] = { Astatic const char *init_exit_sections[] = {ALL_INIT_SECTIONS ,ALL_EXIT_SECTIONS ,NULL }; +/* all text sections */ +static const char *const text_sections[] = {ALL_INIT_TEXT_SECTIONS , +ALL_EXIT_TEXT_SECTIONS ,TEXT_SECTIONS ,NULL }; +/* data section */ static const char *data_sections[] = {DATA_SECTIONS ,NULL };
@@ -948,6 +952,7 @@ static const char *data_sections[] = { Dstatic const char *head_sections[] = {".head.text*" ,NULL };static const char *linker_symbols[] = {"__init_begin" ,"_sinittext" ,"_einittext" ,NULL }; +static const char *const optim_symbols[] = {"*.constprop.*" ,NULL };enum mismatch {TEXT_TO_ANY_INIT ,
@@ -1105,6 +1110,17 @@ static const struct sectioncheck *sectio* This pattern is identified by * refsymname = __init_begin, _sinittext, _einittext * +* Pattern 5: +* GCC may optimize static inlines when fed constant arg(s) resulting +* in functions like cpumask_empty() -- generating an associated symbol +* cpumask_empty.constprop.3 that appears in the audit. If the const that +* is passed in comes from __init, like say nmi_ipi_mask, we get a +* meaningless section warning. May need to add isra symbols too... +* This pattern is identified by +* tosec = init section +* fromsec = text section +* refsymname = *.constprop.* +* **/ static int secref_whitelist(const struct sectioncheck *mismatch, const char *fromsec, const char *fromsym,
@@ -1137,6 +1153,12 @@ static int secref_whitelist(const structif (match (tosym, linker_symbols))return 0 ; +/* Check for pattern 5 */ +if (match (fromsec, text_sections) && +match (tosec, init_sections) && +match (fromsym, optim_symbols)) +return 0 ; +return 1 ; }
PATCH 206/294 ethernet: amd: fix pci device ids
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Varka Bhadram <[email protected]>
commit ba69a3d78e4f51e65933a86b8b107c86709bb2f5 upstream.
Normally any device ids will be above the corresponding device driver structure. This patch moves the pci device ids and MODULE_DEVICE_TABLE() above the pci driver structure.
--- drivers/net/ethernet/amd/amd8111e.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/net/ethernet/amd/amd8111e.c +11 -8
@@ -101,7 +101,6 @@ Revision History:MODULE_AUTHOR ("Advanced Micro Devices, Inc." );MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version " MODULE_VERS );MODULE_LICENSE ("GPL" ); -MODULE_DEVICE_TABLE (pci, amd8111e_pci_tbl);module_param_array (speed_duplex, int,NULL ,0 );MODULE_PARM_DESC (speed_duplex,"Set device speed and duplex modes, 0: Auto Negotiate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex" );module_param_array (coalesce, bool,NULL ,0 );
@@ -109,13 +108,6 @@ MODULE_PARM_DESC(coalesce, "Enable or Dimodule_param_array (dynamic_ipg, bool,NULL ,0 );MODULE_PARM_DESC (dynamic_ipg,"Enable or Disable dynamic IPG, 1: Enable, 0: Disable" ); -static DEFINE_PCI_DEVICE_TABLE (amd8111e_pci_tbl) = { - - {PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD8111E_7462 , -PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0UL }, - {0 , } - -};/* This function will read the PHY registers. */
@@ -1970,6 +1962,17 @@ err_disable_pdev: } +static const struct pci_device_id amd8111e_pci_tbl[] = { + { + .vendor =PCI_VENDOR_ID_AMD , + .device =PCI_DEVICE_ID_AMD8111E_7462 , + }, + { + .vendor =0 , + } +}; +MODULE_DEVICE_TABLE (pci, amd8111e_pci_tbl); +static struct pci_driver amd8111e_driver = { .name =MODULE_NAME , .id_table = amd8111e_pci_tbl,
PATCH 231/294 i2o: hide unsafe ioctl on 64-bit
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
We get a warning about a broken pointer conversion on 64-bit architectures:
drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru':drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(p->virt, (void __user *)sg[i].addr_bus,
^
drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
((void __user *)sg[j].addr_bus, sg_list[j].virt,
^This has clearly never worked right, so we can add an #ifdef around the code. The driver was moved to staging in linux-4.0 and finally removed in 4.2, so upstream does not have a fix for it.
The driver originally got this mostly right, though probably by accident.
--- drivers/message/i2o/i2o_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/message/i2o/i2o_config.c +2 -2
@@ -772,7 +772,7 @@ static long i2o_cfg_compat_ioctl(struct#endif -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC ) && !defined(CONFIG_64BIT )static int i2o_cfg_passthru (unsigned long arg) { struct i2o_cmd_passthru __user *cmd =
@@ -1045,7 +1045,7 @@ static long i2o_cfg_ioctl(struct file *f ret =i2o_cfg_evt_get (arg, fp);break ; -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC ) && !defined(CONFIG_64BIT )case I2OPASSTHRU : ret =i2o_cfg_passthru (arg);break ;
PATCH 233/294 scsi-tgt: fix type conversion warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
In 3.16-stable, we get this warning:
drivers/scsi/scsi_tgt_if.c:289:36: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast [-Wint-conversion]
The driver was removed in 3.17, so the bug was never fixed, but the code works correctly and is only lacking a cast to build cleanly on all architectures.
--- drivers/scsi/scsi_tgt_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_tgt_if.c +1 -1
@@ -286,7 +286,7 @@ static int uspace_ring_map(struct vm_areint i, err;for (i =0 ; i <TGT_RING_PAGES ; i++) { -struct page *page =virt_to_page (ring->tr_pages[i]); +struct page *page =virt_to_page ((void *)ring->tr_pages[i]); err =vm_insert_page (vma, addr, page);if (err)return err;
PATCH 234/294 ips: remove pointless #warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit e03c2da6574223081b786960e39c1e5ecf5d492d upstream.
non-x86 builds want the #warning in the IPS code about compiling on the wrong architecture removed because it keeps triggering on their platforms build farms. Transform from a compile time warning into a runtime one with taint to preserve the original intent of the authors.
--- drivers/scsi/ips.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/scsi/ips.c +5 -4
@@ -206,10 +206,6 @@ module_param(ips, charp, 0);#define IPS_VERSION_HIGH IPS_VER_MAJOR_STRING "." IPS_VER_MINOR_STRING#define IPS_VERSION_LOW "." IPS_VER_BUILD_STRING " " -#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) -#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" -#endif -#define IPS_DMA_DIR (scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \ DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \ PCI_DMA_BIDIRECTIONAL : \
@@ -6789,6 +6785,11 @@ ips_remove_device(struct pci_dev *pci_destatic int __init ips_module_init (void ) { +#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) +printk (KERN_ERR "ips: This driver has only been tested on the x86/ia64/x86_64 platforms\n" ); +add_taint (TAINT_CPU_OUT_OF_SPEC ,LOCKDEP_STILL_OK ); +#endif +if (pci_register_driver (&ips_pci_driver) <0 )return -ENODEV ; ips_driver_template.module =THIS_MODULE ;
PATCH 237/294 be2iscsi: Fix bogus WARN_ON length check
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tim Gardner <[email protected]>
commit dd29dae00d39186890a5eaa2fe4ad8768bfd41a9 upstream.
drivers/scsi/be2iscsi/be_main.c: In function 'be_sgl_create_contiguous':drivers/scsi/be2iscsi/be_main.c:3187:18: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
WARN_ON(!length > 0);
gcc version 5.2.1
--- drivers/scsi/be2iscsi/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/be2iscsi/be_main.c +1 -1
@@ -3152,7 +3152,7 @@ be_sgl_create_contiguous(void *virtual_a {WARN_ON (!virtual_address);WARN_ON (!physical_address); -WARN_ON (!length >0 ); +WARN_ON (!length);WARN_ON (!sgl); sgl->va = virtual_address;
PATCH 238/294 mvsas: fix misleading indentation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Luis de Bethencourt <[email protected]>
commit 7789cd39274c51bf475411fe22a8ee7255082809 upstream.
Fix a smatch warning:drivers/scsi/mvsas/mv_sas.c:740 mvs_task_prep() warn: curly braces intended?
The code is correct, the indention is misleading. When the device is not ready we want to return SAS_PHY_DOWN. But current indentation makes it look like we only do so in the else branch of if (mvi_dev).
--- drivers/scsi/mvsas/mv_sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mvsas/mv_sas.c +2 -2
@@ -737,8 +737,8 @@ static int mvs_task_prep(struct sas_taskmv_dprintk ("device %016llx not ready.\n" ,SAS_ADDR (dev->sas_addr)); - rc =SAS_PHY_DOWN ; -return rc; + rc =SAS_PHY_DOWN ; +return rc; } tei.port = dev->port->lldd_port;if (tei.port && !tei.port->port_attached && !tmf) {
PATCH 240/294 aic94xx: Skip reading user settings if flash is not found
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <[email protected]>
commit 36dd5acd196574d41de3e81d8264df475bbb7123 upstream.
If no user settings are found it's pointless trying to
read them from flash. So skip that step.
This also fixes a compilation warning about uninitialized variables in aic94xx.
--- drivers/scsi/aic94xx/aic94xx_sds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/aic94xx/aic94xx_sds.c +3 -2
@@ -983,7 +983,7 @@ static int asd_process_ctrl_a_user(struc {int err, i;u32 offs, size; -struct asd_ll_el *el; +struct asd_ll_el *el =NULL ;struct asd_ctrla_phy_settings *ps;struct asd_ctrla_phy_settings dflt_ps;
@@ -1004,6 +1004,7 @@ static int asd_process_ctrl_a_user(struc size =sizeof (struct asd_ctrla_phy_settings ); ps = &dflt_ps; + goto out_process; }if (size ==0 )
@@ -1028,7 +1029,7 @@ static int asd_process_ctrl_a_user(strucASD_DPRINTK ("couldn't find ctrla phy settings struct\n" ); goto out2; } - +out_process: err =asd_process_ctrla_phy_settings (asd_ha, ps);if (err) {ASD_DPRINTK ("couldn't process ctrla phy settings\n" );
PATCH 242/294 mtd: maps: rbtx4939-flash: delete an unused variable in rbtx4939_flash_remove
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Atsushi Nemoto <[email protected]>
commit e4c4c9c15ebe8ec03b7f5bf36e079052cc88217c upstream.
--- drivers/mtd/maps/rbtx4939-flash.c | 2 -- 1 file changed, 2 deletions(-)
drivers/mtd/maps/rbtx4939-flash.c +0 -2
@@ -35,8 +35,6 @@ static int rbtx4939_flash_remove(structreturn 0 ;if (info->mtd) { -struct rbtx4939_flash_data *pdata =dev_get_platdata (&dev->dev); -mtd_device_unregister (info->mtd);map_destroy (info->mtd); }
PATCH 245/294 mlx5: avoid build warnings on 32-bit
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 065bd8c28ba37d04c9a5b732173c1508954b1f58 upstream.
The mlx5 driver passes a string pointer in through a 'u64' variable, which on 32-bit machines causes a build warning:
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c: In function 'qp_read_field':drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
The code is in fact safe, so we can shut up the warning by adding extra type casts.
--- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +3 -3
@@ -300,11 +300,11 @@ static u64 qp_read_field(struct mlx5_cor param = qp->pid;break ;case QP_STATE : - param = (u64 )mlx5_qp_state_str (be32_to_cpu (ctx->flags) >>28 ); + param = (unsigned long )mlx5_qp_state_str (be32_to_cpu (ctx->flags) >>28 ); *is_str =1 ;break ;case QP_XPORT : - param = (u64 )mlx5_qp_type_str ((be32_to_cpu (ctx->flags) >>16 ) &0xff ); + param = (unsigned long )mlx5_qp_type_str ((be32_to_cpu (ctx->flags) >>16 ) &0xff ); *is_str =1 ;break ;case QP_MTU :
@@ -464,7 +464,7 @@ static ssize_t dbg_read(struct file *filif (is_str) - ret =snprintf (tbuf,sizeof (tbuf),"%s\n" , (const char *)field); + ret =snprintf (tbuf,sizeof (tbuf),"%s\n" , (const char *)(unsigned long )field);else ret =snprintf (tbuf,sizeof (tbuf),"0x%llx\n" , field);
PATCH 246/294 mISDN: avoid arch specific __builtin_return_address call
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 3e7a8716e20b759eec0ad88145255bb33174f0c8 upstream.
Not all architectures are able to call __builtin_return_address(). On ARM, the mISDN code produces this warning:
hardware/mISDN/w6692.c: In function 'w6692_dctrl':hardware/mISDN/w6692.c:1181:75: warning: unsupported argument to '__builtin_return_address'
pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__,
^
hardware/mISDN/mISDNipac.c: In function 'open_dchannel':
hardware/mISDN/mISDNipac.c:759:75: warning: unsupported argument to '__builtin_return_address'
pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__,
^In a lot of cases, this is relatively easy to work around by passing the value of __builtin_return_address(0) from the callers into the functions that want it. One exception is the indirect 'open' function call in struct isac_hw. While it would be possible to fix this as well, this patch only addresses the other callers properly and lets this one return the direct parent function, which should be good enough.
--- drivers/isdn/hardware/mISDN/mISDNipac.c | 12 +++++++++--- drivers/isdn/hardware/mISDN/w6692.c | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-)
drivers/isdn/hardware/mISDN/mISDNipac.c +9 -3
@@ -754,10 +754,10 @@ dbusy_timer_handler(struct isac_hw *isac }static int -open_dchannel (struct isac_hw *isac,struct channel_req *rq) +open_dchannel_caller (struct isac_hw *isac,struct channel_req *rq,void *caller) {pr_debug ("%s: %s dev(%d) open from %p\n" , isac->name, __func__, - isac->dch.dev.id,__builtin_return_address (1 )); + isac->dch.dev.id, caller);if (rq->protocol !=ISDN_P_TE_S0 )return -EINVAL ;if (rq->adr.channel ==1 )
@@ -771,6 +771,12 @@ open_dchannel(struct isac_hw *isac, strureturn 0 ; } +static int +open_dchannel (struct isac_hw *isac,struct channel_req *rq) +{ +return open_dchannel_caller (isac, rq,__builtin_return_address (0 )); +} +static const char *ISACVer[] = {"2086/2186 V1.1" ,"2085 B1" ,"2085 B2" ,"2085 V2.3" };
@@ -1547,7 +1553,7 @@ ipac_dctrl(struct mISDNchannel *ch, u32case OPEN_CHANNEL : rq = arg;if (rq->protocol ==ISDN_P_TE_S0 ) - err =open_dchannel (isac, rq); + err =open_dchannel_caller (isac, rq,__builtin_return_address (0 ));else err =open_bchannel (ipac, rq);if (err)
drivers/isdn/hardware/mISDN/w6692.c +3 -3
@@ -1176,10 +1176,10 @@ w6692_l1callback(struct dchannel *dch, u }static int -open_dchannel (struct w6692_hw *card,struct channel_req *rq) +open_dchannel (struct w6692_hw *card,struct channel_req *rq,void *caller) {pr_debug ("%s: %s dev(%d) open from %p\n" , card->name, __func__, - card->dch.dev.id,__builtin_return_address (1 )); + card->dch.dev.id, caller);if (rq->protocol !=ISDN_P_TE_S0 )return -EINVAL ;if (rq->adr.channel ==1 )
@@ -1207,7 +1207,7 @@ w6692_dctrl(struct mISDNchannel *ch, u32case OPEN_CHANNEL : rq = arg;if (rq->protocol ==ISDN_P_TE_S0 ) - err =open_dchannel (card, rq); + err =open_dchannel (card, rq,__builtin_return_address (0 ));else err =open_bchannel (card, rq);if (err)
PATCH 247/294 cpmac: remove hopeless #warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d43e6fb4ac4abfe4ef7c102833ed02330ad701e0 upstream.
The #warning was present 10 years ago when the driver first got merged. As the platform is rather obsolete by now, it seems very unlikely that the warning will cause anyone to fix the code properly.
kernelci.org reports the warning for every build in the meantime, so I think it's better to just turn it into a code comment to reduce noise.
--- drivers/net/ethernet/ti/cpmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpmac.c +1 -1
@@ -1226,7 +1226,7 @@ int cpmac_init(void) goto fail_alloc; } -#warning FIXME: unhardcode gpio&reset bits +/* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable (26 );ar7_gpio_disable (27 );ar7_device_reset (AR7_RESET_BIT_CPMAC_LO );
PATCH 248/294 net: caif: fix misleading indentation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 8e0cc8c326d99e41468c96fea9785ab78883a281 upstream.
gcc points out code that is not indented the way it is interpreted:
net/caif/cfpkt_skbuff.c: In function 'cfpkt_setlen':net/caif/cfpkt_skbuff.c:289:4: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
return cfpkt_getlen(pkt);
^~~~~~net/caif/cfpkt_skbuff.c:286:3: note: ...this 'else' clause, but it is not
else
^~~~
It is clear from the context that not returning here would be a bug, as we'd end up passing a negative length into a function that takes a u16 length, so it is not missing curly braces here, and I'm assuming that the indentation is the only part that's wrong about it.
--- net/caif/cfpkt_skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/caif/cfpkt_skbuff.c +1 -1
@@ -286,7 +286,7 @@ int cfpkt_setlen(struct cfpkt *pkt, u16else skb_trim (skb, len); -return cfpkt_getlen (pkt); +return cfpkt_getlen (pkt); }/* Need to expand SKB */
PATCH 249/294 net: am2150: fix nmclan_cs.c shared interrupt handling
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 96a30175f927facfb421655ef08b7a0fe546fbed upstream.
A recent patch tried to work around a valid warning for the use of a deprecated interface by blindly changing from the old pcmcia_request_exclusive_irq() interface to pcmcia_request_irq().
This driver has an interrupt handler that is not currently aware of shared interrupts, but can be easily converted to be. At the moment, the driver reads the interrupt status register repeatedly until it contains only zeroes in the interesting bits, and handles each bit individually.
This patch adds the missing part of returning IRQ_NONE in case none of the bits are set to start with, so we can move on to the next interrupt source.
--- drivers/net/ethernet/amd/nmclan_cs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/amd/nmclan_cs.c +2 -0
@@ -952,6 +952,8 @@ static irqreturn_t mace_interrupt(int ir do { /* WARNING: MACE_IR is a READ/CLEAR port! */ status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR); + if (!(status & ~MACE_IMR_DEFAULT) && IntrCnt == MACE_MAX_IR_ITERATIONS) + return IRQ_NONE; pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status);
PATCH 250/294 am2150: Update nmclan_cs.c to use update PCMCIA API
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Kirsher <[email protected]>
commit 5f5316fcd08ef74b282adf6774956431fac62663 upstream.
Resolves compile warning about use of a deprecated function call:drivers/net/ethernet/amd/nmclan_cs.c: In function ‘nmclan_config’:drivers/net/ethernet/amd/nmclan_cs.c:624:3: warning: ‘pcmcia_request_exclusive_irq’ is deprecated (declared at include/pcmcia/ds.h:213) [-Wdeprecated-declarations]
ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
Updates pcmcia_request_exclusive_irq() to pcmcia_request_irq().
--- drivers/net/ethernet/amd/nmclan_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/nmclan_cs.c +1 -1
@@ -621,7 +621,7 @@ static int nmclan_config(struct pcmcia_d ret =pcmcia_request_io (link);if (ret) goto failed; - ret =pcmcia_request_exclusive_irq (link, mace_interrupt); + ret =pcmcia_request_irq (link, mace_interrupt);if (ret) goto failed; ret =pcmcia_enable_device (link);
PATCH 261/294 staging: bcm: add 32-bit host dependency
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
The driver uses a 32-bit variable to store a pointer, causing a couple of warnings:
../drivers/staging/bcm/CmHost.c: In function 'StoreCmControlResponseMessage':../drivers/staging/bcm/CmHost.c:1503:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1546:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1564:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
I fixed other warnings in an earlier commit 9f1c75ac2dba ("staging/bcm: fix most build warnings"), but couldn't figure out what was the intended behavior on 64-bit machines here.
The driver was removed in linux-3.19, commit d09e9b160fc1 ("staging: bcm: remove driver") which explains that it never worked on 64-bit machines. This adds a Kconfig dependency instead to prevent it from being built in the known broken configuration. This workaround applies to v2.6.37 or higher.
--- drivers/staging/bcm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/bcm/Kconfig +1 -0
@@ -1,6 +1,7 @@ config BCM_WIMAX tristate "Beceem BCS200/BCS220-3 and BCSM250 wimax support" depends on USB && NET + depends on !64BIT help This is an experimental driver for the Beceem WIMAX chipset used by Sprint 4G.
PATCH 265/294 Staging: lustre: missing curly braces in ll_setattr_raw()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 53bd4a004ee5ff0f71a858de78faac98924b4a87 upstream.
Quoted 1 line
Quoted 1 line
From the indenting, it looks like curly braces were intended here.
--- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +2 -1
@@ -1489,7 +1489,7 @@ int ll_setattr_raw(struct dentry *dentryif (attr->ia_valid & (ATTR_SIZE |ATTR_ATIME |ATTR_ATIME_SET | -ATTR_MTIME |ATTR_MTIME_SET )) +ATTR_MTIME |ATTR_MTIME_SET )) {/* For truncate and utimes sending attributes to OSTs, setting * mtime/atime to the past will be performed under PW [0:EOF] * extent lock (new_size:EOF for truncate). It may seem
@@ -1501,6 +1501,7 @@ int ll_setattr_raw(struct dentry *dentry rc =ll_setattr_ost (inode, attr);if (attr->ia_valid &ATTR_SIZE )up_write (&lli->lli_trunc_sem); + } out:if (op_data) {if (op_data->op_ioepoch) {
PATCH 266/294 staging: rtl8723au: core: rtw_wlan_util: fix misleading indentation
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Luis de Bethencourt <[email protected]>
commit 8c182ae20791d638c07ff499709c4a1d4697bd7c upstream.
For loop is outside of the else branch of the above conditional statement. Fixing misleading indentation.
Fix a smatch warning:drivers/staging/rtl8723au/core/rtw_wlan_util.c:528 WMMOnAssocRsp23a() warn: curly braces intended?
--- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/core/rtw_wlan_util.c +1 -1
@@ -546,7 +546,7 @@ void WMMOnAssocRsp23a(struct rtw_adapterelse aSifsTime =16 ; -for (i =0 ; i <4 ; i++) { +for (i =0 ; i <4 ; i++) {ACI = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >>5 ) &0x03 ;ACM = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >>4 ) &0x01 ;
PATCH 273/294 ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 5008efc83bf85b647aa1cbc44718b1675bbb7444 upstream.
The PJ4 inline asm sequence to write to cp15 cannot be built in Thumb-2 mode, due to the way it performs arithmetic on the program counter, so it is built in ARM mode instead. However, building C files in ARM mode under CONFIG_THUMB2_KERNEL is problematic, since the instrumentation performed by subsystems like ftrace does not expect having to deal with interworking branches.
Since the sequence in question is simply a poor man's ISB instruction, let's use a straight 'isb' instead when building in Thumb2 mode. Thumb2 implies V7, so 'isb' should always be supported in that case.
--- arch/arm/kernel/Makefile | 1 - arch/arm/kernel/pj4-cp0.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/kernel/Makefile +0 -1
@@ -84,7 +84,6 @@ obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o -CFLAGS_pj4-cp0.o := -marm AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
arch/arm/kernel/pj4-cp0.c +4 -0
@@ -66,9 +66,13 @@ static void __init pj4_cp_access_write(u __asm__ __volatile__ ( "mcr p15, 0, %1, c1, c0, 2\n\t" +#ifdef CONFIG_THUMB2_KERNEL + "isb\n\t" +#else"mrc p15, 0, %0, c1, c0, 2\n\t" "mov %0, %0\n\t" "sub pc, pc, #4\n\t" +#endif :"=r" (temp) :"r" (value)); }
PATCH 258/294 netfilter; Add some missing default cases to switch statements in nft_reject.
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <[email protected]>
commit 129d23a56623eea0947a05288158d76dc7f2f0ac upstream.
This fixes:
====================net/netfilter/nft_reject.c: In function ‘nft_reject_dump’:net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswitch]
switch (priv->type) {
^net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_ICMPX_UNREACH’ not handled in switch [-Wswi\
tch]net/netfilter/nft_reject_inet.c: In function ‘nft_reject_inet_dump’:net/netfilter/nft_reject_inet.c:105:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswi\
tch]
switch (priv->type) {
^
====================
--- net/netfilter/nft_reject.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nft_reject.c +2 -0
@@ -61,6 +61,8 @@ int nft_reject_dump(struct sk_buff *skb,if (nla_put_u8 (skb,NFTA_REJECT_ICMP_CODE , priv->icmp_code)) goto nla_put_failure;break ; +default : +break ; }return 0 ;
PATCH 262/294 staging: imx-drm: fix indentation warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
gcc-6 produces a harmless warning:
drivers/staging/imx-drm/imx-hdmi.c: In function 'hdmi_config_AVI':drivers/staging/imx-drm/imx-hdmi.c:967:2: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
Commit d083c312cba2 ("drm: bridge/dw_hdmi: simplify hdmi_config_AVI() a little") in linux-4.3 fixes this with a larger rewrite that is not applicable here. After that rewrite, the variable that gets assigned here no longer exists.
The assignment is rather pointless here, as we just set a variable to zero that is later added into another variable using a bitwise or operator, and that has no effect, so I'm just changing the indentation here to shut up the warning.
The driver was originally merged in linux-3.13, and the fix applies to all versions between that and 4.2.
--- drivers/staging/imx-drm/imx-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/imx-drm/imx-hdmi.c +1 -1
@@ -968,7 +968,7 @@ static void hdmi_config_AVI(struct imx_helse pix_fmt =HDMI_FC_AVICONF0_PIX_FMT_RGB ; - under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ; + under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ;/* * Active format identification data is present in the AVI InfoFrame.
PATCH 263/294 staging: vt6655: fix overly large stack usage
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
We get a warning for the large stack usage in some configurations:
drivers/staging/vt6655/device_main.c: In function 'device_ioctl':drivers/staging/vt6655/device_main.c:2974:1: warning: the frame size of 1304 bytes is larger than 1024 bytes [-Wframe-larger-than=]
This is addressed in linux-3.19 with commit 67013f2c0e58 ("staging: vt6655:
mac80211 conversion add main mac80211 functions"), which obsoletes the device_ioctl() function, but as that does not apply to stable kernels, this picks an easier way out by using dynamic allocation.
The driver was merged in 2.6.31, and the fix applies to all versions before 3.19.
--- drivers/staging/vt6655/device_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/vt6655/device_main.c +6 -4
@@ -2933,11 +2933,13 @@ static int device_ioctl(struct net_deviDBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO " SIOCSIWSENS \n" ); rc = -EOPNOTSUPP ;break ; -case SIOCGIWAPLIST : { -char buffer[IW_MAX_AP * (sizeof (struct sockaddr ) +sizeof (struct iw_quality ))]; +char *buffer =kzalloc (IW_MAX_AP * (sizeof (struct sockaddr ) + +sizeof (struct iw_quality )),GFP_KERNEL ); -if (wrq->u.data.pointer) { +if (!buffer) { + rc = -ENOMEM ; + }else if (wrq->u.data.pointer) { rc =iwctl_giwaplist (dev,NULL , &(wrq->u.data), buffer);if (rc ==0 ) { if (copy_to_user(wrq->u.data.pointer,
@@ -2947,6 +2949,7 @@ static int device_ioctl(struct net_devi rc = -EFAULT ; } } +kfree (buffer); }break ;
@@ -2993,7 +2996,6 @@ static int device_ioctl(struct net_deviDBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO " SIOCGIWGENIE \n" ); rc =iwctl_giwgenie (dev,NULL , &(wrq->u.data), wrq->u.data.pointer);break ; -case SIOCSIWENCODEEXT : {char extra[sizeof (struct iw_encode_ext )+MAX_KEY_LEN +1 ];DBG_PRT (MSG_LEVEL_DEBUG ,KERN_INFO " SIOCSIWENCODEEXT \n" );
PATCH 264/294 Staging: iio: adc: fix indent on break statement
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
commit b6acb0cfc21293a1bfc283e9217f58f7474ef728 upstream.
Fix indent warning when building with gcc 6:drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented
as if it were guarded by... [-Wmisleading-indentation]
--- drivers/staging/iio/adc/ad7192.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/ad7192.c +1 -1
@@ -236,7 +236,7 @@ static int ad7192_setup(struct ad7192_st st->mclk = pdata->ext_clk_Hz; else st->mclk = AD7192_INT_FREQ_MHz; -break ; +break ;default : ret = -EINVAL ; goto out;
PATCH 270/294 x86/boot: Add CONFIG_PARAVIRT_SPINLOCKS quirk to arch/x86/boot/compressed/misc.h
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ingo Molnar <[email protected]>
commit 927392d73a97d8d235bb65400e2e3c7f0bec2b6f upstream.
Linus reported the following new warning on x86 allmodconfig with GCC 5.1:
Quoted 5 lines
./arch/x86/include/asm/spinlock.h: In function ‘arch_spin_lock’:./arch/x86/include/asm/spinlock.h:119:3: warning: implicit declaration of function ‘__ticket_lock_spinning’ [-Wimplicit-function-declaration]__ticket_lock_spinning(lock, inc.tail); ^
This warning triggers because of these hacks in misc.h:
/*
* we have to be careful, because no indirections are allowed here, and
* paravirt_ops is a kind of one. As it will only run in baremetal anyway,
* we just keep it from happening
*/
#undef CONFIG_PARAVIRT
#undef CONFIG_KASAN
But these hacks were not updated when CONFIG_PARAVIRT_SPINLOCKS was added, and eventually (with the introduction of queued paravirt spinlocks in recent kernels) this created an invalid Kconfig combination and broke the build.
So add a CONFIG_PARAVIRT_SPINLOCKS #undef line as well.
Also remove the _ASM_X86_DESC_H quirk: that undocumented quirk was originally added ages ago, in:
099e1377269a ("x86: use ELF format in compressed images.")
and I went back to that kernel (and fixed up the main Makefile which didn't build anymore) and checked what failure it
avoided: it avoided an include file dependencies related build failure related to our old x86-platforms code.
That old code is long gone, the header dependencies got cleaned up, and the build does not fail anymore with the totality of asm/desc.h included - so remove the quirk.
--- arch/x86/boot/compressed/misc.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
arch/x86/boot/compressed/misc.h +5 -6
@@ -2,14 +2,13 @@#define BOOT_COMPRESSED_MISC_H /* -* we have to be careful, because no indirections are allowed here, and -* paravirt_ops is a kind of one. As it will only run in baremetal anyway, -* we just keep it from happening +* Special hack: we have to be careful, because no indirections are allowed here, +* and paravirt_ops is a kind of one. As it will only run in baremetal anyway, +* we just keep it from happening. (This list needs to be extended when new +* paravirt and debugging variants are added.) */ #undef CONFIG_PARAVIRT -#ifdef CONFIG_X86_32 -#define _ASM_X86_DESC_H 1 -#endif +#undef CONFIG_PARAVIRT_SPINLOCKS#include <linux/linkage.h> #include <linux/screen_info.h>
PATCH 271/294 ARM: cns3xxx: shut up frame size warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
This shuts up a warning in the 3.18-stable series that has been fixed in newer kernels with commit 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow"):
arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init':arch/arm/mach-cns3xxx/pcie.c:313:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
The fix that went into v4.4 is known to be buggy and was later fixed again with commit 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()"). While we could backport both to 3.18, they are fairly invasive and the warning is definitely harmless here as the call chain is known to not overflow the stack of the init task.
This simply adds a Makefile flag to extend the limit for this one file.
---
We do want 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()") backported into v4.4 though.
--- arch/arm/mach-cns3xxx/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-cns3xxx/Makefile +1 -0
@@ -2,4 +2,5 @@ obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o cns3xxx-y += core.o pm.o cns3xxx-$(CONFIG_ATAGS) += devices.o cns3xxx-$(CONFIG_PCI) += pcie.o +CFLAGS_pcie.o += -Wframe-larger-than=1536 # override default 1024, this is safe here cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o
PATCH 272/294 ARM: 8221/1: PJ4: allow building in Thumb-2 mode
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 13d1b9575ac2c2da143cd2236b6cf0fc314570f8 upstream.
Two files that get included when building the multi_v7_defconfig target fail to build when selecting THUMB2_KERNEL for this configuration.
In both cases, we can just build the file as ARM code, as none of its symbols are exported to modules, so there are no interworking concerns. In the iwmmxt.S case, add ENDPROC() declarations so the symbols are annotated as functions, resulting in the linker to emit the appropriate mode switches.
--- arch/arm/kernel/Makefile | 1 + arch/arm/kernel/iwmmxt.S | 13 +++++++++++++ 2 files changed, 14 insertions(+)
arch/arm/kernel/Makefile +1 -0
@@ -84,6 +84,7 @@ obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o +CFLAGS_pj4-cp0.o := -marm AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
arch/arm/kernel/iwmmxt.S +13 -0
@@ -58,6 +58,7 @@ #define MMX_SIZE (0x98) .text + .arm /* * Lazy switching of Concan coprocessor context
@@ -182,6 +183,8 @@ concan_load: tmcr wCon, r2 mov pc, lr +ENDPROC(iwmmxt_task_enable) + /* * Back up Concan regs to save area and disable access to them * (mainly for gdb or sleep mode usage)
@@ -232,6 +235,8 @@ ENTRY(iwmmxt_task_disable) 1: msr cpsr_c, ip @ restore interrupt mode ldmfd sp!, {r4, pc} +ENDPROC(iwmmxt_task_disable) + /* * Copy Concan state to given memory address *
@@ -268,6 +273,8 @@ ENTRY(iwmmxt_task_copy) msr cpsr_c, ip @ restore interrupt mode mov pc, r3 +ENDPROC(iwmmxt_task_copy) + /* * Restore Concan state from given memory address *
@@ -304,6 +311,8 @@ ENTRY(iwmmxt_task_restore) msr cpsr_c, ip @ restore interrupt mode mov pc, r3 +ENDPROC(iwmmxt_task_restore) + /* * Concan handling on task switch *
@@ -335,6 +344,8 @@ ENTRY(iwmmxt_task_switch) mrc p15, 0, r1, c2, c0, 0 sub pc, lr, r1, lsr #32 @ cpwait and return +ENDPROC(iwmmxt_task_switch) + /* * Remove Concan ownership of given task *
@@ -353,6 +364,8 @@ ENTRY(iwmmxt_task_release) msr cpsr_c, r2 @ restore interrupts mov pc, lr +ENDPROC(iwmmxt_task_release) + .data concan_owner: .word 0
PATCH 274/294 ARM: OMAP: Fix Kconfig warning for omap1
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
commit 52aaac5ae52ad9a7016410ffeedbaf24b722f3a2 upstream.
Commit 21278aeafbfa ("ARM: use menuconfig for sub-arch menus") improved the sub-arch menus, but accidentally caused new warnings for omap1. This was because the commit added a menu entry around config ARCH_OMAP bool entry where the menu had depends on ARCH_MULTI_V6 || ARCH_MULTI_V7.
As ARCH_OMAP is shared between omap1 and omap2plus, let's fix the issue by defining ARCH_OMAP in the shared plat-omap/Kconfig.
--- arch/arm/mach-omap2/Kconfig | 3 --- arch/arm/plat-omap/Kconfig | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/Kconfig +0 -3
@@ -1,9 +1,6 @@ menu "TI OMAP/AM/DM/DRA Family" depends on ARCH_MULTI_V6 || ARCH_MULTI_V7 -config ARCH_OMAP - bool - config ARCH_OMAP2 bool "TI OMAP2" depends on ARCH_MULTI_V6
arch/arm/plat-omap/Kconfig +3 -0
@@ -1,3 +1,6 @@ +config ARCH_OMAP + bool + if ARCH_OMAP menu "TI OMAP Common Features"
PATCH 275/294 ARM: 8160/1: drop warning about return_address not using unwind tables
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
commit e16343c47e4276f5ebc77ca16feb5e50ca1918f9 upstream.
The warning was introduced in 2009 (commit 4bf1fa5a34aa ([ARM] 5613/1:
implement CALLER_ADDRESSx)). The only "problem" here is that CALLER_ADDRESSx for x > 1 returns NULL which doesn't do much harm.
The drawback of implementing a fix (i.e. use unwind tables to implement CALLER_ADDRESSx) is that much of the unwinder code would need to be marked as not traceable.
--- arch/arm/kernel/return_address.c | 4 ---- 1 file changed, 4 deletions(-)
arch/arm/kernel/return_address.c +0 -4
@@ -59,10 +59,6 @@ void *return_address(unsigned int level)#else /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ -#if defined(CONFIG_ARM_UNWIND ) -#warning "TODO: return_address should use unwind tables" -#endif -void *return_address (unsigned int level) {return NULL ;
PATCH 276/294 ARM: 8296/1: cache-l2x0: clean up aurora cache handling
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 20e783e39e55c2615fb61d1b3d139ee9edcf6772 upstream.
The aurora cache controller is the only remaining user of a couple of functions in this file and are completely unused when that is disabled, leading to build warnings:
arch/arm/mm/cache-l2x0.c:167:13: warning: 'l2x0_cache_sync' defined but not used [-Wunused-function] arch/arm/mm/cache-l2x0.c:184:13: warning: 'l2x0_flush_all' defined but not used [-Wunused-function] arch/arm/mm/cache-l2x0.c:194:13: warning: 'l2x0_disable' defined but not used [-Wunused-function]
With the knowledge that the code is now aurora-specific, we can simplify it noticeably:
- The pl310 errata workarounds are not needed on aurora and can be removed
- As confirmed by Thomas Petazzoni from the data sheet, the cache_wait() macro is never needed.
- No need to hold the lock across atomic cache sync
- We can load the l2x0_base into a local variable across operations
There should be no functional change in this patch, but readability and the generated object code improves, along with avoiding the warnings.
(on Armada 370 RD and Armada XP GP, boot tested, plus a little bit of DMA traffic by reading data from a SD card)
--- arch/arm/mm/cache-l2x0.c | 111 ++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 73 deletions(-)
arch/arm/mm/cache-l2x0.c +38 -73
@@ -135,73 +135,6 @@ static void l2c_disable(void)dsb (st); } -#ifdef CONFIG_CACHE_PL310 -static inline void cache_wait (void __iomem *reg,unsigned long mask) -{ -/* cache operations by line are atomic on PL310 */ -} -#else -#define cache_wait l2c_wait_mask -#endif - -static inline void cache_sync (void ) -{ -void __iomem *base = l2x0_base; - -writel_relaxed (0 , base + sync_reg_offset); -cache_wait (base +L2X0_CACHE_SYNC ,1 ); -} - -#if defined(CONFIG_PL310_ERRATA_588369 ) || defined(CONFIG_PL310_ERRATA_727915 ) -static inline void debug_writel (unsigned long val) -{ -l2c_set_debug (l2x0_base, val); -} -#else -/* Optimised out for non-errata case */ -static inline void debug_writel (unsigned long val) -{ -} -#endif - -static void l2x0_cache_sync (void ) -{ -unsigned long flags; - -raw_spin_lock_irqsave (&l2x0_lock, flags); -cache_sync (); -raw_spin_unlock_irqrestore (&l2x0_lock, flags); -} - -static void __l2x0_flush_all (void ) -{ -debug_writel (0x03 ); -__l2c_op_way (l2x0_base +L2X0_CLEAN_INV_WAY ); -cache_sync (); -debug_writel (0x00 ); -} - -static void l2x0_flush_all (void ) -{ -unsigned long flags; - -/* clean all ways */ -raw_spin_lock_irqsave (&l2x0_lock, flags); -__l2x0_flush_all (); -raw_spin_unlock_irqrestore (&l2x0_lock, flags); -} - -static void l2x0_disable (void ) -{ -unsigned long flags; - -raw_spin_lock_irqsave (&l2x0_lock, flags); -__l2x0_flush_all (); -l2c_write_sec (0 , l2x0_base,L2X0_CTRL ); -dsb (st); -raw_spin_unlock_irqrestore (&l2x0_lock, flags); -} -static void l2c_save (void __iomem *base) { l2x0_saved_regs.aux_ctrl =readl_relaxed (l2x0_base +L2X0_AUX_CTRL );
@@ -1126,14 +1059,15 @@ static unsigned long calc_range_end(unsistatic void aurora_pa_range (unsigned long start,unsigned long end,unsigned long offset) { +void __iomem *base = l2x0_base;unsigned long flags;raw_spin_lock_irqsave (&l2x0_lock, flags); -writel_relaxed (start, l2x0_base +AURORA_RANGE_BASE_ADDR_REG ); -writel_relaxed (end, l2x0_base + offset); +writel_relaxed (start, base +AURORA_RANGE_BASE_ADDR_REG ); +writel_relaxed (end, base + offset);raw_spin_unlock_irqrestore (&l2x0_lock, flags); -cache_sync (); +writel_relaxed (0 , base +AURORA_SYNC_REG ); }static void aurora_inv_range (unsigned long start,unsigned long end)
@@ -1193,6 +1127,37 @@ static void aurora_flush_range(unsigned } } +static void aurora_flush_all (void ) +{ +void __iomem *base = l2x0_base; +unsigned long flags; + +/* clean all ways */ +raw_spin_lock_irqsave (&l2x0_lock, flags); +__l2c_op_way (base +L2X0_CLEAN_INV_WAY ); +raw_spin_unlock_irqrestore (&l2x0_lock, flags); + +writel_relaxed (0 , base +AURORA_SYNC_REG ); +} + +static void aurora_cache_sync (void ) +{ +writel_relaxed (0 , l2x0_base +AURORA_SYNC_REG ); +} + +static void aurora_disable (void ) +{ +void __iomem *base = l2x0_base; +unsigned long flags; + +raw_spin_lock_irqsave (&l2x0_lock, flags); +__l2c_op_way (base +L2X0_CLEAN_INV_WAY ); +writel_relaxed (0 , base +AURORA_SYNC_REG ); +l2c_write_sec (0 , base,L2X0_CTRL ); +dsb (st); +raw_spin_unlock_irqrestore (&l2x0_lock, flags); +} +static void aurora_save (void __iomem *base) { l2x0_saved_regs.ctrl =readl_relaxed (base +L2X0_CTRL );
@@ -1267,9 +1232,9 @@ static const struct l2c_init_data of_aur .inv_range = aurora_inv_range, .clean_range = aurora_clean_range, .flush_range = aurora_flush_range, - .flush_all = l2x0_flush_all, - .disable = l2x0_disable, - .sync = l2x0_cache_sync, + .flush_all = aurora_flush_all, + .disable = aurora_disable, + .sync = aurora_cache_sync, .resume = aurora_resume, }, };
PATCH 279/294 MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Maciej W. Rozycki" <[email protected]>
commit 68fe55680d0f3342969f49412fceabb90bdfadba upstream.
Fix a commit 3021773c7c3e ("MIPS: DEC: Avoid la pseudo-instruction in delay slots") regression and remove assembly errors:
arch/mips/dec/int-handler.S: Assembler messages:arch/mips/dec/int-handler.S:162: Error: Macro used $at after ".set noat" arch/mips/dec/int-handler.S:163: Error: Macro used $at after ".set noat" arch/mips/dec/int-handler.S:229: Error: Macro used $at after ".set noat" arch/mips/dec/int-handler.S:230: Error: Macro used $at after ".set noat"
triggering with with the CPU_DADDI_WORKAROUNDS option set and the DADDIU instruction. This is because with that option in place the instruction becomes a macro, which expands to an LI/DADDU (or actually ADDIU/DADDU) sequence that uses $at as a temporary register.
With CPU_DADDI_WORKAROUNDS we only support `-msym32' compilation though, and this is already enforced in arch/mips/Makefile, so choose the 32-bit expansion variant for the supported configurations and then replace the 64-bit variant with #error just in case.
Patchwork: https://patchwork.linux-mips.org/patch/16893/
--- arch/mips/dec/int-handler.S | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-)
arch/mips/dec/int-handler.S +6 -28
@@ -147,23 +147,12 @@ * Find irq with highest priority */ # open coded PTR_LA t1, cpu_mask_nr_tbl -#if (_MIPS_SZPTR == 32) +#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) # open coded la t1, cpu_mask_nr_tbl lui t1, %hi(cpu_mask_nr_tbl) addiu t1, %lo(cpu_mask_nr_tbl) - -#endif -#if (_MIPS_SZPTR == 64) - # open coded dla t1, cpu_mask_nr_tbl - .set push - .set noat - lui t1, %highest(cpu_mask_nr_tbl) - lui AT, %hi(cpu_mask_nr_tbl) - daddiu t1, t1, %higher(cpu_mask_nr_tbl) - daddiu AT, AT, %lo(cpu_mask_nr_tbl) - dsll t1, 32 - daddu t1, t1, AT - .set pop +#else +#error GCC `-msym32' option required for 64-bit DECstation builds #endif 1: lw t2,(t1) nop
@@ -214,23 +203,12 @@ * Find irq with highest priority */ # open coded PTR_LA t1,asic_mask_nr_tbl -#if (_MIPS_SZPTR == 32) +#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) # open coded la t1, asic_mask_nr_tbl lui t1, %hi(asic_mask_nr_tbl) addiu t1, %lo(asic_mask_nr_tbl) - -#endif -#if (_MIPS_SZPTR == 64) - # open coded dla t1, asic_mask_nr_tbl - .set push - .set noat - lui t1, %highest(asic_mask_nr_tbl) - lui AT, %hi(asic_mask_nr_tbl) - daddiu t1, t1, %higher(asic_mask_nr_tbl) - daddiu AT, AT, %lo(asic_mask_nr_tbl) - dsll t1, 32 - daddu t1, t1, AT - .set pop +#else +#error GCC `-msym32' option required for 64-bit DECstation builds #endif 2: lw t2,(t1) nop
PATCH 286/294 mtd: cfi: reduce stack size
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d09957fbb4d0b059b3176b510540df69048ad170 upstream.
The cfi_staa_write_buffers function uses a large amount of kernel stack whenever CONFIG_MTD_MAP_BANK_WIDTH_32 is set, and that results in a warning on ARM allmodconfig builds:
drivers/mtd/chips/cfi_cmdset_0020.c: In function 'cfi_staa_write_buffers':drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
It turns out that this is largely a result of a suboptimal implementation of map_word_andequal(). Replacing this function with a straightforward one reduces the stack size in this function by exactly 200 bytes, shrinks the .text segment for this file from 27648 bytes to 26608 bytes, and makes the warning go away.
--- include/linux/mtd/map.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
include/linux/mtd/map.h +11 -1
@@ -317,7 +317,17 @@ static inline map_word map_word_or(strucreturn r; } -#define map_word_andequal (m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b)) +static inline int map_word_andequal (struct map_info *map,map_word val1,map_word val2,map_word val3) +{ +int i; + +for (i =0 ; i <map_words (map); i++) { +if ((val1.x[i] & val2.x[i]) != val3.x[i]) +return 0 ; + } + +return 1 ; +}static inline int map_word_bitsset (struct map_info *map,map_word val1,map_word val2) {
PATCH 290/294 MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers.
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit 26f7c4bd05cf34e63a4a794150ab66a40a5a84a9 upstream.
These are generated by very recent toolchains and result in an error message when attenpting to convert a kernel from ELF to ECOFF.
--- arch/mips/boot/elf2ecoff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/mips/boot/elf2ecoff.c +4 -2
@@ -49,7 +49,8 @@/* * Some extra ELF definitions */ -#define PT_MIPS_REGINFO 0x70000000/* Register usage information */ +#define PT_MIPS_REGINFO 0x70000000/* Register usage information */ +#define PT_MIPS_ABIFLAGS 0x70000003/* Records ABI related flags */ /* -------------------------------------------------------------------- */
@@ -347,7 +348,8 @@ int main(int argc, char *argv[])/* Section types we can ignore... */ if (ph[i].p_type ==PT_NULL || ph[i].p_type ==PT_NOTE || ph[i].p_type ==PT_PHDR - || ph[i].p_type ==PT_MIPS_REGINFO ) + || ph[i].p_type ==PT_MIPS_REGINFO + || ph[i].p_type ==PT_MIPS_ABIFLAGS )continue ;/* Section types we can't handle... */ else if (ph[i].p_type !=PT_LOAD ) {
PATCH 292/294 e1000e: fix call to do_div() to use u64 arg
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Kirsher <[email protected]>
commit 30544af5483755b11bb5924736e9e0b45ef0644a upstream.
We were using s64 for lat_ns (latency nano-second value) since in our calculations a negative value could be a resultant. For negative values, we then assign lat_ns to be zero, so the value passed to do_div() was never negative, but do_div() expects the argument type to be u64, so do a cast to resolve a compile warning seen on PowerPC.
--- drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/e1000e/ich8lan.c +7 -6
@@ -984,7 +984,7 @@ static s32 e1000_platform_pm_pch_lpt(stru16 max_snoop, max_nosnoop;u16 max_ltr_enc;/* max LTR latency encoded */ s64 lat_ns;/* latency (ns) */ -s64 value; +u64 value;u32 rxa;if (!hw->adapter->max_frame_size) {
@@ -1011,12 +1011,13 @@ static s32 e1000_platform_pm_pch_lpt(str*/ lat_ns = ((s64 )rxa *1024 - (2 * (s64 )hw->adapter->max_frame_size)) *8 *1000 ; -if (lat_ns <0 ) - lat_ns =0 ; -else -do_div (lat_ns, speed); +if (lat_ns <0 ) { + value =0 ; + }else { + value = lat_ns; +do_div (value, speed); + } - value = lat_ns;while (value >PCI_LTR_VALUE_MASK ) { scale++; value =DIV_ROUND_UP (value, (1 <<5 ));
PATCH 294/294 net/xen-netback: disable on 64KB page granularity
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
Building the linux-3.16 stable branch, I ran into this warning that shows a serious problem in the xen-netback driver:
drivers/net/xen-netback/netback.c: In function 'xenvif_dealloc_kthread':drivers/net/xen-netback/netback.c:2002:1: error: the frame size of 16384 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
The bug was fixed in linux-4.4, but for any older stable kernel we either need to backport that fix, or not use the driver when the page size is set to 64KB. As the proper fix is way bigger than the usual limit for stable backport patches, this adds a Kconfig dependency.
--- drivers/net/Kconfig | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/Kconfig +3 -0
@@ -331,6 +331,9 @@ config XEN_NETDEV_FRONTEND config XEN_NETDEV_BACKEND tristate "Xen backend network device" depends on XEN_BACKEND + depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \ + IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \ + PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES) help This driver allows the kernel to act as a Xen network driver domain which exports paravirtual network devices to other
PATCH 209/294 module: fix types of device tables aliases
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Ryabinin <[email protected]>
commit 6301939d97d079f0d3dbe71e750f4daf5d39fc33 upstream.
MODULE_DEVICE_TABLE() macro used to create aliases to device tables. Normally alias should have the same type as aliased symbol.
Device tables are arrays, so they have 'struct type##_device_id[x]' types. Alias created by MODULE_DEVICE_TABLE() will have non-array type -
'struct type##_device_id'.
This inconsistency confuses compiler, it could make a wrong assumption about variable's size which leads KASan to produce a false positive report about out of bounds access.
For every global variable compiler calls __asan_register_globals() passing information about global variable (address, size, size with redzone, name ...) __asan_register_globals() poison symbols redzone to detect possible out of bounds accesses.
When symbol has an alias __asan_register_globals() will be called as for symbol so for alias. Compiler determines size of variable by size of variable's type. Alias and symbol have the same address, so if alias have the wrong size part of memory that actually belongs to the symbol could be poisoned as redzone of alias symbol.
By fixing type of alias symbol we will fix size of it, so __asan_register_globals() will not poison valid memory.
--- include/linux/module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/module.h +1 -1
@@ -135,7 +135,7 @@ void trim_init_extable(struct module *m)#ifdef MODULE /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE (type, name) \ - extern const struct type##_device_id __mod_##type##__##name##_device_table \ +extern const typeof(name) __mod_##type##__##name##_device_table \ __attribute__ ((unused, alias(__stringify(name))))#else /* !MODULE */ #define MODULE_DEVICE_TABLE (type, name)
PATCH 252/294 net: vxge: avoid unused function warnings
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 57e7c8cef224af166b8ec932b5e383641418c005 upstream.
When CONFIG_PCI_MSI is disabled, we get warnings about unused functions in the vxge driver:
drivers/net/ethernet/neterion/vxge/vxge-main.c:2121:13: warning: 'adaptive_coalesce_tx_interrupts' defined but not used [-Wunused-function] drivers/net/ethernet/neterion/vxge/vxge-main.c:2149:13: warning: 'adaptive_coalesce_rx_interrupts' defined but not used [-Wunused-function]
We could add another #ifdef here, but it's nicer to avoid those warnings for good by converting the existing #ifdef to if(IS_ENABLED()), which has the same effect but provides better compile-time coverage in general, and lets the compiler understand better when the function is intentionally unused.
--- drivers/net/ethernet/neterion/vxge/vxge-main.c | 31 ++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-)
drivers/net/ethernet/neterion/vxge/vxge-main.c +12 -19
@@ -2224,8 +2224,6 @@ static irqreturn_t vxge_isr_napi(int irqreturn IRQ_NONE ; } -#ifdef CONFIG_PCI_MSI -static irqreturn_t vxge_tx_msix_handle (int irq,void *dev_id) {struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id;
@@ -2443,16 +2441,13 @@ static void vxge_rem_msix_isr(struct vxgif (vdev->config.intr_type ==MSI_X )pci_disable_msix (vdev->pdev); } -#endif static void vxge_rem_isr (struct vxgedev *vdev) { -#ifdef CONFIG_PCI_MSI -if (vdev->config.intr_type ==MSI_X ) { +if (IS_ENABLED (CONFIG_PCI_MSI ) && + vdev->config.intr_type ==MSI_X ) {vxge_rem_msix_isr (vdev); - } else -#endif -if (vdev->config.intr_type ==INTA ) { + }else if (vdev->config.intr_type ==INTA ) {synchronize_irq (vdev->pdev->irq);free_irq (vdev->pdev->irq, vdev); }
@@ -2461,11 +2456,10 @@ static void vxge_rem_isr(struct vxgedevstatic int vxge_add_isr (struct vxgedev *vdev) {int ret =0 ; -#ifdef CONFIG_PCI_MSI int vp_idx =0 , intr_idx =0 , intr_cnt =0 , msix_idx =0 , irq_req =0 ;int pci_fun =PCI_FUNC (vdev->pdev->devfn); -if (vdev->config.intr_type ==MSI_X ) +if (IS_ENABLED (CONFIG_PCI_MSI ) && vdev->config.intr_type ==MSI_X ) ret =vxge_enable_msix (vdev);if (ret) {
@@ -2476,7 +2470,7 @@ static int vxge_add_isr(struct vxgedev * vdev->config.intr_type =INTA ; } -if (vdev->config.intr_type ==MSI_X ) { +if (IS_ENABLED (CONFIG_PCI_MSI ) && vdev->config.intr_type ==MSI_X ) {for (intr_idx =0 ; intr_idx < (vdev->no_of_vpath *VXGE_HW_VPATH_MSIX_ACTIVE ); intr_idx++) {
@@ -2577,9 +2571,8 @@ static int vxge_add_isr(struct vxgedev * vdev->vxge_entries[intr_cnt].in_use =1 ; vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0 ]; } -INTA_MODE: -#endif +INTA_MODE:if (vdev->config.intr_type ==INTA ) {snprintf (vdev->desc[0 ],VXGE_INTR_STRLEN ,"%s:vxge:INTA" , vdev->ndev->name);
@@ -3890,12 +3883,12 @@ static void vxge_device_config_init(struif (max_mac_vpath >VXGE_MAX_MAC_ADDR_COUNT ) max_mac_vpath =VXGE_MAX_MAC_ADDR_COUNT ; -#ifndef CONFIG_PCI_MSI -vxge_debug_init (VXGE_ERR , -"%s: This Kernel does not support " -"MSI-X. Defaulting to INTA" ,VXGE_DRIVER_NAME ); - *intr_type =INTA ; -#endif +if (!IS_ENABLED (CONFIG_PCI_MSI )) { +vxge_debug_init (VXGE_ERR , +"%s: This Kernel does not support " +"MSI-X. Defaulting to INTA" ,VXGE_DRIVER_NAME ); + *intr_type =INTA ; + }/* Configure whether MSI-X or IRQL. */ switch (*intr_type) {
PATCH 259/294 drm/i915: cleanup some indenting
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit ba0635ffb7665d76715b43ae8144e014a90c1e63 upstream.
Static checkers complain that we should probably add curly braces because, from the indenting, it looks like seq_printf() should be inside the list_for_each_entry() loop. But the code is actually correct, it's just the indenting which is off.
Besides fixing the indenting on seq_printf(), I did add curly braces, because generally mult-line indents should have curly braces to make them more readable.
The unintended indent was left behind and not unindented in
commit d7f46fc4e7323887494db13f063a8e59861fefb0
Author: Ben Widawsky <[email protected]> Date: Fri Dec 6 14:10:55 2013 -0800
drm/i915: Make pin count per VMA
--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -2
@@ -141,10 +141,11 @@ describe_obj(struct seq_file *m, struct obj->madv == I915_MADV_DONTNEED ? " purgeable" : "");if (obj->base.name)seq_printf (m," (name: %d)" , obj->base.name); -list_for_each_entry (vma, &obj->vma_list, vma_link) +list_for_each_entry (vma, &obj->vma_list, vma_link) {if (vma->pin_count >0 ) pin_count++; -seq_printf (m," (pinned x %d)" , pin_count); + } +seq_printf (m," (pinned x %d)" , pin_count);if (obj->pin_display)seq_printf (m," (display)" );if (obj->fence_reg !=I915_FENCE_REG_NONE )
PATCH 269/294 x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Juergen Gross <[email protected]>
commit 1cf38741308c64d08553602b3374fb39224eeb5a upstream.
xen_cleanhighmap() is operating on level2_kernel_pgt only. The upper bound of the loop setting non-kernel-image entries to zero should not exceed the size of level2_kernel_pgt.
--- arch/x86/xen/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/mmu.c +1 -1
@@ -1187,7 +1187,7 @@ static void __init xen_cleanhighmap(unsi/* NOTE: The loop is more greedy than the cleanup_highmap variant. * We include the PMD passed in on _both_ boundaries. */ -for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt +PAGE_SIZE )); +for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt +PTRS_PER_PMD )); pmd++, vaddr +=PMD_SIZE ) {if (pmd_none (*pmd))continue ;
PATCH 282/294 MIPS: Fix the build on jz4740 after removing the custom gpio.h
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Alban Bedel <[email protected]>
commit 5b235dc2647e4977b17b5c41d959d0f455831c3f upstream.
Somehow the wrong version of the patch to remove the use of custom gpio.h on mips has been merged. This patch add the missing fixes for a build error on jz4740 because linux/gpio.h doesn't provide any machine specfics definitions anymore.
Patchwork: https://patchwork.linux-mips.org/patch/11089/
--- arch/mips/jz4740/board-qi_lb60.c | 1 + arch/mips/jz4740/gpio.c | 1 + 2 files changed, 2 insertions(+)
arch/mips/jz4740/board-qi_lb60.c +1 -0
@@ -25,6 +25,7 @@#include <linux/power/jz4740-battery.h> #include <linux/power/gpio-charger.h> +#include <asm/mach-jz4740/gpio.h> #include <asm/mach-jz4740/jz4740_fb.h> #include <asm/mach-jz4740/jz4740_mmc.h> #include <asm/mach-jz4740/jz4740_nand.h>
arch/mips/jz4740/gpio.c +1 -0
@@ -27,6 +27,7 @@#include <linux/seq_file.h> #include <asm/mach-jz4740/base.h> +#include <asm/mach-jz4740/gpio.h> #include "irq.h"
PATCH 284/294 MIPS: elf2ecoff: Fix warning due to dead code.
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit 2d76e9633b572ae5a64150b638eed77f4afc12db upstream.
HOSTCC arch/mips/boot/elf2ecoffarch/mips/boot/elf2ecoff.c: In function ‘main’:arch/mips/boot/elf2ecoff.c:271:8: warning: variable ‘shstrtab’ set but not used [-Wunused-but-set-variable]
char *shstrtab;
--- arch/mips/boot/elf2ecoff.c | 4 ---- 1 file changed, 4 deletions(-)
arch/mips/boot/elf2ecoff.c +0 -4
@@ -267,7 +267,6 @@ int main(int argc, char *argv[])Elf32_Ehdr ex;Elf32_Phdr *ph;Elf32_Shdr *sh; -char *shstrtab;int i, pad;struct sect text, data, bss;struct filehdr efh;
@@ -335,9 +334,6 @@ int main(int argc, char *argv[]) "sh");if (must_convert_endian)convert_elf_shdrs (sh, ex.e_shnum); -/* Read in the section string table. */ - shstrtab =saveRead (infile, sh[ex.e_shstrndx].sh_offset, - sh[ex.e_shstrndx].sh_size,"shstrtab" );/* Figure out if we can cram the program header into an ECOFF header... Basically, we can't handle anything but loadable
PATCH 285/294 staging: r8192ee: prorperly format warning message
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
In stable/linux-3.16.y, we get a warning for 64-bit architectures:
drivers/staging/rtl8192ee/pci.c: In function '_rtl_pci_rx_interrupt':include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'sk_buff_data_t {aka unsigned char *}' [-Wformat=] include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 3 has type 'sk_buff_data_t {aka unsigned char *}' [-Wformat=]
The driver was removed in 3.18 before this was fixed, so there is no workaround to backport, but it's easy enough to avoid the problem by changing the printk message to something similar that uses proper accessors for the skb fields.
--- drivers/staging/rtl8192ee/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192ee/pci.c +2 -2
@@ -882,8 +882,8 @@ static void _rtl_pci_rx_interrupt(struct }else {if (err_count++ <10 ) { -pr_info ("skb->end (%d) - skb->tail (%d) > len (%d)\n" , - skb->end, skb->tail, len); +pr_info ("skb end: %d) - tailroom (%d) > len (%d)\n" , +skb_end_offset (skb),skb_tailroom (skb), len);RT_PRINT_DATA (rtlpriv,COMP_CMD ,DBG_EMERG ,"RX desc\n" , (u8 *)pdesc,32 );
PATCH 287/294 drbd: avoid redefinition of BITS_PER_PAGE
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lars Ellenberg <[email protected]>
commit 2630628b2dbc3fc320aafaf84836119e4e3d62f1 upstream.
Apparently we now implicitly get definitions for BITS_PER_PAGE and BITS_PER_PAGE_MASK from the pid_namespace.h
Instead of renaming our defines, I chose to define only if not yet defined, but to double check the value if already defined.
--- drivers/block/drbd/drbd_bitmap.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/block/drbd/drbd_bitmap.c +6 -0
@@ -478,8 +478,14 @@ void drbd_bm_cleanup(struct drbd_device* this masks out the remaining bits. * Returns the number of bits cleared. */ +#ifndef BITS_PER_PAGE #define BITS_PER_PAGE (1UL << (PAGE_SHIFT + 3))#define BITS_PER_PAGE_MASK (BITS_PER_PAGE - 1) +#else +# if BITS_PER_PAGE != (1UL << (PAGE_SHIFT +3 )) +# error "ambiguous BITS_PER_PAGE" +# endif +#endif #define BITS_PER_LONG_MASK (BITS_PER_LONG - 1)static int bm_clear_surplus (struct drbd_bitmap *b) {
PATCH 289/294 MIPS: jz4740: fix build error in irq.h
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
kernelci found build error on the 3.16 and 3.18 stable trees that don't show up in later versions:
arch/mips/jz4740/irq.h:21:38: error: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] arch/mips/jz4740/irq.h:20:39: error: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] include/linux/irqdesc.h:92:33: error: 'NR_IRQS' undeclared here (not in a function)arch/mips/jz4740/irq.c:91:41: error: 'JZ4740_IRQ_BASE' undeclared (first use in this function)arch/mips/jz4740/irq.c:68:6: error: conflicting types for 'jz4740_irq_resume'arch/mips/jz4740/irq.c:62:6: error: conflicting types for 'jz4740_irq_suspend'arch/mips/jz4740/irq.c:49:39: error: 'JZ4740_IRQ_BASE' undeclared (first use in this function)arch/mips/jz4740/gpio.c:47:32: error: initializer element is not constantarch/mips/jz4740/gpio.c:46:32: error: initializer element is not constantarch/mips/jz4740/gpio.c:45:32: error: initializer element is not constantarch/mips/jz4740/gpio.c:44:32: error: initializer element is not constantarch/mips/jz4740/gpio.c:447:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] arch/mips/jz4740/gpio.c:446:23: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] arch/mips/jz4740/gpio.c:427:14: error: implicit declaration of function 'JZ4740_IRQ_INTC_GPIO' [-Werror=implicit-function-declaration] arch/mips/jz4740/gpio.c:269:9: error: implicit declaration of function 'JZ4740_IRQ_GPIO' [-Werror=implicit-function-declaration]
The problem seems to be caused by commit 83bc76920080 ("MIPS: JZ4740: Use generic irq chip") from linux-3.2, but only showed up in a defconfig build when qi_lb60_defconfig was added in linux-3.13 and that configuration never successfully built.
The code has changed in a number of ways before 4.4, which builds fine. While I did not bisect the problem to a specific change, I found a simple fix by including the obviously missing header.
--- arch/mips/jz4740/irq.h | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/jz4740/irq.h +2 -0
@@ -16,7 +16,9 @@#define __MIPS_JZ4740_IRQ_H__#include <linux/irq.h> +#include <asm/mach-jz4740/irq.h> +struct irq_data ;extern void jz4740_irq_suspend (struct irq_data *data);extern void jz4740_irq_resume (struct irq_data *data);
PATCH 291/294 net: ti: cpmac: Fix compiler warning due to type confusion
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <[email protected]>
commit 2f5281ba2a8feaf6f0aee93356f350855bb530fc upstream.
cpmac_start_xmit() used the max() macro on skb->len (an unsigned int) and ETH_ZLEN (a signed int literal). This led to the following compiler warning:
In file included from include/linux/list.h:8:0,
from include/linux/module.h:9,
from drivers/net/ethernet/ti/cpmac.c:19:
drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_start_xmit':
include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_max1 == &_max2); \
^
drivers/net/ethernet/ti/cpmac.c:560:8: note: in expansion of macro 'max'
len = max(skb->len, ETH_ZLEN);
^On top of this, it assigned the result of the max() macro to a signed integer whilst all further uses of it result in it being cast to varying widths of unsigned integer.
Fix this up by using max_t to ensure the comparison is performed as unsigned integers, and for consistency change the type of the len variable to unsigned int.
--- drivers/net/ethernet/ti/cpmac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/cpmac.c +3 -2
@@ -543,7 +543,8 @@ fatal_error:static int cpmac_start_xmit (struct sk_buff *skb,struct net_device *dev) { -int queue, len; +int queue; +unsigned int len;struct cpmac_desc *desc;struct cpmac_priv *priv =netdev_priv (dev);
@@ -553,7 +554,7 @@ static int cpmac_start_xmit(struct sk_buif (unlikely (skb_padto (skb,ETH_ZLEN )))return NETDEV_TX_OK ; - len =max (skb->len,ETH_ZLEN ); + len = max_t(unsigned int, skb->len, ETH_ZLEN); queue =skb_get_queue_mapping (skb);netif_stop_subqueue (dev, queue);
PATCH 293/294 MIPS: Fix a warning for virt_to_page
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Zubair Lutfullah Kakakhel <[email protected]>
commit 4d5b3bdc0ecb0cf5b1e1598eeaaac4b5cb33868d upstream.
Compiling mm/highmem.c gives a warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast
Fixed by casting to void*
Patchwork: https://patchwork.linux-mips.org/patch/7337/
--- arch/mips/include/asm/page.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/include/asm/page.h +2 -1
@@ -223,7 +223,8 @@ static inline int pfn_valid(unsigned lon#endif -#define virt_to_page (kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) +#define virt_to_page (kaddr) pfn_to_page(PFN_DOWN(virt_to_phys((void *) \ + (kaddr))))extern int __virt_addr_valid (const volatile void *kaddr);#define virt_addr_valid (kaddr) \
PATCH 10/294 net: bcmgenet: fix off-by-one in incrementing read pointer
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit cf377d886f7944a5ccdbd164b89949e13617b096 upstream.
Commit b629be5c8399d7c423b92135eb43a86c924d1cbc ("net: bcmgenet: check harder for out of memory conditions") moved the increment of the local read pointer *before* reading from the hardware descriptor using dmadesc_get_length_status(), which creates an off-by-one situation.
Fix this by moving again the read_ptr increment after we have read the hardware descriptor to get both the control block and the read pointer back in sync.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +4 -5
@@ -1354,11 +1354,6 @@ static unsigned int bcmgenet_desc_rx(str cb = &priv->rx_cbs[priv->rx_read_ptr]; skb = cb->skb; - rxpktprocessed++; - - priv->rx_read_ptr++; - priv->rx_read_ptr &= (priv->num_rx_bds -1 ); -/* We do not have a backing SKB, so we do not have a * corresponding DMA mapping for this incoming packet since * bcmgenet_rx_refill always either has both skb and mapping or
@@ -1471,6 +1466,10 @@ refill: err =bcmgenet_rx_refill (priv, cb);if (err)netif_err (priv, rx_err, dev,"Rx refill failed\n" ); + + rxpktprocessed++; + priv->rx_read_ptr++; + priv->rx_read_ptr &= (priv->num_rx_bds -1 ); }return rxpktprocessed;
PATCH 223/294 ASoC: adau1977: Fix truncation warning on 64 bit architectures
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit d8df26bb57d2a86365de46a5421b97417401e39a upstream.
Negating ADAU1977_BLOCK_POWER_SAI_LDO_EN creates an unsigned long constant with all bits set which on 64 bit architectures needs to be truncated to an unsigned int, generating a warning. Add an explicit cast since we know this is OK.
--- sound/soc/codecs/adau1977.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/adau1977.c +1 -1
@@ -968,7 +968,7 @@ int adau1977_probe(struct device *dev, sif (adau1977->dvdd_reg) power_off_mask = ~0 ;else - power_off_mask = ~ADAU1977_BLOCK_POWER_SAI_LDO_EN ; + power_off_mask = (unsigned int )~ADAU1977_BLOCK_POWER_SAI_LDO_EN ; ret =regmap_update_bits (adau1977->regmap,ADAU1977_REG_BLOCK_POWER_SAI , power_off_mask,0x00 );
PATCH 225/294 clk/efm32gg: fix dt init prototype
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
commit 8ce8ebeb572d70e672a8d158e93ffaac80ea7576 upstream.
Since commit 54196ccbe0ba (of: consolidate linker section OF match table declarations) which went into 3.16-rc1 the following compiler warning is generated:
In file included from drivers/clk/clk-efm32gg.c:12:0: include/linux/of.h:772:20: warning: comparison of distinct pointer types lacks a cast [enabled by default] .data = (fn == (fn_type)NULL) ? fn : fn } ^ include/linux/of.h:785:3: note: in expansion of macro '_OF_DECLARE' _OF_DECLARE(table, name, compat, fn, of_init_fn_1) ^ include/linux/clk-provider.h:545:42: note: in expansion of macro 'OF_DECLARE_1' #define CLK_OF_DECLARE(name, compat, fn) OF_DECLARE_1(clk, name, compat, fn) ^ drivers/clk/clk-efm32gg.c:81:1: note: in expansion of macro 'CLK_OF_DECLARE' CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init); ^
Fix it by making efm32gg_cmu_init return void.
--- drivers/clk/clk-efm32gg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/clk-efm32gg.c +3 -3
@@ -22,7 +22,7 @@ static struct clk_onecell_data clk_data .clk_num = ARRAY_SIZE(clk), }; -static int __init efm32gg_cmu_init (struct device_node *np) +static void __init efm32gg_cmu_init (struct device_node *np) {int i;void __iomem *base;
@@ -33,7 +33,7 @@ static int __init efm32gg_cmu_init(struc base =of_iomap (np,0 );if (!base) {pr_warn ("Failed to map address range for efm32gg,cmu node\n" ); -return -EADDRNOTAVAIL ; +return ; } clk[clk_HFXO] = clk_register_fixed_rate(NULL, "HFXO", NULL,
@@ -76,6 +76,6 @@ static int __init efm32gg_cmu_init(struc clk[clk_HFPERCLKDAC0] =clk_register_gate (NULL ,"HFPERCLK.DAC0" ,"HFXO" ,0 , base +CMU_HFPERCLKEN0 ,17 ,0 ,NULL ); -return of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); +of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); }CLK_OF_DECLARE (efm32ggcmu,"efm32gg,cmu" , efm32gg_cmu_init);
PATCH 226/294 spi: rspi: Remove unused variable in rspi_rz_transfer_one()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 95029a00886f0c8d79e700cb8983b881c75af0f1 upstream.
Introduced by commit 8b983e90ea1a3dd82070f96c062ad521a06b7cc0 ("spi: rspi:
Extract rspi_common_transfer()"), which removed its users.
--- drivers/spi/spi-rspi.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/spi-rspi.c +0 -1
@@ -630,7 +630,6 @@ static int rspi_rz_transfer_one(struct s struct spi_transfer *xfer) {struct rspi_data *rspi =spi_master_get_devdata (master); -int ret;rspi_rz_receive_init (rspi);
PATCH 229/294 tty: nozomi: avoid a harmless gcc warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit a4f642a8a3c2838ad09fe8313d45db46600e1478 upstream.
The nozomi wireless data driver has its own helper function to transfer data from a FIFO, doing an extra byte swap on big-endian architectures, presumably to bring the data back into byte-serial order after readw() or readl() perform their implicit byteswap.
This helper function is used in the receive_data() function to first read the length into a 32-bit variable, which causes a compile-time warning:
drivers/tty/nozomi.c: In function 'receive_data':drivers/tty/nozomi.c:857:9: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized]
The problem is that gcc is unsure whether the data was actually read or not. We know that it is at this point, so we can replace it with a single readl() to shut up that warning.
I am leaving the byteswap in there, to preserve the existing behavior, even though this seems fishy: Reading the length of the data into a cpu-endian variable should normally not use a second byteswap on big-endian systems, unless the hardware is aware of the CPU endianess.
There appears to be a lot more confusion about endianess in this driver, so it probably has not worked on big-endian systems in a long time, if ever, and I have no way to test it. It's well possible that this driver has not been used by anyone in a while, the last patch that looks like it was tested on the hardware is from 2008.
--- drivers/tty/nozomi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/nozomi.c +1 -1
@@ -823,7 +823,7 @@ static int receive_data(enum port_type istruct tty_struct *tty =tty_port_tty_get (&port->port);int i, ret; -read_mem32 ((u32 *) &size, addr,4 ); + size =__le32_to_cpu (readl (addr));/* DBG1( "%d bytes port: %d", size, index); */ if (tty &&test_bit (TTY_THROTTLED , &tty->flags)) {
PATCH 251/294 net: tulip: turn compile-time warning into dev_warn()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit de92718883ddbcd11b738d36ffcf57617b97fa12 upstream.
The tulip driver causes annoying build-time warnings for allmodconfig builds for all recent architectures:
dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined!
This is the last remaining warning for arm64, and I'd like to get rid of it. We don't really know the cache line size, architecturally it would be at least 16 bytes, but all implementations I found have 64 or 128 bytes. Configuring tulip for 32-byte lines as we do on ARM32 seems to be the safe but slow default, and nobody who cares about performance these days would use a tulip chip anyway, so we can just use that.
To save the next person the job of trying to find out what this is for and picking a default for their architecture just to kill off the warning, I'm now removing the preprocessor #warning and turning it into a pr_warn or dev_warn that prints the equivalent information when the driver gets loaded.
--- drivers/net/ethernet/dec/tulip/tulip_core.c | 9 +++++++-- drivers/net/ethernet/dec/tulip/winbond-840.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/dec/tulip/tulip_core.c +7 -2
@@ -98,8 +98,7 @@ static int csr0 = 0x01A00000 | 0x4800;#elif defined(__mips__)static int csr0 =0x00200000 |0x4000 ;#else -#warning Processor architecture undefined! -static int csr0 =0x00A00000 |0x4800 ; +static int csr0;#endif /* Operational parameters that usually are not changed. */
@@ -1982,6 +1981,12 @@ static int __init tulip_init (void)pr_info ("%s" , version);#endif +if (!csr0) { +pr_warn ("tulip: unknown CPU architecture, using default csr0\n" ); +/* default to 8 longword cache line alignment */ + csr0 =0x00A00000 |0x4800 ; + } +/* copy module parms into globals */ tulip_rx_copybreak = rx_copybreak; tulip_max_interrupt_work = max_interrupt_work;
drivers/net/ethernet/dec/tulip/winbond-840.c +1 -1
@@ -907,7 +907,7 @@ static void init_registers(struct net_de#elif defined(CONFIG_SPARC ) || defined (CONFIG_PARISC ) i |=0x4800 ;#else -#warning Processor architecture undefined +dev_warn (&dev->dev,"unknown CPU architecture, using default csr0 setting\n" ); i |=0x4800 ;#endif iowrite32 (i, ioaddr + PCIBusCfg);
PATCH 256/294 brcmfmac: avoid gcc-5.1 warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 22f44150aad7a1d6b074ab6cf59abee61c7187c6 upstream.
gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac driver:
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process':drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]
This is a false positive, and marking the brcmf_fws_hanger_poppkt function as 'static inline' makes the warning go away. I have checked the object file output and while a little code gets moved around, the size of the binary remains identical.
--- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +1 -1
@@ -607,7 +607,7 @@ static int brcmf_fws_hanger_pushpkt(strureturn 0 ; } -static int brcmf_fws_hanger_poppkt (struct brcmf_fws_hanger *h, +static inline int brcmf_fws_hanger_poppkt (struct brcmf_fws_hanger *h,u32 slot_id,struct sk_buff **pktout,bool remove_item) {
PATCH 278/294 MIPS: DEC: Avoid la pseudo-instruction in delay slots
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ralf Baechle <[email protected]>
commit 3021773c7c3e75e20b693931a19362681e744ea9 upstream.
When expanding the la or dla pseudo-instruction in a delay slot the GNU assembler will complain should the pseudo-instruction expand to multiple actual instructions, since only the first of them will be in the delay slot leading to the pseudo-instruction being only partially executed if the branch is taken. Use of PTR_LA in the dec int-handler.S leads to such warnings:
arch/mips/dec/int-handler.S: Assembler messages:
arch/mips/dec/int-handler.S:149: Warning: macro instruction expanded into multiple instructions in a branch delay slot arch/mips/dec/int-handler.S:198: Warning: macro instruction expanded into multiple instructions in a branch delay slot
Avoid this by open coding the PTR_LA macros.
--- arch/mips/dec/int-handler.S | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-)
arch/mips/dec/int-handler.S +38 -2
@@ -146,7 +146,25 @@ /* * Find irq with highest priority */ - PTR_LA t1,cpu_mask_nr_tbl + # open coded PTR_LA t1, cpu_mask_nr_tbl +#if (_MIPS_SZPTR == 32) + # open coded la t1, cpu_mask_nr_tbl + lui t1, %hi(cpu_mask_nr_tbl) + addiu t1, %lo(cpu_mask_nr_tbl) + +#endif +#if (_MIPS_SZPTR == 64) + # open coded dla t1, cpu_mask_nr_tbl + .set push + .set noat + lui t1, %highest(cpu_mask_nr_tbl) + lui AT, %hi(cpu_mask_nr_tbl) + daddiu t1, t1, %higher(cpu_mask_nr_tbl) + daddiu AT, AT, %lo(cpu_mask_nr_tbl) + dsll t1, 32 + daddu t1, t1, AT + .set pop +#endif 1: lw t2,(t1) nop and t2,t0
@@ -195,7 +213,25 @@ /* * Find irq with highest priority */ - PTR_LA t1,asic_mask_nr_tbl + # open coded PTR_LA t1,asic_mask_nr_tbl +#if (_MIPS_SZPTR == 32) + # open coded la t1, asic_mask_nr_tbl + lui t1, %hi(asic_mask_nr_tbl) + addiu t1, %lo(asic_mask_nr_tbl) + +#endif +#if (_MIPS_SZPTR == 64) + # open coded dla t1, asic_mask_nr_tbl + .set push + .set noat + lui t1, %highest(asic_mask_nr_tbl) + lui AT, %hi(asic_mask_nr_tbl) + daddiu t1, t1, %higher(asic_mask_nr_tbl) + daddiu AT, AT, %lo(asic_mask_nr_tbl) + dsll t1, 32 + daddu t1, t1, AT + .set pop +#endif 2: lw t2,(t1) nop and t2,t0
PATCH 280/294 MIPS: ip22: Fix ip28 build for modern gcc
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 23ca9b522383d3b9b7991d8586db30118992af4a upstream.
kernelci reports a failure of the ip28_defconfig build after upgrading its gcc version:
arch/mips/sgi-ip22/Platform:29: *** gcc doesn't support needed option -mr10k-cache-barrier=store. Stop.
The problem apparently is that the -mr10k-cache-barrier=store option is now rejected for CPUs other than r10k. Explicitly including the CPU in the check fixes this and is safe because both options were introduced in gcc-4.4.
Patchwork: https://patchwork.linux-mips.org/patch/15049/
--- arch/mips/sgi-ip22/Platform | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/sgi-ip22/Platform +1 -1
@@ -25,7 +25,7 @@ endif # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys # ifdef CONFIG_SGI_IP28 - ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n) + ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n) $(error gcc doesn't support needed option -mr10k-cache-barrier=store) endif endif
PATCH 281/294 MIPS: MSP71xx: remove odd locking in PCI config space access code
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Ryazanov <[email protected]>
commit c4a305374bbf36414515d2ae00d588c67051e67d upstream.
Caller (generic PCI code) already do proper locking so no need to add another one here.
Patchwork: https://patchwork.linux-mips.org/patch/7601/
--- arch/mips/pci/ops-pmcmsp.c | 12 ------------ 1 file changed, 12 deletions(-)
arch/mips/pci/ops-pmcmsp.c +0 -12
@@ -193,8 +193,6 @@ static void pci_proc_init(void) }#endif /* CONFIG_PROC_FS && PCI_COUNTERS */ -static DEFINE_SPINLOCK (bpci_lock); -/***************************************************************************** * * STRUCT: pci_io_resource
@@ -368,7 +366,6 @@ int msp_pcibios_config_access(unsigned cstruct msp_pci_regs *preg = (void *)PCI_BASE_REG ;unsigned char bus_num = bus->number;unsigned char dev_fn = (unsigned char )devfn; -unsigned long flags;unsigned long intr;unsigned long value;static char pciirqflag;
@@ -401,10 +398,7 @@ int msp_pcibios_config_access(unsigned c }#if defined(CONFIG_PMC_MSP7120_GW ) || defined(CONFIG_PMC_MSP7120_EVAL ) -local_irq_save (flags); vpe_status =dvpe (); -#else -spin_lock_irqsave (&bpci_lock, flags);#endif /*
@@ -457,9 +451,6 @@ int msp_pcibios_config_access(unsigned c#if defined(CONFIG_PMC_MSP7120_GW ) || defined(CONFIG_PMC_MSP7120_EVAL )evpe (vpe_status); -local_irq_restore (flags); -#else -spin_unlock_irqrestore (&bpci_lock, flags);#endif return -1 ;
@@ -467,9 +458,6 @@ int msp_pcibios_config_access(unsigned c#if defined(CONFIG_PMC_MSP7120_GW ) || defined(CONFIG_PMC_MSP7120_EVAL )evpe (vpe_status); -local_irq_restore (flags); -#else -spin_unlock_irqrestore (&bpci_lock, flags);#endif return PCIBIOS_SUCCESSFUL ;
PATCH 113/294 audit: Fix use after free in audit_remove_watch_rule()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit d76036ab47eafa6ce52b69482e91ca3ba337d6d6 upstream.
audit_remove_watch_rule() drops watch's reference to parent but then continues to work with it. That is not safe as parent can get freed once we drop our reference. The following is a trivial reproducer:
mount -o loop image /mnt
touch /mnt/file
auditctl -w /mnt/file -p wax
umount /mnt
auditctl -D
<crash in fsnotify_destroy_mark()>
Grab our own reference in audit_remove_watch_rule() earlier to make sure mark does not get freed under us.
--- kernel/audit_watch.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/audit_watch.c +7 -5
@@ -455,13 +455,15 @@ void audit_remove_watch_rule(struct audilist_del (&krule->rlist);if (list_empty (&watch->rules)) { +/* +* audit_remove_watch() drops our reference to 'parent' which +* can get freed. Grab our own reference to be safe. +*/ +audit_get_parent (parent);audit_remove_watch (watch); - -if (list_empty (&parent->watches)) { -audit_get_parent (parent); +if (list_empty (&parent->watches))fsnotify_destroy_mark (&parent->mark, audit_watch_group); -audit_put_parent (parent); - } +audit_put_parent (parent); } }
PATCH 152/294 xfrm_user: fix info leak in build_aevent()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 931e79d7a7ddee4709c56b39de169a36804589a1 upstream.
The memory reserved to dump the ID of the xfrm state includes a padding byte in struct xfrm_usersa_id added by the compiler for alignment. To prevent the heap info leak, memset(0) the sa_id before filling it.
--- net/xfrm/xfrm_user.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_user.c +1 -0
@@ -1752,6 +1752,7 @@ static int build_aevent(struct sk_buff *return -EMSGSIZE ; id =nlmsg_data (nlh); +memset (&id->sa_id,0 ,sizeof (id->sa_id));memcpy (&id->sa_id.daddr, &x->id.daddr,sizeof (x->id.daddr)); id->sa_id.spi = x->id.spi; id->sa_id.family = x->props.family;
PATCH 129/294 arm64: fpsimd: Prevent registers leaking across exec
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <[email protected]>
commit 096622104e14d8a1db4860bd557717067a0515d2 upstream.
There are some tricky dependencies between the different stages of flushing the FPSIMD register state during exec, and these can race with context switch in ways that can cause the old task's regs to leak across. In particular, a context switch during the memset() can cause some of the task's old FPSIMD registers to reappear.
Disabling preemption for this small window would be no big deal for
performance: preemption is already disabled for similar scenarios like updating the FPSIMD registers in sigreturn.
So, instead of rearranging things in ways that might swap existing subtle bugs for new ones, this patch just disables preemption around the FPSIMD state flushing so that races of this type can't occur here. This brings fpsimd_flush_thread() into line with other code paths.
--- arch/arm64/kernel/fpsimd.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/kernel/fpsimd.c +2 -0
@@ -156,9 +156,11 @@ void fpsimd_thread_switch(struct task_stvoid fpsimd_flush_thread (void ) { +preempt_disable ();memset (¤t->thread.fpsimd_state,0 ,sizeof (struct fpsimd_state ));fpsimd_flush_task_state (current);set_thread_flag (TIF_FOREIGN_FPSTATE ); +preempt_enable (); }/*
PATCH 124/294 Input: trackpoint - add new trackpoint firmware ID
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Ma <[email protected]>
commit ec667683c532c93fb41e100e5d61a518971060e2 upstream.
Synaptics add new TP firmware ID: 0x2 and 0x3, for now both lower 2 bits are indicated as TP. Change the constant to bitwise values.
This makes trackpoint to be recognized on Lenovo Carbon X1 Gen5 instead of it being identified as "PS/2 Generic Mouse".
--- drivers/input/mouse/trackpoint.c | 3 ++- drivers/input/mouse/trackpoint.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/input/mouse/trackpoint.c +2 -1
@@ -263,7 +263,8 @@ static int trackpoint_start_protocol(strif (ps2_command (&psmouse->ps2dev, param,MAKE_PS2_CMD (0 ,2 ,TP_READ_ID )))return -1 ; -if (param[0 ] !=TP_MAGIC_IDENT ) +/* add new TP ID. */ +if (!(param[0 ] &TP_MAGIC_IDENT ))return -1 ;if (firmware_id)
drivers/input/mouse/trackpoint.h +2 -1
@@ -21,8 +21,9 @@#define TP_COMMAND 0xE2/* Commands start with this */ #define TP_READ_ID 0xE1/* Sent for device identification */ -#define TP_MAGIC_IDENT 0x01/* Sent after a TP_READ_ID followed */ +#define TP_MAGIC_IDENT 0x03/* Sent after a TP_READ_ID followed */ /* by the firmware ID */ +/* Firmware ID includes 0x1, 0x2, 0x3 */ /*
PATCH 140/294 net: systemport: Free DMA coherent descriptors on errors
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit c2062ee3d9615828109ffe8089fbf69bed394d05 upstream.
In case bcm_sysport_init_tx_ring() is not able to allocate ring->cbs, we would return with an error, and call bcm_sysport_fini_tx_ring() and it would see that ring->cbs is NULL and do nothing. This would leak the coherent DMA descriptor area, so we need to free it on error before returning.
--- drivers/net/ethernet/broadcom/bcmsysport.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bcmsysport.c +2 -0
@@ -1024,6 +1024,8 @@ static int bcm_sysport_init_tx_ring(stru ring->cbs =kzalloc (sizeof (struct bcm_sysport_cb ) * size,GFP_KERNEL );if (!ring->cbs) { +dma_free_coherent (kdev,sizeof (struct dma_desc ), + ring->desc_cpu, ring->desc_dma);netif_err (priv, hw, priv->netdev,"CB allocation failed\n" );return -ENOMEM ; }
PATCH 149/294 r8169: Be drop monitor friendly
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit 7a4b813cb739ce598ffbad2e84d19d13fa23e25d upstream.
rtl_tx() is the TX reclamation process whereas rtl8169_tx_clear_range() does the TX ring cleaning during shutdown, both of these functions should call dev_consume_skb_any() to be drop monitor friendly.
--- drivers/net/ethernet/realtek/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/realtek/r8169.c +2 -2
@@ -5860,7 +5860,7 @@ static void rtl8169_tx_clear_range(strucrtl8169_unmap_tx_skb (&tp->pci_dev->dev, tx_skb, tp->TxDescArray + entry);if (skb) { -dev_kfree_skb_any (skb); +dev_consume_skb_any (skb); tx_skb->skb =NULL ; } }
@@ -6168,7 +6168,7 @@ static void rtl_tx(struct net_device *de tp->tx_stats.packets++; tp->tx_stats.bytes += tx_skb->skb->len;u64_stats_update_end (&tp->tx_stats.syncp); -dev_kfree_skb_any (tx_skb->skb); +dev_consume_skb_any (tx_skb->skb); tx_skb->skb =NULL ; } dirty_tx++;
PATCH 151/294 xfrm_user: fix info leak in xfrm_notify_sa()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 50329c8a340c9dea60d837645fcf13fc36bfb84d upstream.
The memory reserved to dump the ID of the xfrm state includes a padding byte in struct xfrm_usersa_id added by the compiler for alignment. To prevent the heap info leak, memset(0) the whole struct before filling it.
--- net/xfrm/xfrm_user.c | 1 + 1 file changed, 1 insertion(+)
net/xfrm/xfrm_user.c +1 -0
@@ -2552,6 +2552,7 @@ static int xfrm_notify_sa(struct xfrm_ststruct nlattr *attr; id =nlmsg_data (nlh); +memset (id,0 ,sizeof (*id));memcpy (&id->daddr, &x->id.daddr,sizeof (id->daddr)); id->spi = x->id.spi; id->family = x->props.family;
PATCH 138/294 net: systemport: Be drop monitor friendly
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
commit c45182eb967af11e9482168be5be41aa22e5d321 upstream.
Utilize dev_consume_skb_any(cb->skb) in bcm_sysport_free_cb() which is used when a TX packet is completed, as well as when the RX ring is cleaned on shutdown. None of these two cases are packet drops, so be drop monitor friendly.
--- drivers/net/ethernet/broadcom/bcmsysport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bcmsysport.c +1 -1
@@ -386,7 +386,7 @@ static void bcm_sysport_get_stats(structstatic void bcm_sysport_free_cb (struct bcm_sysport_cb *cb) { -dev_kfree_skb_any (cb->skb); +dev_consume_skb_any (cb->skb); cb->skb =NULL ;dma_unmap_addr_set (cb, dma_addr,0 ); }
PATCH 135/294 tracing: Fix freeing of filter in create_filter() when set_str is false
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (VMware)" <[email protected]>
commit 8b0db1a5bdfcee0dbfa89607672598ae203c9045 upstream.
Performing the following task with kmemleak enabled:
# cd /sys/kernel/tracing/events/irq/irq_handler_entry/
# echo 'enable_event:kmem:kmalloc:3 if irq >' > trigger
# echo 'enable_event:kmem:kmalloc:3 if irq > 31' > trigger
# echo scan > /sys/kernel/debug/kmemleak
# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff8800b9290308 (size 32):
comm "bash", pid 1114, jiffies 4294848451 (age 141.139s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff81cef5aa>] kmemleak_alloc+0x4a/0xa0
[<ffffffff81357938>] kmem_cache_alloc_trace+0x158/0x290
[<ffffffff81261c09>] create_filter_start.constprop.28+0x99/0x940
[<ffffffff812639c9>] create_filter+0xa9/0x160
[<ffffffff81263bdc>] create_event_filter+0xc/0x10
[<ffffffff812655e5>] set_trigger_filter+0xe5/0x210
[<ffffffff812660c4>] event_enable_trigger_func+0x324/0x490
[<ffffffff812652e2>] event_trigger_write+0x1a2/0x260
[<ffffffff8138cf87>] __vfs_write+0xd7/0x380
[<ffffffff8138f421>] vfs_write+0x101/0x260
[<ffffffff8139187b>] SyS_write+0xab/0x130
[<ffffffff81cfd501>] entry_SYSCALL_64_fastpath+0x1f/0xbe
[<ffffffffffffffff>] 0xffffffffffffffffThe function create_filter() is passed a 'filterp' pointer that gets allocated, and if "set_str" is true, it is up to the caller to free it, even on error. The problem is that the pointer is not freed by create_filter() when set_str is false. This is a bug, and it is not up to the caller to free the filter on error if it doesn't care about the string.
--- kernel/trace/trace_events_filter.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/trace_events_filter.c +4 -0
@@ -1950,6 +1950,10 @@ static int create_filter(struct ftrace_eif (err && set_str)append_filter_err (ps, filter); } +if (err && !set_str) { +free_event_filter (filter); + filter =NULL ; + }create_filter_finish (ps); *filterp = filter;
PATCH 136/294 qlge: avoid memcpy buffer overflow
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit e58f95831e7468d25eb6e41f234842ecfe6f014f upstream.
gcc-8.0.0 (snapshot) points out that we copy a variable-length string into a fixed length field using memcpy() with the destination length, and that ends up copying whatever follows the string:
inlined from 'ql_core_dump' at drivers/net/ethernet/qlogic/qlge/qlge_dbg.c:1106:2:drivers/net/ethernet/qlogic/qlge/qlge_dbg.c:708:2: error: 'memcpy' reading 15 bytes from a region of size 14 [-Werror=stringop-overflow=]
memcpy(seg_hdr->description, desc, (sizeof(seg_hdr->description)) - 1);
Changing it to use strncpy() will instead zero-pad the destination, which seems to be the right thing to do here.
The bug is probably harmless, but it seems like a good idea to address it in stable kernels as well, if only for the purpose of building with gcc-8 without warnings.
--- drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlge/qlge_dbg.c +1 -1
@@ -724,7 +724,7 @@ static void ql_build_coredump_seg_header seg_hdr->cookie =MPI_COREDUMP_COOKIE ; seg_hdr->segNum = seg_number; seg_hdr->segSize = seg_size; -memcpy (seg_hdr->description, desc, (sizeof (seg_hdr->description)) -1 ); +strncpy (seg_hdr->description, desc, (sizeof (seg_hdr->description)) -1 ); }/*
PATCH 137/294 nfsd: Limit end of page list when decoding NFSv4 WRITE
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
commit fc788f64f1f3eb31e87d4f53bcf1ab76590d5838 upstream.
When processing an NFSv4 WRITE operation, argp->end should never point past the end of the data in the final page of the page list. Otherwise, nfsd4_decode_compound can walk into uninitialized memory.
More critical, nfsd4_decode_write is failing to increment argp->pagelen when it increments argp->pagelist. This can cause later xdr decoders to assume more data is available than really is, which can cause server crashes on malformed requests.
--- fs/nfsd/nfs4xdr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/nfsd/nfs4xdr.c +2 -4
@@ -134,7 +134,7 @@ static void next_decode_page(struct nfsd argp->p =page_address (argp->pagelist[0 ]); argp->pagelist++;if (argp->pagelen <PAGE_SIZE ) { - argp->end = argp->p + (argp->pagelen>>2 ); + argp->end = argp->p +XDR_QUADLEN (argp->pagelen); argp->pagelen =0 ; }else { argp->end = argp->p + (PAGE_SIZE >>2 );
@@ -1246,9 +1246,7 @@ nfsd4_decode_write(struct nfsd4_compound argp->pagelen -= pages *PAGE_SIZE ; len -= pages *PAGE_SIZE ; - argp->p = (__be32 *)page_address (argp->pagelist[0 ]); - argp->pagelist++; - argp->end = argp->p +XDR_QUADLEN (PAGE_SIZE ); +next_decode_page (argp); } argp->p +=XDR_QUADLEN (len);
PATCH 147/294 ipv6: Fix may be used uninitialized warning in rt6_check
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
commit 3614364527daa870264f6dde77f02853cdecd02c upstream.
rt_cookie might be used uninitialized, fix this by initializing it.
--- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
@@ -1090,7 +1090,7 @@ struct dst_entry *ip6_blackhole_route(ststatic struct dst_entry *ip6_dst_check (struct dst_entry *dst,u32 cookie) {struct rt6_info *rt; -u32 rt_cookie; +u32 rt_cookie =0 ; rt = (struct rt6_info *) dst;
PATCH 154/294 dm: fix printk() rate limiting code
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 604407890ecf624c2fb41013c82b22aade59b455 upstream.
Using the same rate limiting state for different kinds of messages is wrong because this can cause a high frequency message to suppress a report of a low frequency message. Hence use a unique rate limiting state per message type.
--- drivers/md/dm.c | 10 ---------- include/linux/device-mapper.h | 41 ++++++++++++----------------------------- 2 files changed, 12 insertions(+), 39 deletions(-)
drivers/md/dm.c +0 -10
@@ -24,16 +24,6 @@#define DM_MSG_PREFIX "core" -#ifdef CONFIG_PRINTK -/* -* ratelimit state to be used in DMXXX_LIMIT(). -*/ -DEFINE_RATELIMIT_STATE (dm_ratelimit_state, -DEFAULT_RATELIMIT_INTERVAL , -DEFAULT_RATELIMIT_BURST ); -EXPORT_SYMBOL (dm_ratelimit_state); -#endif -/* * Cookies are numeric values sent with CHANGE and REMOVE * uevents while resuming, removing or renaming the device.
include/linux/device-mapper.h +12 -29
58 lines not on this page · raw message
PATCH 159/294 l2tp: hold tunnel while handling genl tunnel updates
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
commit 8c0e421525c9eb50d68e8f633f703ca31680b746 upstream.
We need to make sure the tunnel is not going to be destroyed by l2tp_tunnel_destruct() concurrently.
--- net/l2tp/l2tp_netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/l2tp/l2tp_netlink.c +4 -2
@@ -236,8 +236,8 @@ static int l2tp_nl_cmd_tunnel_modify(str } tunnel_id =nla_get_u32 (info->attrs[L2TP_ATTR_CONN_ID ]); - tunnel =l2tp_tunnel_find (net, tunnel_id); -if (tunnel ==NULL ) { + tunnel =l2tp_tunnel_get (net, tunnel_id); +if (!tunnel) { ret = -ENODEV ; goto out; }
@@ -245,6 +245,8 @@ static int l2tp_nl_cmd_tunnel_modify(strif (info->attrs[L2TP_ATTR_DEBUG ]) tunnel->debug =nla_get_u32 (info->attrs[L2TP_ATTR_DEBUG ]); +l2tp_tunnel_dec_refcount (tunnel); + out:return ret; }
PATCH 163/294 ipv6: fix sparse warning on rt6i_node
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Wei Wang <[email protected]>
commit 4e587ea71bf924f7dac621f1351653bd41e446cb upstream.
Commit c5cff8561d2d adds rcu grace period before freeing fib6_node. This generates a new sparse warning on rt->rt6i_node related code:
net/ipv6/route.c:1394:30: error: incompatible types in comparison expression (different address spaces) ./include/net/ip6_fib.h:187:14: error: incompatible types in comparison expression (different address spaces)
This commit adds "__rcu" tag for rt6i_node and makes sure corresponding rcu API is used for it.
After this fix, sparse no longer generates the above warning.
---
include/net/ip6_fib.h +1 -1
@@ -96,7 +96,7 @@ struct rt6_info {* the same cache line. */ struct fib6_table *rt6i_table; -struct fib6_node *rt6i_node; +struct fib6_node __rcu *rt6i_node;struct in6_addr rt6i_gateway;
net/ipv6/addrconf.c +1 -1
@@ -4737,7 +4737,7 @@ static void __ipv6_ifa_notify(int event,* our DAD process, so we don't need * to do it again */ -if (!(ifp->rt->rt6i_node)) +if (!rcu_access_pointer (ifp->rt->rt6i_node))ip6_ins_rt (ifp->rt);if (ifp->idev->cnf.forwarding)addrconf_join_anycast (ifp);
net/ipv6/ip6_fib.c +7 -4
@@ -836,7 +836,7 @@ add: } rt->dst.rt6_next = iter; *ins = rt; - rt->rt6i_node = fn; +rcu_assign_pointer (rt->rt6i_node, fn);atomic_inc (&rt->rt6i_ref);inet6_rt_notify (RTM_NEWROUTE , rt, info); info->nl_net->ipv6.rt6_stats->fib_rt_entries++;
@@ -861,7 +861,7 @@ add:return err; } *ins = rt; - rt->rt6i_node = fn; +rcu_assign_pointer (rt->rt6i_node, fn); rt->dst.rt6_next = iter->dst.rt6_next;atomic_inc (&rt->rt6i_ref);inet6_rt_notify (RTM_NEWROUTE , rt, info);
@@ -1413,8 +1413,9 @@ static void fib6_del_route(struct fib6_nint fib6_del (struct rt6_info *rt,struct nl_info *info) { +struct fib6_node *fn =rcu_dereference_protected (rt->rt6i_node, +lockdep_is_held (&rt->rt6i_table->tb6_lock));struct net *net = info->nl_net; -struct fib6_node *fn = rt->rt6i_node;struct rt6_info **rtp;#if RT6_DEBUG >=2
@@ -1593,7 +1594,9 @@ static int fib6_clean_node(struct fib6_wif (res) {#if RT6_DEBUG >=2 pr_debug ("%s: del failed: rt=%p@%p err=%d\n" , - __func__, rt, rt->rt6i_node, res); + __func__, rt, +rcu_access_pointer (rt->rt6i_node), + res);#endif continue ; }
PATCH 169/294 CIFS: Fix maximum SMB2 header size
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Shilovsky <[email protected]>
commit 9e37b1784f2be9397a903307574ee565bbadfd75 upstream.
Currently the maximum size of SMB2/3 header is set incorrectly which leads to hanging of directory listing operations on encrypted SMB3 connections. Fix this by setting the maximum size to 170 bytes that is calculated as RFC1002 length field size (4) + transform header size (52) + SMB2 header size (64) + create response size (56).
--- fs/cifs/smb2pdu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2pdu.h +2 -2
@@ -82,8 +82,8 @@#define NUMBER_OF_SMB2_COMMANDS 0x0013 -/* BB FIXME - analyze following length BB */ -#define MAX_SMB2_HDR_SIZE 0x78/* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */ +/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */ +#define MAX_SMB2_HDR_SIZE 0x00b0#define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe)
PATCH 170/294 CIFS: remove endian related sparse warning
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <[email protected]>
commit 6e3c1529c39e92ed64ca41d53abadabbaa1d5393 upstream.
Recent patch had an endian warning ie
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
--- fs/cifs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dir.c +1 -1
@@ -194,7 +194,7 @@ check_name(struct dentry *direntry, struint i;if (unlikely (direntry->d_name.len > - tcon->fsAttrInfo.MaxPathNameComponentLength)) +le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength)))return -ENAMETOOLONG ;if (!(cifs_sb->mnt_cifs_flags &CIFS_MOUNT_POSIX_PATHS )) {
PATCH 158/294 l2tp: hold tunnel while processing genl delete command
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
commit bb0a32ce4389e17e47e198d2cddaf141561581ad upstream.
l2tp_nl_cmd_tunnel_delete() needs to take a reference on the tunnel, to prevent it from being concurrently freed by l2tp_tunnel_destruct().
--- net/l2tp/l2tp_netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/l2tp/l2tp_netlink.c +4 -2
@@ -209,14 +209,16 @@ static int l2tp_nl_cmd_tunnel_delete(str } tunnel_id =nla_get_u32 (info->attrs[L2TP_ATTR_CONN_ID ]); - tunnel =l2tp_tunnel_find (net, tunnel_id); -if (tunnel ==NULL ) { + tunnel =l2tp_tunnel_get (net, tunnel_id); +if (!tunnel) { ret = -ENODEV ; goto out; } (void )l2tp_tunnel_delete (tunnel); +l2tp_tunnel_dec_refcount (tunnel); + out:return ret; }
PATCH 161/294 l2tp: remove useless duplicate session detection in l2tp_netlink
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
commit af87ae465abdc070de0dc35d6c6a9e7a8cd82987 upstream.
There's no point in checking for duplicate sessions at the beginning of l2tp_nl_cmd_session_create(); the ->session_create() callbacks already return -EEXIST when the session already exists.
Furthermore, even if l2tp_session_find() returns NULL, a new session might be created right after the test. So relying on ->session_create() to avoid duplicate session is the only sane behaviour.
---
net/l2tp/l2tp_netlink.c +0 -6
@@ -415,7 +415,6 @@ static int l2tp_nl_cmd_session_create(stu32 peer_session_id;int ret =0 ;struct l2tp_tunnel *tunnel; -struct l2tp_session *session;struct l2tp_session_cfg cfg = {0 , };struct net *net =genl_info_net (info);
@@ -435,11 +434,6 @@ static int l2tp_nl_cmd_session_create(st goto out; } session_id =nla_get_u32 (info->attrs[L2TP_ATTR_SESSION_ID ]); - session =l2tp_session_find (net, tunnel, session_id); -if (session) { - ret = -EEXIST ; - goto out; - }if (!info->attrs[L2TP_ATTR_PEER_SESSION_ID ]) { ret = -EINVAL ;
PATCH 162/294 l2tp: hold tunnel used while creating sessions with netlink
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
commit e702c1204eb57788ef189c839c8c779368267d70 upstream.
Use l2tp_tunnel_get() to retrieve tunnel, so that it can't go away on us. Otherwise l2tp_tunnel_destruct() might release the last reference count concurrently, thus freeing the tunnel while we're using it.
--- net/l2tp/l2tp_netlink.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
net/l2tp/l2tp_netlink.c +12 -9
@@ -422,8 +422,9 @@ static int l2tp_nl_cmd_session_create(st ret = -EINVAL ; goto out; } + tunnel_id =nla_get_u32 (info->attrs[L2TP_ATTR_CONN_ID ]); - tunnel =l2tp_tunnel_find (net, tunnel_id); + tunnel =l2tp_tunnel_get (net, tunnel_id);if (!tunnel) { ret = -ENODEV ; goto out;
@@ -431,24 +432,24 @@ static int l2tp_nl_cmd_session_create(stif (!info->attrs[L2TP_ATTR_SESSION_ID ]) { ret = -EINVAL ; - goto out; + goto out_tunnel; } session_id =nla_get_u32 (info->attrs[L2TP_ATTR_SESSION_ID ]);if (!info->attrs[L2TP_ATTR_PEER_SESSION_ID ]) { ret = -EINVAL ; - goto out; + goto out_tunnel; } peer_session_id =nla_get_u32 (info->attrs[L2TP_ATTR_PEER_SESSION_ID ]);if (!info->attrs[L2TP_ATTR_PW_TYPE ]) { ret = -EINVAL ; - goto out; + goto out_tunnel; } cfg.pw_type =nla_get_u16 (info->attrs[L2TP_ATTR_PW_TYPE ]);if (cfg.pw_type >= __L2TP_PWTYPE_MAX) { ret = -EINVAL ; - goto out; + goto out_tunnel; }if (tunnel->version >2 ) {
@@ -470,7 +471,7 @@ static int l2tp_nl_cmd_session_create(stu16 len =nla_len (info->attrs[L2TP_ATTR_COOKIE ]);if (len >8 ) { ret = -EINVAL ; - goto out; + goto out_tunnel; } cfg.cookie_len = len;memcpy (&cfg.cookie[0 ],nla_data (info->attrs[L2TP_ATTR_COOKIE ]), len);
@@ -479,7 +480,7 @@ static int l2tp_nl_cmd_session_create(stu16 len =nla_len (info->attrs[L2TP_ATTR_PEER_COOKIE ]);if (len >8 ) { ret = -EINVAL ; - goto out; + goto out_tunnel; } cfg.peer_cookie_len = len;memcpy (&cfg.peer_cookie[0 ],nla_data (info->attrs[L2TP_ATTR_PEER_COOKIE ]), len);
@@ -515,7 +516,7 @@ static int l2tp_nl_cmd_session_create(stif ((l2tp_nl_cmd_ops[cfg.pw_type] ==NULL ) || (l2tp_nl_cmd_ops[cfg.pw_type]->session_create ==NULL )) { ret = -EPROTONOSUPPORT ; - goto out; + goto out_tunnel; }/* Check that pseudowire-specific params are present */
@@ -525,7 +526,7 @@ static int l2tp_nl_cmd_session_create(stcase L2TP_PWTYPE_ETH_VLAN :if (!info->attrs[L2TP_ATTR_VLAN_ID ]) { ret = -EINVAL ; - goto out; + goto out_tunnel; }break ;case L2TP_PWTYPE_ETH :
@@ -544,6 +545,8 @@ static int l2tp_nl_cmd_session_create(st ret = (*l2tp_nl_cmd_ops[cfg.pw_type]->session_create)(net, tunnel_id, session_id, peer_session_id, &cfg); +out_tunnel: +l2tp_tunnel_dec_refcount (tunnel); out:return ret; }
PATCH 157/294 l2tp: hold tunnel while looking up sessions in l2tp_netlink
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
commit 54652eb12c1b72e9602d09cb2821d5760939190f upstream.
l2tp_tunnel_find() doesn't take a reference on the returned tunnel. Therefore, it's unsafe to use it because the returned tunnel can go away on us anytime.
Fix this by defining l2tp_tunnel_get(), which works like l2tp_tunnel_find(), but takes a reference on the returned tunnel. Caller then has to drop this reference using l2tp_tunnel_dec_refcount().
As l2tp_tunnel_dec_refcount() needs to be moved to l2tp_core.h, let's simplify the patch and not move the L2TP_REFCNT_DEBUG part. This code has been broken (not even compiling) in May 2012 by
commit a4ca44fa578c ("net: l2tp: Standardize logging styles") and fixed more than two years later by
commit 29abe2fda54f ("l2tp: fix missing line continuation"). So it doesn't appear to be used by anyone.
Same thing for l2tp_tunnel_free(); instead of moving it to l2tp_core.h, let's just simplify things and call kfree_rcu() directly in l2tp_tunnel_dec_refcount(). Extra assertions and debugging code provided by l2tp_tunnel_free() didn't help catching any of the reference counting and socket handling issues found while working on this series.
--- net/l2tp/l2tp_core.c | 66 ++++++++++++++++--------------------------------- net/l2tp/l2tp_core.h | 13 ++++++++++ net/l2tp/l2tp_netlink.c | 6 +++-- 3 files changed, 38 insertions(+), 47 deletions(-)
net/l2tp/l2tp_core.c +21 -45
@@ -112,7 +112,6 @@ struct l2tp_net {spinlock_t l2tp_session_hlist_lock; }; -static void l2tp_tunnel_free (struct l2tp_tunnel *tunnel);static inline struct l2tp_tunnel *l2tp_tunnel (struct sock *sk) {
@@ -126,39 +125,6 @@ static inline struct l2tp_net *l2tp_pernreturn net_generic (net, l2tp_net_id); } -/* Tunnel reference counts. Incremented per session that is added to -* the tunnel. -*/ -static inline void l2tp_tunnel_inc_refcount_1 (struct l2tp_tunnel *tunnel) -{ -atomic_inc (&tunnel->ref_count); -} - -static inline void l2tp_tunnel_dec_refcount_1 (struct l2tp_tunnel *tunnel) -{ -if (atomic_dec_and_test (&tunnel->ref_count)) -l2tp_tunnel_free (tunnel); -} -#ifdef L2TP_REFCNT_DEBUG -#define l2tp_tunnel_inc_refcount (_t) \ -do { \ - pr_debug("l2tp_tunnel_inc_refcount: %s:%d %s: cnt=%d\n", \ - __func__, __LINE__, (_t)->name, \ - atomic_read(&_t->ref_count)); \ - l2tp_tunnel_inc_refcount_1(_t); \ -} while (0) -#define l2tp_tunnel_dec_refcount (_t) -do { \ -pr_debug ("l2tp_tunnel_dec_refcount: %s:%d %s: cnt=%d\n" , \ - __func__, __LINE__, (_t)->name, \ -atomic_read (&_t->ref_count)); \ -l2tp_tunnel_dec_refcount_1 (_t); \ -} while (0) -#else -#define l2tp_tunnel_inc_refcount (t) l2tp_tunnel_inc_refcount_1(t) -#define l2tp_tunnel_dec_refcount (t) l2tp_tunnel_dec_refcount_1(t) -#endif -/* Session hash global list for L2TPv3. * The session_id SHOULD be random according to RFC3931, but several * L2TP implementations use incrementing session_ids. So we do a real
@@ -277,6 +243,27 @@ struct l2tp_session *l2tp_session_find(s }EXPORT_SYMBOL_GPL (l2tp_session_find); +/* Lookup a tunnel. A new reference is held on the returned tunnel. */ +struct l2tp_tunnel *l2tp_tunnel_get (const struct net *net,u32 tunnel_id) +{ +const struct l2tp_net *pn =l2tp_pernet (net); +struct l2tp_tunnel *tunnel; + +rcu_read_lock_bh (); +list_for_each_entry_rcu (tunnel, &pn->l2tp_tunnel_list, list) { +if (tunnel->tunnel_id == tunnel_id) { +l2tp_tunnel_inc_refcount (tunnel); +rcu_read_unlock_bh (); + +return tunnel; + } + } +rcu_read_unlock_bh (); + +return NULL ; +} +EXPORT_SYMBOL_GPL (l2tp_tunnel_get); +/* Like l2tp_session_find() but takes a reference on the returned session. * Optionally calls session->ref() too if do_ref is true. */
@@ -1396,17 +1383,6 @@ static void l2tp_udp_encap_destroy(struc } } -/* Really kill the tunnel. -* Come here only when all sessions have been cleared from the tunnel. -*/ -static void l2tp_tunnel_free (struct l2tp_tunnel *tunnel) -{ -BUG_ON (atomic_read (&tunnel->ref_count) !=0 ); -BUG_ON (tunnel->sock !=NULL ); -l2tp_info (tunnel,L2TP_MSG_CONTROL ,"%s: free...\n" , tunnel->name); -kfree_rcu (tunnel, rcu); -} -/* Workqueue tunnel deletion function */ static void l2tp_tunnel_del_work (struct work_struct *work) {
net/l2tp/l2tp_core.h +13 -0
@@ -240,6 +240,8 @@ out:return tunnel; } +struct l2tp_tunnel *l2tp_tunnel_get (const struct net *net,u32 tunnel_id); +struct l2tp_session *l2tp_session_get (const struct net *net,struct l2tp_tunnel *tunnel,u32 session_id,bool do_ref);
@@ -281,6 +283,17 @@ int l2tp_nl_register_ops(enum l2tp_pwtypvoid l2tp_nl_unregister_ops (enum l2tp_pwtype pw_type);int l2tp_ioctl (struct sock *sk,int cmd,unsigned long arg); +static inline void l2tp_tunnel_inc_refcount (struct l2tp_tunnel *tunnel) +{ +atomic_inc (&tunnel->ref_count); +} + +static inline void l2tp_tunnel_dec_refcount (struct l2tp_tunnel *tunnel) +{ +if (atomic_dec_and_test (&tunnel->ref_count)) +kfree_rcu (tunnel, rcu); +} +/* Session reference counts. Incremented when code obtains a reference * to a session. */
net/l2tp/l2tp_netlink.c +4 -2
@@ -60,10 +60,12 @@ static struct l2tp_session *l2tp_nl_sess (info->attrs[L2TP_ATTR_CONN_ID])) { tunnel_id =nla_get_u32 (info->attrs[L2TP_ATTR_CONN_ID ]); session_id =nla_get_u32 (info->attrs[L2TP_ATTR_SESSION_ID ]); - tunnel =l2tp_tunnel_find (net, tunnel_id); -if (tunnel) + tunnel =l2tp_tunnel_get (net, tunnel_id); +if (tunnel) { session =l2tp_session_get (net, tunnel, session_id, do_ref); +l2tp_tunnel_dec_refcount (tunnel); + } }return session;
PATCH 172/294 sch_htb: fix crash on init failure
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit 88c2ace69dbef696edba77712882af03879abc9c upstream.
The commit below added a call to the ->destroy() callback for all qdiscs which failed in their ->init(), but some were not prepared for such change and can't handle partially initialized qdisc. HTB is one of them and if any error occurs before the qdisc watchdog timer and qdisc work are initialized then we can hit either a null ptr deref (timer->base) when canceling in ->destroy or lockdep error info about trying to register a non-static key and a stack dump. So to fix these two move the watchdog timer and workqueue init before anything that can err out.
To reproduce userspace needs to send broken htb qdisc create request, tested with a modified tc (q_htb.c).
Trace log:
[ 2710.897602] BUG: unable to handle kernel NULL pointer dereference at (null) [ 2710.897977] IP: hrtimer_active+0x17/0x8a [ 2710.898174] PGD 58fab067 [ 2710.898175] P4D 58fab067 [ 2710.898353] PUD 586c0067 [ 2710.898531] PMD 0 [ 2710.898710] [ 2710.899045] Oops: 0000 [#1] SMP [ 2710.899232] Modules linked in: [ 2710.899419] CPU: 1 PID: 950 Comm: tc Not tainted 4.13.0-rc6+ #54 [ 2710.899646] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [ 2710.900035] task: ffff880059ed2700 task.stack: ffff88005ad4c000 [ 2710.900262] RIP: 0010:hrtimer_active+0x17/0x8a [ 2710.900467] RSP: 0018:ffff88005ad4f960 EFLAGS: 00010246 [ 2710.900684] RAX: 0000000000000000 RBX: ffff88003701e298 RCX: 0000000000000000 [ 2710.900933] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88003701e298 [ 2710.901177] RBP: ffff88005ad4f980 R08: 0000000000000001 R09: 0000000000000001 [ 2710.901419] R10: ffff88005ad4f800 R11: 0000000000000400 R12: 0000000000000000 [ 2710.901663] R13: ffff88003701e298 R14: ffffffff822a4540 R15: ffff88005ad4fac0 [ 2710.901907] FS: 00007f2f5e90f740(0000) GS:ffff88005d880000(0000) knlGS:0000000000000000 [ 2710.902277] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2710.902500] CR2: 0000000000000000 CR3: 0000000058ca3000 CR4: 00000000000406e0 [ 2710.902744] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2710.902977] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2710.903180] Call Trace: [ 2710.903332] hrtimer_try_to_cancel+0x1a/0x93 [ 2710.903504] hrtimer_cancel+0x15/0x20 [ 2710.903667] qdisc_watchdog_cancel+0x12/0x14 [ 2710.903866] htb_destroy+0x2e/0xf7 [ 2710.904097] qdisc_create+0x377/0x3fd [ 2710.904330] tc_modify_qdisc+0x4d2/0x4fd [ 2710.904511] rtnetlink_rcv_msg+0x188/0x197 [ 2710.904682] ? rcu_read_unlock+0x3e/0x5f [ 2710.904849] ? rtnl_newlink+0x729/0x729 [ 2710.905017] netlink_rcv_skb+0x6c/0xce [ 2710.905183] rtnetlink_rcv+0x23/0x2a [ 2710.905345] netlink_unicast+0x103/0x181 [ 2710.905511] netlink_sendmsg+0x326/0x337 [ 2710.905679] sock_sendmsg_nosec+0x14/0x3f [ 2710.905847] sock_sendmsg+0x29/0x2e [ 2710.906010] ___sys_sendmsg+0x209/0x28b [ 2710.906176] ? do_raw_spin_unlock+0xcd/0xf8 [ 2710.906346] ? _raw_spin_unlock+0x27/0x31 [ 2710.906514] ? __handle_mm_fault+0x651/0xdb1 [ 2710.906685] ? check_chain_key+0xb0/0xfd [ 2710.906855] __sys_sendmsg+0x45/0x63 [ 2710.907018] ? __sys_sendmsg+0x45/0x63 [ 2710.907185] SyS_sendmsg+0x19/0x1b [ 2710.907344] entry_SYSCALL_64_fastpath+0x23/0xc2
Note that probably this bug goes further back because the default qdisc handling always calls ->destroy on init failure too.
--- net/sched/sch_htb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/sched/sch_htb.c +3 -2
@@ -1025,6 +1025,9 @@ static int htb_init(struct Qdisc *sch, sint err;int i; +qdisc_watchdog_init (&q->watchdog, sch); +INIT_WORK (&q->work, htb_work_func); +if (!opt)return -EINVAL ;
@@ -1045,8 +1048,6 @@ static int htb_init(struct Qdisc *sch, sfor (i =0 ; i <TC_HTB_NUMPRIO ; i++)INIT_LIST_HEAD (q->drops + i); -qdisc_watchdog_init (&q->watchdog, sch); -INIT_WORK (&q->work, htb_work_func);skb_queue_head_init (&q->direct_queue);if (tb[TCA_HTB_DIRECT_QLEN ])
PATCH 166/294 alpha: uapi: Add support for __SANE_USERSPACE_TYPES__
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit cec80d82142ab25c71eee24b529cfeaf17c43062 upstream.
This fixes compiler errors in perf such as:
tests/attr.c: In function 'store_event':tests/attr.c:66:27: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__u64 {aka long unsigned int}' [-Werror=format=]
snprintf(path, PATH_MAX, "%s/event-%d-%llu-%d", dir,
^
--- arch/alpha/include/asm/types.h | 2 +- arch/alpha/include/uapi/asm/types.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-)
arch/alpha/include/asm/types.h +0 -1
@@ -1,7 +1,6 @@#ifndef _ALPHA_TYPES_H#define _ALPHA_TYPES_H -#include <asm-generic/int-ll64.h> #include <uapi/asm/types.h> #endif /* _ALPHA_TYPES_H */
arch/alpha/include/uapi/asm/types.h +11 -1
@@ -9,8 +9,18 @@* need to be careful to avoid a name clashes. */ -#ifndef __KERNEL__ +/* +* This is here because we used to use l64 for alpha +* and we don't want to impact user mode with our change to ll64 +* in the kernel. +* +* However, some user programs are fine with this. They can +* flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here. +*/ +#if !defined(__SANE_USERSPACE_TYPES__) && !defined(__KERNEL__)#include <asm-generic/int-l64.h> +#else +#include <asm-generic/int-ll64.h> #endif #endif /* _UAPI_ALPHA_TYPES_H */
PATCH 173/294 sch_multiq: fix double free on init failure
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit e89d469e3be3ed3d7124a803211a463ff83d0964 upstream.
The below commit added a call to ->destroy() on init failure, but multiq still frees ->queues on error in init, but ->queues is also freed by ->destroy() thus we get double free and corrupted memory.
Very easy to reproduce (eth0 not multiqueue):
$ tc qdisc add dev eth0 root multiq RTNETLINK answers: Operation not supported $ ip l add dumdum type dummy (crash)
Trace log:
[ 3929.467747] general protection fault: 0000 [#1] SMP [ 3929.468083] Modules linked in: [ 3929.468302] CPU: 3 PID: 967 Comm: ip Not tainted 4.13.0-rc6+ #56 [ 3929.468625] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [ 3929.469124] task: ffff88003716a700 task.stack: ffff88005872c000 [ 3929.469449] RIP: 0010:__kmalloc_track_caller+0x117/0x1be [ 3929.469746] RSP: 0018:ffff88005872f6a0 EFLAGS: 00010246 [ 3929.470042] RAX: 00000000000002de RBX: 0000000058a59000 RCX: 00000000000002df [ 3929.470406] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff821f7020 [ 3929.470770] RBP: ffff88005872f6e8 R08: 000000000001f010 R09: 0000000000000000 [ 3929.471133] R10: ffff88005872f730 R11: 0000000000008cdd R12: ff006d75646d7564 [ 3929.471496] R13: 00000000014000c0 R14: ffff88005b403c00 R15: ffff88005b403c00 [ 3929.471869] FS: 00007f0b70480740(0000) GS:ffff88005d980000(0000) knlGS:0000000000000000 [ 3929.472286] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3929.472677] CR2: 00007ffcee4f3000 CR3: 0000000059d45000 CR4: 00000000000406e0 [ 3929.473209] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 3929.474109] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 3929.474873] Call Trace: [ 3929.475337] ? kstrdup_const+0x23/0x25 [ 3929.475863] kstrdup+0x2e/0x4b [ 3929.476338] kstrdup_const+0x23/0x25 [ 3929.478084] __kernfs_new_node+0x28/0xbc [ 3929.478478] kernfs_new_node+0x35/0x55 [ 3929.478929] kernfs_create_link+0x23/0x76 [ 3929.479478] sysfs_do_create_link_sd.isra.2+0x85/0xd7 [ 3929.480096] sysfs_create_link+0x33/0x35 [ 3929.480649] device_add+0x200/0x589 [ 3929.481184] netdev_register_kobject+0x7c/0x12f [ 3929.481711] register_netdevice+0x373/0x471 [ 3929.482174] rtnl_newlink+0x614/0x729 [ 3929.482610] ? rtnl_newlink+0x17f/0x729 [ 3929.483080] rtnetlink_rcv_msg+0x188/0x197 [ 3929.483533] ? rcu_read_unlock+0x3e/0x5f [ 3929.483984] ? rtnl_newlink+0x729/0x729 [ 3929.484420] netlink_rcv_skb+0x6c/0xce [ 3929.484858] rtnetlink_rcv+0x23/0x2a [ 3929.485291] netlink_unicast+0x103/0x181 [ 3929.485735] netlink_sendmsg+0x326/0x337 [ 3929.486181] sock_sendmsg_nosec+0x14/0x3f [ 3929.486614] sock_sendmsg+0x29/0x2e [ 3929.486973] ___sys_sendmsg+0x209/0x28b [ 3929.487340] ? do_raw_spin_unlock+0xcd/0xf8 [ 3929.487719] ? _raw_spin_unlock+0x27/0x31 [ 3929.488092] ? __handle_mm_fault+0x651/0xdb1 [ 3929.488471] ? check_chain_key+0xb0/0xfd [ 3929.488847] __sys_sendmsg+0x45/0x63 [ 3929.489206] ? __sys_sendmsg+0x45/0x63 [ 3929.489576] SyS_sendmsg+0x19/0x1b [ 3929.489901] entry_SYSCALL_64_fastpath+0x23/0xc2 [ 3929.490172] RIP: 0033:0x7f0b6fb93690 [ 3929.490423] RSP: 002b:00007ffcee4ed588 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 3929.490881] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007f0b6fb93690 [ 3929.491198] RDX: 0000000000000000 RSI: 00007ffcee4ed5d0 RDI: 0000000000000003 [ 3929.491521] RBP: ffff88005872ff98 R08: 0000000000000001 R09: 0000000000000000 [ 3929.491801] R10: 00007ffcee4ed350 R11: 0000000000000246 R12: 0000000000000002 [ 3929.492075] R13: 000000000066f1a0 R14: 00007ffcee4f5680 R15: 0000000000000000 [ 3929.492352] ? trace_hardirqs_off_caller+0xa7/0xcf [ 3929.492590] Code: 8b 45 c0 48 8b 45 b8 74 17 48 8b 4d c8 83 ca ff 44 89 ee 4c 89 f7 e8 83 ca ff ff 49 89 c4 eb 49 49 63 56 20 48 8d 48 01 4d 8b 06 <49> 8b 1c 14 48 89 c2 4c 89 e0 65 49 0f c7 08 0f 94 c0 83 f0 01 [ 3929.493335] RIP: __kmalloc_track_caller+0x117/0x1be RSP: ffff88005872f6a0
--- net/sched/sch_multiq.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
net/sched/sch_multiq.c +2 -7
@@ -250,7 +250,7 @@ static int multiq_tune(struct Qdisc *schstatic int multiq_init (struct Qdisc *sch,struct nlattr *opt) {struct multiq_sched_data *q =qdisc_priv (sch); -int i, err; +int i; q->queues =NULL ;
@@ -265,12 +265,7 @@ static int multiq_init(struct Qdisc *schfor (i =0 ; i < q->max_bands; i++) q->queues[i] = &noop_qdisc; - err =multiq_tune (sch, opt); - -if (err) -kfree (q->queues); - -return err; +return multiq_tune (sch, opt); }static int multiq_dump (struct Qdisc *sch,struct sk_buff *skb)
PATCH 181/294 epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove()
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 138e4ad67afd5c6c318b056b4d17c17f2c0ca5c0 upstream.
The race was introduced by me in commit 971316f0503a ("epoll:ep_unregister_pollwait() can use the freed pwq->whead"). I did not realize that nothing can protect eventpoll after ep_poll_callback() sets ->whead = NULL, only whead->lock can save us from the race with ep_free() or ep_remove().
Move ->whead = NULL to the end of ep_poll_callback() and add the necessary barriers.
TODO: cleanup the ewake/EPOLLEXCLUSIVE logic, it was confusing even before this patch.
Hopefully this explains use-after-free reported by syzcaller:
BUG: KASAN: use-after-free in debug_spin_lock_before ... _raw_spin_lock_irqsave+0x4a/0x60 kernel/locking/spinlock.c:159 ep_poll_callback+0x29f/0xff0 fs/eventpoll.c:1148
this is spin_lock(eventpoll->lock),
... Freed by task 17774: ... kfree+0xe8/0x2c0 mm/slub.c:3883 ep_free+0x22c/0x2a0 fs/eventpoll.c:865
---
fs/eventpoll.c +23 -13
@@ -518,8 +518,13 @@ static void ep_remove_wait_queue(structwait_queue_head_t *whead;rcu_read_lock (); -/* If it is cleared by POLLFREE, it should be rcu-safe */ - whead =rcu_dereference (pwq->whead); +/* +* If it is cleared by POLLFREE, it should be rcu-safe. +* If we read NULL we need a barrier paired with +* smp_store_release() in ep_poll_callback(), otherwise +* we rely on whead->lock. +*/ + whead =smp_load_acquire (&pwq->whead);if (whead)remove_wait_queue (whead, &pwq->wait);rcu_read_unlock ();
@@ -1006,17 +1011,6 @@ static int ep_poll_callback(wait_queue_tstruct epitem *epi =ep_item_from_wait (wait);struct eventpoll *ep = epi->ep; -if ((unsigned long )key &POLLFREE ) { -ep_pwq_from_wait (wait)->whead =NULL ; -/* -* whead = NULL above can race with ep_remove_wait_queue() -* which can do another remove_wait_queue() after us, so we -* can't use __remove_wait_queue(). whead->lock is held by -* the caller. -*/ -list_del_init (&wait->task_list); - } -spin_lock_irqsave (&ep->lock, flags);/*
@@ -1081,6 +1075,22 @@ out_unlock:if (pwake)ep_poll_safewake (&ep->poll_wait); +if ((unsigned long )key &POLLFREE ) { +/* +* If we race with ep_remove_wait_queue() it can miss +* ->whead = NULL and do another remove_wait_queue() after +* us, so we can't use __remove_wait_queue(). +*/ +list_del_init (&wait->task_list); +/* +* ->whead != NULL protects us from the race with ep_free() +* or ep_remove(), ep_remove_wait_queue() takes whead->lock +* held by the caller. Once we nullify it, nothing protects +* ep/epi or even wait. +*/ +smp_store_release (&ep_pwq_from_wait (wait)->whead,NULL ); + } +return 1 ; }
PATCH 174/294 sch_hhf: fix null pointer dereference on init failure
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
commit 32db864d33c21fd70a217ba53cb7224889354ffb upstream.
If sch_hhf fails in its ->init() function (either due to wrong user-space arguments as below or memory alloc failure of hh_flows) it will do a null pointer deref of q->hh_flows in its ->destroy() function.
To reproduce the crash:
$ tc qdisc add dev eth0 root hhf quantum 2000000 non_hh_weight 10000000
Crash log:
[ 690.654882] BUG: unable to handle kernel NULL pointer dereference at (null) [ 690.655565] IP: hhf_destroy+0x48/0xbc [ 690.655944] PGD 37345067 [ 690.655948] P4D 37345067 [ 690.656252] PUD 58402067 [ 690.656554] PMD 0 [ 690.656857] [ 690.657362] Oops: 0000 [#1] SMP [ 690.657696] Modules linked in: [ 690.658032] CPU: 3 PID: 920 Comm: tc Not tainted 4.13.0-rc6+ #57 [ 690.658525] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 [ 690.659255] task: ffff880058578000 task.stack: ffff88005acbc000 [ 690.659747] RIP: 0010:hhf_destroy+0x48/0xbc [ 690.660146] RSP: 0018:ffff88005acbf9e0 EFLAGS: 00010246 [ 690.660601] RAX: 0000000000000000 RBX: 0000000000000020 RCX: 0000000000000000 [ 690.661155] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff821f63f0 [ 690.661710] RBP: ffff88005acbfa08 R08: ffffffff81b10a90 R09: 0000000000000000 [ 690.662267] R10: 00000000f42b7019 R11: ffff880058578000 R12: 00000000ffffffea [ 690.662820] R13: ffff8800372f6400 R14: 0000000000000000 R15: 0000000000000000 [ 690.663769] FS: 00007f8ae5e8b740(0000) GS:ffff88005d980000(0000) knlGS:0000000000000000 [ 690.667069] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 690.667965] CR2: 0000000000000000 CR3: 0000000058523000 CR4: 00000000000406e0 [ 690.668918] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 690.669945] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 690.671003] Call Trace: [ 690.671743] qdisc_create+0x377/0x3fd [ 690.672534] tc_modify_qdisc+0x4d2/0x4fd [ 690.673324] rtnetlink_rcv_msg+0x188/0x197 [ 690.674204] ? rcu_read_unlock+0x3e/0x5f [ 690.675091] ? rtnl_newlink+0x729/0x729 [ 690.675877] netlink_rcv_skb+0x6c/0xce [ 690.676648] rtnetlink_rcv+0x23/0x2a [ 690.677405] netlink_unicast+0x103/0x181 [ 690.678179] netlink_sendmsg+0x326/0x337 [ 690.678958] sock_sendmsg_nosec+0x14/0x3f [ 690.679743] sock_sendmsg+0x29/0x2e [ 690.680506] ___sys_sendmsg+0x209/0x28b [ 690.681283] ? __handle_mm_fault+0xc7d/0xdb1 [ 690.681915] ? check_chain_key+0xb0/0xfd [ 690.682449] __sys_sendmsg+0x45/0x63 [ 690.682954] ? __sys_sendmsg+0x45/0x63 [ 690.683471] SyS_sendmsg+0x19/0x1b [ 690.683974] entry_SYSCALL_64_fastpath+0x23/0xc2 [ 690.684516] RIP: 0033:0x7f8ae529d690 [ 690.685016] RSP: 002b:00007fff26d2d6b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 690.685931] RAX: ffffffffffffffda RBX: ffffffff810d278c RCX: 00007f8ae529d690 [ 690.686573] RDX: 0000000000000000 RSI: 00007fff26d2d700 RDI: 0000000000000003 [ 690.687047] RBP: ffff88005acbff98 R08: 0000000000000001 R09: 0000000000000000 [ 690.687519] R10: 00007fff26d2d480 R11: 0000000000000246 R12: 0000000000000002 [ 690.687996] R13: 0000000001258070 R14: 0000000000000001 R15: 0000000000000000 [ 690.688475] ? trace_hardirqs_off_caller+0xa7/0xcf [ 690.688887] Code: 00 00 e8 2a 02 ae ff 49 8b bc 1d 60 02 00 00 48 83 c3 08 e8 19 02 ae ff 48 83 fb 20 75 dc 45 31 f6 4d 89 f7 4d 03 bd 20 02 00 00 <49> 8b 07 49 39 c7 75 24 49 83 c6 10 49 81 fe 00 40 00 00 75 e1 [ 690.690200] RIP: hhf_destroy+0x48/0xbc RSP: ffff88005acbf9e0 [ 690.690636] CR2: 0000000000000000
--- net/sched/sch_hhf.c | 3 +++ 1 file changed, 3 insertions(+)
net/sched/sch_hhf.c +3 -0
@@ -509,6 +509,9 @@ static void hhf_destroy(struct Qdisc *schhf_free (q->hhf_valid_bits[i]); } +if (!q->hh_flows) +return ; +for (i =0 ; i <HH_FLOWS_CNT ; i++) {struct hh_flow_state *flow, *next;struct list_head *head = &q->hh_flows[i];
PATCH 182/294 cifs: check MaxPathNameComponentLength != 0 before using it
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ronnie Sahlberg <[email protected]>
commit f74bc7c6679200a4a83156bb89cbf6c229fe8ec0 upstream.
And fix tcon leak in error path.
--- fs/cifs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/cifs/dir.c +3 -2
@@ -193,7 +193,8 @@ check_name(struct dentry *direntry, strustruct cifs_sb_info *cifs_sb =CIFS_SB (direntry->d_sb);int i; -if (unlikely (direntry->d_name.len > +if (unlikely (tcon->fsAttrInfo.MaxPathNameComponentLength && + direntry->d_name.len >le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength)))return -ENAMETOOLONG ;
@@ -509,7 +510,7 @@ cifs_atomic_open(struct inode *inode, st rc =check_name (direntry, tcon);if (rc) - goto out_free_xid; + goto out; server = tcon->ses->server;
PATCH 188/294 ALSA: seq: Fix use-after-free at creating a port
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 71105998845fb012937332fe2e806d443c09e026 upstream.
There is a potential race window opened at creating and deleting a port via ioctl, as spotted by fuzzing. snd_seq_create_port() creates a port object and returns its pointer, but it doesn't take the refcount, thus it can be deleted immediately by another thread. Meanwhile, snd_seq_ioctl_create_port() still calls the function snd_seq_system_client_ev_port_start() with the created port object that is being deleted, and this triggers use-after-free like:
BUG: KASAN: use-after-free in snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] at addr ffff8801f2241cb1 ============================================================================= BUG kmalloc-512 (Tainted: G B ): kasan: bad access detected ----------------------------------------------------------------------------- INFO: Allocated in snd_seq_create_port+0x94/0x9b0 [snd_seq] age=1 cpu=3 pid=4511 ___slab_alloc+0x425/0x460 __slab_alloc+0x20/0x40 kmem_cache_alloc_trace+0x150/0x190 snd_seq_create_port+0x94/0x9b0 [snd_seq] snd_seq_ioctl_create_port+0xd1/0x630 [snd_seq] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] snd_seq_ioctl+0x40/0x80 [snd_seq] do_vfs_ioctl+0x54b/0xda0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x16/0x75 INFO: Freed in port_delete+0x136/0x1a0 [snd_seq] age=1 cpu=2 pid=4717 __slab_free+0x204/0x310 kfree+0x15f/0x180 port_delete+0x136/0x1a0 [snd_seq] snd_seq_delete_port+0x235/0x350 [snd_seq] snd_seq_ioctl_delete_port+0xc8/0x180 [snd_seq] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] snd_seq_ioctl+0x40/0x80 [snd_seq] do_vfs_ioctl+0x54b/0xda0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x16/0x75 Call Trace: [<ffffffff81b03781>] dump_stack+0x63/0x82 [<ffffffff81531b3b>] print_trailer+0xfb/0x160 [<ffffffff81536db4>] object_err+0x34/0x40 [<ffffffff815392d3>] kasan_report.part.2+0x223/0x520 [<ffffffffa07aadf4>] ? snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] [<ffffffff815395fe>] __asan_report_load1_noabort+0x2e/0x30 [<ffffffffa07aadf4>] snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] [<ffffffffa07aa8f0>] ? snd_seq_ioctl_delete_port+0x180/0x180 [snd_seq] [<ffffffff8136be50>] ? taskstats_exit+0xbc0/0xbc0 [<ffffffffa07abc5c>] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] [<ffffffffa07abd10>] snd_seq_ioctl+0x40/0x80 [snd_seq] [<ffffffff8136d433>] ? acct_account_cputime+0x63/0x80 [<ffffffff815b515b>] do_vfs_ioctl+0x54b/0xda0 .....
We may fix this in a few different ways, and in this patch, it's fixed simply by taking the refcount properly at snd_seq_create_port() and letting the caller unref the object after use. Also, there is another potential use-after-free by sprintf() call in snd_seq_create_port(), and this is moved inside the lock.
This fix covers CVE-2017-15265.
--- sound/core/seq/seq_clientmgr.c | 6 +++++- sound/core/seq/seq_ports.c | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-)
sound/core/seq/seq_clientmgr.c +5 -1
@@ -1260,6 +1260,7 @@ static int snd_seq_ioctl_create_port(strstruct snd_seq_client_port *port;struct snd_seq_port_info info;struct snd_seq_port_callback *callback; +int port_idx;if (copy_from_user (&info, arg,sizeof (info)))return -EFAULT ;
@@ -1273,7 +1274,9 @@ static int snd_seq_ioctl_create_port(strreturn -ENOMEM ;if (client->type ==USER_CLIENT && info.kernel) { -snd_seq_delete_port (client, port->addr.port); + port_idx = port->addr.port; +snd_seq_port_unlock (port); +snd_seq_delete_port (client, port_idx);return -EINVAL ; }if (client->type ==KERNEL_CLIENT ) {
@@ -1295,6 +1298,7 @@ static int snd_seq_ioctl_create_port(strsnd_seq_set_port_info (port, &info);snd_seq_system_client_ev_port_start (port->addr.client, port->addr.port); +snd_seq_port_unlock (port);if (copy_to_user (arg, &info,sizeof (info)))return -EFAULT ;
sound/core/seq/seq_ports.c +5 -2
@@ -122,7 +122,9 @@ static void port_subs_info_init(struct s } -/* create a port, port number is returned (-1 on failure) */ +/* create a port, port number is returned (-1 on failure); +* the caller needs to unref the port via snd_seq_port_unlock() appropriately +*/ struct snd_seq_client_port *snd_seq_create_port (struct snd_seq_client *client,int port) {
@@ -151,6 +153,7 @@ struct snd_seq_client_port *snd_seq_creasnd_use_lock_init (&new_port->use_lock);port_subs_info_init (&new_port->c_src);port_subs_info_init (&new_port->c_dest); +snd_use_lock_use (&new_port->use_lock); num = port >=0 ? port :0 ;mutex_lock (&client->ports_mutex);
@@ -165,9 +168,9 @@ struct snd_seq_client_port *snd_seq_crealist_add_tail (&new_port->list, &p->list); client->num_ports++; new_port->addr.port = num;/* store the port number in the port */ +sprintf (new_port->name,"port-%d" , num);write_unlock_irqrestore (&client->ports_lock, flags);mutex_unlock (&client->ports_mutex); -sprintf (new_port->name,"port-%d" , num);return new_port; }
PATCH 185/294 KEYS: prevent KEYCTL_READ on negative key
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit 37863c43b2c6464f252862bf2e9768264e961678 upstream.
Because keyctl_read_key() looks up the key with no permissions requested, it may find a negatively instantiated key. If the key is also possessed, we went ahead and called ->read() on the key. But the key payload will actually contain the ->reject_error rather than the normal payload. Thus, the kernel oopses trying to read the user_key_payload from memory address (int)-ENOKEY = 0x00000000ffffff82.
Fortunately the payload data is stored inline, so it shouldn't be possible to abuse this as an arbitrary memory read primitive...
Reproducer:
keyctl new_session
keyctl request2 user desc '' @s
keyctl read $(keyctl show | awk '/user: desc/ {print $1}')
It causes a crash like the following:
BUG: unable to handle kernel paging request at 00000000ffffff92
IP: user_read+0x33/0xa0
PGD 36a54067 P4D 36a54067 PUD 0
Oops: 0000 [#1] SMP
CPU: 0 PID: 211 Comm: keyctl Not tainted 4.14.0-rc1 #337
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-20170228_101828-anatol 04/01/2014
task: ffff90aa3b74c3c0 task.stack: ffff9878c0478000
RIP: 0010:user_read+0x33/0xa0
RSP: 0018:ffff9878c047bee8 EFLAGS: 00010246
RAX: 0000000000000001 RBX: ffff90aa3d7da340 RCX: 0000000000000017
RDX: 0000000000000000 RSI: 00000000ffffff82 RDI: ffff90aa3d7da340
RBP: ffff9878c047bf00 R08: 00000024f95da94f R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f58ece69740(0000) GS:ffff90aa3e200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000ffffff92 CR3: 0000000036adc001 CR4: 00000000003606f0
Call Trace:
keyctl_read_key+0xac/0xe0
SyS_keyctl+0x99/0x120
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x7f58ec787bb9
RSP: 002b:00007ffc8d401678 EFLAGS: 00000206 ORIG_RAX: 00000000000000fa
RAX: ffffffffffffffda RBX: 00007ffc8d402800 RCX: 00007f58ec787bb9
RDX: 0000000000000000 RSI: 00000000174a63ac RDI: 000000000000000b
RBP: 0000000000000004 R08: 00007ffc8d402809 R09: 0000000000000020
R10: 0000000000000000 R11: 0000000000000206 R12: 00007ffc8d402800
R13: 00007ffc8d4016e0 R14: 0000000000000000 R15: 0000000000000000
Code: e5 41 55 49 89 f5 41 54 49 89 d4 53 48 89 fb e8 a4 b4 ad ff 85 c0 74 09 80 3d b9 4c 96 00 00 74 43 48 8b b3 20 01 00 00 4d 85 ed <0f> b7 5e 10 74 29 4d 85 e4 74 24 4c 39 e3 4c 89 e2 4c 89 ef 48
RIP: user_read+0x33/0xa0 RSP: ffff9878c047bee8
CR2: 00000000ffffff92--- security/keys/keyctl.c | 5 +++++ 1 file changed, 5 insertions(+)
security/keys/keyctl.c +5 -0
@@ -735,6 +735,11 @@ long keyctl_read_key(key_serial_t keyid, key =key_ref_to_ptr (key_ref); +if (test_bit (KEY_FLAG_NEGATIVE , &key->flags)) { + ret = -ENOKEY ; + goto error2; + } +/* see if we can read it directly */ ret =key_permission (key_ref,KEY_NEED_READ );if (ret ==0 )
PATCH 190/294 packet: hold bind lock when rebinding to fanout hook
In reply to Ben Hutchings3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
commit 008ba2a13f2d04c947adc536d19debb8fe66f110 upstream.
Packet socket bind operations must hold the po->bind_lock. This keeps po->running consistent with whether the socket is actually on a ptype list to receive packets.
fanout_add unbinds a socket and its packet_rcv/tpacket_rcv call, then binds the fanout object to receive through packet_rcv_fanout.
Make it hold the po->bind_lock when testing po->running and rebinding. Else, it can race with other rebind operations, such as that in packet_set_ring from packet_rcv to tpacket_rcv. Concurrent updates can result in a socket being added to a fanout group twice, causing use-after-free KASAN bug reports, among others.
Reported independently by both trinity and syzkaller. Verified that the syzkaller reproducer passes after this patch.
--- net/packet/af_packet.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
net/packet/af_packet.c +11 -5
@@ -1459,10 +1459,6 @@ static int fanout_add(struct sock *sk, umutex_lock (&fanout_mutex); - err = -EINVAL ; -if (!po->running) - goto out; - err = -EALREADY ;if (po->fanout) goto out;
@@ -1499,7 +1495,10 @@ static int fanout_add(struct sock *sk, ulist_add (&match->list, &fanout_list); } err = -EINVAL ; -if (match->type == type && + +spin_lock (&po->bind_lock); +if (po->running && + match->type == type && match->prot_hook.type == po->prot_hook.type && match->prot_hook.dev == po->prot_hook.dev) { err = -ENOSPC ;
@@ -1511,6 +1510,13 @@ static int fanout_add(struct sock *sk, u err =0 ; } } +spin_unlock (&po->bind_lock); + +if (err && !atomic_read (&match->sk_ref)) { +list_del (&match->list); +kfree (match); + } + out:mutex_unlock (&fanout_mutex);return err;