Linux 4.9.200
Greg KH
maintainerI'm announcing the release of the 4.9.200 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 14 ++++- arch/arm/boot/dts/imx7s.dtsi | 8 +-- arch/arm/boot/dts/logicpd-torpedo-som.dtsi | 4 + arch/arm/mach-davinci/dm365.c | 4 - arch/arm/mm/alignment.c | 44 +++++++++++++--- arch/mips/bcm63xx/prom.c | 2 arch/mips/include/asm/bmips.h | 10 +-- arch/mips/kernel/smp-bmips.c | 8 +-- drivers/dma/qcom/bam_dma.c | 14 +++++ drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 ++- drivers/net/ethernet/hisilicon/hip04_eth.c | 15 +++-- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 42 +++++++++------ drivers/net/vxlan.c | 5 + drivers/of/unittest.c | 1 drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 4 - drivers/regulator/pfuze100-regulator.c | 8 ++- drivers/regulator/ti-abb-regulator.c | 26 +++------ drivers/scsi/Kconfig | 2 drivers/scsi/device_handler/scsi_dh_alua.c | 21 ++++++- drivers/scsi/sni_53c710.c | 4 - drivers/target/target_core_device.c | 21 ------- fs/cifs/cifsglob.h | 5 + fs/cifs/cifsproto.h | 1 fs/cifs/file.c | 23 +++++--- fs/cifs/smb2file.c | 2 include/linux/gfp.h | 23 ++++++++ include/linux/skbuff.h | 3 - include/net/flow_dissector.h | 3 - include/net/fq.h | 2 include/net/fq_impl.h | 4 - include/net/sock.h | 11 +++- kernel/time/alarmtimer.c | 4 - net/core/datagram.c | 2 net/core/ethtool.c | 4 + net/core/flow_dissector.c | 48 +++++++----------- net/dccp/ipv4.c | 4 - net/dsa/dsa2.c | 2 net/ipv4/datagram.c | 2 net/ipv4/tcp_ipv4.c | 4 - net/sched/sch_fq_codel.c | 6 +- net/sched/sch_hhf.c | 8 +-- net/sched/sch_sfb.c | 13 ++-- net/sched/sch_sfq.c | 14 +++-- net/sctp/socket.c | 2 sound/soc/codecs/wm_adsp.c | 3 - sound/soc/rockchip/rockchip_i2s.c | 2 tools/perf/builtin-kmem.c | 1 tools/testing/selftests/net/reuseport_dualstack.c | 3 - 48 files changed, 285 insertions(+), 180 deletions(-)
Adam Ford (1):
ARM: dts: logicpd-torpedo-som: Remove twl_keypad
Anson Huang (1):
ARM: dts: imx7s: Correct GPT's ipg clock source
Axel Lin (1):
regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone
Bodo Stroesser (1):
scsi: target: core: Do not overwrite CDB byte 1
Dan Carpenter (1):
pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable()
Dave Wysochanski (1):
cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs
Doug Berger (1):
net: bcmgenet: reset 40nm EPHY on energy detect
Eran Ben Elisha (1):
net/mlx4_core: Dynamically set guaranteed amount of counters per VF
Eric Dumazet (4):
dccp: do not leak jiffies on the wire
net: add READ_ONCE() annotation in __skb_wait_for_more_packets()
inet: stop leaking jiffies on the wire net/flow_dissector: switch to siphash
Greg Kroah-Hartman (1):
Linux 4.9.200
Hannes Reinecke (1):
scsi: scsi_dh_alua: handle RTPG sense code correctly during state transitions
Jeffrey Hugo (1):
dmaengine: qcom: bam_dma: Fix resource leak
Jiangfeng Xiao (1):
net: hisilicon: Fix ping latency when deal with high throughput
Jonas Gorski (1):
MIPS: bmips: mark exception vectors as char arrays
Kees Cook (1):
Kbuild: make designated_init attribute fatal
Masahiro Yamada (1):
kbuild: use -fmacro-prefix-map to make __FILE__ a relative path
Navid Emamdoost (1):
of: unittest: fix memory leak in unittest_data_add
Peter Ujfalusi (1):
ARM: davinci: dm365: Fix McBSP dma_slave_map entry
Petr Vorel (1):
alarmtimer: Change remaining ENOTSUPP to EOPNOTSUPP
Robin Murphy (1):
ASoc: rockchip: i2s: Fix RPM imbalance
Russell King (1):
ARM: mm: fix alignment handler faults under memory pressure
Seth Forshee (1):
kbuild: add -fcf-protection=none when using retpoline flags
Stuart Henderson (1):
ASoC: wm_adsp: Don't generate kcontrols without READ flags
Tejun Heo (1):
net: fix sk_page_frag() recursion from memory reclaim
Thomas Bogendoerfer (2):
scsi: sni_53c710: fix compilation error
scsi: fix kconfig dependency warning related to 53C700_LE_ON_BE
Vivien Didelot (1):
net: dsa: fix switch tree list
Wei Wang (1):
selftests: net: reuseport_dualstack: fix uninitalized parameter
Xin Long (1):
vxlan: check tun_info options_len properly
Yizhuo (1):
regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized
Yunfeng Ye (1):
perf kmem: Fix memory leak in compact_gfp_flags()
zhanglin (1):
net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()
Greg KH
maintainerMakefile +13 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 199 +SUBLEVEL = 200 EXTRAVERSION = NAME = Roaring Lionus
@@ -834,6 +834,18 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) # enforce correct pointer usage KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) +# Require designated initializers for all marked structures +KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) + +# change __FILE__ to the relative path from the srctree +KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) + +# ensure -fcf-protection is disabled when using retpoline as it is +# incompatible with -mindirect-branch=thunk-extern +ifdef CONFIG_RETPOLINE +KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) +endif + # use the deterministic mode of AR if available KBUILD_ARFLAGS := $(call ar-option,D)
arch/arm/boot/dts/imx7s.dtsi +4 -4
@@ -437,7 +437,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302d0000 0x10000>; interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT1_ROOT_CLK>, <&clks IMX7D_GPT1_ROOT_CLK>; clock-names = "ipg", "per"; };
@@ -446,7 +446,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302e0000 0x10000>; interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT2_ROOT_CLK>, <&clks IMX7D_GPT2_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
@@ -456,7 +456,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302f0000 0x10000>; interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT3_ROOT_CLK>, <&clks IMX7D_GPT3_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
@@ -466,7 +466,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x30300000 0x10000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT4_ROOT_CLK>, <&clks IMX7D_GPT4_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
arch/arm/boot/dts/logicpd-torpedo-som.dtsi +4 -0
@@ -266,3 +266,7 @@ &twl_gpio { ti,use-leds; }; + +&twl_keypad { + status = "disabled"; +};
arch/arm/mach-davinci/dm365.c +2 -2
@@ -864,8 +864,8 @@ static s8 dm365_queue_priority_mapping[][2] = { };static const struct dma_slave_map dm365_edma_map[] = { - {"davinci-mcbsp.0" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, - {"davinci-mcbsp.0" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, + {"davinci-mcbsp" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, + {"davinci-mcbsp" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, {"davinci_voicecodec" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, {"davinci_voicecodec" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, {"spi_davinci.2" ,"tx" ,EDMA_FILTER_PARAM (0 ,10 ) },
arch/arm/mm/alignment.c +36 -8
75 lines not on this page · raw message
arch/mips/bcm63xx/prom.c +1 -1
@@ -84,7 +84,7 @@ void __init prom_init(void)* Here we will start up CPU1 in the background and ask it to * reconfigure itself then go back to sleep. */ -memcpy ((void *)0xa0000200 , &bmips_smp_movevec,0x20 ); +memcpy ((void *)0xa0000200 , bmips_smp_movevec,0x20 );__sync ();set_c0_cause (C_SW0 );cpumask_set_cpu (1 , &bmips_booted_mask);
arch/mips/include/asm/bmips.h +5 -5
@@ -75,11 +75,11 @@ static inline int register_bmips_smp_ops(void)#endif } -extern char bmips_reset_nmi_vec; -extern char bmips_reset_nmi_vec_end; -extern char bmips_smp_movevec; -extern char bmips_smp_int_vec; -extern char bmips_smp_int_vec_end; +extern char bmips_reset_nmi_vec[]; +extern char bmips_reset_nmi_vec_end[]; +extern char bmips_smp_movevec[]; +extern char bmips_smp_int_vec[]; +extern char bmips_smp_int_vec_end[];extern int bmips_smp_enabled;extern int bmips_cpu_offset;
arch/mips/kernel/smp-bmips.c +4 -4
@@ -453,10 +453,10 @@ static void bmips_wr_vec(unsigned long dst, char *start, char *end)static inline void bmips_nmi_handler_setup (void ) { -bmips_wr_vec (BMIPS_NMI_RESET_VEC , &bmips_reset_nmi_vec, - &bmips_reset_nmi_vec_end); -bmips_wr_vec (BMIPS_WARM_RESTART_VEC , &bmips_smp_int_vec, - &bmips_smp_int_vec_end); +bmips_wr_vec (BMIPS_NMI_RESET_VEC , bmips_reset_nmi_vec, + bmips_reset_nmi_vec_end); +bmips_wr_vec (BMIPS_WARM_RESTART_VEC , bmips_smp_int_vec, + bmips_smp_int_vec_end); }struct reset_vec_info {
drivers/dma/qcom/bam_dma.c +14 -0
@@ -686,7 +686,21 @@ static int bam_dma_terminate_all(struct dma_chan *chan)/* remove all transactions, including active transaction */ spin_lock_irqsave (&bchan->vc.lock, flag); +/* +* If we have transactions queued, then some might be committed to the +* hardware in the desc fifo. The only way to reset the desc fifo is +* to do a hardware reset (either by pipe or the entire block). +* bam_chan_init_hw() will trigger a pipe reset, and also reinit the +* pipe. If the pipe is left disabled (default state after pipe reset) +* and is accessed by a connected hardware engine, a fatal error in +* the BAM will occur. There is a small window where this could happen +* with bam_chan_init_hw(), but it is assumed that the caller has +* stopped activity on any attached hardware engine. Make sure to do +* this first so that the BAM hardware doesn't cause memory corruption +* by accessing freed resources. +*/ if (bchan->curr_txd) { +bam_chan_init_hw (bchan, bchan->curr_txd->dir);list_add (&bchan->curr_txd->vd.node, &bchan->vc.desc_issued); bchan->curr_txd =NULL ; }
drivers/net/ethernet/broadcom/genet/bcmgenet.c +7 -2
@@ -1914,6 +1914,8 @@ static void bcmgenet_link_intr_enable(struct bcmgenet_priv *priv)*/ if (priv->internal_phy) { int0_enable |=UMAC_IRQ_LINK_EVENT ; +if (GENET_IS_V1 (priv) ||GENET_IS_V2 (priv) ||GENET_IS_V3 (priv)) + int0_enable |=UMAC_IRQ_PHY_DET_R ; }else if (priv->ext_phy) { int0_enable |=UMAC_IRQ_LINK_EVENT ; }else if (priv->phy_interface ==PHY_INTERFACE_MODE_MOCA ) {
@@ -2531,6 +2533,10 @@ static void bcmgenet_irq_task(struct work_struct *work)bcmgenet_power_up (priv,GENET_POWER_WOL_MAGIC ); } +if (status &UMAC_IRQ_PHY_DET_R && + priv->dev->phydev->autoneg !=AUTONEG_ENABLE ) +phy_init_hw (priv->dev->phydev); +/* Link UP/DOWN event */ if (status &UMAC_IRQ_LINK_EVENT ) phy_mac_interrupt(priv->phydev,
@@ -2627,8 +2633,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id) }/* all other interested interrupts handled in bottom half */ - status &= (UMAC_IRQ_LINK_EVENT | -UMAC_IRQ_MPD_R ); + status &= (UMAC_IRQ_LINK_EVENT |UMAC_IRQ_MPD_R |UMAC_IRQ_PHY_DET_R );if (status) {/* Save irq status for bottom-half processing. */ spin_lock_irqsave (&priv->lock, flags);
drivers/net/ethernet/hisilicon/hip04_eth.c +9 -6
@@ -174,6 +174,7 @@ struct hip04_priv {dma_addr_t rx_phys[RX_DESC_NUM ];unsigned int rx_head;unsigned int rx_buf_size; +unsigned int rx_cnt_remaining;struct device_node *phy_node;struct phy_device *phy;
@@ -487,7 +488,6 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) struct hip04_priv *priv = container_of(napi, struct hip04_priv, napi);struct net_device *ndev = priv->ndev;struct net_device_stats *stats = &ndev->stats; -unsigned int cnt =hip04_recv_cnt (priv);struct rx_desc *desc;struct sk_buff *skb;unsigned char *buf;
@@ -500,8 +500,8 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)/* clean up tx descriptors */ tx_remaining =hip04_tx_reclaim (ndev, false); - -while (cnt && !last) { + priv->rx_cnt_remaining +=hip04_recv_cnt (priv); +while (priv->rx_cnt_remaining && !last) { buf = priv->rx_buf[priv->rx_head]; skb =build_skb (buf, priv->rx_buf_size);if (unlikely (!skb)) {
@@ -547,11 +547,13 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)hip04_set_recv_desc (priv, phys); priv->rx_head =RX_NEXT (priv->rx_head); -if (rx >= budget) +if (rx >= budget) { + --priv->rx_cnt_remaining; goto done; + } -if (--cnt ==0 ) - cnt =hip04_recv_cnt (priv); +if (--priv->rx_cnt_remaining ==0 ) + priv->rx_cnt_remaining +=hip04_recv_cnt (priv); }if (!(priv->reg_inten &RCV_INT )) {
@@ -636,6 +638,7 @@ static int hip04_mac_open(struct net_device *ndev)int i; priv->rx_head =0 ; + priv->rx_cnt_remaining =0 ; priv->tx_head =0 ; priv->tx_tail =0 ;hip04_reset_ppe (priv);
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +26 -16
61 lines not on this page · raw message
drivers/net/vxlan.c +4 -1
@@ -2049,8 +2049,11 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, label = info->key.label; udp_sum = !!(info->key.tun_flags &TUNNEL_CSUM ); -if (info->options_len) +if (info->options_len) { +if (info->options_len <sizeof (*md)) + goto drop; md =ip_tunnel_info_opts (info); + } }else { md->gbp = skb->mark; }
drivers/of/unittest.c +1 -0
@@ -933,6 +933,7 @@ static int __init unittest_data_add(void)of_fdt_unflatten_tree (unittest_data,NULL , &unittest_data_node);if (!unittest_data_node) {pr_warn ("%s: No tree to attach; not running tests\n" , __func__); +kfree (unittest_data);return -ENODATA ; }of_node_set_flag (unittest_data_node,OF_DETACHED );
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +2 -2
@@ -640,8 +640,8 @@ static int ns2_pinmux_enable(struct pinctrl_dev *pctrl_dev,const struct ns2_pin_function *func;const struct ns2_pin_group *grp; -if (grp_select > pinctrl->num_groups || - func_select > pinctrl->num_functions) +if (grp_select >= pinctrl->num_groups || + func_select >= pinctrl->num_functions)return -EINVAL ; func = &pinctrl->functions[func_select];
drivers/regulator/pfuze100-regulator.c +7 -1
@@ -608,7 +608,13 @@ static int pfuze100_regulator_probe(struct i2c_client *client,/* SW2~SW4 high bit check and modify the voltage value table */ if (i >= sw_check_start && i <= sw_check_end) { -regmap_read (pfuze_chip->regmap, desc->vsel_reg, &val); + ret =regmap_read (pfuze_chip->regmap, + desc->vsel_reg, &val); +if (ret) { +dev_err (&client->dev,"Fails to read from the register.\n" ); +return ret; + } +if (val & sw_hi) {if (pfuze_chip->chip_id ==PFUZE3000 ) { desc->volt_table = pfuze3000_sw2hi;
drivers/regulator/ti-abb-regulator.c +8 -18
@@ -173,19 +173,14 @@ static int ti_abb_wait_txdone(struct device *dev, struct ti_abb *abb)while (timeout++ <= abb->settling_time) { status =ti_abb_check_txdone (abb);if (status) -break ; +return 0 ;udelay (1 ); } -if (timeout > abb->settling_time) { -dev_warn_ratelimited (dev, -"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , - __func__, timeout,readl (abb->int_base)); -return -ETIMEDOUT ; - } - -return 0 ; +dev_warn_ratelimited (dev,"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , + __func__, timeout,readl (abb->int_base)); +return -ETIMEDOUT ; }/**
@@ -205,19 +200,14 @@ static int ti_abb_clear_all_txdone(struct device *dev, const struct ti_abb *abb) status =ti_abb_check_txdone (abb);if (!status) -break ; +return 0 ;udelay (1 ); } -if (timeout > abb->settling_time) { -dev_warn_ratelimited (dev, -"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , - __func__, timeout,readl (abb->int_base)); -return -ETIMEDOUT ; - } - -return 0 ; +dev_warn_ratelimited (dev,"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , + __func__, timeout,readl (abb->int_base)); +return -ETIMEDOUT ; }/**
drivers/scsi/Kconfig +1 -1
@@ -986,7 +986,7 @@ config SCSI_SNI_53C710 config 53C700_LE_ON_BE bool - depends on SCSI_LASI700 + depends on SCSI_LASI700 || SCSI_SNI_53C710 default y config SCSI_STEX
drivers/scsi/device_handler/scsi_dh_alua.c +16 -5
@@ -527,6 +527,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)unsigned int tpg_desc_tbl_off;unsigned char orig_transition_tmo;unsigned long flags; +bool transitioning_sense = false;if (!pg->expiry) {unsigned long transition_tmo =ALUA_FAILOVER_TIMEOUT *HZ ;
@@ -571,13 +572,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) goto retry; }/* -* Retry on ALUA state transition or if any -* UNIT ATTENTION occurred. +* If the array returns with 'ALUA state transition' +* sense code here it cannot return RTPG data during +* transition. So set the state to 'transitioning' directly. */ if (sense_hdr.sense_key ==NOT_READY && - sense_hdr.asc ==0x04 && sense_hdr.ascq ==0x0a ) - err =SCSI_DH_RETRY ; -else if (sense_hdr.sense_key ==UNIT_ATTENTION ) + sense_hdr.asc ==0x04 && sense_hdr.ascq ==0x0a ) { + transitioning_sense = true; + goto skip_rtpg; + } +/* +* Retry on any other UNIT ATTENTION occurred. +*/ +if (sense_hdr.sense_key ==UNIT_ATTENTION ) err =SCSI_DH_RETRY ;if (err ==SCSI_DH_RETRY && pg->expiry !=0 &&time_before (jiffies, pg->expiry)) {
@@ -665,7 +672,11 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) off =8 + (desc[7 ] *4 ); } + skip_rtpg:spin_lock_irqsave (&pg->lock, flags); +if (transitioning_sense) + pg->state =SCSI_ACCESS_STATE_TRANSITIONING ; + sdev_printk(KERN_INFO, sdev, "%s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n", ALUA_DH_NAME, pg->group_id, print_alua_state(pg->state),
drivers/scsi/sni_53c710.c +1 -3
@@ -78,10 +78,8 @@ static int snirm710_probe(struct platform_device *dev) base = res->start; hostdata =kzalloc (sizeof (*hostdata),GFP_KERNEL ); -if (!hostdata) { -dev_printk (KERN_ERR , dev,"Failed to allocate host data\n" ); +if (!hostdata)return -ENOMEM ; - } hostdata->dev = &dev->dev;dma_set_mask (&dev->dev,DMA_BIT_MASK (32 ));
drivers/target/target_core_device.c +0 -21
@@ -1046,27 +1046,6 @@ passthrough_parse_cdb(struct se_cmd *cmd, {unsigned char *cdb = cmd->t_task_cdb; -/* -* Clear a lun set in the cdb if the initiator talking to use spoke -* and old standards version, as we can't assume the underlying device -* won't choke up on it. -*/ -switch (cdb[0 ]) { -case READ_10 :/* SBC - RDProtect */ -case READ_12 :/* SBC - RDProtect */ -case READ_16 :/* SBC - RDProtect */ -case SEND_DIAGNOSTIC :/* SPC - SELF-TEST Code */ -case VERIFY :/* SBC - VRProtect */ -case VERIFY_16 :/* SBC - VRProtect */ -case WRITE_VERIFY :/* SBC - VRProtect */ -case WRITE_VERIFY_12 :/* SBC - VRProtect */ -case MAINTENANCE_IN :/* SPC - Parameter Data Format for SA RTPG */ -break ; -default : - cdb[1 ] &=0x1f ;/* clear logical unit number */ -break ; - } -/* * For REPORT LUNS we always need to emulate the response, for everything * else, pass it up.
fs/cifs/cifsglob.h +5 -0
@@ -1178,6 +1178,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file);struct cifsInodeInfo {bool can_cache_brlcks;struct list_head llist;/* locks helb by this inode */ +/* +* NOTE: Some code paths call down_read(lock_sem) twice, so +* we must always use use cifs_down_write() instead of down_write() +* for this semaphore to avoid deadlocks. +*/ struct rw_semaphore lock_sem;/* protect the fields above */ /* BB add in lists for dirty pages i.e. write caching info for oplock */ struct list_head openFileList;
fs/cifs/cifsproto.h +1 -0
@@ -138,6 +138,7 @@ extern int cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, const unsigned int xid);extern int cifs_push_mandatory_locks (struct cifsFileInfo *cfile); +extern void cifs_down_write (struct rw_semaphore *sem); extern struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file, struct tcon_link *tlink,
fs/cifs/file.c +15 -8
@@ -280,6 +280,13 @@ cifs_has_mand_locks(struct cifsInodeInfo *cinode)return has_locks; } +void +cifs_down_write (struct rw_semaphore *sem) +{ +while (!down_write_trylock (sem)) +msleep (10 ); +} +struct cifsFileInfo *cifs_new_fileinfo (struct cifs_fid *fid,struct file *file,struct tcon_link *tlink,__u32 oplock)
@@ -305,7 +312,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,INIT_LIST_HEAD (&fdlocks->locks); fdlocks->cfile = cfile; cfile->llist = fdlocks; -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);list_add (&fdlocks->llist, &cinode->llist);up_write (&cinode->lock_sem);
@@ -457,7 +464,7 @@ void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_handler)* Delete any outstanding lock records. We'll lose them when the file * is closed anyway. */ -down_write (&cifsi->lock_sem); +cifs_down_write (&cifsi->lock_sem);list_for_each_entry_safe (li, tmp, &cifs_file->llist->locks, llist) {list_del (&li->llist);cifs_del_lock_waiters (li);
@@ -1011,7 +1018,7 @@ static void cifs_lock_add(struct cifsFileInfo *cfile, struct cifsLockInfo *lock) { struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry)); -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);list_add_tail (&lock->llist, &cfile->llist->locks);up_write (&cinode->lock_sem); }
@@ -1033,7 +1040,7 @@ cifs_lock_add_if(struct cifsFileInfo *cfile, struct cifsLockInfo *lock, try_again: exist = false; -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem); exist =cifs_find_lock_conflict (cfile, lock->offset, lock->length, lock->type, &conf_lock,CIFS_LOCK_OP );
@@ -1055,7 +1062,7 @@ cifs_lock_add_if(struct cifsFileInfo *cfile, struct cifsLockInfo *lock, (lock->blist.next == &lock->blist));if (!rc) goto try_again; -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);list_del_init (&lock->blist); }
@@ -1108,7 +1115,7 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)return rc; try_again: -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);if (!cinode->can_cache_brlcks) {up_write (&cinode->lock_sem);return rc;
@@ -1312,7 +1319,7 @@ cifs_push_locks(struct cifsFileInfo *cfile)int rc =0 ;/* we are going to update can_cache_brlcks here - need a write access */ -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);if (!cinode->can_cache_brlcks) {up_write (&cinode->lock_sem);return rc;
@@ -1501,7 +1508,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,if (!buf)return -ENOMEM ; -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem);for (i =0 ; i <2 ; i++) { cur = buf; num =0 ;
fs/cifs/smb2file.c +1 -1
@@ -138,7 +138,7 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, cur = buf; -down_write (&cinode->lock_sem); +cifs_down_write (&cinode->lock_sem); list_for_each_entry_safe(li, tmp, &cfile->llist->locks, llist) { if (flock->fl_start > li->offset || (flock->fl_start + length) <
include/linux/gfp.h +23 -0
@@ -284,6 +284,29 @@ static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)return !!(gfp_flags & __GFP_DIRECT_RECLAIM); } +/** +* gfpflags_normal_context - is gfp_flags a normal sleepable context? +* @gfp_flags: gfp_flags to test +* +* Test whether @gfp_flags indicates that the allocation is from the +* %current context and allowed to sleep. +* +* An allocation being allowed to block doesn't mean it owns the %current +* context. When direct reclaim path tries to allocate memory, the +* allocation context is nested inside whatever %current was doing at the +* time of the original allocation. The nested allocation may be allowed +* to block but modifying anything %current owns can corrupt the outer +* context's expectations. +* +* %true result from this function indicates that the allocation context +* can sleep and use anything that's associated with %current. +*/ +static inline bool gfpflags_normal_context (const gfp_t gfp_flags) +{ +return (gfp_flags & (__GFP_DIRECT_RECLAIM | __GFP_MEMALLOC)) == + __GFP_DIRECT_RECLAIM; +} +#ifdef CONFIG_HIGHMEM #define OPT_ZONE_HIGHMEM ZONE_HIGHMEM#else
include/linux/skbuff.h +2 -1
@@ -1178,7 +1178,8 @@ static inline __u32 skb_get_hash_flowi4(struct sk_buff *skb, const struct flowi4return skb->hash; } -__u32 skb_get_hash_perturb (const struct sk_buff *skb,u32 perturb); +__u32 skb_get_hash_perturb (const struct sk_buff *skb, +const siphash_key_t *perturb);static inline __u32 skb_get_hash_raw (const struct sk_buff *skb) {
include/net/flow_dissector.h +2 -1
@@ -3,6 +3,7 @@#include <linux/types.h> #include <linux/in6.h> +#include <linux/siphash.h> #include <uapi/linux/if_ether.h> /**
@@ -151,7 +152,7 @@ struct flow_dissector {struct flow_keys {struct flow_dissector_key_control control;#define FLOW_KEYS_HASH_START_FIELD basic -struct flow_dissector_key_basic basic; +struct flow_dissector_key_basic basic__aligned(SIPHASH_ALIGNMENT) ;struct flow_dissector_key_tags tags;struct flow_dissector_key_vlan vlan;struct flow_dissector_key_keyid keyid;
include/net/fq.h +1 -1
@@ -70,7 +70,7 @@ struct fq {struct list_head backlogs;spinlock_t lock;u32 flows_cnt; -u32 perturbation; +siphash_key_t perturbation;u32 limit;u32 memory_limit;u32 memory_usage;
include/net/fq_impl.h +2 -2
@@ -105,7 +105,7 @@ static struct fq_flow *fq_flow_classify(struct fq *fq,lockdep_assert_held (&fq->lock); - hash =skb_get_hash_perturb (skb, fq->perturbation); + hash =skb_get_hash_perturb (skb, &fq->perturbation); idx =reciprocal_scale (hash, fq->flows_cnt); flow = &fq->flows[idx];
@@ -252,7 +252,7 @@ static int fq_init(struct fq *fq, int flows_cnt)INIT_LIST_HEAD (&fq->backlogs);spin_lock_init (&fq->lock); fq->flows_cnt =max_t (u32, flows_cnt,1 ); - fq->perturbation =prandom_u32 (); +get_random_bytes (&fq->perturbation,sizeof (fq->perturbation)); fq->quantum =300 ; fq->limit =8192 ; fq->memory_limit =16 <<20 ;/* 16 MBytes */
include/net/sock.h +8 -3
@@ -2045,12 +2045,17 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp,* sk_page_frag - return an appropriate page_frag * @sk: socket * -* If socket allocation mode allows current thread to sleep, it means its -* safe to use the per task page_frag instead of the per socket one. +* Use the per task page_frag instead of the per socket one for +* optimization when we know that we're in the normal context and owns +* everything that's associated with %current. +* +* gfpflags_allow_blocking() isn't enough here as direct reclaim may nest +* inside other socket operations and end up recursing into sk_page_frag() +* while it's already in use. */ static inline struct page_frag *sk_page_frag (struct sock *sk) { -if (gfpflags_allow_blocking (sk->sk_allocation)) +if (gfpflags_normal_context (sk->sk_allocation))return ¤t->task_frag;return &sk->sk_frag;
kernel/time/alarmtimer.c +2 -2
@@ -586,7 +586,7 @@ static void alarm_timer_get(struct k_itimer *timr,static int alarm_timer_del (struct k_itimer *timr) {if (!rtcdev) -return -ENOTSUPP ; +return -EOPNOTSUPP ;if (alarm_try_to_cancel (&timr->it.alarm.alarmtimer) <0 )return TIMER_RETRY ;
@@ -610,7 +610,7 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,ktime_t exp;if (!rtcdev) -return -ENOTSUPP ; +return -EOPNOTSUPP ;if (flags & ~TIMER_ABSTIME )return -EINVAL ;
net/core/datagram.c +1 -1
@@ -96,7 +96,7 @@ int __skb_wait_for_more_packets(struct sock *sk, int *err, long *timeo_p,if (error) goto out_err; -if (sk->sk_receive_queue.prev != skb) +if (READ_ONCE (sk->sk_receive_queue.prev) != skb) goto out;/* Socket shut down? */
net/core/ethtool.c +3 -1
@@ -1438,11 +1438,13 @@ static int ethtool_reset(struct net_device *dev, char __user *useraddr)static int ethtool_get_wol (struct net_device *dev,char __user *useraddr) { -struct ethtool_wolinfo wol = { .cmd =ETHTOOL_GWOL }; +struct ethtool_wolinfo wol;if (!dev->ethtool_ops->get_wol)return -EOPNOTSUPP ; +memset (&wol,0 ,sizeof (struct ethtool_wolinfo )); + wol.cmd =ETHTOOL_GWOL ; dev->ethtool_ops->get_wol (dev, &wol);if (copy_to_user (useraddr, &wol,sizeof (wol)))
net/core/flow_dissector.c +20 -28
111 lines not on this page · raw message
net/dccp/ipv4.c +2 -2
@@ -121,7 +121,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) inet->inet_daddr, inet->inet_sport, inet->inet_dport); - inet->inet_id = dp->dccps_iss ^ jiffies; + inet->inet_id =prandom_u32 (); err =dccp_connect (sk); rt =NULL ;
@@ -417,7 +417,7 @@ struct sock *dccp_v4_request_recv_sock(const struct sock *sk,RCU_INIT_POINTER (newinet->inet_opt,rcu_dereference (ireq->ireq_opt)); newinet->mc_index =inet_iif (skb); newinet->mc_ttl =ip_hdr (skb)->ttl; - newinet->inet_id = jiffies; + newinet->inet_id =prandom_u32 ();if (dst ==NULL && (dst =inet_csk_route_child_sock (sk, newsk, req)) ==NULL ) goto put_and_exit;
net/dsa/dsa2.c +1 -1
@@ -59,7 +59,7 @@ static struct dsa_switch_tree *dsa_add_dst(u32 tree) dst->tree = tree; dst->cpu_switch =-1 ;INIT_LIST_HEAD (&dst->list); -list_add_tail (&dsa_switch_trees, &dst->list); +list_add_tail (&dst->list, &dsa_switch_trees);kref_init (&dst->refcount);return dst;
net/ipv4/datagram.c +1 -1
@@ -75,7 +75,7 @@ int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len inet->inet_dport = usin->sin_port; sk->sk_state =TCP_ESTABLISHED ;sk_set_txhash (sk); - inet->inet_id = jiffies; + inet->inet_id =prandom_u32 ();sk_dst_set (sk, &rt->dst); err =0 ;
net/ipv4/tcp_ipv4.c +2 -2
@@ -239,7 +239,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) inet->inet_sport, usin->sin_port); - inet->inet_id = tp->write_seq ^ jiffies; + inet->inet_id =prandom_u32 (); err =tcp_connect (sk);
@@ -1307,7 +1307,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,inet_csk (newsk)->icsk_ext_hdr_len =0 ;if (inet_opt)inet_csk (newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; - newinet->inet_id = newtp->write_seq ^ jiffies; + newinet->inet_id =prandom_u32 ();if (!dst) { dst =inet_csk_route_child_sock (sk, newsk, req);
net/sched/sch_fq_codel.c +3 -3
@@ -57,7 +57,7 @@ struct fq_codel_sched_data {struct fq_codel_flow *flows;/* Flows table [flows_cnt] */ u32 *backlogs;/* backlog table [flows_cnt] */ u32 flows_cnt;/* number of flows */ -u32 perturbation;/* hash perturbation */ +siphash_key_t perturbation;/* hash perturbation */ u32 quantum;/* psched_mtu(qdisc_dev(sch)); */ u32 drop_batch_size;u32 memory_limit;
@@ -75,7 +75,7 @@ struct fq_codel_sched_data {static unsigned int fq_codel_hash (const struct fq_codel_sched_data *q,struct sk_buff *skb) { -u32 hash =skb_get_hash_perturb (skb, q->perturbation); +u32 hash =skb_get_hash_perturb (skb, &q->perturbation);return reciprocal_scale (hash, q->flows_cnt); }
@@ -482,7 +482,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt) q->memory_limit =32 <<20 ;/* 32 MBytes */ q->drop_batch_size =64 ; q->quantum =psched_mtu (qdisc_dev (sch)); - q->perturbation =prandom_u32 (); +get_random_bytes (&q->perturbation,sizeof (q->perturbation));INIT_LIST_HEAD (&q->new_flows);INIT_LIST_HEAD (&q->old_flows);codel_params_init (&q->cparams);
net/sched/sch_hhf.c +4 -4
@@ -4,11 +4,11 @@* Copyright (C) 2013 Nandita Dukkipati <[email protected]> */ -#include <linux/jhash.h> #include <linux/jiffies.h> #include <linux/module.h> #include <linux/skbuff.h> #include <linux/vmalloc.h> +#include <linux/siphash.h> #include <net/pkt_sched.h> #include <net/sock.h>
@@ -125,7 +125,7 @@ struct wdrr_bucket {struct hhf_sched_data {struct wdrr_bucket buckets[WDRR_BUCKET_CNT ]; -u32 perturbation;/* hash perturbation */ +siphash_key_t perturbation;/* hash perturbation */ u32 quantum;/* psched_mtu(qdisc_dev(sch)); */ u32 drop_overlimit;/* number of times max qdisc packet * limit was hit
@@ -263,7 +263,7 @@ static enum wdrr_bucket_idx hhf_classify(struct sk_buff *skb, struct Qdisc *sch) }/* Get hashed flow-id of the skb. */ - hash =skb_get_hash_perturb (skb, q->perturbation); + hash =skb_get_hash_perturb (skb, &q->perturbation);/* Check if this packet belongs to an already established HH flow. */ flow_pos = hash &HHF_BIT_MASK ;
@@ -593,7 +593,7 @@ static int hhf_init(struct Qdisc *sch, struct nlattr *opt) sch->limit =1000 ; q->quantum =psched_mtu (qdisc_dev (sch)); - q->perturbation =prandom_u32 (); +get_random_bytes (&q->perturbation,sizeof (q->perturbation));INIT_LIST_HEAD (&q->new_buckets);INIT_LIST_HEAD (&q->old_buckets);
net/sched/sch_sfb.c +7 -6
@@ -22,7 +22,7 @@#include <linux/errno.h> #include <linux/skbuff.h> #include <linux/random.h> -#include <linux/jhash.h> +#include <linux/siphash.h> #include <net/ip.h> #include <net/pkt_sched.h> #include <net/inet_ecn.h>
@@ -48,7 +48,7 @@ struct sfb_bucket {* (Section 4.4 of SFB reference : moving hash functions) */ struct sfb_bins { -u32 perturbation;/* jhash perturbation */ +siphash_key_t perturbation;/* siphash key */ struct sfb_bucket bins[SFB_LEVELS ][SFB_NUMBUCKETS ]; };
@@ -219,7 +219,8 @@ static u32 sfb_compute_qlen(u32 *prob_r, u32 *avgpm_r, const struct sfb_sched_dastatic void sfb_init_perturbation (u32 slot,struct sfb_sched_data *q) { - q->bins[slot].perturbation =prandom_u32 (); +get_random_bytes (&q->bins[slot].perturbation, +sizeof (q->bins[slot].perturbation)); }static void sfb_swap_slot (struct sfb_sched_data *q)
@@ -314,9 +315,9 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,/* If using external classifiers, get result and record it. */ if (!sfb_classify (skb, fl, &ret, &salt)) goto other_drop; - sfbhash =jhash_1word (salt, q->bins[slot].perturbation); + sfbhash =siphash_1u32 (salt, &q->bins[slot].perturbation); }else { - sfbhash =skb_get_hash_perturb (skb, q->bins[slot].perturbation); + sfbhash =skb_get_hash_perturb (skb, &q->bins[slot].perturbation); }
@@ -352,7 +353,7 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,/* Inelastic flow */ if (q->double_buffering) { sfbhash =skb_get_hash_perturb (skb, - q->bins[slot].perturbation); + &q->bins[slot].perturbation);if (!sfbhash) sfbhash =1 ;sfb_skb_cb (skb)->hashes[slot] = sfbhash;
net/sched/sch_sfq.c +8 -6
@@ -18,7 +18,7 @@#include <linux/errno.h> #include <linux/init.h> #include <linux/skbuff.h> -#include <linux/jhash.h> +#include <linux/siphash.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include <net/netlink.h>
@@ -120,7 +120,7 @@ struct sfq_sched_data {u8 headdrop;u8 maxdepth;/* limit of packets per flow */ -u32 perturbation; +siphash_key_t perturbation;u8 cur_depth;/* depth of longest slot */ u8 flags;unsigned short scaled_quantum;/* SFQ_ALLOT_SIZE(quantum) */
@@ -158,7 +158,7 @@ static inline struct sfq_head *sfq_dep_head(struct sfq_sched_data *q, sfq_indexstatic unsigned int sfq_hash (const struct sfq_sched_data *q,const struct sk_buff *skb) { -return skb_get_hash_perturb (skb, q->perturbation) & (q->divisor -1 ); +return skb_get_hash_perturb (skb, &q->perturbation) & (q->divisor -1 ); } static unsigned int sfq_classify(struct sk_buff *skb, struct Qdisc *sch,
@@ -607,9 +607,11 @@ static void sfq_perturbation(unsigned long arg)struct Qdisc *sch = (struct Qdisc *)arg;struct sfq_sched_data *q =qdisc_priv (sch);spinlock_t *root_lock =qdisc_lock (qdisc_root_sleeping (sch)); +siphash_key_t nkey; +get_random_bytes (&nkey,sizeof (nkey));spin_lock (root_lock); - q->perturbation =prandom_u32 (); + q->perturbation = nkey;if (!q->filter_list && q->tail)sfq_rehash (sch);spin_unlock (root_lock);
@@ -681,7 +683,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)del_timer (&q->perturb_timer);if (q->perturb_period) {mod_timer (&q->perturb_timer, jiffies + q->perturb_period); - q->perturbation =prandom_u32 (); +get_random_bytes (&q->perturbation,sizeof (q->perturbation)); }sch_tree_unlock (sch);kfree (p);
@@ -737,7 +739,7 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt) q->quantum =psched_mtu (qdisc_dev (sch)); q->scaled_quantum =SFQ_ALLOT_SIZE (q->quantum); q->perturb_period =0 ; - q->perturbation =prandom_u32 (); +get_random_bytes (&q->perturbation,sizeof (q->perturbation));if (opt) {int err =sfq_change (sch, opt);
net/sctp/socket.c +1 -1
@@ -7734,7 +7734,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk, newinet->inet_rcv_saddr = inet->inet_rcv_saddr; newinet->inet_dport =htons (asoc->peer.port); newinet->pmtudisc = inet->pmtudisc; - newinet->inet_id = asoc->next_tsn ^ jiffies; + newinet->inet_id =prandom_u32 (); newinet->uc_ttl = inet->uc_ttl; newinet->mc_loop =1 ;
sound/soc/codecs/wm_adsp.c +1 -2
@@ -948,8 +948,7 @@ static unsigned int wmfw_convert_flags(unsigned int in, unsigned int len) }if (in) { -if (in &WMFW_CTL_FLAG_READABLE ) - out |= rd; + out |= rd;if (in &WMFW_CTL_FLAG_WRITEABLE ) out |= wr;if (in &WMFW_CTL_FLAG_VOLATILE )
sound/soc/rockchip/rockchip_i2s.c +1 -1
@@ -649,7 +649,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) ret =devm_snd_dmaengine_pcm_register (&pdev->dev,NULL ,0 );if (ret) {dev_err (&pdev->dev,"Could not register PCM\n" ); -return ret; + goto err_suspend; }return 0 ;
tools/perf/builtin-kmem.c +1 -0
@@ -674,6 +674,7 @@ static char *compact_gfp_flags(char *gfp_flags) new =realloc (new_flags, len +strlen (cpt) +2 );if (new ==NULL ) {free (new_flags); +free (orig_flags);return NULL ; }
tools/testing/selftests/net/reuseport_dualstack.c +2 -1
@@ -128,7 +128,7 @@ static void test(int *rcv_fds, int count, int proto) {struct epoll_event ev;int epfd, i, test_fd; -uint16_t test_family; +int test_family;socklen_t len; epfd =epoll_create (1 );
@@ -145,6 +145,7 @@ static void test(int *rcv_fds, int count, int proto)send_from_v4 (proto); test_fd =receive_once (epfd, proto); + len =sizeof (test_family);if (getsockopt (test_fd,SOL_SOCKET ,SO_DOMAIN , &test_family, &len))error (1 , errno,"failed to read socket domain" );if (test_family !=AF_INET )