5.4.8-stable review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 173/191 sit: do not confirm neighbor when do pmtu update
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 4d42df46d6372ece4cb4279870b46c2ea7304a47 ]
When do IPv6 tunnel PMTU update and calls __ip6_rt_update_pmtu() in the end, we should not call dst_confirm_neigh() as there is no two-way communication.
v5: No change.
v4: No change.
v3: Do not remove dst_confirm_neigh, but add a new bool parameter in
dst_ops.update_pmtu to control whether we should do neighbor confirm. Also split the big patch to small ones for each area.
v2: Remove dst_confirm_neigh in __ip6_rt_update_pmtu.
--- net/ipv6/sit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/sit.c +1 -1
@@ -944,7 +944,7 @@ static netdev_tx_t ipip6_tunnel_xmit(str }if (tunnel->parms.iph.daddr) -skb_dst_update_pmtu (skb, mtu); +skb_dst_update_pmtu_no_confirm (skb, mtu);if (skb->len > mtu && !skb_is_gso (skb)) {icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu);
Greg Kroah-Hartman
maintainerPATCH 186/191 ipv6/addrconf: only check invalid header values when NETLINK_F_STRICT_CHK is set
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 2beb6d2901a3f73106485d560c49981144aeacb1 ]
In commit 4b1373de73a3 ("net: ipv6: addr: perform strict checks also for doit handlers") we add strict check for inet6_rtm_getaddr(). But we did the invalid header values check before checking if NETLINK_F_STRICT_CHK is set. This may break backwards compatibility if user already set the ifm->ifa_prefixlen, ifm->ifa_flags, ifm->ifa_scope in their netlink code.
I didn't move the nlmsg_len check because I thought it's a valid check.
--- net/ipv6/addrconf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/ipv6/addrconf.c +4 -4
@@ -5231,16 +5231,16 @@ static int inet6_rtm_valid_getaddr_req(sreturn -EINVAL ; } +if (!netlink_strict_get_check (skb)) +return nlmsg_parse_deprecated (nlh,sizeof (*ifm), tb,IFA_MAX , + ifa_ipv6_policy, extack); + ifm =nlmsg_data (nlh);if (ifm->ifa_prefixlen || ifm->ifa_flags || ifm->ifa_scope) {NL_SET_ERR_MSG_MOD (extack,"Invalid values in header for get address request" );return -EINVAL ; } -if (!netlink_strict_get_check (skb)) -return nlmsg_parse_deprecated (nlh,sizeof (*ifm), tb,IFA_MAX , - ifa_ipv6_policy, extack); - err =nlmsg_parse_deprecated_strict (nlh,sizeof (*ifm), tb,IFA_MAX , ifa_ipv6_policy, extack);if (err)
Greg Kroah-Hartman
maintainerPATCH 185/191 bnxt: apply computed clamp value for coalece parameter
In reply to Greg Kroah-HartmanFrom: Jonathan Lemon <[email protected]>
[ Upstream commit 6adc4601c2a1ac87b4ab8ed0cb55db6efd0264e8 ]
After executing "ethtool -C eth0 rx-usecs-irq 0", the box becomes unresponsive, likely due to interrupt livelock. It appears that a minimum clamp value for the irq timer is computed, but is never applied.
Fix by applying the corrected clamp value.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -6178,7 +6178,7 @@ static void bnxt_hwrm_set_coal_params(st tmr =bnxt_usec_to_coal_tmr (bp, hw_coal->coal_ticks_irq); val =clamp_t (u16, tmr,1 , coal_cap->cmpl_aggr_dma_tmr_during_int_max); - req->cmpl_aggr_dma_tmr_during_int =cpu_to_le16 (tmr); + req->cmpl_aggr_dma_tmr_during_int =cpu_to_le16 (val); req->enables |=cpu_to_le16 (BNXT_COAL_CMPL_AGGR_TMR_DURING_INT_ENABLE ); }
Greg Kroah-Hartman
maintainerPATCH 184/191 gtp: do not allow adding duplicate tid and ms_addr pdp context
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
[ Upstream commit 6b01b1d9b2d38dc84ac398bfe9f00baff06a31e5 ]
GTP RX packet path lookups pdp context with TID. If duplicate TID pdp contexts are existing in the list, it couldn't select correct pdp context. So, TID value should be unique.
GTP TX packet path lookups pdp context with ms_addr. If duplicate ms_addr pdp contexts are existing in the list, it couldn't select correct pdp context. So, ms_addr value should be unique.
--- drivers/net/gtp.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
drivers/net/gtp.c +22 -10
@@ -928,24 +928,31 @@ static void ipv4_pdp_fill(struct pdp_ctx } } -static int ipv4_pdp_add (struct gtp_dev *gtp,struct sock *sk, -struct genl_info *info) +static int gtp_pdp_add (struct gtp_dev *gtp,struct sock *sk, +struct genl_info *info) { +struct pdp_ctx *pctx, *pctx_tid =NULL ;struct net_device *dev = gtp->dev;u32 hash_ms, hash_tid =0 ; -struct pdp_ctx *pctx; +unsigned int version;bool found = false;__be32 ms_addr; ms_addr =nla_get_be32 (info->attrs[GTPA_MS_ADDRESS ]); hash_ms =ipv4_hashfn (ms_addr) % gtp->hash_size; + version =nla_get_u32 (info->attrs[GTPA_VERSION ]); -hlist_for_each_entry_rcu (pctx, >p->addr_hash[hash_ms], hlist_addr) { -if (pctx->ms_addr_ip4.s_addr == ms_addr) { - found = true; -break ; - } - } + pctx =ipv4_pdp_find (gtp, ms_addr); +if (pctx) + found = true; +if (version ==GTP_V0 ) + pctx_tid =gtp0_pdp_find (gtp, +nla_get_u64 (info->attrs[GTPA_TID ])); +else if (version ==GTP_V1 ) + pctx_tid =gtp1_pdp_find (gtp, +nla_get_u32 (info->attrs[GTPA_I_TEI ])); +if (pctx_tid) + found = true;if (found) {if (info->nlhdr->nlmsg_flags &NLM_F_EXCL )
@@ -953,6 +960,11 @@ static int ipv4_pdp_add(struct gtp_dev *if (info->nlhdr->nlmsg_flags &NLM_F_REPLACE )return -EOPNOTSUPP ; +if (pctx && pctx_tid) +return -EEXIST ; +if (!pctx) + pctx = pctx_tid; +ipv4_pdp_fill (pctx, info);if (pctx->gtp_version ==GTP_V0 )
@@ -1076,7 +1088,7 @@ static int gtp_genl_new_pdp(struct sk_bu goto out_unlock; } - err =ipv4_pdp_add (gtp, sk, info); + err =gtp_pdp_add (gtp, sk, info); out_unlock:rcu_read_unlock ();
Greg Kroah-Hartman
maintainerPATCH 188/191 net: ena: fix napi handler misbehavior when the napi budget is zero
In reply to Greg Kroah-HartmanFrom: Netanel Belgazal <[email protected]>
[ Upstream commit 24dee0c7478d1a1e00abdf5625b7f921467325dc ]
In netpoll the napi handler could be called with budget equal to zero. Current ENA napi handler doesn't take that into consideration.
The napi handler handles Rx packets in a do-while loop. Currently, the budget check happens only after decrementing the budget, therefore the napi handler, in rare cases, could run over MAX_INT packets.
In addition to that, this moves all budget related variables to int calculation and stop mixing u32 to avoid ambiguity
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +7 -3
@@ -1238,8 +1238,8 @@ static int ena_io_poll(struct napi_struc struct ena_napi *ena_napi = container_of(napi, struct ena_napi, napi);struct ena_ring *tx_ring, *rx_ring; -u32 tx_work_done; -u32 rx_work_done; +int tx_work_done; +int rx_work_done =0 ;int tx_budget;int napi_comp_call =0 ;int ret;
@@ -1256,7 +1256,11 @@ static int ena_io_poll(struct napi_struc } tx_work_done =ena_clean_tx_irq (tx_ring, tx_budget); - rx_work_done =ena_clean_rx_irq (rx_ring, napi, budget); +/* On netpoll the budget is zero and the handler should only clean the +* tx completions. +*/ +if (likely (budget)) + rx_work_done =ena_clean_rx_irq (rx_ring, napi, budget);/* If the device is about to reset or down, avoid unmask * the interrupt and return 0 so NAPI won't reschedule
Greg Kroah-Hartman
maintainerPATCH 187/191 net: phylink: fix interface passed to mac_link_up
In reply to Greg Kroah-HartmanFrom: Russell King <[email protected]>
[ Upstream commit 9b2079c046a9d6c9c73a4ec33816678565ee01f3 ]
A mismerge between the following two commits:
c678726305b9 ("net: phylink: ensure consistent phy interface mode") 27755ff88c0e ("net: phylink: Add phylink_mac_link_{up, down} wrapper functions")
resulted in the wrong interface being passed to the mac_link_up() function. Fix this up.
--- drivers/net/phy/phylink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/phy/phylink.c +1 -2
@@ -444,8 +444,7 @@ static void phylink_mac_link_up(struct p pl->cur_interface = link_state.interface; pl->ops->mac_link_up (pl->config, pl->link_an_mode, - pl->phy_state.interface, - pl->phydev); + pl->cur_interface, pl->phydev);if (ndev)netif_carrier_on (ndev);
Greg Kroah-Hartman
maintainerPATCH 148/191 net: dsa: bcm_sf2: Fix IP fragment location and behavior
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 7c3125f0a6ebc17846c5908ad7d6056d66c1c426 ]
The IP fragment is specified through user-defined field as the first bit of the first user-defined word. We were previously trying to extract it from the user-defined mask which could not possibly work. The ip_frag is also supposed to be a boolean, if we do not cast it as such, we risk overwriting the next fields in CFP_DATA(6) which would render the rule inoperative.
--- drivers/net/dsa/bcm_sf2_cfp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/dsa/bcm_sf2_cfp.c +3 -3
@@ -358,7 +358,7 @@ static int bcm_sf2_cfp_ipv4_rule_set(strreturn -EINVAL ; } - ip_frag =be32_to_cpu (fs->m_ext.data[0 ]); + ip_frag = !!(be32_to_cpu (fs->h_ext.data[0 ]) &1 );/* Locate the first rule available */ if (fs->location ==RX_CLS_LOC_ANY )
@@ -569,7 +569,7 @@ static int bcm_sf2_cfp_rule_cmp(struct bif (rule->fs.flow_type != fs->flow_type || rule->fs.ring_cookie != fs->ring_cookie || - rule->fs.m_ext.data[0 ] != fs->m_ext.data[0 ]) + rule->fs.h_ext.data[0 ] != fs->h_ext.data[0 ])continue ;switch (fs->flow_type & ~FLOW_EXT ) {
@@ -621,7 +621,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(strreturn -EINVAL ; } - ip_frag =be32_to_cpu (fs->m_ext.data[0 ]); + ip_frag = !!(be32_to_cpu (fs->h_ext.data[0 ]) &1 ); layout = &udf_tcpip6_layout; slice_num =bcm_sf2_get_slice_number (layout,0 );
Greg Kroah-Hartman
maintainerPATCH 145/191 drm: limit to INT_MAX in create_blob ioctl
In reply to Greg Kroah-HartmanFrom: Daniel Vetter <[email protected]>
commit 5bf8bec3f4ce044a223c40cbce92590d938f0e9c upstream.
The hardened usercpy code is too paranoid ever since commit 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes")
Code itself should have been fine as-is.
--- drivers/gpu/drm/drm_property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_property.c +1 -1
@@ -561,7 +561,7 @@ drm_property_create_blob(struct drm_devistruct drm_property_blob *blob;int ret; -if (!length || length >ULONG_MAX -sizeof (struct drm_property_blob )) +if (!length || length >INT_MAX -sizeof (struct drm_property_blob ))return ERR_PTR (-EINVAL ); blob =kvzalloc (sizeof (struct drm_property_blob )+length,GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 169/191 gtp: do not confirm neighbor when do pmtu update
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 6e9105c73f8d2163d12d5dfd762fd75483ed30f5 ]
When do IPv6 tunnel PMTU update and calls __ip6_rt_update_pmtu() in the end, we should not call dst_confirm_neigh() as there is no two-way communication.
Although GTP only support ipv4 right now, and __ip_rt_update_pmtu() does not call dst_confirm_neigh(), we still set it to false to keep consistency with IPv6 code.
v5: No change.
v4: No change.
v3: Do not remove dst_confirm_neigh, but add a new bool parameter in
dst_ops.update_pmtu to control whether we should do neighbor confirm. Also split the big patch to small ones for each area.
v2: Remove dst_confirm_neigh in __ip6_rt_update_pmtu.
--- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/gtp.c +1 -1
@@ -541,7 +541,7 @@ static int gtp_build_skb_ip4(struct sk_b mtu =dst_mtu (&rt->dst); } - rt->dst.ops->update_pmtu (&rt->dst,NULL , skb, mtu, true); + rt->dst.ops->update_pmtu (&rt->dst,NULL , skb, mtu, false);if (!skb_is_gso (skb) && (iph->frag_off &htons (IP_DF )) && mtu <ntohs (iph->tot_len)) {
Greg Kroah-Hartman
maintainerPATCH 164/191 bnxt_en: Add missing devlink health reporters for VFs.
In reply to Greg Kroah-HartmanFrom: Vasundhara Volam <[email protected]>
[ Upstream commit 7e334fc8003c7a38372cc98e7be6082670a47d29 ]
The VF driver also needs to create the health reporters since VFs are also involved in firmware reset and recovery. Modify bnxt_dl_register() and bnxt_dl_unregister() so that they can be called by the VFs to register/unregister devlink. Only the PF will register the devlink parameters. With devlink registered, we can now create the health reporters on the VFs.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 ++++-------- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 23 ++++++++++++++++------ 2 files changed, 22 insertions(+), 14 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +5 -8
@@ -11343,12 +11343,11 @@ static void bnxt_remove_one(struct pci_dstruct net_device *dev =pci_get_drvdata (pdev);struct bnxt *bp =netdev_priv (dev); -if (BNXT_PF (bp)) { +if (BNXT_PF (bp))bnxt_sriov_disable (bp); -bnxt_dl_fw_reporters_destroy (bp, true); -bnxt_dl_unregister (bp); - } +bnxt_dl_fw_reporters_destroy (bp, true); +bnxt_dl_unregister (bp);pci_disable_pcie_error_reporting (pdev);unregister_netdev (dev);bnxt_shutdown_tc (bp);
@@ -11844,10 +11843,8 @@ static int bnxt_init_one(struct pci_devif (rc) goto init_err_cleanup_tc; -if (BNXT_PF (bp)) { -bnxt_dl_register (bp); -bnxt_dl_fw_reporters_create (bp); - } +bnxt_dl_register (bp); +bnxt_dl_fw_reporters_create (bp); netdev_info(dev, "%s found at mem %lx, node addr %pM\n", board_info[ent->driver_data].name,
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +17 -6
@@ -226,6 +226,8 @@ static const struct devlink_ops bnxt_dl_#endif /* CONFIG_BNXT_SRIOV */ }; +static const struct devlink_ops bnxt_vf_dl_ops; +enum bnxt_dl_param_id {BNXT_DEVLINK_PARAM_ID_BASE =DEVLINK_PARAM_GENERIC_ID_MAX ,BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK ,
@@ -439,7 +441,10 @@ int bnxt_dl_register(struct bnxt *bp)return -ENOTSUPP ; } - dl =devlink_alloc (&bnxt_dl_ops,sizeof (struct bnxt_dl )); +if (BNXT_PF (bp)) + dl =devlink_alloc (&bnxt_dl_ops,sizeof (struct bnxt_dl )); +else + dl =devlink_alloc (&bnxt_vf_dl_ops,sizeof (struct bnxt_dl ));if (!dl) {netdev_warn (bp->dev,"devlink_alloc failed" );return -ENOMEM ;
@@ -458,6 +463,9 @@ int bnxt_dl_register(struct bnxt *bp) goto err_dl_free; } +if (!BNXT_PF (bp)) +return 0 ; + rc =devlink_params_register (dl, bnxt_dl_params,ARRAY_SIZE (bnxt_dl_params));if (rc) {
@@ -507,11 +515,14 @@ void bnxt_dl_unregister(struct bnxt *bp)if (!dl)return ; -devlink_port_params_unregister (&bp->dl_port, bnxt_dl_port_params, -ARRAY_SIZE (bnxt_dl_port_params)); -devlink_port_unregister (&bp->dl_port); -devlink_params_unregister (dl, bnxt_dl_params, -ARRAY_SIZE (bnxt_dl_params)); +if (BNXT_PF (bp)) { +devlink_port_params_unregister (&bp->dl_port, + bnxt_dl_port_params, +ARRAY_SIZE (bnxt_dl_port_params)); +devlink_port_unregister (&bp->dl_port); +devlink_params_unregister (dl, bnxt_dl_params, +ARRAY_SIZE (bnxt_dl_params)); + }devlink_unregister (dl);devlink_free (dl); }
Greg Kroah-Hartman
maintainerPATCH 161/191 bnxt_en: Fix bp->fw_health allocation and free logic.
In reply to Greg Kroah-HartmanFrom: Vasundhara Volam <[email protected]>
[ Upstream commit 8280b38e01f71e0f89389ccad3fa43b79e57c604 ]
bp->fw_health needs to be allocated for either the firmware initiated reset feature or the driver initiated error recovery feature. The current code is not allocating bp->fw_health for all the necessary cases. This patch corrects the logic to allocate bp->fw_health correctly when needed. If allocation fails, we clear the feature flags.
We also add the the missing kfree(bp->fw_health) when the driver is unloaded. If we get an async reset message from the firmware, we also need to make sure that we have a valid bp->fw_health before proceeding.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 36 +++++++++++++++++++++--------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 2 files changed, 27 insertions(+), 10 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +26 -10
@@ -1995,6 +1995,9 @@ static int bnxt_async_event_process(strucase ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY : {u32 data1 =le32_to_cpu (cmpl->event_data1); +if (!bp->fw_health) + goto async_event_process_exit; + bp->fw_reset_timestamp = jiffies; bp->fw_reset_min_dsecs = cmpl->timestamp_lo;if (!bp->fw_reset_min_dsecs)
@@ -4438,8 +4441,9 @@ static int bnxt_hwrm_func_drv_rgtr(struc FUNC_DRV_RGTR_REQ_ENABLES_VER); req.os_type =cpu_to_le16 (FUNC_DRV_RGTR_REQ_OS_TYPE_LINUX ); - flags =FUNC_DRV_RGTR_REQ_FLAGS_16BIT_VER_MODE | -FUNC_DRV_RGTR_REQ_FLAGS_HOT_RESET_SUPPORT ; + flags =FUNC_DRV_RGTR_REQ_FLAGS_16BIT_VER_MODE ; +if (bp->fw_cap &BNXT_FW_CAP_HOT_RESET ) + flags |=FUNC_DRV_RGTR_REQ_FLAGS_HOT_RESET_SUPPORT ;if (bp->fw_cap &BNXT_FW_CAP_ERROR_RECOVERY ) flags |=FUNC_DRV_RGTR_REQ_FLAGS_ERROR_RECOVERY_SUPPORT ; req.flags =cpu_to_le32 (flags);
@@ -7096,14 +7100,6 @@ static int bnxt_hwrm_error_recovery_qcfg rc =_hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );if (rc) goto err_recovery_out; -if (!fw_health) { - fw_health =kzalloc (sizeof (*fw_health),GFP_KERNEL ); - bp->fw_health = fw_health; -if (!fw_health) { - rc = -ENOMEM ; - goto err_recovery_out; - } - } fw_health->flags =le32_to_cpu (resp->flags);if ((fw_health->flags &ERROR_RECOVERY_QCFG_RESP_FLAGS_CO_CPU ) && !(bp->fw_cap &BNXT_FW_CAP_KONG_MB_CHNL )) {
@@ -10419,6 +10415,23 @@ static void bnxt_init_dflt_coal(struct b bp->stats_coal_ticks =BNXT_DEF_STATS_COAL_TICKS ; } +static void bnxt_alloc_fw_health (struct bnxt *bp) +{ +if (bp->fw_health) +return ; + +if (!(bp->fw_cap &BNXT_FW_CAP_HOT_RESET ) && + !(bp->fw_cap &BNXT_FW_CAP_ERROR_RECOVERY )) +return ; + + bp->fw_health =kzalloc (sizeof (*bp->fw_health),GFP_KERNEL ); +if (!bp->fw_health) { +netdev_warn (bp->dev,"Failed to allocate fw_health\n" ); + bp->fw_cap &= ~BNXT_FW_CAP_HOT_RESET ; + bp->fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY ; + } +} +static int bnxt_fw_init_one_p1 (struct bnxt *bp) {int rc;
@@ -10465,6 +10478,7 @@ static int bnxt_fw_init_one_p2(struct bnnetdev_warn (bp->dev,"hwrm query adv flow mgnt failure rc: %d\n" , rc); +bnxt_alloc_fw_health (bp); rc =bnxt_hwrm_error_recovery_qcfg (bp);if (rc) netdev_warn(bp->dev, "hwrm query error recovery failure rc: %d\n",
@@ -11344,6 +11358,8 @@ static void bnxt_remove_one(struct pci_dbnxt_dcb_free (bp);kfree (bp->edev); bp->edev =NULL ; +kfree (bp->fw_health); + bp->fw_health =NULL ;bnxt_cleanup_pci (bp);bnxt_free_ctx_mem (bp);kfree (bp->ctx);
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -0
@@ -1658,6 +1658,7 @@ struct bnxt {#define BNXT_FW_CAP_PCIE_STATS_SUPPORTED 0x00020000#define BNXT_FW_CAP_EXT_STATS_SUPPORTED 0x00040000#define BNXT_FW_CAP_ERR_RECOVER_RELOAD 0x00100000 +#define BNXT_FW_CAP_HOT_RESET 0x00200000#define BNXT_NEW_RM (bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM)u32 hwrm_spec_code;
Greg Kroah-Hartman
maintainerPATCH 158/191 bnxt_en: Fix MSIX request logic for RDMA driver.
In reply to Greg Kroah-HartmanFrom: Michael Chan <[email protected]>
[ Upstream commit 0c722ec0a289c7f6b53f89bad1cfb7c4db3f7a62 ]
The logic needs to check both bp->total_irqs and the reserved IRQs in hw_resc->resv_irqs if applicable and see if both are enough to cover the L2 and RDMA requested vectors. The current code is only checking bp->total_irqs and can fail in some code paths, such as the TX timeout code path with the RDMA driver requesting vectors after recovery. In this code path, we have not reserved enough MSIX resources for the RDMA driver yet.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +6 -2
@@ -113,8 +113,10 @@ static int bnxt_req_msix_vecs(struct bnx {struct net_device *dev = edev->net;struct bnxt *bp =netdev_priv (dev); +struct bnxt_hw_resc *hw_resc;int max_idx, max_cp_rings;int avail_msix, idx; +int total_vecs;int rc =0 ;ASSERT_RTNL ();
@@ -142,7 +144,10 @@ static int bnxt_req_msix_vecs(struct bnx } edev->ulp_tbl[ulp_id].msix_base = idx; edev->ulp_tbl[ulp_id].msix_requested = avail_msix; -if (bp->total_irqs < (idx + avail_msix)) { + hw_resc = &bp->hw_resc; + total_vecs = idx + avail_msix; +if (bp->total_irqs < total_vecs || + (BNXT_NEW_RM (bp) && hw_resc->resv_irqs < total_vecs)) {if (netif_running (dev)) {bnxt_close_nic (bp, true, false); rc =bnxt_open_nic (bp, true, false);
@@ -156,7 +161,6 @@ static int bnxt_req_msix_vecs(struct bnx }if (BNXT_NEW_RM (bp)) { -struct bnxt_hw_resc *hw_resc = &bp->hw_resc;int resv_msix; resv_msix = hw_resc->resv_irqs - bp->cp_nr_rings;
Greg Kroah-Hartman
maintainerPATCH 157/191 udp: fix integer overflow while computing available space in sk_rcvbuf
In reply to Greg Kroah-HartmanFrom: Antonio Messina <[email protected]>
[ Upstream commit feed8a4fc9d46c3126fb9fcae0e9248270c6321a ]
When the size of the receive buffer for a socket is close to 2^31 when computing if we have enough space in the buffer to copy a packet from the queue to the buffer we might hit an integer overflow.
When an user set net.core.rmem_default to a value close to 2^31 UDP packets are dropped because of this overflow. This can be visible, for instance, with failure to resolve hostnames.
This can be fixed by casting sk_rcvbuf (which is an int) to unsigned int, similarly to how it is done in TCP.
--- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/udp.c +1 -1
@@ -1475,7 +1475,7 @@ int __udp_enqueue_schedule_skb(struct so* queue contains some other skb */ rmem =atomic_add_return (size, &sk->sk_rmem_alloc); -if (rmem > (size + sk->sk_rcvbuf)) +if (rmem > (size + (unsigned int )sk->sk_rcvbuf)) goto uncharge_drop;spin_lock (&list->lock);
Greg Kroah-Hartman
maintainerPATCH 113/191 cdrom: respect device capabilities during opening action
In reply to Greg Kroah-HartmanFrom: Diego Elio Pettenò <[email protected]>
[ Upstream commit 366ba7c71ef77c08d06b18ad61b26e2df7352338 ]
Reading the TOC only works if the device can play audio, otherwise these commands fail (and possibly bring the device to an unhealthy state.)
Similarly, cdrom_mmc3_profile() should only be called if the device supports generic packet commands.
To: Jens Axboe <[email protected]>
--- drivers/cdrom/cdrom.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/cdrom/cdrom.c +11 -1
@@ -996,6 +996,12 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype *tracks) tracks->xa =0 ; tracks->error =0 ;cd_dbg (CD_COUNT_TRACKS ,"entering cdrom_count_tracks\n" ); + +if (!CDROM_CAN (CDC_PLAY_AUDIO )) { + tracks->error =CDS_NO_INFO ; +return ; + } +/* Grab the TOC header so we can see how many tracks there are */ ret = cdi->ops->audio_ioctl (cdi,CDROMREADTOCHDR , &header);if (ret) {
@@ -1162,7 +1168,8 @@ int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, ret =open_for_data (cdi);if (ret) goto err; -cdrom_mmc3_profile (cdi); +if (CDROM_CAN (CDC_GENERIC_PACKET )) +cdrom_mmc3_profile (cdi);if (mode &FMODE_WRITE ) { ret = -EROFS ;if (cdrom_open_write (cdi))
@@ -2882,6 +2889,9 @@ int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written)it doesn't give enough information or fails. then we return the toc contents. */ use_toc: +if (!CDROM_CAN (CDC_PLAY_AUDIO )) +return -ENOSYS ; + toc.cdte_format =CDROM_MSF ; toc.cdte_track =CDROM_LEADOUT ;if ((ret = cdi->ops->audio_ioctl (cdi,CDROMREADTOCENTRY , &toc)))
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 142/191 hrtimer: Annotate lockless access to timer->state
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 56144737e67329c9aaed15f942d46a6302e2e3d8 upstream.
syzbot reported various data-race caused by hrtimer_is_queued() reading timer->state. A READ_ONCE() is required there to silence the warning.
Also add the corresponding WRITE_ONCE() when timer->state is set.
In remove_hrtimer() the hrtimer_is_queued() helper is open coded to avoid loading timer->state twice.
KCSAN reported these cases:
BUG: KCSAN: data-race in __remove_hrtimer / tcp_pacing_check
write to 0xffff8880b2a7d388 of 1 bytes by interrupt on cpu 0:
__remove_hrtimer+0x52/0x130 kernel/time/hrtimer.c:991 __run_hrtimer kernel/time/hrtimer.c:1496 [inline] __hrtimer_run_queues+0x250/0x600 kernel/time/hrtimer.c:1576 hrtimer_run_softirq+0x10e/0x150 kernel/time/hrtimer.c:1593 __do_softirq+0x115/0x33f kernel/softirq.c:292 run_ksoftirqd+0x46/0x60 kernel/softirq.c:603 smpboot_thread_fn+0x37d/0x4a0 kernel/smpboot.c:165 kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
read to 0xffff8880b2a7d388 of 1 bytes by task 24652 on cpu 1:
tcp_pacing_check net/ipv4/tcp_output.c:2235 [inline] tcp_pacing_check+0xba/0x130 net/ipv4/tcp_output.c:2225 tcp_xmit_retransmit_queue+0x32c/0x5a0 net/ipv4/tcp_output.c:3044 tcp_xmit_recovery+0x7c/0x120 net/ipv4/tcp_input.c:3558 tcp_ack+0x17b6/0x3170 net/ipv4/tcp_input.c:3717 tcp_rcv_established+0x37e/0xf50 net/ipv4/tcp_input.c:5696 tcp_v4_do_rcv+0x381/0x4e0 net/ipv4/tcp_ipv4.c:1561 sk_backlog_rcv include/net/sock.h:945 [inline] __release_sock+0x135/0x1e0 net/core/sock.c:2435 release_sock+0x61/0x160 net/core/sock.c:2951 sk_stream_wait_memory+0x3d7/0x7c0 net/core/stream.c:145 tcp_sendmsg_locked+0xb47/0x1f30 net/ipv4/tcp.c:1393 tcp_sendmsg+0x39/0x60 net/ipv4/tcp.c:1434 inet_sendmsg+0x6d/0x90 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0x9f/0xc0 net/socket.c:657 BUG: KCSAN: data-race in __remove_hrtimer / __tcp_ack_snd_check
write to 0xffff8880a3a65588 of 1 bytes by interrupt on cpu 0:
__remove_hrtimer+0x52/0x130 kernel/time/hrtimer.c:991 __run_hrtimer kernel/time/hrtimer.c:1496 [inline] __hrtimer_run_queues+0x250/0x600 kernel/time/hrtimer.c:1576 hrtimer_run_softirq+0x10e/0x150 kernel/time/hrtimer.c:1593 __do_softirq+0x115/0x33f kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0xbb/0xe0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830
read to 0xffff8880a3a65588 of 1 bytes by task 22891 on cpu 1:
__tcp_ack_snd_check+0x415/0x4f0 net/ipv4/tcp_input.c:5265 tcp_ack_snd_check net/ipv4/tcp_input.c:5287 [inline] tcp_rcv_established+0x750/0xf50 net/ipv4/tcp_input.c:5708 tcp_v4_do_rcv+0x381/0x4e0 net/ipv4/tcp_ipv4.c:1561 sk_backlog_rcv include/net/sock.h:945 [inline] __release_sock+0x135/0x1e0 net/core/sock.c:2435 release_sock+0x61/0x160 net/core/sock.c:2951 sk_stream_wait_memory+0x3d7/0x7c0 net/core/stream.c:145 tcp_sendmsg_locked+0xb47/0x1f30 net/ipv4/tcp.c:1393 tcp_sendmsg+0x39/0x60 net/ipv4/tcp.c:1434 inet_sendmsg+0x6d/0x90 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0x9f/0xc0 net/socket.c:657 __sys_sendto+0x21f/0x320 net/socket.c:1952 __do_sys_sendto net/socket.c:1964 [inline] __se_sys_sendto net/socket.c:1960 [inline] __x64_sys_sendto+0x89/0xb0 net/socket.c:1960 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 24652 Comm: syz-executor.3 Not tainted 5.4.0-rc3+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
[ tglx: Added comments ]
--- include/linux/hrtimer.h | 14 ++++++++++---- kernel/time/hrtimer.c | 11 +++++++---- 2 files changed, 17 insertions(+), 8 deletions(-)
include/linux/hrtimer.h +10 -4
@@ -456,12 +456,18 @@ extern u64 hrtimer_next_event_without(coextern bool hrtimer_active (const struct hrtimer *timer); -/* -* Helper function to check, whether the timer is on one of the queues +/** +* hrtimer_is_queued = check, whether the timer is on one of the queues +* @timer: Timer to check +* +* Returns: True if the timer is queued, false otherwise +* +* The function can be used lockless, but it gives only a current snapshot. */ -static inline int hrtimer_is_queued (struct hrtimer *timer) +static inline bool hrtimer_is_queued (struct hrtimer *timer) { -return timer->state &HRTIMER_STATE_ENQUEUED ; +/* The READ_ONCE pairs with the update functions of timer->state */ +return !!(READ_ONCE (timer->state) &HRTIMER_STATE_ENQUEUED ); }/*
kernel/time/hrtimer.c +7 -4
@@ -966,7 +966,8 @@ static int enqueue_hrtimer(struct hrtime base->cpu_base->active_bases |=1 << base->index; - timer->state =HRTIMER_STATE_ENQUEUED ; +/* Pairs with the lockless read in hrtimer_is_queued() */ +WRITE_ONCE (timer->state,HRTIMER_STATE_ENQUEUED );return timerqueue_add (&base->active, &timer->node); }
@@ -988,7 +989,8 @@ static void __remove_hrtimer(struct hrtistruct hrtimer_cpu_base *cpu_base = base->cpu_base;u8 state = timer->state; - timer->state = newstate; +/* Pairs with the lockless read in hrtimer_is_queued() */ +WRITE_ONCE (timer->state, newstate);if (!(state &HRTIMER_STATE_ENQUEUED ))return ;
@@ -1013,8 +1015,9 @@ static void __remove_hrtimer(struct hrtistatic inline int remove_hrtimer (struct hrtimer *timer,struct hrtimer_clock_base *base,bool restart) { -if (hrtimer_is_queued (timer)) { -u8 state = timer->state; +u8 state = timer->state; + +if (state &HRTIMER_STATE_ENQUEUED ) {int reprogram;/*
Greg Kroah-Hartman
maintainerPATCH 151/191 net/sched: act_mirred: Pull mac prior redir to non mac_header_xmit device
In reply to Greg Kroah-HartmanFrom: Shmulik Ladkani <[email protected]>
[ Upstream commit 70cf3dc7313207816255b9acb0dffb19dae78144 ]
There's no skb_pull performed when a mirred action is set at egress of a mac device, with a target device/action that expects skb->data to point at the network header.
As a result, either the target device is errornously given an skb with data pointing to the mac (egress case), or the net stack receives the skb with data pointing to the mac (ingress case).
E.g:
# tc qdisc add dev eth9 root handle 1: prio # tc filter add dev eth9 parent 1: prio 9 protocol ip handle 9 basic \ action mirred egress redirect dev tun0
(tun0 is a tun device. result: tun0 errornously gets the eth header
instead of the iph)
Revise the push/pull logic of tcf_mirred_act() to not rely on the skb_at_tc_ingress() vs tcf_mirred_act_wants_ingress() comparison, as it does not cover all "pull" cases.
Instead, calculate whether the required action on the target device requires the data to point at the network header, and compare this to whether skb->data points to network header - and make the push/pull adjustments as necessary.
--- net/sched/act_mirred.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
net/sched/act_mirred.c +12 -10
@@ -219,8 +219,10 @@ static int tcf_mirred_act(struct sk_buffbool use_reinsert;bool want_ingress;bool is_redirect; +bool expects_nh;int m_eaction;int mac_len; +bool at_nh; rec_level =__this_cpu_inc_return (mirred_rec_level);if (unlikely (rec_level >MIRRED_RECURSION_LIMIT )) {
@@ -261,19 +263,19 @@ static int tcf_mirred_act(struct sk_buff goto out; } -/* If action's target direction differs than filter's direction, -* and devices expect a mac header on xmit, then mac push/pull is -* needed. -*/ want_ingress =tcf_mirred_act_wants_ingress (m_eaction); -if (skb_at_tc_ingress (skb) != want_ingress && m_mac_header_xmit) { -if (!skb_at_tc_ingress (skb)) { -/* caught at egress, act ingress: pull mac */ - mac_len =skb_network_header (skb) -skb_mac_header (skb); + + expects_nh = want_ingress || !m_mac_header_xmit; + at_nh = skb->data ==skb_network_header (skb); +if (at_nh != expects_nh) { + mac_len =skb_at_tc_ingress (skb) ? skb->mac_len : +skb_network_header (skb) -skb_mac_header (skb); +if (expects_nh) { +/* target device/action expect data at nh */ skb_pull_rcsum (skb2, mac_len); }else { -/* caught at ingress, act egress: push mac */ -skb_push_rcsum (skb2, skb->mac_len); +/* target device/action expect data at mac */ +skb_push_rcsum (skb2, mac_len); } }
Greg Kroah-Hartman
maintainerPATCH 118/191 s390/zcrypt: handle new reply code FILTERED_BY_HYPERVISOR
In reply to Greg Kroah-HartmanFrom: Harald Freudenberger <[email protected]>
[ Upstream commit 6733775a92eacd612ac88afa0fd922e4ffeb2bc7 ]
This patch introduces support for a new architectured reply code 0x8B indicating that a hypervisor layer (if any) has rejected an ap message.
Linux may run as a guest on top of a hypervisor like zVM or KVM. So the crypto hardware seen by the ap bus may be restricted by the hypervisor for example only a subset like only clear key crypto requests may be supported. Other requests will be filtered out - rejected by the hypervisor. The new reply code 0x8B will appear in such cases and needs to get recognized by the ap bus and zcrypt device driver zoo.
--- drivers/s390/crypto/zcrypt_error.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/s390/crypto/zcrypt_error.h +2 -0
@@ -61,6 +61,7 @@ struct error_hdr {#define REP82_ERROR_EVEN_MOD_IN_OPND 0x85#define REP82_ERROR_RESERVED_FIELD 0x88#define REP82_ERROR_INVALID_DOMAIN_PENDING 0x8A +#define REP82_ERROR_FILTERED_BY_HYPERVISOR 0x8B#define REP82_ERROR_TRANSPORT_FAIL 0x90#define REP82_ERROR_PACKET_TRUNCATED 0xA0#define REP82_ERROR_ZERO_BUFFER_LEN 0xB0
@@ -91,6 +92,7 @@ static inline int convert_error(struct zcrypt_queue *zq,case REP82_ERROR_INVALID_DOMAIN_PRECHECK :case REP82_ERROR_INVALID_DOMAIN_PENDING :case REP82_ERROR_INVALID_SPECIAL_CMD : +case REP82_ERROR_FILTERED_BY_HYPERVISOR :// REP88_ERROR_INVALID_KEY // '82' CEX2A // REP88_ERROR_OPERAND // '84' CEX2A // REP88_ERROR_OPERAND_EVEN_MOD // '85' CEX2A
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 138/191 netfilter: bridge: make sure to pull arp header in br_nf_forward_arp()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 5604285839aaedfb23ebe297799c6e558939334d upstream.
syzbot is kind enough to remind us we need to call skb_may_pull()
BUG: KMSAN: uninit-value in br_nf_forward_arp+0xe61/0x1230 net/bridge/br_netfilter_hooks.c:665 CPU: 1 PID: 11631 Comm: syz-executor.1 Not tainted 5.4.0-rc8-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x220 lib/dump_stack.c:118 kmsan_report+0x128/0x220 mm/kmsan/kmsan_report.c:108 __msan_warning+0x64/0xc0 mm/kmsan/kmsan_instr.c:245 br_nf_forward_arp+0xe61/0x1230 net/bridge/br_netfilter_hooks.c:665 nf_hook_entry_hookfn include/linux/netfilter.h:135 [inline] nf_hook_slow+0x18b/0x3f0 net/netfilter/core.c:512 nf_hook include/linux/netfilter.h:260 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] __br_forward+0x78f/0xe30 net/bridge/br_forward.c:109 br_flood+0xef0/0xfe0 net/bridge/br_forward.c:234 br_handle_frame_finish+0x1a77/0x1c20 net/bridge/br_input.c:162 nf_hook_bridge_pre net/bridge/br_input.c:245 [inline] br_handle_frame+0xfb6/0x1eb0 net/bridge/br_input.c:348 __netif_receive_skb_core+0x20b9/0x51a0 net/core/dev.c:4830 __netif_receive_skb_one_core net/core/dev.c:4927 [inline] __netif_receive_skb net/core/dev.c:5043 [inline] process_backlog+0x610/0x13c0 net/core/dev.c:5874 napi_poll net/core/dev.c:6311 [inline] net_rx_action+0x7a6/0x1aa0 net/core/dev.c:6379 __do_softirq+0x4a1/0x83a kernel/softirq.c:293 do_softirq_own_stack+0x49/0x80 arch/x86/entry/entry_64.S:1091 </IRQ> do_softirq kernel/softirq.c:338 [inline] __local_bh_enable_ip+0x184/0x1d0 kernel/softirq.c:190 local_bh_enable+0x36/0x40 include/linux/bottom_half.h:32 rcu_read_unlock_bh include/linux/rcupdate.h:688 [inline] __dev_queue_xmit+0x38e8/0x4200 net/core/dev.c:3819 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3825 packet_snd net/packet/af_packet.c:2959 [inline] packet_sendmsg+0x8234/0x9100 net/packet/af_packet.c:2984 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg net/socket.c:657 [inline] __sys_sendto+0xc44/0xc70 net/socket.c:1952 __do_sys_sendto net/socket.c:1964 [inline] __se_sys_sendto+0x107/0x130 net/socket.c:1960 __x64_sys_sendto+0x6e/0x90 net/socket.c:1960 do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45a679 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f0a3c9e5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045a679 RDX: 000000000000000e RSI: 0000000020000200 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 00000000200000c0 R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0a3c9e66d4 R13: 00000000004c8ec1 R14: 00000000004dfe28 R15: 00000000ffffffff
Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:149 [inline] kmsan_internal_poison_shadow+0x5c/0x110 mm/kmsan/kmsan.c:132 kmsan_slab_alloc+0x97/0x100 mm/kmsan/kmsan_hooks.c:86 slab_alloc_node mm/slub.c:2773 [inline] __kmalloc_node_track_caller+0xe27/0x11a0 mm/slub.c:4381 __kmalloc_reserve net/core/skbuff.c:141 [inline] __alloc_skb+0x306/0xa10 net/core/skbuff.c:209 alloc_skb include/linux/skbuff.h:1049 [inline] alloc_skb_with_frags+0x18c/0xa80 net/core/skbuff.c:5662 sock_alloc_send_pskb+0xafd/0x10a0 net/core/sock.c:2244 packet_alloc_skb net/packet/af_packet.c:2807 [inline] packet_snd net/packet/af_packet.c:2902 [inline] packet_sendmsg+0x63a6/0x9100 net/packet/af_packet.c:2984 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg net/socket.c:657 [inline] __sys_sendto+0xc44/0xc70 net/socket.c:1952 __do_sys_sendto net/socket.c:1964 [inline] __se_sys_sendto+0x107/0x130 net/socket.c:1960 __x64_sys_sendto+0x6e/0x90 net/socket.c:1960 do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- net/bridge/br_netfilter_hooks.c | 3 +++ 1 file changed, 3 insertions(+)
net/bridge/br_netfilter_hooks.c +3 -0
@@ -662,6 +662,9 @@ static unsigned int br_nf_forward_arp(vonf_bridge_pull_encap_header (skb); } +if (unlikely (!pskb_may_pull (skb,sizeof (struct arphdr )))) +return NF_DROP ; +if (arp_hdr (skb)->ar_pln !=4 ) {if (is_vlan_arp (skb, state->net))nf_bridge_push_encap_header (skb);
Greg Kroah-Hartman
maintainerPATCH 140/191 net: add a READ_ONCE() in skb_peek_tail()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit f8cc62ca3e660ae3fdaee533b1d554297cd2ae82 upstream.
skb_peek_tail() can be used without protection of a lock, as spotted by KCSAN [1]
In order to avoid load-stearing, add a READ_ONCE()
Note that the corresponding WRITE_ONCE() are already there.
[1]
BUG: KCSAN: data-race in sk_wait_data / skb_queue_tail
read to 0xffff8880b36a4118 of 8 bytes by task 20426 on cpu 1:
skb_peek_tail include/linux/skbuff.h:1784 [inline] sk_wait_data+0x15b/0x250 net/core/sock.c:2477 kcm_wait_data+0x112/0x1f0 net/kcm/kcmsock.c:1103 kcm_recvmsg+0xac/0x320 net/kcm/kcmsock.c:1130 sock_recvmsg_nosec net/socket.c:871 [inline] sock_recvmsg net/socket.c:889 [inline] sock_recvmsg+0x92/0xb0 net/socket.c:885 ___sys_recvmsg+0x1a0/0x3e0 net/socket.c:2480 do_recvmmsg+0x19a/0x5c0 net/socket.c:2601 __sys_recvmmsg+0x1ef/0x200 net/socket.c:2680 __do_sys_recvmmsg net/socket.c:2703 [inline] __se_sys_recvmmsg net/socket.c:2696 [inline] __x64_sys_recvmmsg+0x89/0xb0 net/socket.c:2696 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9
write to 0xffff8880b36a4118 of 8 bytes by task 451 on cpu 0:
__skb_insert include/linux/skbuff.h:1852 [inline] __skb_queue_before include/linux/skbuff.h:1958 [inline] __skb_queue_tail include/linux/skbuff.h:1991 [inline] skb_queue_tail+0x7e/0xc0 net/core/skbuff.c:3145 kcm_queue_rcv_skb+0x202/0x310 net/kcm/kcmsock.c:206 kcm_rcv_strparser+0x74/0x4b0 net/kcm/kcmsock.c:370 __strp_recv+0x348/0xf50 net/strparser/strparser.c:309 strp_recv+0x84/0xa0 net/strparser/strparser.c:343 tcp_read_sock+0x174/0x5c0 net/ipv4/tcp.c:1639 strp_read_sock+0xd4/0x140 net/strparser/strparser.c:366 do_strp_work net/strparser/strparser.c:414 [inline] strp_work+0x9a/0xe0 net/strparser/strparser.c:423 process_one_work+0x3d4/0x890 kernel/workqueue.c:2269 worker_thread+0xa0/0x800 kernel/workqueue.c:2415 kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 451 Comm: kworker/u4:3 Not tainted 5.4.0-rc3+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: kstrp strp_work
--- include/linux/skbuff.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/linux/skbuff.h +4 -2
@@ -1795,7 +1795,7 @@ static inline struct sk_buff *skb_peek_n*/ static inline struct sk_buff *skb_peek_tail (const struct sk_buff_head *list_) { -struct sk_buff *skb = list_->prev; +struct sk_buff *skb =READ_ONCE (list_->prev);if (skb == (struct sk_buff *)list_) skb =NULL ;
@@ -1861,7 +1861,9 @@ static inline void __skb_insert(struct s struct sk_buff *prev, struct sk_buff *next, struct sk_buff_head *list) { -/* see skb_queue_empty_lockless() for the opposite READ_ONCE() */ +/* See skb_queue_empty_lockless() and skb_peek_tail() +* for the opposite READ_ONCE() +*/ WRITE_ONCE(newsk->next, next);WRITE_ONCE (newsk->prev, prev);WRITE_ONCE (next->prev, newsk);
Greg Kroah-Hartman
maintainerPATCH 115/191 perf diff: Use llabs() with 64-bit values
In reply to Greg Kroah-HartmanFrom: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit 98e93245113d0f5c279ef77f4a9e7d097323ad71 ]
To fix these build errors on a debian mipsel cross build environment:
builtin-diff.c: In function 'block_cycles_diff_cmp':
builtin-diff.c:550:6: error: absolute value function 'labs' given an argument of type 's64' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
550 | l = labs(left->diff.cycles);
| ^~~~
builtin-diff.c:551:6: error: absolute value function 'labs' given an argument of type 's64' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value]
551 | r = labs(right->diff.cycles);
| ^~~~--- tools/perf/builtin-diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-diff.c +2 -2
@@ -575,8 +575,8 @@ static int64_t block_cycles_diff_cmp(struct hist_entry *left,if (!pairs_left && !pairs_right)return 0 ; - l =labs (left->diff.cycles); - r =labs (right->diff.cycles); + l =llabs (left->diff.cycles); + r =llabs (right->diff.cycles);return r - l; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 132/191 md: make sure desc_nr less than MD_SB_DISKS
In reply to Greg Kroah-HartmanFrom: Yufen Yu <[email protected]>
[ Upstream commit 3b7436cc9449d5ff7fa1c1fd5bc3edb6402ff5b8 ]
For super_90_load, we need to make sure 'desc_nr' less than MD_SB_DISKS, avoiding invalid memory access of 'sb->disks'.
--- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
@@ -1159,6 +1159,7 @@ static int super_90_load(struct md_rdev/* not spare disk, or LEVEL_MULTIPATH */ if (sb->level ==LEVEL_MULTIPATH || (rdev->desc_nr >=0 && + rdev->desc_nr <MD_SB_DISKS && sb->disks[rdev->desc_nr].state & ((1 <<MD_DISK_SYNC ) | (1 <<MD_DISK_ACTIVE )))) spare_disk = false;
Greg Kroah-Hartman
maintainerPATCH 129/191 userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
[ Upstream commit 3c1c24d91ffd536de0a64688a9df7f49e58fadbc ]
A while ago Andy noticed
(http://lkml.kernel.org/r/CALCETrWY+5ynDct7eU_nDUqx=okQvjm=Y5wJvA4ahBja=CQXGw@mail.gmail.com)
that UFFD_FEATURE_EVENT_FORK used by an unprivileged user may have security implications.
As the first step of the solution the following patch limits the availably of UFFD_FEATURE_EVENT_FORK only for those having CAP_SYS_PTRACE.
The usage of CAP_SYS_PTRACE ensures compatibility with CRIU.
Yet, if there are other users of non-cooperative userfaultfd that run without CAP_SYS_PTRACE, they would be broken :(
Current implementation of UFFD_FEATURE_EVENT_FORK modifies the file descriptor table from the read() implementation of uffd, which may have security implications for unprivileged use of the userfaultfd.
Limit availability of UFFD_FEATURE_EVENT_FORK only for callers that have CAP_SYS_PTRACE.
--- fs/userfaultfd.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
fs/userfaultfd.c +11 -7
@@ -1834,13 +1834,12 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx,if (copy_from_user (&uffdio_api, buf,sizeof (uffdio_api))) goto out; features = uffdio_api.features; -if (uffdio_api.api !=UFFD_API || (features & ~UFFD_API_FEATURES )) { -memset (&uffdio_api,0 ,sizeof (uffdio_api)); -if (copy_to_user (buf, &uffdio_api,sizeof (uffdio_api))) - goto out; - ret = -EINVAL ; - goto out; - } + ret = -EINVAL ; +if (uffdio_api.api !=UFFD_API || (features & ~UFFD_API_FEATURES )) + goto err_out; + ret = -EPERM ; +if ((features &UFFD_FEATURE_EVENT_FORK ) && !capable (CAP_SYS_PTRACE )) + goto err_out;/* report all available features and ioctls to userland */ uffdio_api.features =UFFD_API_FEATURES ; uffdio_api.ioctls =UFFD_API_IOCTLS ;
@@ -1853,6 +1852,11 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx, ret =0 ; out:return ret; +err_out: +memset (&uffdio_api,0 ,sizeof (uffdio_api)); +if (copy_to_user (buf, &uffdio_api,sizeof (uffdio_api))) + ret = -EFAULT ; + goto out; } static long userfaultfd_ioctl(struct file *file, unsigned cmd,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 114/191 cifs: move cifsFileInfo_put logic into a work-queue
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
[ Upstream commit 32546a9586aa4565035bb557e191648e022b29e8 ]
This patch moves the final part of the cifsFileInfo_put() logic where we need a write lock on lock_sem to be processed in a separate thread that holds no other locks.
This is to prevent deadlocks like the one below:
Quoted 232 lines
there are 6 processes looping to while trying to
down_writecinode->lock_sem, 5 of them from_cifsFileInfo_put, and one fromcifs_new_fileinfoand there are 5 other processes which are blocked, several of them waiting on either
PG_writebackorPG_locked(which are both set), all for the same page of the file2
inode_lock()(inode->i_rwsem) for the file
1wait_on_page_writeback()for the page
1down_read(inode->i_rwsem)for the inode of the directory 1 inode_lock()(inode->i_rwsem) for the inode of the directory 1__lock_pageso processes are blocked waiting on:
page flagsPG_lockedandPG_writebackfor one specific pageinode->i_rwsemfor the directory
inode->i_rwsemfor the file
cifsInodeInflock_semhere are the more gory details (let me know if I need to provide anything more/better):
[0 00:48:22.765] [UN] PID: 8863 TASK:
ffff8c691547c5c0CPU: 3
COMMAND: "reopen_file"
#0 [ffff9965007e3ba8]__scheduleatffffffff9b6e6095
#1 [ffff9965007e3c38] schedule atffffffff9b6e64df
#2 [ffff9965007e3c48]rwsem_down_write_slowpathatffffffff9af283d7#3 [ffff9965007e3cb8]legitimize_pathatffffffff9b0f975d#4 [ffff9965007e3d08]path_openatatffffffff9b0fe55d
#5 [ffff9965007e3dd8]do_filp_openatffffffff9b100a33#6 [ffff9965007e3ee0]do_sys_openatffffffff9b0eb2d6
#7 [ffff9965007e3f38]do_syscall_64atffffffff9ae04315
* (I thinklegitimize_pathis bogus)in
path_openat} else { const char *s = path_init(nd, flags); while (!(error = link_path_walk(s, nd)) && (error = do_last(nd, file, op)) > 0) { <<<<
do_last:
if (open_flag&O_CREAT)
inode_lock(dir->d_inode); <<<<
else
so it's trying to takeinode->i_rwsemfor the directoryDENTRY INODE SUPERBLK TYPE PATH
ffff8c68bb8e79c0ffff8c691158ef20ffff8c6915bf9000DIR/mnt/vm1_smb/inode.i_rwsem isffff8c691158efc0<struct
rw_semaphore0xffff8c691158efc0>:owner: <struct task_struct 0xffff8c6914275d00> (UN - 8856 - reopen_file), counter: 0x0000000000000003 waitlist: 2 0xffff9965007e3c90 8863 reopen_file UN 0 1:29:22.926 RWSEM_WAITING_FOR_WRITE 0xffff996500393e00 9802 ls UN 0 1:17:26.700
RWSEM_WAITING_FOR_READthe owner of the inode.i_rwsem of the directory is:
[0 00:00:00.109] [UN] PID: 8856 TASK:
ffff8c6914275d00CPU: 3
COMMAND: "reopen_file"
#0 [ffff99650065b828]__scheduleatffffffff9b6e6095
#1 [ffff99650065b8b8] schedule atffffffff9b6e64df
#2 [ffff99650065b8c8]schedule_timeoutatffffffff9b6e9f89
#3 [ffff99650065b940] msleep atffffffff9af573a9
#4 [ffff99650065b948] _cifsFileInfo_put.cold.63 atffffffffc0a42dd6[cifs] #5 [ffff99650065ba38]cifs_writepage_lockedatffffffffc0a0b8f3[cifs] #6 [ffff99650065bab0]cifs_launder_pageatffffffffc0a0bb72[cifs] #7 [ffff99650065bb30]invalidate_inode_pages2_rangeatffffffff9b04d4bd#8 [ffff99650065bcb8]cifs_invalidate_mappingatffffffffc0a11339[cifs] #9 [ffff99650065bcd0]cifs_revalidate_mappingatffffffffc0a1139a[cifs]
#10 [ffff99650065bcf0]cifs_d_revalidateatffffffffc0a014f6[cifs] #11 [ffff99650065bd08]path_openatatffffffff9b0fe7f7
#12 [ffff99650065bdd8]do_filp_openatffffffff9b100a33
#13 [ffff99650065bee0]do_sys_openatffffffff9b0eb2d6
#14 [ffff99650065bf38]do_syscall_64atffffffff9ae04315
cifs_launder_pageis for page0xffffd1e2c07d2480crash> page.index,mapping,flags
0xffffd1e2c07d2480index = 0x8 mapping = 0xffff8c68f3cd0db0flags =
0xfffffc0008095PAGE-FLAG BIT VALUE PG_locked 0 0000001 PG_uptodate 2 0000004 PG_lru 4 0000010 PG_waiters 7 0000080 PG_writeback 15 0008000inode is
ffff8c68f3cd0c40
inode.i_rwsem isffff8c68f3cd0ce0
DENTRY INODE SUPERBLK TYPE PATHffff8c68a1f1b480ffff8c68f3cd0c40ffff8c6915bf9000REG/mnt/vm1_smb/testfile.8853this process holds the
inode->i_rwsemfor the parent directory, is laundering a page attached to the inode of the file it's opening, and in_cifsFileInfo_putis trying todown_writethecifsInodeInflock_semfor the file itself.<struct
rw_semaphore0xffff8c68f3cd0ce0>:owner: <struct task_struct 0xffff8c6914272e80> (UN - 8854 - reopen_file), counter: 0x0000000000000003 waitlist: 1 0xffff9965005dfd80 8855 reopen_file UN 0 1:29:22.912
RWSEM_WAITING_FOR_WRITEthis is the inode.i_rwsem for the file
the owner:
[0 00:48:22.739] [UN] PID: 8854 TASK:
ffff8c6914272e80CPU: 2
COMMAND: "reopen_file"
#0 [ffff99650054fb38]__scheduleatffffffff9b6e6095
#1 [ffff99650054fbc8] schedule atffffffff9b6e64df
#2 [ffff99650054fbd8]io_scheduleatffffffff9b6e68e2
#3 [ffff99650054fbe8]__lock_pageatffffffff9b03c56f
#4 [ffff99650054fc80]pagecache_get_pageatffffffff9b03dcdf
#5 [ffff99650054fcc0]grab_cache_page_write_beginatffffffff9b03ef4c#6 [ffff99650054fcd0]cifs_write_beginatffffffffc0a064ec[cifs] #7 [ffff99650054fd30]generic_perform_writeatffffffff9b03bba4#8 [ffff99650054fda8]__generic_file_write_iteratffffffff9b04060a#9 [ffff99650054fdf0] cifs_strict_writev.cold.70 atffffffffc0a4469b[cifs]
#10 [ffff99650054fe48]new_sync_writeatffffffff9b0ec1dd
#11 [ffff99650054fed0]vfs_writeatffffffff9b0eed35
#12 [ffff99650054ff00]ksys_writeatffffffff9b0eefd9
#13 [ffff99650054ff38]do_syscall_64atffffffff9ae04315the process holds the
inode->i_rwsemfor the file to which it's writing, and is trying to__lock_pagefor the same page as in the other processesthe other tasks:
[0 00:00:00.028] [UN] PID: 8859 TASK:ffff8c6915479740CPU: 2
COMMAND: "reopen_file"
#0 [ffff9965007b39d8]__scheduleatffffffff9b6e6095
#1 [ffff9965007b3a68] schedule atffffffff9b6e64df
#2 [ffff9965007b3a78]schedule_timeoutatffffffff9b6e9f89
#3 [ffff9965007b3af0] msleep atffffffff9af573a9
#4 [ffff9965007b3af8] cifs_new_fileinfo.cold.61 atffffffffc0a42a07[cifs] #5 [ffff9965007b3b78]cifs_openatffffffffc0a0709d[cifs]
#6 [ffff9965007b3cd8]do_dentry_openatffffffff9b0e9b7a
#7 [ffff9965007b3d08]path_openatatffffffff9b0fe34f
#8 [ffff9965007b3dd8]do_filp_openatffffffff9b100a33
#9 [ffff9965007b3ee0]do_sys_openatffffffff9b0eb2d6
#10 [ffff9965007b3f38]do_syscall_64atffffffff9ae04315this is opening the file, and is trying to
down_writecinode->lock_sem[0 00:00:00.041] [UN] PID: 8860 TASK:
ffff8c691547ae80CPU: 2
COMMAND: "reopen_file"
[0 00:00:00.057] [UN] PID: 8861 TASK:ffff8c6915478000CPU: 3
COMMAND: "reopen_file"
[0 00:00:00.059] [UN] PID: 8858 TASK:ffff8c6914271740CPU: 2
COMMAND: "reopen_file"
[0 00:00:00.109] [UN] PID: 8862 TASK:ffff8c691547dd00CPU: 6
COMMAND: "reopen_file"
#0 [ffff9965007c3c78]__scheduleatffffffff9b6e6095
#1 [ffff9965007c3d08] schedule atffffffff9b6e64df
#2 [ffff9965007c3d18]schedule_timeoutatffffffff9b6e9f89
#3 [ffff9965007c3d90] msleep atffffffff9af573a9
#4 [ffff9965007c3d98] _cifsFileInfo_put.cold.63 atffffffffc0a42dd6[cifs] #5 [ffff9965007c3e88]cifs_closeatffffffffc0a07aaf[cifs]
#6 [ffff9965007c3ea0]__fputatffffffff9b0efa6e
#7 [ffff9965007c3ee8]task_work_runatffffffff9aef1614
#8 [ffff9965007c3f20]exit_to_usermode_loopatffffffff9ae03d6f#9 [ffff9965007c3f38]do_syscall_64atffffffff9ae0444cclosing the file, and trying to
down_writecifsi->lock_sem[0 00:48:22.839] [UN] PID: 8857 TASK:
ffff8c6914270000CPU: 7
COMMAND: "reopen_file"
#0 [ffff9965006a7cc8]__scheduleatffffffff9b6e6095
#1 [ffff9965006a7d58] schedule atffffffff9b6e64df
#2 [ffff9965006a7d68]io_scheduleatffffffff9b6e68e2
#3 [ffff9965006a7d78]wait_on_page_bitatffffffff9b03cac6#4 [ffff9965006a7e10]__filemap_fdatawait_rangeatffffffff9b03b028#5 [ffff9965006a7ed8]filemap_write_and_waitatffffffff9b040165#6 [ffff9965006a7ef0]cifs_flushatffffffffc0a0c2fa[cifs] #7 [ffff9965006a7f10]filp_closeatffffffff9b0e93f1
#8 [ffff9965006a7f30]__x64_sys_closeatffffffff9b0e9a0e#9 [ffff9965006a7f38]do_syscall_64atffffffff9ae04315in
__filemap_fdatawait_rangewait_on_page_writeback(page);for the same page of the file
[0 00:48:22.718] [UN] PID: 8855 TASK:
ffff8c69142745c0CPU: 7
COMMAND: "reopen_file"
#0 [ffff9965005dfc98]__scheduleatffffffff9b6e6095
#1 [ffff9965005dfd28] schedule atffffffff9b6e64df
#2 [ffff9965005dfd38]rwsem_down_write_slowpathatffffffff9af283d7#3 [ffff9965005dfdf0]cifs_strict_writevatffffffffc0a0c40a[cifs] #4 [ffff9965005dfe48]new_sync_writeatffffffff9b0ec1dd#5 [ffff9965005dfed0]vfs_writeatffffffff9b0eed35
#6 [ffff9965005dff00]ksys_writeatffffffff9b0eefd9
#7 [ffff9965005dff38]do_syscall_64atffffffff9ae04315inode_lock(inode);and one 'ls' later on, to see whether the rest of the mount is available (the test file is in the root, so we get blocked up on the directory ->i_rwsem), so the entire mount is unavailable
[0 00:36:26.473] [UN] PID: 9802 TASK:
ffff8c691436ae80CPU: 4
COMMAND: "ls"
#0 [ffff996500393d28]__scheduleatffffffff9b6e6095
#1 [ffff996500393db8] schedule atffffffff9b6e64df
#2 [ffff996500393dc8]rwsem_down_read_slowpathatffffffff9b6e9421#3 [ffff996500393e78]down_read_killableatffffffff9b6e95e2#4 [ffff996500393e88]iterate_diratffffffff9b103c56#5 [ffff996500393ec8]ksys_getdents64atffffffff9b104b0c#6 [ffff996500393f30]__x64_sys_getdents64atffffffff9b104bb6#7 [ffff996500393f38]do_syscall_64atffffffff9ae04315
Quoted 6 lines
in
iterate_dir:if (shared) res = down_read_killable(&inode->i_rwsem); <<<< else res = down_write_killable(&inode->i_rwsem);
--- fs/cifs/cifsfs.c | 13 +++++++- fs/cifs/cifsglob.h | 5 +++- fs/cifs/file.c | 74 ++++++++++++++++++++++++++++++---------------- 3 files changed, 65 insertions(+), 27 deletions(-)
fs/cifs/cifsfs.c +12 -1
@@ -119,6 +119,7 @@ extern mempool_t *cifs_mid_poolp;struct workqueue_struct *cifsiod_wq;struct workqueue_struct *decrypt_wq; +struct workqueue_struct *fileinfo_put_wq;struct workqueue_struct *cifsoplockd_wq;__u32 cifs_lock_secret;
@@ -1554,11 +1555,18 @@ init_cifs(void) goto out_destroy_cifsiod_wq; } + fileinfo_put_wq =alloc_workqueue ("cifsfileinfoput" , +WQ_UNBOUND |WQ_FREEZABLE |WQ_MEM_RECLAIM ,0 ); +if (!fileinfo_put_wq) { + rc = -ENOMEM ; + goto out_destroy_decrypt_wq; + } + cifsoplockd_wq =alloc_workqueue ("cifsoplockd" ,WQ_FREEZABLE |WQ_MEM_RECLAIM ,0 );if (!cifsoplockd_wq) { rc = -ENOMEM ; - goto out_destroy_decrypt_wq; + goto out_destroy_fileinfo_put_wq; } rc =cifs_fscache_register ();
@@ -1624,6 +1632,8 @@ out_unreg_fscache:cifs_fscache_unregister (); out_destroy_cifsoplockd_wq:destroy_workqueue (cifsoplockd_wq); +out_destroy_fileinfo_put_wq: +destroy_workqueue (fileinfo_put_wq); out_destroy_decrypt_wq:destroy_workqueue (decrypt_wq); out_destroy_cifsiod_wq:
@@ -1653,6 +1663,7 @@ exit_cifs(void)cifs_fscache_unregister ();destroy_workqueue (cifsoplockd_wq);destroy_workqueue (decrypt_wq); +destroy_workqueue (fileinfo_put_wq);destroy_workqueue (cifsiod_wq);cifs_proc_clean (); }
fs/cifs/cifsglob.h +4 -1
@@ -1265,6 +1265,7 @@ struct cifsFileInfo {struct mutex fh_mutex;/* prevents reopen race after dead ses*/ struct cifs_search_info srch_inf;struct work_struct oplock_break;/* work for oplock breaks */ +struct work_struct put;/* work for the final part of _put */ };struct cifs_io_parms {
@@ -1370,7 +1371,8 @@ cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file) }struct cifsFileInfo *cifsFileInfo_get (struct cifsFileInfo *cifs_file); -void _cifsFileInfo_put (struct cifsFileInfo *cifs_file,bool wait_oplock_hdlr); +void _cifsFileInfo_put (struct cifsFileInfo *cifs_file,bool wait_oplock_hdlr, +bool offload);void cifsFileInfo_put (struct cifsFileInfo *cifs_file);#define CIFS_CACHE_READ_FLG 1
@@ -1908,6 +1910,7 @@ void cifs_queue_oplock_break(struct cifsFileInfo *cfile);extern const struct slow_work_ops cifs_oplock_break_ops;extern struct workqueue_struct *cifsiod_wq;extern struct workqueue_struct *decrypt_wq; +extern struct workqueue_struct *fileinfo_put_wq;extern struct workqueue_struct *cifsoplockd_wq;extern __u32 cifs_lock_secret;
fs/cifs/file.c +49 -25
134 lines not on this page · raw message
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 92/191 scsi: ufs: Fix up auto hibern8 enablement
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
[ Upstream commit 71d848b8d97ec0f8e993d63cf9de6ac8b3f7c43d ]
Fix up possible unclocked register access to auto hibern8 register in resume path and through sysfs entry. Meanwhile, enable auto hibern8 only after device is fully initialized in probe path.
--- drivers/scsi/ufs/ufs-sysfs.c | 15 +++++++++------ drivers/scsi/ufs/ufshcd.c | 14 +++++++------- drivers/scsi/ufs/ufshcd.h | 2 ++ 3 files changed, 18 insertions(+), 13 deletions(-)
drivers/scsi/ufs/ufs-sysfs.c +9 -6
@@ -126,13 +126,16 @@ static void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)return ;spin_lock_irqsave (hba->host->host_lock, flags); -if (hba->ahit == ahit) - goto out_unlock; - hba->ahit = ahit; -if (!pm_runtime_suspended (hba->dev)) -ufshcd_writel (hba, hba->ahit,REG_AUTO_HIBERNATE_IDLE_TIMER ); -out_unlock: +if (hba->ahit != ahit) + hba->ahit = ahit;spin_unlock_irqrestore (hba->host->host_lock, flags); +if (!pm_runtime_suspended (hba->dev)) { +pm_runtime_get_sync (hba->dev); +ufshcd_hold (hba, false); +ufshcd_auto_hibern8_enable (hba); +ufshcd_release (hba); +pm_runtime_put (hba->dev); + } }/* Convert Auto-Hibernate Idle Timer register value to microseconds */
drivers/scsi/ufs/ufshcd.c +7 -7
@@ -3950,7 +3950,7 @@ static int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)return ret; } -static void ufshcd_auto_hibern8_enable (struct ufs_hba *hba) +void ufshcd_auto_hibern8_enable (struct ufs_hba *hba) {unsigned long flags;
@@ -6890,9 +6890,6 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)/* UniPro link is active now */ ufshcd_set_link_active (hba); -/* Enable Auto-Hibernate if configured */ -ufshcd_auto_hibern8_enable (hba); - ret =ufshcd_verify_dev_init (hba);if (ret) goto out;
@@ -6943,6 +6940,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)/* set the state as operational after switching to desired gear */ hba->ufshcd_state =UFSHCD_STATE_OPERATIONAL ; +/* Enable Auto-Hibernate if configured */ +ufshcd_auto_hibern8_enable (hba); +/* * If we are in error handling context or in power management callbacks * context, no need to scan the host
@@ -7959,12 +7959,12 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)if (hba->clk_scaling.is_allowed)ufshcd_resume_clkscaling (hba); -/* Schedule clock gating in case of no access to UFS device yet */ -ufshcd_release (hba); -/* Enable Auto-Hibernate if configured */ ufshcd_auto_hibern8_enable (hba); +/* Schedule clock gating in case of no access to UFS device yet */ +ufshcd_release (hba); + goto out; set_old_link_state:
drivers/scsi/ufs/ufshcd.h +2 -0
@@ -916,6 +916,8 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,int ufshcd_query_flag (struct ufs_hba *hba,enum query_opcode opcode,enum flag_idn idn,bool *flag_res); +void ufshcd_auto_hibern8_enable (struct ufs_hba *hba); +#define SD_ASCII_STD true#define SD_RAW false int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 89/191 scsi: scsi_debug: num_tgts must be >= 0
In reply to Greg Kroah-HartmanFrom: Maurizio Lombardi <[email protected]>
[ Upstream commit aa5334c4f3014940f11bf876e919c956abef4089 ]
Passing the parameter "num_tgts=-1" will start an infinite loop that exhausts the system memory
--- drivers/scsi/scsi_debug.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/scsi/scsi_debug.c +5 -0
@@ -5263,6 +5263,11 @@ static int __init scsi_debug_init(void)return -EINVAL ; } +if (sdebug_num_tgts <0 ) { +pr_err ("num_tgts must be >= 0\n" ); +return -EINVAL ; + } +if (sdebug_guard >1 ) {pr_err ("guard must be 0 or 1\n" );return -EINVAL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 106/191 scripts/kallsyms: fix definitely-lost memory leak
In reply to Greg Kroah-HartmanFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 21915eca088dc271c970e8351290e83d938114ac ]
build_initial_tok_table() overwrites unused sym_entry to shrink the table size. Before the entry is overwritten, table[i].sym must be freed since it is malloc'ed data.
This fixes the 'definitely lost' report from valgrind. I ran valgrind against x86_64_defconfig of v5.4-rc8 kernel, and here is the summary:
[Before the fix]
LEAK SUMMARY:
definitely lost: 53,184 bytes in 2,874 blocks
[After the fix]
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
--- scripts/kallsyms.c | 2 ++ 1 file changed, 2 insertions(+)
scripts/kallsyms.c +2 -0
@@ -489,6 +489,8 @@ static void build_initial_tok_table(void) table[pos] = table[i];learn_symbol (table[pos].sym, table[pos].len); pos++; + }else { +free (table[i].sym); } } table_cnt = pos;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 104/191 apparmor: fix unsigned len comparison with less than zero
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit 00e0590dbaec6f1bcaa36a85467d7e3497ced522 ]
The sanity check in macro update_for_len checks to see if len is less than zero, however, len is a size_t so it can never be less than zero, so this sanity check is a no-op. Fix this by making len a ssize_t so the comparison will work and add ulen that is a size_t copy of len so that the min() macro won't throw warnings about comparing different types.
Addresses-Coverity: ("Macro compares unsigned to 0")
--- security/apparmor/label.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
security/apparmor/label.c +7 -5
@@ -1458,11 +1458,13 @@ static inline bool use_label_hname(struct aa_ns *ns, struct aa_label *label,/* helper macro for snprint routines */ #define update_for_len (total, len, size, str) \ do { \ + size_t ulen = len; \ + \ AA_BUG(len < 0); \ - total += len; \ - len = min(len, size); \ - size -= len; \ - str += len; \ + total += ulen; \ + ulen = min(ulen, size); \ + size -= ulen; \ + str += ulen; \ } while (0)/**
@@ -1597,7 +1599,7 @@ int aa_label_snxprint(char *str, size_t size, struct aa_ns *ns,struct aa_ns *prev_ns =NULL ;struct label_it i;int count =0 , total =0 ; -size_t len; +ssize_t len;AA_BUG (!str && size !=0 );AA_BUG (!label);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 103/191 Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
In reply to Greg Kroah-HartmanFrom: Michael Kelley <[email protected]>
[ Upstream commit 7a1323b5dfe44a9013a2cc56ef2973034a00bf88 ]
The crash handler calls hv_synic_cleanup() to shutdown the Hyper-V synthetic interrupt controller. But if the CPU that calls hv_synic_cleanup() has a VMbus channel interrupt assigned to it (which is likely the case in smaller VM sizes), hv_synic_cleanup() returns an error and the synthetic interrupt controller isn't shutdown. While the lack of being shutdown hasn't caused a known problem, it still should be fixed for highest reliability.
So directly call hv_synic_disable_regs() instead of hv_synic_cleanup(), which ensures that the synic is always shutdown.
--- drivers/hv/vmbus_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -1
@@ -2308,7 +2308,7 @@ static void hv_crash_handler(struct pt_regs *regs) vmbus_connection.conn_state =DISCONNECTED ; cpu =smp_processor_id ();hv_stimer_cleanup (cpu); -hv_synic_cleanup (cpu); +hv_synic_disable_regs (cpu);hyperv_cleanup (); };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 96/191 habanalabs: skip VA block list update in reset flow
In reply to Greg Kroah-HartmanFrom: Omer Shpigelman <[email protected]>
[ Upstream commit 71c5e55e7c077fa17c42fbda91a8d14322825c44 ]
Reduce context close time by skipping the VA block free list update in order to avoid hard reset with open contexts.
Reset with open contexts can potentially lead to a kernel crash as the generic pool of the MMU hops is destroyed while it is not empty because some unmap operations are not done.
The commit affect mainly when running on simulator.
--- drivers/misc/habanalabs/memory.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
drivers/misc/habanalabs/memory.c +20 -10
@@ -965,17 +965,19 @@ init_page_pack_err:* * @ctx : current context * @vaddr : device virtual address to unmap +* @ctx_free : true if in context free flow, false otherwise. * * This function does the following: * - Unmap the physical pages related to the given virtual address * - return the device virtual block to the virtual block list */ -static int unmap_device_va (struct hl_ctx *ctx,u64 vaddr) +static int unmap_device_va (struct hl_ctx *ctx,u64 vaddr,bool ctx_free) {struct hl_device *hdev = ctx->hdev;struct hl_vm_phys_pg_pack *phys_pg_pack =NULL ;struct hl_vm_hash_node *hnode =NULL ;struct hl_userptr *userptr =NULL ; +struct hl_va_range *va_range;enum vm_type_t *vm_type;u64 next_vaddr, i;u32 page_size;
@@ -1003,6 +1005,7 @@ static int unmap_device_va(struct hl_ctx *ctx, u64 vaddr)if (*vm_type ==VM_TYPE_USERPTR ) { is_userptr = true; + va_range = &ctx->host_va_range; userptr = hnode->ptr; rc =init_phys_pg_pack_from_userptr (ctx, userptr, &phys_pg_pack);
@@ -1014,6 +1017,7 @@ static int unmap_device_va(struct hl_ctx *ctx, u64 vaddr) } }else if (*vm_type ==VM_TYPE_PHYS_PACK ) { is_userptr = false; + va_range = &ctx->dram_va_range; phys_pg_pack = hnode->ptr; }else { dev_warn(hdev->dev,
@@ -1052,12 +1056,18 @@ static int unmap_device_va(struct hl_ctx *ctx, u64 vaddr)mutex_unlock (&ctx->mmu_lock); -if (add_va_block (hdev, - is_userptr ? &ctx->host_va_range : &ctx->dram_va_range, - vaddr, - vaddr + phys_pg_pack->total_size -1 )) -dev_warn (hdev->dev,"add va block failed for vaddr: 0x%llx\n" , - vaddr); +/* +* No point in maintaining the free VA block list if the context is +* closing as the list will be freed anyway +*/ +if (!ctx_free) { + rc =add_va_block (hdev, va_range, vaddr, + vaddr + phys_pg_pack->total_size -1 ); +if (rc) +dev_warn (hdev->dev, +"add va block failed for vaddr: 0x%llx\n" , + vaddr); + }atomic_dec (&phys_pg_pack->mapping_cnt);kfree (hnode);
@@ -1189,8 +1199,8 @@ int hl_mem_ioctl(struct hl_fpriv *hpriv, void *data)break ;case HL_MEM_OP_UNMAP : - rc =unmap_device_va (ctx, - args->in.unmap.device_virt_addr); + rc =unmap_device_va (ctx, args->in.unmap.device_virt_addr, + false);break ;default :
@@ -1620,7 +1630,7 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)dev_dbg (hdev->dev,"hl_mem_hash_node of vaddr 0x%llx of asid %d is still alive\n" , hnode->vaddr, ctx->asid); -unmap_device_va (ctx, hnode->vaddr); +unmap_device_va (ctx, hnode->vaddr, true); }spin_lock (&vm->idr_lock);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 64/191 scsi: ufs: fix potential bug which ends in system hang
In reply to Greg Kroah-HartmanFrom: Bean Huo <[email protected]>
[ Upstream commit cfcbae3895b86c390ede57b2a8f601dd5972b47b ]
In function __ufshcd_query_descriptor(), in the event of an error happening, we directly goto out_unlock and forget to invaliate hba->dev_cmd.query.descriptor pointer. This results in this pointer still valid in ufshcd_copy_query_response() for other query requests which go through ufshcd_exec_raw_upiu_cmd(). This will cause __memcpy() crash and system hangs. Log as shown below:
Unable to handle kernel paging request at virtual address
ffff000012233c40
Mem abort info:
ESR = 0x96000047
Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000047
CM = 0, WnR = 1
swapper pgtable: 4k pages, 48-bit VAs, pgdp = 0000000028cc735c [ffff000012233c40] pgd=00000000bffff003, pud=00000000bfffe003, pmd=00000000ba8b8003, pte=0000000000000000
Internal error: Oops: 96000047 [#2] PREEMPT SMP ... Call trace: __memcpy+0x74/0x180 ufshcd_issue_devman_upiu_cmd+0x250/0x3c0 ufshcd_exec_raw_upiu_cmd+0xfc/0x1a8 ufs_bsg_request+0x178/0x3b0 bsg_queue_rq+0xc0/0x118 blk_mq_dispatch_rq_list+0xb0/0x538 blk_mq_sched_dispatch_requests+0x18c/0x1d8 __blk_mq_run_hw_queue+0xb4/0x118 blk_mq_run_work_fn+0x28/0x38 process_one_work+0x1ec/0x470 worker_thread+0x48/0x458 kthread+0x130/0x138 ret_from_fork+0x10/0x1c Code: 540000ab a8c12027 a88120c7 a8c12027 (a88120c7) ---[ end trace 793e1eb5dff69f2d ]--- note: kworker/0:2H[2054] exited with preempt_count 1
This patch is to move "descriptor = NULL" down to below the label "out_unlock".
--- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +1 -1
@@ -2986,10 +2986,10 @@ static int __ufshcd_query_descriptor(struct ufs_hba *hba, goto out_unlock; } - hba->dev_cmd.query.descriptor =NULL ; *buf_len =be16_to_cpu (response->upiu_res.length); out_unlock: + hba->dev_cmd.query.descriptor =NULL ;mutex_unlock (&hba->dev_cmd.lock); out:ufshcd_release (hba);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 83/191 watchdog: imx7ulp: Fix reboot hang
In reply to Greg Kroah-HartmanFrom: Fabio Estevam <[email protected]>
[ Upstream commit 6083ab7b2f3f25022e2e8f4c42f14a8521f47873 ]
The following hang is observed when a 'reboot' command is issued:
# reboot # Stopping network: OK Stopping klogd: OK Stopping syslogd: OK umount: devtmpfs busy - remounted read-only [ 8.612079] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system reboot [ 10.694753] reboot: Restarting system [ 11.699008] Reboot failed -- System halted
Fix this problem by adding a .restart ops member.
--- drivers/watchdog/imx7ulp_wdt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/watchdog/imx7ulp_wdt.c +16 -0
@@ -106,12 +106,28 @@ static int imx7ulp_wdt_set_timeout(struct watchdog_device *wdog,return 0 ; } +static int imx7ulp_wdt_restart (struct watchdog_device *wdog, +unsigned long action,void *data) +{ +struct imx7ulp_wdt_device *wdt =watchdog_get_drvdata (wdog); + +imx7ulp_wdt_enable (wdt->base, true); +imx7ulp_wdt_set_timeout (&wdt->wdd,1 ); + +/* wait for wdog to fire */ +while (true) + ; + +return NOTIFY_DONE ; +} +static const struct watchdog_ops imx7ulp_wdt_ops = { .owner =THIS_MODULE , .start = imx7ulp_wdt_start, .stop = imx7ulp_wdt_stop, .ping = imx7ulp_wdt_ping, .set_timeout = imx7ulp_wdt_set_timeout, + .restart = imx7ulp_wdt_restart, };static const struct watchdog_info imx7ulp_wdt_info = {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 59/191 iomap: fix return value of iomap_dio_bio_actor on 32bit systems
In reply to Greg Kroah-HartmanFrom: Jan Stancek <[email protected]>
[ Upstream commit e9f930ac88a8936ccc2d021110c98810cf5aa810 ]
Naresh reported LTP diotest4 failing for 32bit x86 and arm -next kernels on ext4. Same problem exists in 5.4-rc7 on xfs.
The failure comes down to:
openat(AT_FDCWD, "testdata-4.5918", O_RDWR|O_DIRECT) = 4 mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f7b000
read(4, 0xb7f7b000, 4096) = 0 // expects -EFAULT
Problem is conversion at iomap_dio_bio_actor() return. Ternary operator has a return type and an attempt is made to convert each of operands to the type of the other. In this case "ret" (int) is converted to type of "copied" (unsigned long). Both have size of 4 bytes:
size_t copied = 0;
int ret = -14;
long long actor_ret = copied ? copied : ret;
On x86_64: actor_ret == -14;
On x86 : actor_ret == 4294967282Replace ternary operator with 2 return statements to avoid this unwanted conversion.
--- fs/iomap/direct-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/iomap/direct-io.c +3 -1
@@ -318,7 +318,9 @@ zero_tail:if (pad)iomap_dio_zero (dio, iomap, pos, fs_block_size - pad); } -return copied ? copied : ret; +if (copied) +return copied; +return ret; } static loff_t
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 76/191 dt-bindings: Improve validation build error handling
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
[ Upstream commit 93512dad334deb444619505f1fbb761156f7471b ]
Schema errors can cause make to exit before useful information is printed. This leaves developers wondering what's wrong. It can be overcome passing '-k' to make, but that's not an obvious solution. There's 2 scenarios where this happens.
When using DT_SCHEMA_FILES to validate with a single schema, any error in the schema results in processed-schema.yaml being empty causing a make error. The result is the specific errors in the schema are never shown because processed-schema.yaml is the first target built. Simply making processed-schema.yaml last in extra-y ensures the full schema validation with detailed error messages happen first.
The 2nd problem is while schema errors are ignored for processed-schema.yaml, full validation of the schema still runs in parallel and any schema validation errors will still stop the build when running validation of dts files. The fix is to not add the schema examples to extra-y in this case. This means 'dtbs_check' is no longer a superset of 'dt_binding_check'. Update the documentation to make this clear.
--- Documentation/devicetree/bindings/Makefile | 5 ++++- Documentation/devicetree/writing-schema.rst | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/Makefile +4 -1
@@ -12,7 +12,6 @@ $(obj)/%.example.dts: $(src)/%.yaml FORCE $(call if_changed,chk_binding) DT_TMP_SCHEMA := processed-schema.yaml -extra-y += $(DT_TMP_SCHEMA) quiet_cmd_mk_schema = SCHEMA $@ cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs)
@@ -26,8 +25,12 @@ DT_DOCS = $(shell \ DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS)) +ifeq ($(CHECK_DTBS),) extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) extra-y += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) +endif $(obj)/$(DT_TMP_SCHEMA): $(DT_SCHEMA_FILES) FORCE $(call if_changed,mk_schema) + +extra-y += $(DT_TMP_SCHEMA)
Documentation/devicetree/writing-schema.rst +4 -2
@@ -130,11 +130,13 @@ binding schema. All of the DT binding documents can be validated using the make dt_binding_check -In order to perform validation of DT source files, use the `dtbs_check` target:: +In order to perform validation of DT source files, use the ``dtbs_check`` target:: make dtbs_check -This will first run the `dt_binding_check` which generates the processed schema. +Note that ``dtbs_check`` will skip any binding schema files with errors. It is +necessary to use ``dt_binding_check`` to get all the validation errors in the +binding schema files. It is also possible to run checks with a single schema file by setting the ``DT_SCHEMA_FILES`` variable to a specific schema file.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 68/191 PCI: rpaphp: Correctly match ibm, my-drc-index to drc-name when using drc-info
In reply to Greg Kroah-HartmanFrom: Tyrel Datwyler <[email protected]>
[ Upstream commit 4f9f2d3d7a434b7f882b72550194c9278f4a3925 ]
The newer ibm,drc-info property is a condensed description of the old ibm,drc-* properties (ie. names, types, indexes, and power-domains). When matching a drc-index to a drc-name we need to verify that the index is within the start and last drc-index range and map it to a drc-name using the drc-name-prefix and logical index.
Fix the mapping by checking that the index is within the range of the current drc-info entry, and build the name from the drc-name-prefix concatenated with the starting drc-name-suffix value and the sequential index obtained by subtracting ibm,my-drc-index from this entries drc-start-index.
--- drivers/pci/hotplug/rpaphp_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pci/hotplug/rpaphp_core.c +3 -2
@@ -248,9 +248,10 @@ static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name,/* Should now know end of current entry */ /* Found it */ -if (my_index <= drc.last_drc_index) { +if (my_index >= drc.drc_index_start && my_index <= drc.last_drc_index) { +int index = my_index - drc.drc_index_start;sprintf (cell_drc_name,"%s%d" , drc.drc_name_prefix, - my_index); + drc.drc_name_suffix_start + index);break ; } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 38/191 dtc: Use pkg-config to locate libyaml
In reply to Greg Kroah-HartmanFrom: Pavel Modilaynen <[email protected]>
[ Upstream commit 067c650c456e758f933aaf87a202f841d34be269 ]
Using Makefile's wildcard with absolute path to detect the presence of libyaml results in false-positive detection when cross-compiling e.g. in yocto environment. The latter results in build error:
| scripts/dtc/yamltree.o: In function `yaml_propval_int': | yamltree.c: undefined reference to `yaml_sequence_start_event_initialize' | yamltree.c: undefined reference to `yaml_emitter_emit' | yamltree.c: undefined reference to `yaml_scalar_event_initialize'
...
Use pkg-config to locate libyaml to address this scenario.
--- scripts/dtc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/dtc/Makefile +2 -2
@@ -11,7 +11,7 @@ dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o # Source files need to get at the userspace version of libfdt_env.h to compile HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt -ifeq ($(wildcard /usr/include/yaml.h),) +ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),) ifneq ($(CHECK_DTBS),) $(error dtc needs libyaml for DT schema validation support. \ Install the necessary libyaml development package.)
@@ -19,7 +19,7 @@ endif HOST_EXTRACFLAGS += -DNO_YAML else dtc-objs += yamltree.o -HOSTLDLIBS_dtc := -lyaml +HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs) endif # Generated files need one more search path to include headers in source tree
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 54/191 dma-direct: check for overflows on 32 bit DMA addresses
In reply to Greg Kroah-HartmanFrom: Nicolas Saenz Julienne <[email protected]>
[ Upstream commit b12d66278dd627cbe1ea7c000aa4715aaf8830c8 ]
As seen on the new Raspberry Pi 4 and sta2x11's DMA implementation it is possible for a device configured with 32 bit DMA addresses and a partial DMA mapping located at the end of the address space to overflow. It happens when a higher physical address, not DMAable, is translated to it's DMA counterpart.
For example the Raspberry Pi 4, configurable up to 4 GB of memory, has an interconnect capable of addressing the lower 1 GB of physical memory with a DMA offset of 0xc0000000. It transpires that, any attempt to translate physical addresses higher than the first GB will result in an overflow which dma_capable() can't detect as it only checks for addresses bigger then the maximum allowed DMA address.
Fix this by verifying in dma_capable() if the DMA address range provided is at any point lower than the minimum possible DMA address on the bus.
--- include/linux/dma-direct.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
include/linux/dma-direct.h +10 -2
@@ -3,8 +3,11 @@#define _LINUX_DMA_DIRECT_H 1#include <linux/dma-mapping.h> +#include <linux/memblock.h> /* for min_low_pfn */ #include <linux/mem_encrypt.h> +static inline dma_addr_t phys_to_dma (struct device *dev,phys_addr_t paddr); +#ifdef CONFIG_ARCH_HAS_PHYS_TO_DMA #include <asm/dma-direct.h> #else
@@ -24,11 +27,16 @@ static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dev_addr)static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size) { +dma_addr_t end = addr + size -1 ; +if (!dev->dma_mask)return false; -return addr + size -1 <= -min_not_zero (*dev->dma_mask, dev->bus_dma_mask); +if (!IS_ENABLED (CONFIG_ARCH_DMA_ADDR_T_64BIT ) && +min (addr, end) <phys_to_dma (dev,PFN_PHYS (min_low_pfn))) +return false; + +return end <=min_not_zero (*dev->dma_mask, dev->bus_dma_mask); }#endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 51/191 clk: clk-gpio: propagate rate change to parent
In reply to Greg Kroah-HartmanFrom: Michael Hennerich <[email protected]>
[ Upstream commit fc59462c5ce60da119568fac325c92fc6b7c6175 ]
For an external clock source, which is gated via a GPIO, the rate change should typically be propagated to the parent clock.
The situation where we are requiring this propagation, is when an external clock is connected to override an internal clock (which typically has a fixed rate). The external clock can have a different rate than the internal one, and may also be variable, thus requiring the rate propagation.
This rate change wasn't propagated until now, and it's unclear about cases where this shouldn't be propagated. Thus, it's unclear whether this is fixing a bug, or extending the current driver behavior. Also, it's unsure about whether this may break any existing setups; in the case that it does, a device-tree property may be added to disable this flag.
--- drivers/clk/clk-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-gpio.c +1 -1
@@ -280,7 +280,7 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)else clk =clk_register_gpio_gate (&pdev->dev, node->name, parent_names ? parent_names[0 ] :NULL , gpiod, -0 ); +CLK_SET_RATE_PARENT );if (IS_ERR (clk))return PTR_ERR (clk);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 48/191 f2fs: fix to update dirs i_pino during cross_rename
In reply to Greg Kroah-HartmanFrom: Chao Yu <[email protected]>
[ Upstream commit 2a60637f06ac94869b2e630eaf837110d39bf291 ]
As Eric reported:
RENAME_EXCHANGE support was just added to fsstress in xfstests:
commit 65dfd40a97b6bbbd2a22538977bab355c5bc0f06 Author: kaixuxia <[email protected]> Date: Thu Oct 31 14:41:48 2019 +0800 fsstress: add EXCHANGE renameat2 support
This is causing xfstest generic/579 to fail due to fsck.f2fs reporting errors. I'm not sure what the problem is, but it still happens even with all the fs-verity stuff in the test commented out, so that the test just runs fsstress.
generic/579 23s ... [10:02:25]
[ 7.745370] run fstests generic/579 at 2019-11-04 10:02:25
_check_generic_filesystem: filesystem on /dev/vdc is inconsistent (see /results/f2fs/results-default/generic/579.full for details)
[10:02:47]
Ran: generic/579
Failures: generic/579
Failed 1 of 1 tests
Xunit report: /results/f2fs/results-default/result.xml
Here's the contents of 579.full:
_check_generic_filesystem: filesystem on /dev/vdc is inconsistent
*** fsck.f2fs output ***
[ASSERT] (__chk_dots_dentries:1378) --> Bad inode number[0x24] for '..', parent parent ino is [0xd10]
The root cause is that we forgot to update directory's i_pino during cross_rename, fix it.
--- fs/f2fs/namei.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
fs/f2fs/namei.c +12 -3
@@ -981,7 +981,8 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,if (!old_dir_entry || whiteout)file_lost_pino (old_inode);else -F2FS_I (old_inode)->i_pino = new_dir->i_ino; +/* adjust dir's i_pino to pass fsck check */ +f2fs_i_pino_write (old_inode, new_dir->i_ino);up_write (&F2FS_I (old_inode)->i_sem); old_inode->i_ctime =current_time (old_inode);
@@ -1141,7 +1142,11 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,f2fs_set_link (old_dir, old_entry, old_page, new_inode);down_write (&F2FS_I (old_inode)->i_sem); -file_lost_pino (old_inode); +if (!old_dir_entry) +file_lost_pino (old_inode); +else +/* adjust dir's i_pino to pass fsck check */ +f2fs_i_pino_write (old_inode, new_dir->i_ino);up_write (&F2FS_I (old_inode)->i_sem); old_dir->i_ctime =current_time (old_dir);
@@ -1156,7 +1161,11 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,f2fs_set_link (new_dir, new_entry, new_page, old_inode);down_write (&F2FS_I (new_inode)->i_sem); -file_lost_pino (new_inode); +if (!new_dir_entry) +file_lost_pino (new_inode); +else +/* adjust dir's i_pino to pass fsck check */ +f2fs_i_pino_write (new_inode, old_dir->i_ino);up_write (&F2FS_I (new_inode)->i_sem); new_dir->i_ctime =current_time (new_dir);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 42/191 ext4: update direct I/O read lock pattern for IOCB_NOWAIT
In reply to Greg Kroah-HartmanFrom: Matthew Bobrowski <[email protected]>
[ Upstream commit 548feebec7e93e58b647dba70b3303dcb569c914 ]
This patch updates the lock pattern in ext4_direct_IO_read() to not block on inode lock in cases of IOCB_NOWAIT direct I/O reads. The locking condition implemented here is similar to that of 942491c9e6d6 ("xfs: fix AIM7 regression").
--- fs/ext4/inode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/ext4/inode.c +7 -1
@@ -3836,7 +3836,13 @@ static ssize_t ext4_direct_IO_read(struct kiocb *iocb, struct iov_iter *iter)* writes & truncates and since we take care of writing back page cache, * we are protected against page writeback as well. */ -inode_lock_shared (inode); +if (iocb->ki_flags &IOCB_NOWAIT ) { +if (!inode_trylock_shared (inode)) +return -EAGAIN ; + }else { +inode_lock_shared (inode); + } + ret =filemap_write_and_wait_range (mapping, iocb->ki_pos, iocb->ki_pos + count -1 );if (ret)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 39/191 selftests/powerpc: Skip tm-signal-sigreturn-nt if TM not available
In reply to Greg Kroah-HartmanFrom: Michael Ellerman <[email protected]>
[ Upstream commit 505127068d9b705a6cf335143239db91bfe7bbe2 ]
On systems where TM (Transactional Memory) is disabled the tm-signal-sigreturn-nt test causes a SIGILL:
test: tm_signal_sigreturn_nt
tags: git_version:7c202575ef63
!! child died by signal 4
failure: tm_signal_sigreturn_nt
We should skip the test if TM is not available.
--- tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c +4 -0
@@ -10,10 +10,12 @@*/ #define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <signal.h> #include "utils.h" +#include "tm.h" void trap_signal_handler (int signo,siginfo_t *si,void *uc) {
@@ -29,6 +31,8 @@ int tm_signal_sigreturn_nt(void) {struct sigaction trap_sa; +SKIP_IF (!have_htm ()); + trap_sa.sa_flags =SA_SIGINFO ; trap_sa.sa_sigaction = trap_signal_handler;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 8/191 gpio: mxc: Only get the second IRQ when there is more than one IRQ
In reply to Greg Kroah-HartmanFrom: Anson Huang <[email protected]>
[ Upstream commit c8f3d144004dd3f471ffd414690d15a005e4acd6 ]
On some of i.MX SoCs like i.MX8QXP, there is ONLY one IRQ for each GPIO bank, so it is better to check the IRQ count before getting second IRQ to avoid below error message during probe:
[ 1.070908] gpio-mxc 5d080000.gpio: IRQ index 1 not found [ 1.077420] gpio-mxc 5d090000.gpio: IRQ index 1 not found [ 1.083766] gpio-mxc 5d0a0000.gpio: IRQ index 1 not found [ 1.090122] gpio-mxc 5d0b0000.gpio: IRQ index 1 not found [ 1.096470] gpio-mxc 5d0c0000.gpio: IRQ index 1 not found [ 1.102804] gpio-mxc 5d0d0000.gpio: IRQ index 1 not found [ 1.109144] gpio-mxc 5d0e0000.gpio: IRQ index 1 not found [ 1.115475] gpio-mxc 5d0f0000.gpio: IRQ index 1 not found
--- drivers/gpio/gpio-mxc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpio/gpio-mxc.c +10 -3
@@ -411,6 +411,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;struct mxc_gpio_port *port; +int irq_count;int irq_base;int err;
@@ -426,9 +427,15 @@ static int mxc_gpio_probe(struct platform_device *pdev)if (IS_ERR (port->base))return PTR_ERR (port->base); - port->irq_high =platform_get_irq (pdev,1 ); -if (port->irq_high <0 ) - port->irq_high =0 ; + irq_count =platform_irq_count (pdev); +if (irq_count <0 ) +return irq_count; + +if (irq_count >1 ) { + port->irq_high =platform_get_irq (pdev,1 ); +if (port->irq_high <0 ) + port->irq_high =0 ; + } port->irq =platform_get_irq (pdev,0 );if (port->irq <0 )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 4/191 scsi: lpfc: Fix discovery failures when target device connectivity bounces
In reply to Greg Kroah-HartmanFrom: James Smart <[email protected]>
[ Upstream commit 3f97aed6117c7677eb16756c4ec8b86000fd5822 ]
An issue was seen discovering all SCSI Luns when a target device undergoes link bounce.
The driver currently does not qualify the FC4 support on the target. Therefore it will send a SCSI PRLI and an NVMe PRLI. The expectation is that the target will reject the PRLI if it is not supported. If a PRLI times out, the driver will retry. The driver will not proceed with the device until both SCSI and NVMe PRLIs are resolved. In the failure case, the device is FCP only and does not respond to the NVMe PRLI, thus initiating the wait/retry loop in the driver. During that time, a RSCN is received (device bounced) causing the driver to issue a GID_FT. The GID_FT response comes back before the PRLI mess is resolved and it prematurely cancels the PRLI retry logic and leaves the device in a STE_PRLI_ISSUE state. Discovery with the target never completes or resets.
Fix by resetting the node state back to STE_NPR_NODE when GID_FT completes, thereby restarting the discovery process for the node.
--- drivers/scsi/lpfc/lpfc_hbadisc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_hbadisc.c +6 -1
@@ -5405,9 +5405,14 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)/* If we've already received a PLOGI from this NPort * we don't need to try to discover it again. */ -if (ndlp->nlp_flag &NLP_RCV_PLOGI ) +if (ndlp->nlp_flag &NLP_RCV_PLOGI && + !(ndlp->nlp_type & + (NLP_FCP_TARGET |NLP_NVME_TARGET )))return NULL ; + ndlp->nlp_prev_state = ndlp->nlp_state; +lpfc_nlp_set_state (vport, ndlp,NLP_STE_NPR_NODE ); +spin_lock_irq (shost->host_lock); ndlp->nlp_flag |=NLP_NPR_2B_DISC ;spin_unlock_irq (shost->host_lock);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 19/191 scsi: lpfc: Fix hardlockup in lpfc_abort_handler
In reply to Greg Kroah-HartmanFrom: James Smart <[email protected]>
[ Upstream commit 91a52b617cdb8bf6d298892101c061d438b84a19 ]
In lpfc_abort_handler, the lock acquire order is hbalock (irqsave), buf_lock (irq) and ring_lock (irq). The issue is that in two places the locks are released out of order - the buf_lock and the hbalock - resulting in the cpu preemption/lock flags getting restored out of order and deadlocking the cpu.
Fix the unlock order by fully releasing the hbalocks as well.
--- drivers/scsi/lpfc/lpfc_scsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +3 -2
@@ -4846,20 +4846,21 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) ret_val =__lpfc_sli_issue_iocb (phba,LPFC_FCP_RING , abtsiocb,0 ); } -/* no longer need the lock after this point */ -spin_unlock_irqrestore (&phba->hbalock, flags);if (ret_val ==IOCB_ERROR ) {/* Indicate the IO is not being aborted by the driver. */ iocb->iocb_flag &= ~LPFC_DRIVER_ABORTED ; lpfc_cmd->waitq =NULL ;spin_unlock (&lpfc_cmd->buf_lock); +spin_unlock_irqrestore (&phba->hbalock, flags);lpfc_sli_release_iocbq (phba, abtsiocb); ret =FAILED ; goto out; } +/* no longer need the lock after this point */ spin_unlock (&lpfc_cmd->buf_lock); +spin_unlock_irqrestore (&phba->hbalock, flags);if (phba->cfg_poll &DISABLE_FCP_RING_INT ) lpfc_sli_handle_fast_ring_event(phba,
Signature · 1 line
2.20.1
Re: [PATCH 5.4 055/191] mfd: mfd-core: Honour Device Trees request to disable a child-device
In reply to Greg Kroah-HartmanQuoted 9 lines · Greg Kroah-Hartman
From: Lee Jones <[email protected]>
[ Upstream commit
6b5c350648b857047b47acf74a57087ad27d6183]Until now, MFD has assumed all child devices passed to it (via
mfd_cells) are to be registered. It does not take into account requests from Device Tree and the like to disable child devices on a per-platform basis.
Quoted 4 lines
Well now it does.
As far as I understand it, this commit is not suitable for backporting. The link above explains the problem for a similar patch:
But I believe this would introduce a rather ugly bug in mfd_remove_devices() if the first sub-device is set to disabled:
It iterates over the children devices to find the base address of the allocated "usage count" array, which is then used to free it. If the first sub-device is missing, it would free the wrong address.
This problem does not exist in mainline because the MFD usage counting was removed entirely as part of the larger "Simplify MFD Core" series [1].
None of the device trees in the stable kernels should depend on disabling MFD devices from the device tree. (They were written at a time when the MFD core ignored that request entirely...) Therefore, I would suggest to drop this patch entirely.
[1]: https://lore.kernel.org/lkml/[email protected]/
Quoted 33 lines
Reported-by Barry Song <[email protected]>Reported-by Stephan Gerhold <[email protected]>Reviewed-by Daniel Thompson <[email protected]>Reviewed-by Mark Brown <[email protected]>Tested-by Stephan Gerhold <[email protected]>Signed-off-by Lee Jones <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/mfd/mfd-core.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/mfd/mfd-core.c +5
-0@@ -174,6 +174,11 @@ static int mfd_add_device(struct device *parent, int id,if (parent->of_node && cell->of_compatible) {for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { +if (!of_device_is_available (np)) { +/* Ignore disabled devices error free */ + ret =0 ; + goto fail_alias; + } pdev->dev.of_node = np; pdev->dev.fwnode = &np->fwnode;break ;Signature · 1 line
2.20.1
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
hello ,
compiled and booted 5.4.8-rc1+ on my laptop. No Regressions according to "sudo dmesg -l err".
--
software engineer
rajagiri school of engineering and technology
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
Build results:
total: 158 pass: 158 fail: 0 Qemu test results: total: 385 pass: 385 fail: 0
Guenter
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
LTP syscalls memfd_create04 failed on arm64 devices. Test PASS on arm, i386 and x86_64.
We are bisecting this failure on arm64.
Test case failed log,
memfd_create04.c:68: INFO: Attempt to create file using 64kB huge page size memfd_create04.c:76: FAIL: memfd_create() failed unexpectedly: ENOENT (2)
Strace output:memfd_create(\"tfile\", MFD_HUGETLB|0x40000000) = -1 ENOENT (No such file or directory)
Test case Description,
/*
* Test: Validating memfd_create() with MFD_HUGETLB and MFD_HUGE_x flags. *
* Test cases: Attempt to create files in the hugetlbfs filesystem using
* different huge page sizes.
*
* Test logic: memfd_create() should return non-negative value (fd)
* if the system supports that particular huge page size.
* On success, fd is returned.
* On failure, -1 is returned with ENODEV error.
*/
Test code snippet:
<>check_hugepage_support(&tflag);
tst_res(TINFO,
"Attempt to create file using %s huge page size",
tflag.h_size);
fd = sys_memfd_create("tfile", MFD_HUGETLB | tflag.flag); if (fd < 0) {
if (errno == tflag.exp_err)tst_res(TPASS, "Test failed as expected\n"); else
tst_brk(TFAIL | TERRNO,
"memfd_create() failed unexpectedly");
return;
}
<>
Steps to reproduce:
- cd /opt/ltp/testcases/bin/
- ./memfd_create04
Test output log,
https://lkft.validation.linaro.org/scheduler/job/1081716
Test results comparison,
https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/tests/ltp-syscalls-tests/memfd_create04
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 27 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
LTP syscalls
memfd_create04failed on arm64 devices. Test PASS on arm, i386 andx86_64.We are bisecting this failure on arm64.
Quoted 7 lines
Test case failed log,
memfd_create04.c:68: INFO: Attempt to create file using 64kB huge page size memfd_create04.c:76: FAIL:memfd_create()failed unexpectedly: ENOENT (2)Strace output:
memfd_create(\"tfile\", MFD_HUGETLB|0x40000000)= -1 ENOENT (No such file or directory)
-ENOENT is what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2 mm/hugetlbfs: fix error handling when setting up mounts
Quoted 49 lines
Test case Description,
/*
* Test: Validatingmemfd_create()withMFD_HUGETLBandMFD_HUGE_xflags. *
* Test cases: Attempt to create files in the hugetlbfs filesystem using
* different huge page sizes.
*
* Test logic:memfd_create()should return non-negative value (fd)
* if the system supports that particular huge page size.
* On success, fd is returned.
* On failure, -1 is returned with ENODEV error.
*/Test code snippet:
<>check_hugepage_support(&tflag);
tst_res(TINFO,
"Attempt to create file using %s huge page size",
tflag.h_size);fd =
sys_memfd_create("tfile", MFD_HUGETLB | tflag.flag); if (fd < 0) {
if (errno == tflag.exp_err)tst_res(TPASS, "Test failed as expected\n"); else
tst_brk(TFAIL | TERRNO,
"memfd_create()failed unexpectedly");
return;
}<>
Steps to reproduce:
- cd/opt/ltp/testcases/bin/
- ./memfd_create04Test output log,
https://lkft.validation.linaro.org/scheduler/job/1081716Test results comparison,
https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/tests/ltp-syscalls-tests/memfd_create04--
Linaro LKFT
https://lkft.linaro.org
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mounts
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
Arnd
Greg Kroah-Hartman
maintainerQuoted 11 lines · Arnd Bergmann
Quoted 10 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mounts
Quoted 7 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
So does that mean that Linus's tree shows this LTP failure as well?
This does seem to fix a real issue, as shown by the LTP test noticing it, so should the error code value be fixed in Linus's tree?
thanks,
greg k-h
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mounts
Quoted 8 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
I think autosel is way too aggressive. This is an excellent example.
Guenter
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mounts
Quoted 7 lines
Quoted 5 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
So does that mean that Linus's tree shows this LTP failure as well?
Yes, according to
https://qa-reports.linaro.org/lkft/linux-mainline-oe/tests/ltp-syscalls-tests/memfd_create04
mainline has the same testcase failure, it started happening between v5.4-10135-gc3bfc5dd73c6 and v5.4-10271-g596cf45cbf6e, when the patch was originally merged into 5.5-rc1.
Quoted 2 lines
This does seem to fix a real issue, as shown by the LTP test noticing it, so should the error code value be fixed in Linus's tree?
No idea what to conclude from the testcase failure, let's see if Mike has any suggestions.
Arnd
Greg Kroah-Hartman
maintainerQuoted 14 lines · Guenter Roeck
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mounts
Quoted 8 lines
Quoted 6 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
I think autosel is way too aggressive. This is an excellent example.
Why? It fixes a bug, the text says so, and the code shows it. This is a great example of a patch that autosel _should_ be picking up. Now the fact that it happens to break existing functionality is not an autosel-detectable thing. Especially as that same functionality is now broken in Linus's tree :)
Autosel assumes that patches are correct, it can't know that they are buggy. That should have been weeded out by the developers and testing before they hit Linus's tree.
thanks,
greg k-h
Quoted 30 lines · Arnd Bergmann
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mountsQuoted 7 lines
Quoted 5 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
So does that mean that Linus's tree shows this LTP failure as well?
Yes, according to
https://qa-reports.linaro.org/lkft/linux-mainline-oe/tests/ltp-syscalls-tests/memfd_create04
mainline has the same testcase failure, it started happening between v5.4-10135-gc3bfc5dd73c6 and v5.4-10271-g596cf45cbf6e, when the patch was originally merged into 5.5-rc1.
Quoted 6 lines
Quoted 2 lines
This does seem to fix a real issue, as shown by the LTP test noticing it, so should the error code value be fixed in Linus's tree?
No idea what to conclude from the testcase failure, let's see if Mike has any suggestions.
Thanks for isolating to this patch!
There are dependencies between arch specific code and arch independent code during the setup of hugetlb sizes/mounts. Let me take a closer look at the arm64 code and get access to a system for debug.
Signature · 1 line
Mike Kravetz
Jon Hunter
maintainerQuoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
All tests are passing for Tegra ...
Test results for stable-v5.4:
13 builds: 13 pass, 0 fail
22 boots: 22 pass, 0 fail
38 tests: 38 pass, 0 failLinux version: 5.4.8-rc1-gb06e60adec89
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Cheers
Jon
Signature · 1 line
nvpublic
Quoted 38 lines · Mike Kravetz
Quoted 30 lines · Arnd Bergmann
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mountsQuoted 7 lines
Quoted 5 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
So does that mean that Linus's tree shows this LTP failure as well?
Yes, according to
https://qa-reports.linaro.org/lkft/linux-mainline-oe/tests/ltp-syscalls-tests/memfd_create04
mainline has the same testcase failure, it started happening between v5.4-10135-gc3bfc5dd73c6 and v5.4-10271-g596cf45cbf6e, when the patch was originally merged into 5.5-rc1.Quoted 6 lines
Quoted 2 lines
This does seem to fix a real issue, as shown by the LTP test noticing it, so should the error code value be fixed in Linus's tree?
No idea what to conclude from the testcase failure, let's see if Mike has any suggestions.
Quoted 5 lines
Thanks for isolating to this patch!
There are dependencies between arch specific code and arch independent code during the setup of hugetlb sizes/mounts. Let me take a closer look at the arm64 code and get access to a system for debug.
Before I started investigating, Jan Stancek found and fixed the issue.
http://lkml.kernel.org/r/a14b944b6e5e207d2f84f43227c98ed1f68290a2.1578072927.git.jstancek@redhat.com
Signature · 1 line
Mike Kravetz
Quoted 4 lines · Mike Kravetz
Before I started investigating, Jan Stancek found and fixed the issue.
http://lkml.kernel.org/r/a14b944b6e5e207d2f84f43227c98ed1f68290a2.1578072927.git.jstancek@redhat.com
Applied upstream as commit 15f0ec941f4f ("mm/hugetlbfs: fix for_each_hstate() loop in init_hugetlbfs_fs()").
I didn't add a cc: stable, because the original didn't have one, and the "Fixes:" tag should make it happen.
Linus
Den 03-01-2020 kl. 20:40, skrev Linus Torvalds:
Quoted 6 lines · Mike Kravetz
Quoted 4 lines
Before I started investigating, Jan Stancek found and fixed the issue.
http://lkml.kernel.org/r/a14b944b6e5e207d2f84f43227c98ed1f68290a2.1578072927.git.jstancek@redhat.com
Quoted 8 lines
Applied upstream as commit
15f0ec941f4f("mm/hugetlbfs: fixfor_each_hstate()loop ininit_hugetlbfs_fs()").I didn't add a cc: stable, because the original didn't have one, and the "Fixes:" tag should make it happen.
Linus
Does not seem to exist in public git yet, maybe you forgot to push ?
--
Thomas
Quoted 2 lines · Thomas Backlund
Does not seem to exist in public git yet, maybe you forgot to push ?
Not "forgot", but I've pulled a couple of other things, and done my usual build tests etc. I tend batch up the pulls and pushes a bit, sorry for not making that clear.
But I've pushed it all out now.
Linus
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Den 03-01-2020 kl. 21:23, skrev Linus Torvalds:
Quoted 5 lines · Thomas Backlund
Quoted 1 line
Does not seem to exist in public git yet, maybe you forgot to push ?
Not "forgot", but I've pulled a couple of other things, and done my usual build tests etc. I tend batch up the pulls and pushes a bit, sorry for not making that clear.
Ok.
Quoted 3 lines
But I've pushed it all out now.
Linus
I got it, thanks
--
Thomas
Greg Kroah-Hartman
maintainerQuoted 41 lines · Mike Kravetz
Quoted 40 lines · Mike Kravetz
Quoted 30 lines · Arnd Bergmann
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 3 lines · Naresh Kamboju
On Fri, 3 Jan 2020 at 03:42, Greg Kroah-Hartman
<[email protected]> wrote:
-ENOENTis what you get when hugetlbfs is not mounted, so this hints to
8fc312b32b2mm/hugetlbfs: fix error handling when setting up mountsQuoted 7 lines
Quoted 5 lines
I see that Mike Kravetz suggested not putting this patch into stable in
https://lore.kernel.org/lkml/[email protected]/
but it was picked through the autosel mechanism later.
So does that mean that Linus's tree shows this LTP failure as well?
Yes, according to
https://qa-reports.linaro.org/lkft/linux-mainline-oe/tests/ltp-syscalls-tests/memfd_create04
mainline has the same testcase failure, it started happening between v5.4-10135-gc3bfc5dd73c6 and v5.4-10271-g596cf45cbf6e, when the patch was originally merged into 5.5-rc1.Quoted 6 lines
Quoted 2 lines
This does seem to fix a real issue, as shown by the LTP test noticing it, so should the error code value be fixed in Linus's tree?
No idea what to conclude from the testcase failure, let's see if Mike has any suggestions.
Thanks for isolating to this patch!
Quoted 7 lines
Quoted 3 lines
There are dependencies between arch specific code and arch independent code during the setup of hugetlb sizes/mounts. Let me take a closer look at the arm64 code and get access to a system for debug.
Before I started investigating, Jan Stancek found and fixed the issue.
http://lkml.kernel.org/r/a14b944b6e5e207d2f84f43227c98ed1f68290a2.1578072927.git.jstancek@redhat.com
Great, thanks for this, now queued up.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 15 lines · shuah
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing all of these and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 25 lines · Jon Hunter
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.8 release. There are 191 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 04 Jan 2020 21:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.8-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.Quoted 5 lines
thanks,
greg k-h
-------------
All tests are passing for Tegra ...
Test results for stable-v5.4:
Quoted 9 lines
13 builds: 13 pass, 0 fail 22 boots: 22 pass, 0 fail 38 tests: 38 pass, 0 failLinux version: 5.4.8-rc1-gb06e60adec89
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,tegra194-p2972-0000, tegra20-ventana, tegra210-p2371-2180, tegra30-cardhu-a04
Thanks for testing all of these and letting me know.
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 5.4 055/191] mfd: mfd-core: Honour Device Trees request to disable a child-device
In reply to Stephan GerholdQuoted 24 lines · Stephan Gerhold
Quoted 9 lines · Greg Kroah-Hartman
From: Lee Jones <[email protected]>
[ Upstream commit
6b5c350648b857047b47acf74a57087ad27d6183]Until now, MFD has assumed all child devices passed to it (via
mfd_cells) are to be registered. It does not take into account requests from Device Tree and the like to disable child devices on a per-platform basis.Quoted 4 lines
Well now it does.
As far as I understand it, this commit is not suitable for backporting. The link above explains the problem for a similar patch:
But I believe this would introduce a rather ugly bug in
mfd_remove_devices()if the first sub-device is set to disabled:
It iterates over the children devices to find the base address of the allocated "usage count" array, which is then used to free it. If the first sub-device is missing, it would free the wrong address.
Quoted 7 lines
This problem does not exist in mainline because the MFD usage counting was removed entirely as part of the larger "Simplify MFD Core" series [1].
None of the device trees in the stable kernels should depend on disabling MFD devices from the device tree. (They were written at a time when the MFD core ignored that request entirely...) Therefore, I would suggest to drop this patch entirely.
Thanks for catching this, now dropped from all stable queues.
greg k-h
Quoted 9 lines · Linus Torvalds
Quoted 4 lines · Mike Kravetz
Before I started investigating, Jan Stancek found and fixed the issue.
http://lkml.kernel.org/r/a14b944b6e5e207d2f84f43227c98ed1f68290a2.1578072927.git.jstancek@redhat.com
Applied upstream as commit
15f0ec941f4f("mm/hugetlbfs: fixfor_each_hstate()loop ininit_hugetlbfs_fs()").
After applying above patch.
LTP test case memfd_create04 getting PASS on mainline Linus's tree from Jan 3rd onwards.
ref link,
https://qa-reports.linaro.org/lkft/linux-mainline-oe/tests/ltp-syscalls-tests/memfd_create04
- Naresh Kamboju