5.11.14-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 152/210 i40e: Fix display statistics for veb_tc
In reply to Greg Kroah-HartmanFrom: Eryk Rybak <[email protected]>
[ Upstream commit c3214de929dbf1b7374add8bbed30ce82b197bbb ]
If veb-stats was enabled, the ethtool stats triggered a warning due to invalid size: 'unexpected stat size for veb.tc_%u_tx_packets'. This was due to an incorrect structure definition for the statistics. Structures and functions have been improved in line with requirements for the presentation of statistics, in particular for the functions:
'i40e_add_ethtool_stats' and 'i40e_add_stat_strings'.
--- .../net/ethernet/intel/i40e/i40e_ethtool.c | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +46 -6
@@ -232,6 +232,8 @@ static void __i40e_add_stat_strings(u8 **p, const struct i40e_stats stats[], I40E_STAT(struct i40e_vsi, _name, _stat)#define I40E_VEB_STAT (_name, _stat) \ I40E_STAT(struct i40e_veb, _name, _stat) +#define I40E_VEB_TC_STAT (_name, _stat) \ + I40E_STAT(struct i40e_cp_veb_tc_stats, _name, _stat)#define I40E_PFC_STAT (_name, _stat) \ I40E_STAT(struct i40e_pfc_stats, _name, _stat)#define I40E_QUEUE_STAT (_name, _stat) \
@@ -266,11 +268,18 @@ static const struct i40e_stats i40e_gstrings_veb_stats[] = { I40E_VEB_STAT("veb.rx_unknown_protocol", stats.rx_unknown_protocol), }; +struct i40e_cp_veb_tc_stats { +u64 tc_rx_packets; +u64 tc_rx_bytes; +u64 tc_tx_packets; +u64 tc_tx_bytes; +}; +static const struct i40e_stats i40e_gstrings_veb_tc_stats[] = { -I40E_VEB_STAT ("veb.tc_%u_tx_packets" , tc_stats.tc_tx_packets), -I40E_VEB_STAT ("veb.tc_%u_tx_bytes" , tc_stats.tc_tx_bytes), -I40E_VEB_STAT ("veb.tc_%u_rx_packets" , tc_stats.tc_rx_packets), -I40E_VEB_STAT ("veb.tc_%u_rx_bytes" , tc_stats.tc_rx_bytes), +I40E_VEB_TC_STAT ("veb.tc_%u_tx_packets" , tc_tx_packets), +I40E_VEB_TC_STAT ("veb.tc_%u_tx_bytes" , tc_tx_bytes), +I40E_VEB_TC_STAT ("veb.tc_%u_rx_packets" , tc_rx_packets), +I40E_VEB_TC_STAT ("veb.tc_%u_rx_bytes" , tc_rx_bytes), };static const struct i40e_stats i40e_gstrings_misc_stats[] = {
@@ -2217,6 +2226,29 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset) } } +/** +* i40e_get_veb_tc_stats - copy VEB TC statistics to formatted structure +* @tc: the TC statistics in VEB structure (veb->tc_stats) +* @i: the index of traffic class in (veb->tc_stats) structure to copy +* +* Copy VEB TC statistics from structure of arrays (veb->tc_stats) to +* one dimensional structure i40e_cp_veb_tc_stats. +* Produce formatted i40e_cp_veb_tc_stats structure of the VEB TC +* statistics for the given TC. +**/ +static struct i40e_cp_veb_tc_stats +i40e_get_veb_tc_stats (struct i40e_veb_tc_stats *tc,unsigned int i) +{ +struct i40e_cp_veb_tc_stats veb_tc = { + .tc_rx_packets = tc->tc_rx_packets[i], + .tc_rx_bytes = tc->tc_rx_bytes[i], + .tc_tx_packets = tc->tc_tx_packets[i], + .tc_tx_bytes = tc->tc_tx_bytes[i], + }; + +return veb_tc; +} +/** * i40e_get_pfc_stats - copy HW PFC statistics to formatted structure * @pf: the PF device structure
@@ -2301,8 +2333,16 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, i40e_gstrings_veb_stats);for (i =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) -i40e_add_ethtool_stats (&data, veb_stats ? veb :NULL , - i40e_gstrings_veb_tc_stats); +if (veb_stats) { +struct i40e_cp_veb_tc_stats veb_tc = +i40e_get_veb_tc_stats (&veb->tc_stats, i); + +i40e_add_ethtool_stats (&data, &veb_tc, + i40e_gstrings_veb_tc_stats); + }else { +i40e_add_ethtool_stats (&data,NULL , + i40e_gstrings_veb_tc_stats); + }i40e_add_ethtool_stats (&data, pf, i40e_gstrings_stats);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 156/210 mptcp: forbit mcast-related sockopt on MPTCP sockets
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
[ Upstream commit 86581852d7710990d8af9dadfe9a661f0abf2114 ]
Unrolling mcast state at msk dismantel time is bug prone, as syzkaller reported:
======================================================
WARNING: possible circular locking dependency detected
5.11.0-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor905/8822 is trying to acquire lock:ffffffff8d678fe8 (rtnl_mutex){+.+.}-{3:3}, at: ipv6_sock_mc_close+0xd7/0x110 net/ipv6/mcast.c:323
but task is already holding lock:ffff888024390120 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1600 [inline] ffff888024390120 (sk_lock-AF_INET6){+.+.}-{0:0}, at: mptcp6_release+0x57/0x130 net/mptcp/protocol.c:3507
which lock already depends on the new lock.
Instead we can simply forbit any mcast-related setsockopt
--- net/mptcp/protocol.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
net/mptcp/protocol.c +45 -0
@@ -2863,6 +2863,48 @@ static int mptcp_setsockopt_v6(struct mptcp_sock *msk, int optname,return ret; } +static bool mptcp_unsupported (int level,int optname) +{ +if (level ==SOL_IP ) { +switch (optname) { +case IP_ADD_MEMBERSHIP : +case IP_ADD_SOURCE_MEMBERSHIP : +case IP_DROP_MEMBERSHIP : +case IP_DROP_SOURCE_MEMBERSHIP : +case IP_BLOCK_SOURCE : +case IP_UNBLOCK_SOURCE : +case MCAST_JOIN_GROUP : +case MCAST_LEAVE_GROUP : +case MCAST_JOIN_SOURCE_GROUP : +case MCAST_LEAVE_SOURCE_GROUP : +case MCAST_BLOCK_SOURCE : +case MCAST_UNBLOCK_SOURCE : +case MCAST_MSFILTER : +return true; + } +return false; + } +if (level ==SOL_IPV6 ) { +switch (optname) { +case IPV6_ADDRFORM : +case IPV6_ADD_MEMBERSHIP : +case IPV6_DROP_MEMBERSHIP : +case IPV6_JOIN_ANYCAST : +case IPV6_LEAVE_ANYCAST : +case MCAST_JOIN_GROUP : +case MCAST_LEAVE_GROUP : +case MCAST_JOIN_SOURCE_GROUP : +case MCAST_LEAVE_SOURCE_GROUP : +case MCAST_BLOCK_SOURCE : +case MCAST_UNBLOCK_SOURCE : +case MCAST_MSFILTER : +return true; + } +return false; + } +return false; +} +static int mptcp_setsockopt (struct sock *sk,int level,int optname,sockptr_t optval,unsigned int optlen) {
@@ -2871,6 +2913,9 @@ static int mptcp_setsockopt(struct sock *sk, int level, int optname,pr_debug ("msk=%p" , msk); +if (mptcp_unsupported (level, optname)) +return -ENOPROTOOPT ; +if (level ==SOL_SOCKET )return mptcp_setsockopt_sol_socket (msk, optname, optval, optlen);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 129/210 mlxsw: spectrum: Fix ECN marking in tunnel decapsulation
In reply to Greg Kroah-HartmanFrom: Ido Schimmel <[email protected]>
[ Upstream commit 66167c310deb4ac1725f81004fb4b504676ad0bf ]
Cited commit changed the behavior of the software data path with regards to the ECN marking of decapsulated packets. However, the commit did not change other callers of __INET_ECN_decapsulate(), namely mlxsw. The driver is using the function in order to ensure that the hardware and software data paths act the same with regards to the ECN marking of decapsulated packets.
The discrepancy was uncovered by commit 5aa3c334a449 ("selftests:
forwarding: vxlan_bridge_1d: Fix vxlan ecn decapsulate value") that aligned the selftest to the new behavior. Without this patch the selftest passes when used with veth pairs, but fails when used with mlxsw netdevs.
Fix this by instructing the device to propagate the ECT(1) mark from the outer header to the inner header when the inner header is ECT(0), for both NVE and IP-in-IP tunnels.
A helper is added in order not to duplicate the code between both tunnel types.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 15 +++++++++++++++ .../net/ethernet/mellanox/mlxsw/spectrum_ipip.c | 7 +++---- .../net/ethernet/mellanox/mlxsw/spectrum_nve.c | 7 +++---- 3 files changed, 21 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum.h +15 -0
@@ -21,6 +21,7 @@#include <net/red.h> #include <net/vxlan.h> #include <net/flow_offload.h> +#include <net/inet_ecn.h> #include "port.h" #include "core.h"
@@ -346,6 +347,20 @@ struct mlxsw_sp_port_type_speed_ops {u32 (*ptys_proto_cap_masked_get)(u32 eth_proto_cap); }; +static inline u8 mlxsw_sp_tunnel_ecn_decap (u8 outer_ecn,u8 inner_ecn, +bool *trap_en) +{ +bool set_ce = false; + + *trap_en = !!__INET_ECN_decapsulate (outer_ecn, inner_ecn, &set_ce); +if (set_ce) +return INET_ECN_CE ; +else if (outer_ecn ==INET_ECN_ECT_1 && inner_ecn ==INET_ECN_ECT_0 ) +return INET_ECN_ECT_1 ; +else +return inner_ecn; +} +static inline struct net_device *mlxsw_sp_bridge_vxlan_dev_find (struct net_device *br_dev) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +3 -4
@@ -335,12 +335,11 @@ static int mlxsw_sp_ipip_ecn_decap_init_one(struct mlxsw_sp *mlxsw_sp, u8 inner_ecn, u8 outer_ecn) { char tidem_pl[MLXSW_REG_TIDEM_LEN]; -bool trap_en, set_ce = false;u8 new_inner_ecn; +bool trap_en; - trap_en =__INET_ECN_decapsulate (outer_ecn, inner_ecn, &set_ce); - new_inner_ecn = set_ce ?INET_ECN_CE : inner_ecn; - + new_inner_ecn =mlxsw_sp_tunnel_ecn_decap (outer_ecn, inner_ecn, + &trap_en);mlxsw_reg_tidem_pack (tidem_pl, outer_ecn, inner_ecn, new_inner_ecn, trap_en, trap_en ?MLXSW_TRAP_ID_DECAP_ECN0 :0 );return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (tidem), tidem_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +3 -4
@@ -909,12 +909,11 @@ static int __mlxsw_sp_nve_ecn_decap_init(struct mlxsw_sp *mlxsw_sp, u8 inner_ecn, u8 outer_ecn) { char tndem_pl[MLXSW_REG_TNDEM_LEN]; -bool trap_en, set_ce = false;u8 new_inner_ecn; +bool trap_en; - trap_en = !!__INET_ECN_decapsulate (outer_ecn, inner_ecn, &set_ce); - new_inner_ecn = set_ce ?INET_ECN_CE : inner_ecn; - + new_inner_ecn =mlxsw_sp_tunnel_ecn_decap (outer_ecn, inner_ecn, + &trap_en);mlxsw_reg_tndem_pack (tndem_pl, outer_ecn, inner_ecn, new_inner_ecn, trap_en, trap_en ?MLXSW_TRAP_ID_DECAP_ECN0 :0 );return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (tndem), tndem_pl);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 155/210 net: udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...);
In reply to Greg Kroah-HartmanFrom: Norman Maurer <[email protected]>
[ Upstream commit 98184612aca0a9ee42b8eb0262a49900ee9eef0d ]
Support for UDP_GRO was added in the past but the implementation for getsockopt was missed which did lead to an error when we tried to retrieve the setting for UDP_GRO. This patch adds the missing switch case for UDP_GRO
--- net/ipv4/udp.c | 4 ++++ 1 file changed, 4 insertions(+)
net/ipv4/udp.c +4 -0
@@ -2749,6 +2749,10 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname, val = up->gso_size;break ; +case UDP_GRO : + val = up->gro_enabled; +break ; +/* The following two cannot be changed on UDP sockets, the return is * always 0 (which corresponds to the full checksum coverage of UDP). */ case UDPLITE_SEND_CSCOV :
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 154/210 drm/msm: Set drvdata to NULL when msm_drm_init() fails
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit 5620b135aea49a8f41c86aaecfcb1598a7774121 ]
We should set the platform device's driver data to NULL here so that code doesn't assume the struct drm_device pointer is valid when it could have been destroyed. The lifetime of this pointer is managed by a kref but when msm_drm_init() fails we call drm_dev_put() on the pointer which will free the pointer's memory. This driver uses the component model, so there's sort of two "probes" in this file, one for the platform device i.e. msm_pdev_probe() and one for the component i.e. msm_drm_bind(). The msm_drm_bind() code is using the platform device's driver data to store struct drm_device so the two functions are intertwined.
This relationship becomes a problem for msm_pdev_shutdown() when it tests the NULL-ness of the pointer to see if it should call drm_atomic_helper_shutdown(). The NULL test is a proxy check for if the pointer has been freed by kref_put(). If the drm_device has been destroyed, then we shouldn't call the shutdown helper, and we know that is the case if msm_drm_init() failed, therefore set the driver data to NULL so that this pointer liveness is tracked properly.
Message-Id: <[email protected]>
--- drivers/gpu/drm/msm/msm_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_drv.c +1 -0
@@ -570,6 +570,7 @@ err_free_priv:kfree (priv); err_put_drm_dev:drm_dev_put (ddev); +platform_set_drvdata (pdev,NULL );return ret; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 158/210 scsi: ufs: core: Fix task management request completion timeout
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
[ Upstream commit 1235fc569e0bf541ddda0a1224d4c6fa6d914890 ]
ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = ufshcd_compl_tm()), but since blk_mq_tagset_busy_iter() only iterates over all reserved tags and requests which are not in IDLE state, ufshcd_compl_tm() never gets a chance to run. Thus, TMR always ends up with completion timeout. Fix it by calling blk_mq_start_request() in __ufshcd_issue_tm_cmd().
--- drivers/scsi/ufs/ufshcd.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufshcd.c +1 -0
@@ -6381,6 +6381,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,spin_lock_irqsave (host->host_lock, flags); task_tag = hba->nutrs + free_slot; +blk_mq_start_request (req); treq->req_header.dword_0 |=cpu_to_be32 (task_tag);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 161/210 drm/msm/disp/dpu1: program 3d_merge only if block is attached
In reply to Greg Kroah-HartmanFrom: Kalyan Thota <[email protected]>
[ Upstream commit 12aca1ce9ee33af3751aec5e55a5900747cbdd4b ]
Update the 3d merge as active in the data path only if the hw block is selected in the configuration.
Message-Id: <[email protected]>
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +3 -1
@@ -496,7 +496,9 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,DPU_REG_WRITE (c,CTL_TOP , mode_sel);DPU_REG_WRITE (c,CTL_INTF_ACTIVE , intf_active); -DPU_REG_WRITE (c,CTL_MERGE_3D_ACTIVE ,BIT (cfg->merge_3d -MERGE_3D_0 )); +if (cfg->merge_3d) +DPU_REG_WRITE (c,CTL_MERGE_3D_ACTIVE , +BIT (cfg->merge_3d -MERGE_3D_0 )); } static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 163/210 ARM: dts: turris-omnia: fix hardware buffer management
In reply to Greg Kroah-HartmanFrom: Rui Salvaterra <[email protected]>
[ Upstream commit 5b2c7e0ae762fff2b172caf16b2766cc3e1ad859 ]
Hardware buffer management has never worked on the Turris Omnia, as the required MBus window hadn't been reserved. Fix thusly.
--- arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +2 -1
@@ -32,7 +32,8 @@ ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 - MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>; + MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 + MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; internal-regs {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 126/210 can: bcm/raw: fix msg_namelen values depending on CAN_REQUIRED_SIZE
In reply to Greg Kroah-HartmanFrom: Oliver Hartkopp <[email protected]>
[ Upstream commit 9e9714742fb70467464359693a73b911a630226f ]
Since commit f5223e9eee65 ("can: extend sockaddr_can to include j1939 members") the sockaddr_can has been extended in size and a new CAN_REQUIRED_SIZE macro has been introduced to calculate the protocol specific needed size.
The ABI for the msg_name and msg_namelen has not been adapted to the new CAN_REQUIRED_SIZE macro for the other CAN protocols which leads to a problem when an existing binary reads the (increased) struct sockaddr_can in msg_name.
--- net/can/bcm.c | 10 ++++++---- net/can/raw.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-)
net/can/bcm.c +6 -4
@@ -86,6 +86,8 @@ MODULE_LICENSE("Dual BSD/GPL");MODULE_AUTHOR ("Oliver Hartkopp <[email protected]>" );MODULE_ALIAS ("can-proto-2" ); +#define BCM_MIN_NAMELEN CAN_REQUIRED_SIZE(struct sockaddr_can, can_ifindex) +/* * easy access to the first 64 bit of can(fd)_frame payload. cp->data is * 64 bit aligned so the offset has to be multiples of 8 which is ensured
@@ -1292,7 +1294,7 @@ static int bcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)/* no bound device as default => check msg_name */ DECLARE_SOCKADDR(struct sockaddr_can *, addr, msg->msg_name); -if (msg->msg_namelen <CAN_REQUIRED_SIZE (*addr, can_ifindex)) +if (msg->msg_namelen <BCM_MIN_NAMELEN )return -EINVAL ;if (addr->can_family !=AF_CAN )
@@ -1534,7 +1536,7 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,struct net *net =sock_net (sk);int ret =0 ; -if (len <CAN_REQUIRED_SIZE (*addr, can_ifindex)) +if (len <BCM_MIN_NAMELEN )return -EINVAL ;lock_sock (sk);
@@ -1616,8 +1618,8 @@ static int bcm_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,sock_recv_ts_and_drops (msg, sk, skb);if (msg->msg_name) { -__sockaddr_check_size (sizeof (struct sockaddr_can )); - msg->msg_namelen =sizeof (struct sockaddr_can ); +__sockaddr_check_size (BCM_MIN_NAMELEN ); + msg->msg_namelen =BCM_MIN_NAMELEN ;memcpy (msg->msg_name, skb->cb, msg->msg_namelen); }
net/can/raw.c +8 -6
@@ -60,6 +60,8 @@ MODULE_LICENSE("Dual BSD/GPL");MODULE_AUTHOR ("Urs Thuermann <[email protected]>" );MODULE_ALIAS ("can-proto-1" ); +#define RAW_MIN_NAMELEN CAN_REQUIRED_SIZE(struct sockaddr_can, can_ifindex) +#define MASK_ALL 0/* A raw socket has a list of can_filters attached to it, each receiving
@@ -394,7 +396,7 @@ static int raw_bind(struct socket *sock, struct sockaddr *uaddr, int len)int err =0 ;int notify_enetdown =0 ; -if (len <CAN_REQUIRED_SIZE (*addr, can_ifindex)) +if (len <RAW_MIN_NAMELEN )return -EINVAL ;if (addr->can_family !=AF_CAN )return -EINVAL ;
@@ -475,11 +477,11 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,if (peer)return -EOPNOTSUPP ; -memset (addr,0 ,sizeof (*addr)); +memset (addr,0 ,RAW_MIN_NAMELEN ); addr->can_family =AF_CAN ; addr->can_ifindex = ro->ifindex; -return sizeof (*addr); +return RAW_MIN_NAMELEN ; } static int raw_setsockopt(struct socket *sock, int level, int optname,
@@ -731,7 +733,7 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)if (msg->msg_name) { DECLARE_SOCKADDR(struct sockaddr_can *, addr, msg->msg_name); -if (msg->msg_namelen <CAN_REQUIRED_SIZE (*addr, can_ifindex)) +if (msg->msg_namelen <RAW_MIN_NAMELEN )return -EINVAL ;if (addr->can_family !=AF_CAN )
@@ -824,8 +826,8 @@ static int raw_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,sock_recv_ts_and_drops (msg, sk, skb);if (msg->msg_name) { -__sockaddr_check_size (sizeof (struct sockaddr_can )); - msg->msg_namelen =sizeof (struct sockaddr_can ); +__sockaddr_check_size (RAW_MIN_NAMELEN ); + msg->msg_namelen =RAW_MIN_NAMELEN ;memcpy (msg->msg_name, skb->cb, msg->msg_namelen); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 130/210 ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso
In reply to Greg Kroah-HartmanFrom: Lv Yunlong <[email protected]>
[ Upstream commit 63415767a2446136372e777cde5bb351f21ec21d ]
In myri10ge_sw_tso, the skb_list_walk_safe macro will set
(curr) = (segs) and (next) = (curr)->next. If status!=0 is true, the memory pointed by curr and segs will be free by dev_kfree_skb_any(curr). But later, the segs is used by segs = segs->next and causes a uaf.
As (next) = (curr)->next, my patch replaces seg->next to next.
--- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/myricom/myri10ge/myri10ge.c +1 -1
@@ -2897,7 +2897,7 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,dev_kfree_skb_any (curr);if (segs !=NULL ) { curr = segs; - segs = segs->next; + segs = next; curr->next =NULL ;dev_kfree_skb_any (segs); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 131/210 gianfar: Handle error code at MAC address change
In reply to Greg Kroah-HartmanFrom: Claudiu Manoil <[email protected]>
[ Upstream commit bff5b62585123823842833ab20b1c0a7fa437f8c ]
Handle return error code of eth_mac_addr();
--- drivers/net/ethernet/freescale/gianfar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/gianfar.c +5 -1
@@ -364,7 +364,11 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num,static int gfar_set_mac_addr (struct net_device *dev,void *p) { -eth_mac_addr (dev, p); +int ret; + + ret =eth_mac_addr (dev, p); +if (ret) +return ret;gfar_set_mac_for_addr (dev,0 , dev->dev_addr);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 162/210 Revert "arm64: dts: marvell: armada-cp110: Switch to per-port SATA interrupts"
In reply to Greg Kroah-HartmanFrom: Gregory CLEMENT <[email protected]>
[ Upstream commit 967ff33eb0efcd48e4df11ab9aee51c41e0f44d0 ]
The driver part of this support was not merged which leads to break AHCI on all Marvell Armada 7k8k / CN913x platforms as it was reported by Marcin Wojtas.
So for now let's remove it in order to fix the issue waiting for the driver part really be merged.
This reverts commit 53e950d597e3578da84238b86424bfcc9e101d87.
--- arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +3 -3
@@ -300,9 +300,11 @@ }; CP11X_LABEL(sata0): sata@540000 { - compatible = "marvell,armada-8k-ahci"; + compatible = "marvell,armada-8k-ahci", + "generic-ahci"; reg = <0x540000 0x30000>; dma-coherent; + interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&CP11X_LABEL(clk) 1 15>, <&CP11X_LABEL(clk) 1 16>; #address-cells = <1>;
@@ -310,12 +312,10 @@ status = "disabled"; sata-port@0 { - interrupts = <109 IRQ_TYPE_LEVEL_HIGH>; reg = <0>; }; sata-port@1 { - interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; reg = <1>; }; };
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 165/210 net: macb: restore cmp registers on resume path
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit a14d273ba15968495896a38b7b3399dba66d0270 ]
Restore CMP screener registers on resume path.
--- drivers/net/ethernet/cadence/macb_main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +7 -0
@@ -3235,6 +3235,9 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs)bool cmp_b = false;bool cmp_c = false; +if (!macb_is_gem (bp)) +return ; + tp4sp_v = &(fs->h_u.tcp_ip4_spec); tp4sp_m = &(fs->m_u.tcp_ip4_spec);
@@ -3603,6 +3606,7 @@ static void macb_restore_features(struct macb *bp) {struct net_device *netdev = bp->dev;netdev_features_t features = netdev->features; +struct ethtool_rx_fs_item *item;/* TX checksum offload */ macb_set_txcsum_feature (bp, features);
@@ -3611,6 +3615,9 @@ static void macb_restore_features(struct macb *bp)macb_set_rxcsum_feature (bp, features);/* RX Flow Filters */ +list_for_each_entry (item, &bp->rx_fs_list.list, list) +gem_prog_cmp_regs (bp, &item->fs); +macb_set_rxflow_feature (bp, features); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 174/210 can: mcp251x: fix support for half duplex SPI host controllers
In reply to Greg Kroah-HartmanFrom: Marc Kleine-Budde <[email protected]>
[ Upstream commit 617085fca6375e2c1667d1fbfc6adc4034c85f04 ]
Some SPI host controllers do not support full-duplex SPI transfers.
The function mcp251x_spi_trans() does a full duplex transfer. It is used in several places in the driver, where a TX half duplex transfer is sufficient.
To fix support for half duplex SPI host controllers, this patch introduces a new function mcp251x_spi_write() and changes all callers that do a TX half duplex transfer to use mcp251x_spi_write().
--- drivers/net/can/spi/mcp251x.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/net/can/spi/mcp251x.c +18 -6
@@ -314,6 +314,18 @@ static int mcp251x_spi_trans(struct spi_device *spi, int len)return ret; } +static int mcp251x_spi_write (struct spi_device *spi,int len) +{ +struct mcp251x_priv *priv =spi_get_drvdata (spi); +int ret; + + ret =spi_write (spi, priv->spi_tx_buf, len); +if (ret) +dev_err (&spi->dev,"spi write failed: ret = %d\n" , ret); + +return ret; +} +static u8 mcp251x_read_reg (struct spi_device *spi,u8 reg) {struct mcp251x_priv *priv =spi_get_drvdata (spi);
@@ -361,7 +373,7 @@ static void mcp251x_write_reg(struct spi_device *spi, u8 reg, u8 val) priv->spi_tx_buf[1 ] = reg; priv->spi_tx_buf[2 ] = val; -mcp251x_spi_trans (spi,3 ); +mcp251x_spi_write (spi,3 ); }static void mcp251x_write_2regs (struct spi_device *spi,u8 reg,u8 v1,u8 v2)
@@ -373,7 +385,7 @@ static void mcp251x_write_2regs(struct spi_device *spi, u8 reg, u8 v1, u8 v2) priv->spi_tx_buf[2 ] = v1; priv->spi_tx_buf[3 ] = v2; -mcp251x_spi_trans (spi,4 ); +mcp251x_spi_write (spi,4 ); } static void mcp251x_write_bits(struct spi_device *spi, u8 reg,
@@ -386,7 +398,7 @@ static void mcp251x_write_bits(struct spi_device *spi, u8 reg, priv->spi_tx_buf[2 ] = mask; priv->spi_tx_buf[3 ] = val; -mcp251x_spi_trans (spi,4 ); +mcp251x_spi_write (spi,4 ); }static u8 mcp251x_read_stat (struct spi_device *spi)
@@ -618,7 +630,7 @@ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf, buf[i]); }else {memcpy (priv->spi_tx_buf, buf,TXBDAT_OFF + len); -mcp251x_spi_trans (spi,TXBDAT_OFF + len); +mcp251x_spi_write (spi,TXBDAT_OFF + len); } }
@@ -650,7 +662,7 @@ static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame,/* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ priv->spi_tx_buf[0 ] =INSTRUCTION_RTS (1 << tx_buf_idx); -mcp251x_spi_trans (priv->spi,1 ); +mcp251x_spi_write (priv->spi,1 ); } static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
@@ -888,7 +900,7 @@ static int mcp251x_hw_reset(struct spi_device *spi)mdelay (MCP251X_OST_DELAY_MS ); priv->spi_tx_buf[0 ] =INSTRUCTION_RESET ; - ret =mcp251x_spi_trans (spi,1 ); + ret =mcp251x_spi_write (spi,1 );if (ret)return ret;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 181/210 net/mlx5: Fix PBMC register mapping
In reply to Greg Kroah-HartmanFrom: Aya Levin <[email protected]>
[ Upstream commit 534b1204ca4694db1093b15cf3e79a99fcb6a6da ]
Add reserved mapping to cover all the register in order to avoid setting arbitrary values to newer FW which implements the reserved fields.
--- include/linux/mlx5/mlx5_ifc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mlx5/mlx5_ifc.h +1 -1
@@ -10108,7 +10108,7 @@ struct mlx5_ifc_pbmc_reg_bits {struct mlx5_ifc_bufferx_reg_bits buffer[10 ]; -u8 reserved_at_2e0[0x40 ]; +u8 reserved_at_2e0[0x80 ]; };struct mlx5_ifc_qtct_reg_bits {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 182/210 RDMA/cxgb4: check for ipv6 address properly while destroying listener
In reply to Greg Kroah-HartmanFrom: Potnuri Bharat Teja <[email protected]>
[ Upstream commit 603c4690b01aaffe3a6c3605a429f6dac39852ae ]
ipv6 bit is wrongly set by the below which causes fatal adapter lookup engine errors for ipv4 connections while destroying a listener. Fix it to properly check the local address for ipv6.
--- drivers/infiniband/hw/cxgb4/cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +2 -1
@@ -3616,7 +3616,8 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)c4iw_init_wr_wait (ep->com.wr_waitp); err =cxgb4_remove_server ( ep->com.dev->rdev.lldi.ports[0 ], ep->stid, - ep->com.dev->rdev.lldi.rxq_ids[0 ], true); + ep->com.dev->rdev.lldi.rxq_ids[0 ], + ep->com.local_addr.ss_family ==AF_INET6 );if (err) goto done; err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 183/210 perf report: Fix wrong LBR block sorting
In reply to Greg Kroah-HartmanFrom: Jin Yao <[email protected]>
[ Upstream commit f2013278ae40b89cc27916366c407ce5261815ef ]
When '--total-cycles' is specified, it supports sorting for all blocks by 'Sampled Cycles%'. This is useful to concentrate on the globally hottest blocks.
'Sampled Cycles%' - block sampled cycles aggregation / total sampled cycles
But in current code, it doesn't use the cycles aggregation. Part of 'cycles' counting is possibly dropped for some overlap jumps. But for identifying the hot block, we always need the full cycles.
# perf record -b ./triad_loop # perf report --total-cycles --stdio
Before:
#
# Sampled Cycles% Sampled Cycles Avg Cycles% Avg Cycles [Program Block Range] Shared Object
# ............... .............. ........... .......... ............................................................. .................
#
0.81% 793 4.32% 793 [setup-vdso.h:34 -> setup-vdso.h:40] ld-2.27.so
0.49% 480 0.87% 160 [native_write_msr+0 -> native_write_msr+16] [kernel.kallsyms]
0.48% 476 0.52% 95 [native_read_msr+0 -> native_read_msr+29] [kernel.kallsyms]
0.31% 303 1.65% 303 [nmi_restore+0 -> nmi_restore+37] [kernel.kallsyms]
0.26% 255 1.39% 255 [nohz_balance_exit_idle+75 -> nohz_balance_exit_idle+162] [kernel.kallsyms]
0.24% 234 1.28% 234 [end_repeat_nmi+67 -> end_repeat_nmi+83] [kernel.kallsyms]
0.23% 227 1.24% 227 [__irqentry_text_end+96 -> __irqentry_text_end+126] [kernel.kallsyms]
0.20% 194 1.06% 194 [native_set_debugreg+52 -> native_set_debugreg+56] [kernel.kallsyms]
0.11% 106 0.14% 26 [native_sched_clock+0 -> native_sched_clock+98] [kernel.kallsyms]
0.10% 97 0.53% 97 [trigger_load_balance+0 -> trigger_load_balance+67] [kernel.kallsyms]
0.09% 85 0.46% 85 [get-dynamic-info.h:102 -> get-dynamic-info.h:111] ld-2.27.so
...
0.00% 92.7K 0.02% 4 [triad_loop.c:64 -> triad_loop.c:65] triad_loopThe hottest block '[triad_loop.c:64 -> triad_loop.c:65]' is not at the top of output.
After:
# Sampled Cycles% Sampled Cycles Avg Cycles% Avg Cycles [Program Block Range] Shared Object
# ............... .............. ........... .......... .............................................................. .................
#
94.35% 92.7K 0.02% 4 [triad_loop.c:64 -> triad_loop.c:65] triad_loop
0.81% 793 4.32% 793 [setup-vdso.h:34 -> setup-vdso.h:40] ld-2.27.so
0.49% 480 0.87% 160 [native_write_msr+0 -> native_write_msr+16] [kernel.kallsyms]
0.48% 476 0.52% 95 [native_read_msr+0 -> native_read_msr+29] [kernel.kallsyms]
0.31% 303 1.65% 303 [nmi_restore+0 -> nmi_restore+37] [kernel.kallsyms]
0.26% 255 1.39% 255 [nohz_balance_exit_idle+75 -> nohz_balance_exit_idle+162] [kernel.kallsyms]
0.24% 234 1.28% 234 [end_repeat_nmi+67 -> end_repeat_nmi+83] [kernel.kallsyms]
0.23% 227 1.24% 227 [__irqentry_text_end+96 -> __irqentry_text_end+126] [kernel.kallsyms]
0.20% 194 1.06% 194 [native_set_debugreg+52 -> native_set_debugreg+56] [kernel.kallsyms]
0.11% 106 0.14% 26 [native_sched_clock+0 -> native_sched_clock+98] [kernel.kallsyms]
0.10% 97 0.53% 97 [trigger_load_balance+0 -> trigger_load_balance+67] [kernel.kallsyms]
0.09% 85 0.46% 85 [get-dynamic-info.h:102 -> get-dynamic-info.h:111] ld-2.27.so
0.08% 82 0.06% 11 [intel_pmu_drain_pebs_nhm+580 -> intel_pmu_drain_pebs_nhm+627] [kernel.kallsyms]
0.08% 77 0.42% 77 [lru_add_drain_cpu+0 -> lru_add_drain_cpu+133] [kernel.kallsyms]
0.08% 74 0.10% 18 [handle_pmi_common+271 -> handle_pmi_common+310] [kernel.kallsyms]
0.08% 74 0.40% 74 [get-dynamic-info.h:131 -> get-dynamic-info.h:157] ld-2.27.so
0.07% 69 0.09% 17 [intel_pmu_drain_pebs_nhm+432 -> intel_pmu_drain_pebs_nhm+468] [kernel.kallsyms]Now the hottest block is reported at the top of output.
--- tools/perf/util/block-info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/block-info.c +3 -3
@@ -201,7 +201,7 @@ static int block_total_cycles_pct_entry(struct perf_hpp_fmt *fmt,double ratio =0.0 ;if (block_fmt->total_cycles) - ratio = (double )bi->cycles / (double )block_fmt->total_cycles; + ratio = (double )bi->cycles_aggr / (double )block_fmt->total_cycles;return color_pct (hpp, block_fmt->width,100.0 * ratio); }
@@ -216,9 +216,9 @@ static int64_t block_total_cycles_pct_sort(struct perf_hpp_fmt *fmt,double l, r;if (block_fmt->total_cycles) { - l = ((double )bi_l->cycles / + l = ((double )bi_l->cycles_aggr / (double )block_fmt->total_cycles) *100000.0 ; - r = ((double )bi_r->cycles / + r = ((double )bi_r->cycles_aggr / (double )block_fmt->total_cycles) *100000.0 ;return (int64_t )l - (int64_t )r; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 184/210 RDMA/qedr: Fix kernel panic when trying to access recv_cq
In reply to Greg Kroah-HartmanFrom: Kamal Heib <[email protected]>
[ Upstream commit e1ad897b9c738d5550be6762bf3a6ef1672259a4 ]
As INI QP does not require a recv_cq, avoid the following null pointer dereference by checking if the qp_type is not INI before trying to extract the recv_cq.
BUG: kernel NULL pointer dereference, address: 00000000000000e0 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 0 PID: 54250 Comm: mpitests-IMB-MP Not tainted 5.12.0-rc5 #1 Hardware name: Dell Inc. PowerEdge R320/0KM5PX, BIOS 2.7.0 08/19/2019 RIP: 0010:qedr_create_qp+0x378/0x820 [qedr] Code: 02 00 00 50 e8 29 d4 a9 d1 48 83 c4 18 e9 65 fe ff ff 48 8b 53 10 48 8b 43 18 44 8b 82 e0 00 00 00 45 85 c0 0f 84 10 74 00 00 <8b> b8 e0 00 00 00 85 ff 0f 85 50 fd ff ff e9 fd 73 00 00 48 8d bd RSP: 0018:ffff9c8f056f7a70 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff9c8f056f7b58 RCX: 0000000000000009 RDX: ffff8c41a9744c00 RSI: ffff9c8f056f7b58 RDI: ffff8c41c0dfa280 RBP: ffff8c41c0dfa280 R08: 0000000000000002 R09: 0000000000000001 R10: 0000000000000000 R11: ffff8c41e06fc608 R12: ffff8c4194052000 R13: 0000000000000000 R14: ffff8c4191546070 R15: ffff8c41c0dfa280 FS: 00007f78b2787b80(0000) GS:ffff8c43a3200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000e0 CR3: 00000001011d6002 CR4: 00000000001706f0 Call Trace: ib_uverbs_handler_UVERBS_METHOD_QP_CREATE+0x4e4/0xb90 [ib_uverbs] ? ib_uverbs_cq_event_handler+0x30/0x30 [ib_uverbs] ib_uverbs_run_method+0x6f6/0x7a0 [ib_uverbs] ? ib_uverbs_handler_UVERBS_METHOD_QP_DESTROY+0x70/0x70 [ib_uverbs] ? __cond_resched+0x15/0x30 ? __kmalloc+0x5a/0x440 ib_uverbs_cmd_verbs+0x195/0x360 [ib_uverbs] ? xa_load+0x6e/0x90 ? cred_has_capability+0x7c/0x130 ? avc_has_extended_perms+0x17f/0x440 ? vma_link+0xae/0xb0 ? vma_set_page_prot+0x2a/0x60 ? mmap_region+0x298/0x6c0 ? do_mmap+0x373/0x520 ? selinux_file_ioctl+0x17f/0x220 ib_uverbs_ioctl+0xa7/0x110 [ib_uverbs] __x64_sys_ioctl+0x84/0xc0 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f78b120262b
--- drivers/infiniband/hw/qedr/verbs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/qedr/verbs.c +2 -1
@@ -1244,7 +1244,8 @@ static int qedr_check_qp_attrs(struct ib_pd *ibpd, struct qedr_dev *dev,* TGT QP isn't associated with RQ/SQ */ if ((attrs->qp_type !=IB_QPT_GSI ) && (dev->gsi_qp_created) && - (attrs->qp_type !=IB_QPT_XRC_TGT )) { + (attrs->qp_type !=IB_QPT_XRC_TGT ) && + (attrs->qp_type !=IB_QPT_XRC_INI )) {struct qedr_cq *send_cq =get_qedr_cq (attrs->send_cq);struct qedr_cq *recv_cq =get_qedr_cq (attrs->recv_cq);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 166/210 clk: fix invalid usage of list cursor in register
In reply to Greg Kroah-HartmanFrom: Lukasz Bartosik <[email protected]>
[ Upstream commit 8d3c0c01cb2e36b2bf3c06a82b18b228d0c8f5d0 ]
Fix invalid usage of a list_for_each_entry cursor in clk_notifier_register(). When list is empty or if the list is completely traversed (without breaking from the loop on one of the entries) then the list cursor does not point to a valid entry and therefore should not be used.
The issue was dicovered when running 5.12-rc1 kernel on x86_64 with KASAN enabled:
BUG: KASAN: global-out-of-bounds in clk_notifier_register+0xab/0x230
Read of size 8 at addr ffffffffa0d10588 by task swapper/0/1
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc1 #1
Hardware name: Google Caroline/Caroline,
BIOS Google_Caroline.7820.430.0 07/20/2018
Call Trace:
dump_stack+0xee/0x15c
print_address_description+0x1e/0x2dc
kasan_report+0x188/0x1ce
? clk_notifier_register+0xab/0x230
? clk_prepare_lock+0x15/0x7b
? clk_notifier_register+0xab/0x230
clk_notifier_register+0xab/0x230
dw8250_probe+0xc01/0x10d4
...
Memory state around the buggy address:
ffffffffa0d10480: 00 00 00 00 00 03 f9 f9 f9 f9 f9 f9 00 00 00 00
ffffffffa0d10500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9
>ffffffffa0d10580: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
^
ffffffffa0d10600: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00
ffffffffa0d10680: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
==================================================================--- drivers/clk/clk.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/clk/clk.c +8 -9
@@ -4336,20 +4336,19 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb)/* search the list of notifiers for this clk */ list_for_each_entry (cn, &clk_notifier_list, node)if (cn->clk == clk) -break ; + goto found;/* if clk wasn't in the notifier list, allocate new clk_notifier */ -if (cn->clk != clk) { - cn =kzalloc (sizeof (*cn),GFP_KERNEL ); -if (!cn) - goto out; + cn =kzalloc (sizeof (*cn),GFP_KERNEL ); +if (!cn) + goto out; - cn->clk = clk; -srcu_init_notifier_head (&cn->notifier_head); + cn->clk = clk; +srcu_init_notifier_head (&cn->notifier_head); -list_add (&cn->node, &clk_notifier_list); - } +list_add (&cn->node, &clk_notifier_list); +found: ret =srcu_notifier_chain_register (&cn->notifier_head, nb); clk->core->notifier_count++;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 185/210 drm/vc4: crtc: Reduce PV fifo threshold on hvs4
In reply to Greg Kroah-HartmanFrom: Dom Cobley <[email protected]>
[ Upstream commit eb9dfdd1ed40357b99a4201c8534c58c562e48c9 ]
Experimentally have found PV on hvs4 reports fifo full error with expected settings and does not with one less
This appears as:
[drm:drm_atomic_helper_wait_for_flip_done] *ERROR* [CRTC:82:crtc-3] flip_done timed out
with bit 10 of PV_STAT set "HVS driving pixels when the PV FIFO is full"
--- drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/gpu/drm/vc4/vc4_crtc.c +17 -0
@@ -210,6 +210,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) {const struct vc4_crtc_data *crtc_data =vc4_crtc_to_vc4_crtc_data (vc4_crtc);const struct vc4_pv_data *pv_data =vc4_crtc_to_vc4_pv_data (vc4_crtc); +struct vc4_dev *vc4 =to_vc4_dev (vc4_crtc->base.dev);u32 fifo_len_bytes = pv_data->fifo_depth;/*
@@ -238,6 +239,22 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format)if (crtc_data->hvs_output ==5 )return 32 ; +/* +* It looks like in some situations, we will overflow +* the PixelValve FIFO (with the bit 10 of PV stat being +* set) and stall the HVS / PV, eventually resulting in +* a page flip timeout. +* +* Displaying the video overlay during a playback with +* Kodi on an RPi3 seems to be a great solution with a +* failure rate around 50%. +* +* Removing 1 from the FIFO full level however +* seems to completely remove that issue. +*/ +if (!vc4->hvs->hvs5) +return fifo_len_bytes -3 *HVS_FIFO_LATENCY_PIX -1 ; +return fifo_len_bytes -3 *HVS_FIFO_LATENCY_PIX ; } }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 186/210 i40e: Fix parameters in aq_get_phy_register()
In reply to Greg Kroah-HartmanFrom: Grzegorz Siwik <[email protected]>
[ Upstream commit b2d0efc4be7ed320e33eaa9b6dd6f3f6011ffb8e ]
Change parameters order in aq_get_phy_register() due to wrong statistics in PHY reported by ethtool. Previously all PHY statistics were exactly the same for all interfaces
Now statistics are reported correctly - different for different interfaces
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -5285,7 +5285,7 @@ static int i40e_get_module_eeprom(struct net_device *netdev, status =i40e_aq_get_phy_register (hw,I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE , - true, addr, offset, &value,NULL ); + addr, true, offset, &value,NULL );if (status)return -EIO ; data[i] = value;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 187/210 RDMA/addr: Be strict with gid size
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit d1c803a9ccd7bd3aff5e989ccfb39ed3b799b975 ]
The nla_len() is less than or equal to 16. If it's less than 16 then end of the "gid" buffer is uninitialized.
--- drivers/infiniband/core/addr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/core/addr.c +3 -1
@@ -76,7 +76,9 @@ static struct workqueue_struct *addr_wq;static const struct nla_policy ib_nl_addr_policy[LS_NLA_TYPE_MAX ] = { [LS_NLA_TYPE_DGID ] = {.type =NLA_BINARY , - .len =sizeof (struct rdma_nla_ls_gid )}, + .len =sizeof (struct rdma_nla_ls_gid ), + .validation_type =NLA_VALIDATE_MIN , + .min =sizeof (struct rdma_nla_ls_gid )}, };static inline bool ib_nl_is_good_ip_resp (const struct nlmsghdr *nlh)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 188/210 vdpa/mlx5: should exclude header length and fcs from mtu
In reply to Greg Kroah-HartmanFrom: Si-Wei Liu <[email protected]>
[ Upstream commit d084d996aaf53c0cc583dc75a4fc2a67fe485846 ]
When feature VIRTIO_NET_F_MTU is negotiated on mlx5_vdpa, 22 extra bytes worth of MTU length is shown in guest. This is because the mlx5_query_port_max_mtu API returns the "hardware" MTU value, which does not just contain the
Ethernet payload, but includes extra lengths starting
from the Ethernet header up to the FCS altogether.
Fix the MTU so packets won't get dropped silently.
--- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 ++++ drivers/vdpa/mlx5/net/mlx5_vnet.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/vdpa/mlx5/core/mlx5_vdpa.h +4 -0
@@ -4,9 +4,13 @@ #ifndef __MLX5_VDPA_H__ #define __MLX5_VDPA_H__ +#include <linux/etherdevice.h> +#include <linux/if_vlan.h> #include <linux/vdpa.h> #include <linux/mlx5/driver.h> +#define MLX5V_ETH_HARD_MTU (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN) + struct mlx5_vdpa_direct_mr { u64 start; u64 end;
drivers/vdpa/mlx5/net/mlx5_vnet.c +14 -1
@@ -1902,6 +1902,19 @@ static const struct vdpa_config_ops mlx5_vdpa_ops = { .free = mlx5_vdpa_free, }; +static int query_mtu (struct mlx5_core_dev *mdev,u16 *mtu) +{ +u16 hw_mtu; +int err; + + err =mlx5_query_nic_vport_mtu (mdev, &hw_mtu); +if (err) +return err; + + *mtu = hw_mtu -MLX5V_ETH_HARD_MTU ; +return 0 ; +} +static int alloc_resources (struct mlx5_vdpa_net *ndev) {struct mlx5_vdpa_net_resources *res = &ndev->res;
@@ -1987,7 +2000,7 @@ static int mlx5v_probe(struct auxiliary_device *adev,init_mvqs (ndev);mutex_init (&ndev->reslock); config = &ndev->config; - err =mlx5_query_nic_vport_mtu (mdev, &ndev->mtu); + err =query_mtu (mdev, &ndev->mtu);if (err) goto err_mtu;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 189/210 vdpa/mlx5: Fix wrong use of bit numbers
In reply to Greg Kroah-HartmanFrom: Eli Cohen <[email protected]>
[ Upstream commit 4b454a82418dd76d8c0590bb3f7a99a63ea57dc5 ]
VIRTIO_F_VERSION_1 is a bit number. Use BIT_ULL() with mask conditionals.
Also, in mlx5_vdpa_is_little_endian() use BIT_ULL for consistency with the rest of the code.
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +2 -2
@@ -820,7 +820,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueMLX5_SET (virtio_q, vq_ctx, event_qpn_or_msix, mvq->fwqp.mqp.qpn);MLX5_SET (virtio_q, vq_ctx, queue_size, mvq->num_ent);MLX5_SET (virtio_q, vq_ctx, virtio_version_1_0, - !!(ndev->mvdev.actual_features &VIRTIO_F_VERSION_1 )); + !!(ndev->mvdev.actual_features &BIT_ULL (VIRTIO_F_VERSION_1 )));MLX5_SET64 (virtio_q, vq_ctx, desc_addr, mvq->desc_addr);MLX5_SET64 (virtio_q, vq_ctx, used_addr, mvq->device_addr);MLX5_SET64 (virtio_q, vq_ctx, available_addr, mvq->driver_addr);
@@ -1550,7 +1550,7 @@ static void teardown_virtqueues(struct mlx5_vdpa_net *ndev)static inline bool mlx5_vdpa_is_little_endian (struct mlx5_vdpa_dev *mvdev) {return virtio_legacy_is_little_endian () || - (mvdev->actual_features & (1ULL <<VIRTIO_F_VERSION_1 )); + (mvdev->actual_features &BIT_ULL (VIRTIO_F_VERSION_1 )); }static __virtio16 cpu_to_mlx5vdpa16 (struct mlx5_vdpa_dev *mvdev,u16 val)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 190/210 RAS/CEC: Correct ce_add_elem()s returned values
In reply to Greg Kroah-HartmanFrom: William Roche <[email protected]>
commit 3a62583c2853b0ab37a57dde79decea210b5fb89 upstream.
ce_add_elem() uses different return values to signal a result from adding an element to the collector. Commit in Fixes: broke the case where the element being added is not found in the array. Correct that.
[ bp: Rewrite commit message, add kernel-doc comments. ]
--- drivers/ras/cec.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/ras/cec.c +12 -3
@@ -309,11 +309,20 @@ static bool sanity_check(struct ce_arrayreturn ret; } +/** +* cec_add_elem - Add an element to the CEC array. +* @pfn: page frame number to insert +* +* Return values: +* - <0: on error +* - 0: on success +* - >0: when the inserted pfn was offlined +*/ static int cec_add_elem (u64 pfn) {struct ce_array *ca = &ce_arr; +int count, err, ret =0 ;unsigned int to =0 ; -int count, ret =0 ;/* * We can be called very early on the identify_cpu() path where we are
@@ -330,8 +339,8 @@ static int cec_add_elem(u64 pfn)if (ca->n ==MAX_ELEMS )WARN_ON (!del_lru_elem_unlocked (ca)); - ret =find_elem (ca, pfn, &to); -if (ret <0 ) { + err =find_elem (ca, pfn, &to); +if (err <0 ) {/* * Shift range [to-end] to make room for one more element. */
Greg Kroah-Hartman
maintainerPATCH 191/210 clk: socfpga: fix iomem pointer cast on 64-bit
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 2867b9746cef78745c594894aece6f8ef826e0b4 upstream.
Pointers should be cast with uintptr_t instead of integer. This fixes warning when compile testing on ARM64:
drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
--- drivers/clk/socfpga/clk-gate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/socfpga/clk-gate.c +1 -1
@@ -99,7 +99,7 @@ static unsigned long socfpga_clk_recalc_ val =readl (socfpgaclk->div_reg) >> socfpgaclk->shift; val &=GENMASK (socfpgaclk->width -1 ,0 );/* Check for GPIO_DB_CLK by its offset */ -if ((int ) socfpgaclk->div_reg &SOCFPGA_GPIO_DB_CLK_OFFSET ) +if ((uintptr_t ) socfpgaclk->div_reg &SOCFPGA_GPIO_DB_CLK_OFFSET ) div = val +1 ;else div = (1 << val);
Greg Kroah-Hartman
maintainerPATCH 192/210 lockdep: Address clang -Wformat warning printing for %hd
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 6d48b7912cc72275dc7c59ff961c8bac7ef66a92 upstream.
Clang doesn't like format strings that truncate a 32-bit value to something shorter:
kernel/locking/lockdep.c:709:4: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat]
In this case, the warning is a slightly questionable, as it could realize that both class->wait_type_outer and class->wait_type_inner are in fact 8-bit struct members, even though the result of the ?: operator becomes an 'int'.
However, there is really no point in printing the number as a 16-bit 'short' rather than either an 8-bit or 32-bit number, so just change it to a normal %d.
--- kernel/locking/lockdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/locking/lockdep.c +1 -1
@@ -705,7 +705,7 @@ static void print_lock_name(struct lock_printk (KERN_CONT " (" );__print_lock_name (class); -printk (KERN_CONT "){%s}-{%hd:%hd}" , usage, +printk (KERN_CONT "){%s}-{%d:%d}" , usage, class->wait_type_outer ?: class->wait_type_inner, class->wait_type_inner); }
Greg Kroah-Hartman
maintainerPATCH 169/210 s390/cpcmd: fix inline assembly register clobbering
In reply to Greg Kroah-HartmanFrom: Alexander Gordeev <[email protected]>
[ Upstream commit 7a2f91441b2c1d81b77c1cd816a4659f4abc9cbe ]
Register variables initialized using arithmetic. That leads to kasan instrumentaton code corrupting the registers contents. Follow GCC guidlines and use temporary variables for assigning init values to register variables.
--- arch/s390/kernel/cpcmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/s390/kernel/cpcmd.c +4 -2
@@ -37,10 +37,12 @@ static int diag8_noresponse(int cmdlen)static int diag8_response (int cmdlen,char *response,int *rlen) { +unsigned long _cmdlen = cmdlen |0x40000000L ; +unsigned long _rlen = *rlen; register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; register unsigned long reg3 asm ("3") = (addr_t) response; - register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; - register unsigned long reg5 asm ("5") = *rlen; + register unsigned long reg4 asm ("4") = _cmdlen; + register unsigned long reg5 asm ("5") = _rlen; asmvolatile ( " diag %2,%0,0x8\n"
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 194/210 net: sched: bump refcount for new action in ACT replace mode
In reply to Greg Kroah-HartmanFrom: Kumar Kartikeya Dwivedi <[email protected]>
commit 6855e8213e06efcaf7c02a15e12b1ae64b9a7149 upstream.
Currently, action creation using ACT API in replace mode is buggy. When invoking for non-existent action index 42,
tc action replace action bpf obj foo.o sec <xyz> index 42
kernel creates the action, fills up the netlink response, and then just deletes the action after notifying userspace.
tc action show action bpf
doesn't list the action.
This happens due to the following sequence when ovr = 1 (replace mode) is enabled:
tcf_idr_check_alloc is used to atomically check and either obtain reference for existing action at index, or reserve the index slot using a dummy entry (ERR_PTR(-EBUSY)).
This is necessary as pointers to these actions will be held after dropping the idrinfo lock, so bumping the reference count is necessary as we need to insert the actions, and notify userspace by dumping their attributes. Finally, we drop the reference we took using the tcf_action_put_many call in tcf_action_add. However, for the case where a new action is created due to free index, its refcount remains one. This when paired with the put_many call leads to the kernel setting up the action, notifying userspace of its creation, and then tearing it down. For existing actions, the refcount is still held so they remain unaffected.
Fortunately due to rtnl_lock serialization requirement, such an action with refcount == 1 will not be concurrently deleted by anything else, at best CLS API can move its refcount up and down by binding to it after it has been published from tcf_idr_insert_many. Since refcount is atleast one until put_many call, CLS API cannot delete it. Also __tcf_action_put release path already ensures deterministic outcome (either new action will be created or existing action will be reused in case CLS API tries to bind to action concurrently) due to idr lock serialization.
We fix this by making refcount of newly created actions as 2 in ACT API replace mode. A relaxed store will suffice as visibility is ensured only after the tcf_idr_insert_many call.
Note that in case of creation or overwriting using CLS API only (i.e. bind = 1), overwriting existing action object is not allowed, and any such request is silently ignored (without error).
The refcount bump that occurs in tcf_idr_check_alloc call there for existing action will pair with tcf_exts_destroy call made from the owner module for the same action. In case of action creation, there is no existing action, so no tcf_exts_destroy callback happens.
This means no code changes for CLS API.
--- net/sched/act_api.c | 3 +++ 1 file changed, 3 insertions(+)
net/sched/act_api.c +3 -0
@@ -1049,6 +1049,9 @@ struct tc_action *tcf_action_init_1(struif (!name) a->hw_stats = hw_stats; +if (!bind && ovr && err ==ACT_P_CREATED ) +refcount_set (&a->tcfa_refcnt,2 ); +return a; err_out:
Greg Kroah-Hartman
maintainerPATCH 195/210 x86/traps: Correct exc_general_protection() and math_error() return paths
In reply to Greg Kroah-HartmanFrom: Thomas Tai <[email protected]>
commit 632a1c209b8773cb0119fe3aada9f1db14fa357c upstream.
Commit
334872a09198 ("x86/traps: Attempt to fixup exceptions in vDSO before signaling")
added return statements which bypass calling cond_local_irq_disable().
According to
ca4c6a9858c2 ("x86/traps: Make interrupt enable/disable symmetric in C code"),
cond_local_irq_disable() is needed because the asm return code no longer disables interrupts. Follow the existing code as an example to use "goto exit" instead of "return" statement.
[ bp: Massage commit message. ]
--- arch/x86/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/traps.c +2 -2
@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_pr tsk->thread.trap_nr =X86_TRAP_GP ;if (fixup_vdso_exception (regs,X86_TRAP_GP , error_code,0 )) -return ; + goto exit;show_signal (tsk,SIGSEGV ,"" , desc, regs, error_code);force_sig (SIGSEGV );
@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *r goto exit;if (fixup_vdso_exception (regs, trapnr,0 ,0 )) -return ; + goto exit;force_sig_fault (SIGFPE , si_code, (void __user *)uprobe_get_trap_addr (regs));
Greg Kroah-Hartman
maintainerPATCH 196/210 gpiolib: Read "gpio-line-names" from a firmware node
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit b41ba2ec54a70908067034f139aa23d0dd2985ce upstream.
On STM32MP1, the GPIO banks are subnodes of pin-controller@50002000, see arch/arm/boot/dts/stm32mp151.dtsi. The driver for pin-controller@50002000 is in drivers/pinctrl/stm32/pinctrl-stm32.c and iterates over all of its DT subnodes when registering each GPIO bank gpiochip. Each gpiochip has:
- gpio_chip.parent = dev,
where dev is the device node of the pin controller
- gpio_chip.of_node = np,
which is the OF node of the GPIO bank
Therefore, dev_fwnode(chip->parent) != of_fwnode_handle(chip.of_node), i.e. pin-controller@50002000 != pin-controller@50002000/gpio@5000*000.
The original code behaved correctly, as it extracted the "gpio-line-names" from of_fwnode_handle(chip.of_node) = pin-controller@50002000/gpio@5000*000.
To achieve the same behaviour, read property from the firmware node.
--- drivers/gpio/gpiolib.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/gpio/gpiolib.c +4 -8
@@ -365,22 +365,18 @@ static int gpiochip_set_desc_names(struc* * Looks for device property "gpio-line-names" and if it exists assigns * GPIO line names for the chip. The memory allocated for the assigned -* names belong to the underlying software node and should not be released +* names belong to the underlying firmware node and should not be released * by the caller. */ static int devprop_gpiochip_set_names (struct gpio_chip *chip) {struct gpio_device *gdev = chip->gpiodev; -struct device *dev = chip->parent; +struct fwnode_handle *fwnode =dev_fwnode (&gdev->dev);const char **names;int ret, i;int count; -/* GPIO chip may not have a parent device whose properties we inspect. */ -if (!dev) -return 0 ; - - count =device_property_string_array_count (dev,"gpio-line-names" ); + count =fwnode_property_string_array_count (fwnode,"gpio-line-names" );if (count <0 )return 0 ;
@@ -394,7 +390,7 @@ static int devprop_gpiochip_set_names(stif (!names)return -ENOMEM ; - ret =device_property_read_string_array (dev,"gpio-line-names" , + ret =fwnode_property_read_string_array (fwnode,"gpio-line-names" , names, count);if (ret <0 ) {dev_warn (&gdev->dev,"failed to read GPIO line names\n" );
Greg Kroah-Hartman
maintainerPATCH 197/210 cfg80211: remove WARN_ON() in cfg80211_sme_connect
In reply to Greg Kroah-HartmanFrom: Du Cheng <[email protected]>
commit 1b5ab825d9acc0f27d2f25c6252f3526832a9626 upstream.
A WARN_ON(wdev->conn) would trigger in cfg80211_sme_connect(), if multiple send_msg(NL80211_CMD_CONNECT) system calls are made from the userland, which should be anticipated and handled by the wireless driver. Remove this WARN_ON() to prevent kernel panic if kernel is configured to "panic_on_warn".
Bug reported by syzbot.
--- net/wireless/sme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/sme.c +1 -1
@@ -530,7 +530,7 @@ static int cfg80211_sme_connect(struct wcfg80211_sme_free (wdev); } -if (WARN_ON (wdev->conn)) +if (wdev->conn)return -EINPROGRESS ; wdev->conn =kzalloc (sizeof (*wdev->conn),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 198/210 net: tun: set tun->dev->addr_len during TUNSETLINK processing
In reply to Greg Kroah-HartmanFrom: Phillip Potter <[email protected]>
commit cca8ea3b05c972ffb5295367e6c544369b45fbdd upstream.
When changing type with TUNSETLINK ioctl command, set tun->dev->addr_len to match the appropriate type, using new tun_get_addr_len utility function which returns appropriate address length for given type. Fixes a KMSAN-found uninit-value bug reported by syzbot at:
https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51
--- drivers/net/tun.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
drivers/net/tun.c +48 -0
@@ -69,6 +69,14 @@#include <linux/bpf.h> #include <linux/bpf_trace.h> #include <linux/mutex.h> +#include <linux/ieee802154.h> +#include <linux/if_ltalk.h> +#include <uapi/linux/if_fddi.h> +#include <uapi/linux/if_hippi.h> +#include <uapi/linux/if_fc.h> +#include <net/ax25.h> +#include <net/rose.h> +#include <net/6lowpan.h> #include <linux/uaccess.h> #include <linux/proc_fs.h>
@@ -2925,6 +2933,45 @@ static int tun_set_ebpf(struct tun_strucreturn __tun_set_ebpf (tun, prog_p, prog); } +/* Return correct value for tun->dev->addr_len based on tun->dev->type. */ +static unsigned char tun_get_addr_len (unsigned short type) +{ +switch (type) { +case ARPHRD_IP6GRE : +case ARPHRD_TUNNEL6 : +return sizeof (struct in6_addr ); +case ARPHRD_IPGRE : +case ARPHRD_TUNNEL : +case ARPHRD_SIT : +return 4 ; +case ARPHRD_ETHER : +return ETH_ALEN ; +case ARPHRD_IEEE802154 : +case ARPHRD_IEEE802154_MONITOR : +return IEEE802154_EXTENDED_ADDR_LEN ; +case ARPHRD_PHONET_PIPE : +case ARPHRD_PPP : +case ARPHRD_NONE : +return 0 ; +case ARPHRD_6LOWPAN : +return EUI64_ADDR_LEN ; +case ARPHRD_FDDI : +return FDDI_K_ALEN ; +case ARPHRD_HIPPI : +return HIPPI_ALEN ; +case ARPHRD_IEEE802 : +return FC_ALEN ; +case ARPHRD_ROSE : +return ROSE_ADDR_LEN ; +case ARPHRD_NETROM : +return AX25_ADDR_LEN ; +case ARPHRD_LOCALTLK : +return LTALK_ALEN ; +default : +return 0 ; + } +} +static long __tun_chr_ioctl (struct file *file,unsigned int cmd,unsigned long arg,int ifreq_len) {
@@ -3088,6 +3135,7 @@ static long __tun_chr_ioctl(struct filebreak ; } tun->dev->type = (int ) arg; + tun->dev->addr_len =tun_get_addr_len (tun->dev->type);netif_info (tun, drv, tun->dev,"linktype set to %d\n" , tun->dev->type); call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE,
Greg Kroah-Hartman
maintainerPATCH 199/210 drivers: net: fix memory leak in atusb_probe
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
commit 6b9fbe16955152626557ec6f439f3407b7769941 upstream.
syzbot reported memory leak in atusb_probe()[1]. The problem was in atusb_alloc_urbs().
Since urb is anchored, we need to release the reference to correctly free the urb
backtrace:
[<ffffffff82ba0466>] kmalloc include/linux/slab.h:559 [inline]
[<ffffffff82ba0466>] usb_alloc_urb+0x66/0xe0 drivers/usb/core/urb.c:74
[<ffffffff82ad3888>] atusb_alloc_urbs drivers/net/ieee802154/atusb.c:362 [inline][2]
[<ffffffff82ad3888>] atusb_probe+0x158/0x820 drivers/net/ieee802154/atusb.c:1038 [1]--- drivers/net/ieee802154/atusb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ieee802154/atusb.c +1 -0
@@ -365,6 +365,7 @@ static int atusb_alloc_urbs(struct atusbreturn -ENOMEM ; }usb_anchor_urb (urb, &atusb->idle_urbs); +usb_free_urb (urb); n--; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 164/210 net: cls_api: Fix uninitialised struct field bo->unlocked_driver_cb
In reply to Greg Kroah-HartmanFrom: Yunjian Wang <[email protected]>
[ Upstream commit 990b03b05b2fba79de2a1ee9dc359fc552d95ba6 ]
The 'unlocked_driver_cb' struct field in 'bo' is not being initialized in tcf_block_offload_init(). The uninitialized 'unlocked_driver_cb' will be used when calling unlocked_driver_cb(). So initialize 'bo' to zero to avoid the issue.
Addresses-Coverity: ("Uninitialized scalar variable")
--- net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/cls_api.c +1 -1
@@ -646,7 +646,7 @@ static void tc_block_indr_cleanup(struct flow_block_cb *block_cb)struct net_device *dev = block_cb->indr.dev;struct Qdisc *sch = block_cb->indr.sch;struct netlink_ext_ack extack = {}; -struct flow_block_offload bo; +struct flow_block_offload bo = {}; tcf_block_offload_init(&bo, dev, sch, FLOW_BLOCK_UNBIND, block_cb->indr.binder_type,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 170/210 perf inject: Fix repipe usage
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
[ Upstream commit 026334a3bb6a3919b42aba9fc11843db2b77fd41 ]
Since commit 14d3d54052539a1e ("perf session: Try to read pipe data from file") 'perf inject' has started printing "PERFILE2h" when not processing pipes.
The commit exposed perf to the possiblity that the input is not a pipe but the 'repipe' parameter gets used. That causes the printing because perf inject sets 'repipe' to true always.
The 'repipe' parameter of perf_session__new() is used by 2 functions:
- perf_file_header__read_pipe()
- trace_report()
In both cases, the functions copy data to STDOUT_FILENO when 'repipe' is true.
Fix by setting 'repipe' to true only if the output is a pipe.
--- tools/perf/builtin-inject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-inject.c +1 -1
@@ -906,7 +906,7 @@ int cmd_inject(int argc, const char **argv) } data.path = inject.input_name; - inject.session =perf_session__new (&data, true, &inject.tool); + inject.session =perf_session__new (&data, inject.output.is_pipe, &inject.tool);if (IS_ERR (inject.session))return PTR_ERR (inject.session);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 171/210 openvswitch: fix send of uninitialized stack memory in ct limit reply
In reply to Greg Kroah-HartmanFrom: Ilya Maximets <[email protected]>
[ Upstream commit 4d51419d49930be2701c2633ae271b350397c3ca ]
'struct ovs_zone_limit' has more members than initialized in ovs_ct_limit_get_default_limit(). The rest of the memory is a random kernel stack content that ends up being sent to userspace.
Fix that by using designated initializer that will clear all non-specified fields.
--- net/openvswitch/conntrack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/openvswitch/conntrack.c +4 -4
@@ -2032,10 +2032,10 @@ static int ovs_ct_limit_del_zone_limit(struct nlattr *nla_zone_limit,static int ovs_ct_limit_get_default_limit (struct ovs_ct_limit_info *info,struct sk_buff *reply) { -struct ovs_zone_limit zone_limit; - - zone_limit.zone_id =OVS_ZONE_LIMIT_DEFAULT_ZONE ; - zone_limit.limit = info->default_limit; +struct ovs_zone_limit zone_limit = { + .zone_id =OVS_ZONE_LIMIT_DEFAULT_ZONE , + .limit = info->default_limit, + };return nla_put_nohdr (reply,sizeof (zone_limit), &zone_limit); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 172/210 i2c: designware: Adjust bus_freq_hz when refuse high speed mode set
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 5e729bc54bda705f64941008b018b4e41a4322bf ]
When hardware doesn't support High Speed Mode, we forget bus_freq_hz timing adjustment. This makes the timings and real registers being unsynchronized. Adjust bus_freq_hz when refuse high speed mode set.
--- drivers/i2c/busses/i2c-designware-master.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-designware-master.c +1 -0
@@ -129,6 +129,7 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)if ((comp_param1 &DW_IC_COMP_PARAM_1_SPEED_MODE_MASK ) !=DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH ) {dev_err (dev->dev,"High Speed not supported!\n" ); + t->bus_freq_hz =I2C_MAX_FAST_MODE_FREQ ; dev->master_cfg &= ~DW_IC_CON_SPEED_MASK ; dev->master_cfg |=DW_IC_CON_SPEED_FAST ; dev->hs_hcnt =0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 173/210 iwlwifi: fix 11ax disabled bit in the regulatory capability flags
In reply to Greg Kroah-HartmanFrom: Luca Coelho <[email protected]>
[ Upstream commit 07cc40fec9a85e669ea12e161a438d2cbd76f1ed ]
When version 2 of the regulatory capability flags API was implemented, the flag to disable 11ax was defined as bit 13, but this was later changed and the bit remained as bit 10, like in version 1. This was never changed in the driver, so we were checking for the wrong bit in newer devices. Fix it.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +1 -1
@@ -232,7 +232,7 @@ enum iwl_reg_capa_flags_v2 {REG_CAPA_V2_MCS_9_ALLOWED =BIT (6 ),REG_CAPA_V2_WEATHER_DISABLED =BIT (7 ),REG_CAPA_V2_40MHZ_ALLOWED =BIT (8 ), - REG_CAPA_V2_11AX_DISABLED = BIT(13), + REG_CAPA_V2_11AX_DISABLED = BIT(10), };/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 203/210 net: ieee802154: fix nl802154 del llsec key
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 37feaaf5ceb2245e474369312bb7b922ce7bce69 upstream.
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1592,7 +1592,8 @@ static int nl802154_del_llsec_key(structstruct nlattr *attrs[NL802154_KEY_ATTR_MAX +1 ];struct ieee802154_llsec_key_id id; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ;if (ieee802154_llsec_parse_key_id (attrs[NL802154_KEY_ATTR_ID ], &id) <0 )
Greg Kroah-Hartman
maintainerPATCH 204/210 net: ieee802154: fix nl802154 del llsec dev
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 3d1eac2f45585690d942cf47fd7fbd04093ebd1b upstream.
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVICE is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1758,7 +1758,8 @@ static int nl802154_del_llsec_dev(structstruct nlattr *attrs[NL802154_DEV_ATTR_MAX +1 ];__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVICE ] || +nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR ])
Greg Kroah-Hartman
maintainerPATCH 208/210 net: ieee802154: forbid monitor for del llsec seclevel
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 9dde130937e95b72adfae64ab21d6e7e707e2dac upstream.
This patch forbids to del llsec seclevel for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -2092,6 +2092,9 @@ static int nl802154_del_llsec_seclevel(sstruct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_seclevel sl; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_LEVEL ] ||llsec_parse_seclevel (info->attrs[NL802154_ATTR_SEC_LEVEL ], &sl) <0 )
Greg Kroah-Hartman
maintainerPATCH 202/210 net: ieee802154: nl-mac: fix check on panid
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 6f7f657f24405f426212c09260bf7fe8a52cef33 upstream.
This patch fixes a null pointer derefence for panid handle by move the check for the netlink variable directly before accessing them.
--- net/ieee802154/nl-mac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/ieee802154/nl-mac.c +4 -3
@@ -551,9 +551,7 @@ ieee802154_llsec_parse_key_id(struct gen desc->mode =nla_get_u8 (info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE ]);if (desc->mode ==IEEE802154_SCF_KEY_IMPLICIT ) { -if (!info->attrs[IEEE802154_ATTR_PAN_ID ] && - !(info->attrs[IEEE802154_ATTR_SHORT_ADDR ] || - info->attrs[IEEE802154_ATTR_HW_ADDR ])) +if (!info->attrs[IEEE802154_ATTR_PAN_ID ])return -EINVAL ; desc->device_addr.pan_id =nla_get_shortaddr (info->attrs[IEEE802154_ATTR_PAN_ID ]);
@@ -562,6 +560,9 @@ ieee802154_llsec_parse_key_id(struct gen desc->device_addr.mode =IEEE802154_ADDR_SHORT ; desc->device_addr.short_addr =nla_get_shortaddr (info->attrs[IEEE802154_ATTR_SHORT_ADDR ]); }else { +if (!info->attrs[IEEE802154_ATTR_HW_ADDR ]) +return -EINVAL ; + desc->device_addr.mode =IEEE802154_ADDR_LONG ; desc->device_addr.extended_addr =nla_get_hwaddr (info->attrs[IEEE802154_ATTR_HW_ADDR ]); }
Greg Kroah-Hartman
maintainerPATCH 206/210 net: ieee802154: fix nl802154 del llsec devkey
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 27c746869e1a135dffc2f2a80715bb7aa00445b4 upstream.
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVKEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1916,7 +1916,8 @@ static int nl802154_del_llsec_devkey(strstruct ieee802154_llsec_device_key key;__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] || +nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR ])
Greg Kroah-Hartman
maintainerPATCH 88/210 i2c: turn recovery error on init to debug
In reply to Greg Kroah-HartmanFrom: Wolfram Sang <[email protected]>
commit e409a6a3e0690efdef9b8a96197bc61ff117cfaf upstream.
In some configurations, recovery is optional. So, don't throw an error when it is not used because e.g. pinctrl settings for recovery are not provided. Reword the message and make it debug output.
--- drivers/i2c/i2c-core-base.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/i2c/i2c-core-base.c +4 -3
@@ -378,7 +378,7 @@ static int i2c_gpio_init_recovery(structstatic int i2c_init_recovery (struct i2c_adapter *adap) {struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; -char *err_str; +char *err_str, *err_level =KERN_ERR ;if (!bri)return 0 ;
@@ -387,7 +387,8 @@ static int i2c_init_recovery(struct i2c_return -EPROBE_DEFER ;if (!bri->recover_bus) { - err_str ="no recover_bus() found" ; + err_str ="no suitable method provided" ; + err_level =KERN_DEBUG ; goto err; }
@@ -414,7 +415,7 @@ static int i2c_init_recovery(struct i2c_return 0 ; err: -dev_err (&adap->dev,"Not using recovery: %s\n" , err_str); +dev_printk (err_level, &adap->dev,"Not using recovery: %s\n" , err_str); adap->bus_recovery_info =NULL ;return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 207/210 net: ieee802154: forbid monitor for set llsec params
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 88c17855ac4291fb462e13a86b7516773b6c932e upstream.
This patch forbids to set llsec params for monitor interfaces which we don't support yet.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1384,6 +1384,9 @@ static int nl802154_set_llsec_params(stru32 changed =0 ;int ret; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (info->attrs[NL802154_ATTR_SEC_ENABLED ]) {u8 enabled;
Greg Kroah-Hartman
maintainerPATCH 209/210 net: ieee802154: stop dump llsec params for monitors
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 1534efc7bbc1121e92c86c2dabebaf2c9dcece19 upstream.
This patch stops dumping llsec params for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -820,8 +820,13 @@ nl802154_send_iface(struct sk_buff *msg, goto nla_put_failure;#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) + goto out; +if (nl802154_get_llsec_params (msg, rdev, wpan_dev) <0 ) goto nla_put_failure; + +out:#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ genlmsg_end (msg, hdr);
Greg Kroah-Hartman
maintainerPATCH 136/210 ARM: dts: imx6: pbab01: Set vmmc supply for both SD interfaces
In reply to Greg Kroah-HartmanFrom: Stefan Riedmueller <[email protected]>
[ Upstream commit f57011e72f5fe0421ec7a812beb1b57bdf4bb47f ]
Setting the vmmc supplies is crucial since otherwise the supplying regulators get disabled and the SD interfaces are no longer powered which leads to system failures if the system is booted from that SD interface.
--- arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi +2 -0
@@ -433,6 +433,7 @@ pinctrl-0 = <&pinctrl_usdhc2>; cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + vmmc-supply = <&vdd_sd1_reg>; status = "disabled"; };
@@ -442,5 +443,6 @@ &pinctrl_usdhc3_cdwp>; cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; + vmmc-supply = <&vdd_sd0_reg>; status = "disabled"; };
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 139/210 nfp: flower: ignore duplicate merge hints from FW
In reply to Greg Kroah-HartmanFrom: Yinjun Zhang <[email protected]>
[ Upstream commit 2ea538dbee1c79f6f6c24a6f2f82986e4b7ccb78 ]
A merge hint message needs some time to process before the merged flow actually reaches the firmware, during which we may get duplicate merge hints if there're more than one packet that hit the pre-merged flow. And processing duplicate merge hints will cost extra host_ctx's which are a limited resource.
Avoid the duplicate merge by using hash table to store the sub_flows to be merged.
--- .../net/ethernet/netronome/nfp/flower/main.h | 8 ++++ .../ethernet/netronome/nfp/flower/metadata.c | 16 ++++++- .../ethernet/netronome/nfp/flower/offload.c | 48 ++++++++++++++++++- 3 files changed, 69 insertions(+), 3 deletions(-)
drivers/net/ethernet/netronome/nfp/flower/main.h +8 -0
@@ -190,6 +190,7 @@ struct nfp_fl_internal_ports {* @qos_rate_limiters: Current active qos rate limiters * @qos_stats_lock: Lock on qos stats updates * @pre_tun_rule_cnt: Number of pre-tunnel rules offloaded +* @merge_table: Hash table to store merged flows */ struct nfp_flower_priv {struct nfp_app *app;
@@ -223,6 +224,7 @@ struct nfp_flower_priv {unsigned int qos_rate_limiters;spinlock_t qos_stats_lock;/* Protect the qos stats */ int pre_tun_rule_cnt; +struct rhashtable merge_table; };/**
@@ -350,6 +352,12 @@ struct nfp_fl_payload_link { };extern const struct rhashtable_params nfp_flower_table_params; +extern const struct rhashtable_params merge_table_params; + +struct nfp_merge_info { +u64 parent_ctx; +struct rhash_head ht_node; +};struct nfp_fl_stats_frame {__be32 stats_con_id;
drivers/net/ethernet/netronome/nfp/flower/metadata.c +15 -1
@@ -490,6 +490,12 @@ const struct rhashtable_params nfp_flower_table_params = { .automatic_shrinking = true, }; +const struct rhashtable_params merge_table_params = { + .key_offset = offsetof(struct nfp_merge_info , parent_ctx), + .head_offset = offsetof(struct nfp_merge_info , ht_node), + .key_len =sizeof (u64), +}; +int nfp_flower_metadata_init (struct nfp_app *app,u64 host_ctx_count,unsigned int host_num_mems) {
@@ -506,6 +512,10 @@ int nfp_flower_metadata_init(struct nfp_app *app, u64 host_ctx_count,if (err) goto err_free_flow_table; + err =rhashtable_init (&priv->merge_table, &merge_table_params); +if (err) + goto err_free_stats_ctx_table; +get_random_bytes (&priv->mask_id_seed,sizeof (priv->mask_id_seed));/* Init ring buffer and unallocated mask_ids. */
@@ -513,7 +523,7 @@ int nfp_flower_metadata_init(struct nfp_app *app, u64 host_ctx_count,kmalloc_array (NFP_FLOWER_MASK_ENTRY_RS ,NFP_FLOWER_MASK_ELEMENT_RS ,GFP_KERNEL );if (!priv->mask_ids.mask_id_free_list.buf) - goto err_free_stats_ctx_table; + goto err_free_merge_table; priv->mask_ids.init_unallocated =NFP_FLOWER_MASK_ENTRY_RS -1 ;
@@ -550,6 +560,8 @@ err_free_last_used:kfree (priv->mask_ids.last_used); err_free_mask_id:kfree (priv->mask_ids.mask_id_free_list.buf); +err_free_merge_table: +rhashtable_destroy (&priv->merge_table); err_free_stats_ctx_table:rhashtable_destroy (&priv->stats_ctx_table); err_free_flow_table:
@@ -568,6 +580,8 @@ void nfp_flower_metadata_cleanup(struct nfp_app *app) nfp_check_rhashtable_empty, NULL);rhashtable_free_and_destroy (&priv->stats_ctx_table, nfp_check_rhashtable_empty,NULL ); +rhashtable_free_and_destroy (&priv->merge_table, + nfp_check_rhashtable_empty,NULL );kvfree (priv->stats);kfree (priv->mask_ids.mask_id_free_list.buf);kfree (priv->mask_ids.last_used);
drivers/net/ethernet/netronome/nfp/flower/offload.c +46 -2
89 lines not on this page · raw message
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 141/210 I2C: JZ4780: Fix bug for Ingenic X1000.
In reply to Greg Kroah-HartmanFrom: 周琰杰 (Zhou Yanjie) <[email protected]>
[ Upstream commit 942bfbecc0281c75db84f744b9b77b0f2396f484 ]
Only send "X1000_I2C_DC_STOP" when last byte, or it will cause error when I2C write operation which should look like this:
device_addr + w, reg_addr, data;
But without this patch, it looks like this:
device_addr + w, reg_addr, device_addr + w, data;
--- drivers/i2c/busses/i2c-jz4780.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-jz4780.c +2 -2
@@ -526,8 +526,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id) i2c_sta =jz4780_i2c_readw (i2c,JZ4780_I2C_STA ); data = *i2c->wbuf; data &= ~JZ4780_I2C_DC_READ ; -if ((!i2c->stop_hold) && (i2c->cdata->version >= -ID_X1000 )) +if ((i2c->wt_len ==1 ) && (!i2c->stop_hold) && + (i2c->cdata->version >=ID_X1000 )) data |=X1000_I2C_DC_STOP ;jz4780_i2c_writew (i2c,JZ4780_I2C_DC , data); i2c->wbuf++;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 143/210 net/mlx5e: Fix mapping of ct_label zero
In reply to Greg Kroah-HartmanFrom: Ariel Levkovich <[email protected]>
[ Upstream commit d24f847e54214049814b9515771622eaab3f42ab ]
ct_label 0 is a default label each flow has and therefore there can be rules that match on ct_label=0 without a prior rule that set the ct_label to this value.
The ct_label value is not used directly in the HW rules and instead it is mapped to some id within a defined range and this id is used to set and match the metadata register which carries the ct_label.
If we have a rule that matches on ct_label=0, the hw rule will perform matching on a value that is != 0 because of the mapping from label to id. Since the metadata register default value is 0 and it was never set before to anything else by an action that sets the ct_label, there will always be a mismatch between that register and the value in the rule.
To support such rule, a forced mapping of ct_label 0 to id=0 is done so that it will match the metadata register default value of 0.
--- .../ethernet/mellanox/mlx5/core/en/tc_ct.c | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +29 -7
@@ -184,6 +184,28 @@ mlx5_tc_ct_entry_has_nat(struct mlx5_ct_entry *entry)return !!(entry->tuple_nat_node.next); } +static int +mlx5_get_label_mapping (struct mlx5_tc_ct_priv *ct_priv, +u32 *labels,u32 *id) +{ +if (!memchr_inv (labels,0 ,sizeof (u32) *4 )) { + *id =0 ; +return 0 ; + } + +if (mapping_add (ct_priv->labels_mapping, labels, id)) +return -EOPNOTSUPP ; + +return 0 ; +} + +static void +mlx5_put_label_mapping (struct mlx5_tc_ct_priv *ct_priv,u32 id) +{ +if (id) +mapping_remove (ct_priv->labels_mapping, id); +} +static int mlx5_tc_ct_rule_to_tuple (struct mlx5_ct_tuple *tuple,struct flow_rule *rule) {
@@ -435,7 +457,7 @@ mlx5_tc_ct_entry_del_rule(struct mlx5_tc_ct_priv *ct_priv,mlx5_tc_rule_delete (netdev_priv (ct_priv->netdev), zone_rule->rule, attr);mlx5e_mod_hdr_detach (ct_priv->dev, ct_priv->mod_hdr_tbl, zone_rule->mh); -mapping_remove (ct_priv->labels_mapping, attr->ct_attr.ct_labels_id); +mlx5_put_label_mapping (ct_priv, attr->ct_attr.ct_labels_id);kfree (attr); }
@@ -638,8 +660,8 @@ mlx5_tc_ct_entry_create_mod_hdr(struct mlx5_tc_ct_priv *ct_priv,if (!meta)return -EOPNOTSUPP ; - err =mapping_add (ct_priv->labels_mapping, meta->ct_metadata.labels, - &attr->ct_attr.ct_labels_id); + err =mlx5_get_label_mapping (ct_priv, meta->ct_metadata.labels, + &attr->ct_attr.ct_labels_id);if (err)return -EOPNOTSUPP ;if (nat) {
@@ -675,7 +697,7 @@ mlx5_tc_ct_entry_create_mod_hdr(struct mlx5_tc_ct_priv *ct_priv, err_mapping:dealloc_mod_hdr_actions (&mod_acts); -mapping_remove (ct_priv->labels_mapping, attr->ct_attr.ct_labels_id); +mlx5_put_label_mapping (ct_priv, attr->ct_attr.ct_labels_id);return err; }
@@ -743,7 +765,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, err_rule:mlx5e_mod_hdr_detach (ct_priv->dev, ct_priv->mod_hdr_tbl, zone_rule->mh); -mapping_remove (ct_priv->labels_mapping, attr->ct_attr.ct_labels_id); +mlx5_put_label_mapping (ct_priv, attr->ct_attr.ct_labels_id); err_mod_hdr:kfree (attr); err_attr:
@@ -1198,7 +1220,7 @@ void mlx5_tc_ct_match_del(struct mlx5_tc_ct_priv *priv, struct mlx5_ct_attr *ct_if (!priv || !ct_attr->ct_labels_id)return ; -mapping_remove (priv->labels_mapping, ct_attr->ct_labels_id); +mlx5_put_label_mapping (priv, ct_attr->ct_labels_id); }int
@@ -1276,7 +1298,7 @@ mlx5_tc_ct_match_add(struct mlx5_tc_ct_priv *priv, ct_labels[1 ] = key->ct_labels[1 ] & mask->ct_labels[1 ]; ct_labels[2 ] = key->ct_labels[2 ] & mask->ct_labels[2 ]; ct_labels[3 ] = key->ct_labels[3 ] & mask->ct_labels[3 ]; -if (mapping_add (priv->labels_mapping, ct_labels, &ct_attr->ct_labels_id)) +if (mlx5_get_label_mapping (priv, ct_labels, &ct_attr->ct_labels_id))return -EOPNOTSUPP ;mlx5e_tc_match_to_reg_match (spec,LABELS_TO_REG , ct_attr->ct_labels_id,MLX5_CT_LABELS_MASK );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 157/210 mptcp: revert "mptcp: provide subflow aware release function"
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
[ Upstream commit 0a3cc57978d1d1448312f8973bd84dca4a71433a ]
This change reverts commit ad98dd37051e ("mptcp: provide subflow aware release function"). The latter introduced a deadlock spotted by syzkaller and is not needed anymore after the previous commit.
--- net/mptcp/protocol.c | 55 ++------------------------------------------ 1 file changed, 2 insertions(+), 53 deletions(-)
net/mptcp/protocol.c +2 -53
@@ -11,7 +11,6 @@#include <linux/netdevice.h> #include <linux/sched/signal.h> #include <linux/atomic.h> -#include <linux/igmp.h> #include <net/sock.h> #include <net/inet_common.h> #include <net/inet_hashtables.h>
@@ -20,7 +19,6 @@#include <net/tcp_states.h> #if IS_ENABLED (CONFIG_MPTCP_IPV6 )#include <net/transp_v6.h> -#include <net/addrconf.h> #endif #include <net/mptcp.h> #include <net/xfrm.h>
@@ -3424,34 +3422,10 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,return mask; } -static int mptcp_release (struct socket *sock) -{ -struct mptcp_subflow_context *subflow; -struct sock *sk = sock->sk; -struct mptcp_sock *msk; - -if (!sk) -return 0 ; - -lock_sock (sk); - - msk =mptcp_sk (sk); - -mptcp_for_each_subflow (msk, subflow) { -struct sock *ssk =mptcp_subflow_tcp_sock (subflow); - -ip_mc_drop_socket (ssk); - } - -release_sock (sk); - -return inet_release (sock); -} -static const struct proto_ops mptcp_stream_ops = { .family =PF_INET , .owner =THIS_MODULE , - .release = mptcp_release, + .release = inet_release, .bind = mptcp_bind, .connect = mptcp_stream_connect, .socketpair = sock_no_socketpair,
@@ -3498,35 +3472,10 @@ void __init mptcp_proto_init(void) }#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) -static int mptcp6_release (struct socket *sock) -{ -struct mptcp_subflow_context *subflow; -struct mptcp_sock *msk; -struct sock *sk = sock->sk; - -if (!sk) -return 0 ; - -lock_sock (sk); - - msk =mptcp_sk (sk); - -mptcp_for_each_subflow (msk, subflow) { -struct sock *ssk =mptcp_subflow_tcp_sock (subflow); - -ip_mc_drop_socket (ssk); -ipv6_sock_mc_close (ssk); -ipv6_sock_ac_close (ssk); - } - -release_sock (sk); -return inet6_release (sock); -} -static const struct proto_ops mptcp_v6_stream_ops = { .family =PF_INET6 , .owner =THIS_MODULE , - .release = mptcp6_release, + .release = inet6_release, .bind = mptcp_bind, .connect = mptcp_stream_connect, .socketpair = sock_no_socketpair,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 160/210 drm/msm: a6xx: fix version check for the A650 SQE microcode
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 6ddbfa1f5adbd5dea14ff66778ca58257f09f17d ]
I suppose the microcode version check for a650 is incorrect. It checks for the version 1.95, while the firmware released have major version of 0:
0.91 (vulnerable), 0.99 (fixing the issue).
Lower version requirements to accept firmware 0.99.
Message-Id: <[email protected]>
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +3 -3
@@ -566,17 +566,17 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu, }else {/* * a650 tier targets don't need whereami but still need to be -* equal to or newer than 1.95 for other security fixes +* equal to or newer than 0.95 for other security fixes */ if (adreno_is_a650 (adreno_gpu)) { -if ((buf[0 ] &0xfff ) >=0x195 ) { +if ((buf[0 ] &0xfff ) >=0x095 ) { ret = true; goto out; }DRM_DEV_ERROR (&gpu->pdev->dev,"a650 SQE ucode is too old. Have version %x need at least %x\n" , - buf[0 ] &0xfff ,0x195 ); + buf[0 ] &0xfff ,0x095 ); }/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 159/210 scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
[ Upstream commit 4b42d557a8add52b9a9924fb31e40a218aab7801 ]
In __ufshcd_issue_tm_cmd(), it is not correct to use hba->nutrs + req->tag as the Task Tag in a TMR UPIU. Directly use req->tag as the Task Tag.
--- drivers/scsi/ufs/ufshcd.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/scsi/ufs/ufshcd.c +13 -17
@@ -6363,38 +6363,34 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,DECLARE_COMPLETION_ONSTACK (wait);struct request *req;unsigned long flags; -int free_slot, task_tag, err; +int task_tag, err;/* -* Get free slot, sleep if slots are unavailable. -* Even though we use wait_event() which sleeps indefinitely, -* the maximum wait time is bounded by %TM_CMD_TIMEOUT. +* blk_get_request() is used here only to get a free tag. */ req =blk_get_request (q,REQ_OP_DRV_OUT ,0 );if (IS_ERR (req))return PTR_ERR (req); req->end_io_data = &wait; - free_slot = req->tag; -WARN_ON_ONCE (free_slot <0 || free_slot >= hba->nutmrs);ufshcd_hold (hba, false);spin_lock_irqsave (host->host_lock, flags); - task_tag = hba->nutrs + free_slot;blk_mq_start_request (req); + task_tag = req->tag; treq->req_header.dword_0 |=cpu_to_be32 (task_tag); -memcpy (hba->utmrdl_base_addr + free_slot, treq,sizeof (*treq)); -ufshcd_vops_setup_task_mgmt (hba, free_slot, tm_function); +memcpy (hba->utmrdl_base_addr + task_tag, treq,sizeof (*treq)); +ufshcd_vops_setup_task_mgmt (hba, task_tag, tm_function);/* send command to the controller */ -__set_bit (free_slot, &hba->outstanding_tasks); +__set_bit (task_tag, &hba->outstanding_tasks);/* Make sure descriptors are ready before ringing the task doorbell */ wmb (); -ufshcd_writel (hba,1 << free_slot,REG_UTP_TASK_REQ_DOOR_BELL ); +ufshcd_writel (hba,1 << task_tag,REG_UTP_TASK_REQ_DOOR_BELL );/* Make sure that doorbell is committed immediately */ wmb ();
@@ -6414,24 +6410,24 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,ufshcd_add_tm_upiu_trace (hba, task_tag,"tm_complete_err" );dev_err (hba->dev,"%s: task management cmd 0x%.2x timed-out\n" , __func__, tm_function); -if (ufshcd_clear_tm_cmd (hba, free_slot)) -dev_WARN (hba->dev,"%s: unable clear tm cmd (slot %d) after timeout\n" , - __func__, free_slot); +if (ufshcd_clear_tm_cmd (hba, task_tag)) +dev_WARN (hba->dev,"%s: unable to clear tm cmd (slot %d) after timeout\n" , + __func__, task_tag); err = -ETIMEDOUT ; }else { err =0 ; -memcpy (treq, hba->utmrdl_base_addr + free_slot,sizeof (*treq)); +memcpy (treq, hba->utmrdl_base_addr + task_tag,sizeof (*treq));ufshcd_add_tm_upiu_trace (hba, task_tag,"tm_complete" ); }spin_lock_irqsave (hba->host->host_lock, flags); -__clear_bit (free_slot, &hba->outstanding_tasks); +__clear_bit (task_tag, &hba->outstanding_tasks);spin_unlock_irqrestore (hba->host->host_lock, flags); +ufshcd_release (hba);blk_put_request (req); -ufshcd_release (hba);return err; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 135/210 net:tipc: Fix a double free in tipc_sk_mcast_rcv
In reply to Greg Kroah-HartmanFrom: Lv Yunlong <[email protected]>
[ Upstream commit 6bf24dc0cc0cc43b29ba344b66d78590e687e046 ]
In the if(skb_peek(arrvq) == skb) branch, it calls __skb_dequeue(arrvq) to get the skb by skb = skb_peek(arrvq). Then __skb_dequeue() unlinks the skb from arrvq and returns the skb which equals to skb_peek(arrvq). After __skb_dequeue(arrvq) finished, the skb is freed by kfree_skb(__skb_dequeue(arrvq)) in the first time.
Unfortunately, the same skb is freed in the second time by kfree_skb(skb) after the branch completed.
My patch removes kfree_skb() in the if(skb_peek(arrvq) == skb) branch, because this skb will be freed by kfree_skb(skb) finally.
--- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/socket.c +1 -1
@@ -1265,7 +1265,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,spin_lock_bh (&inputq->lock);if (skb_peek (arrvq) == skb) {skb_queue_splice_tail_init (&tmpq, inputq); -kfree_skb (__skb_dequeue (arrvq)); +__skb_dequeue (arrvq); }spin_unlock_bh (&inputq->lock);__skb_queue_purge (&tmpq);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 134/210 cxgb4: avoid collecting SGE_QBASE regs during traffic
In reply to Greg Kroah-HartmanFrom: Rahul Lakkireddy <[email protected]>
[ Upstream commit 1bfb3dea965ff9f6226fd1709338f227363b6061 ]
Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX registers can lead to SGE missing doorbells under heavy traffic. So, only collect them when adapter is idle. Also update the regdump range to skip collecting these registers.
--- .../net/ethernet/chelsio/cxgb4/cudbg_lib.c | 23 +++++++++++++++---- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +19 -4
@@ -1794,11 +1794,25 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init,struct cudbg_buffer temp_buff = {0 };struct sge_qbase_reg_field *sge_qbase;struct ireg_buf *ch_sge_dbg; +u8 padap_running =0 ;int i, rc; +u32 size; - rc =cudbg_get_buff (pdbg_init, dbg_buff, -sizeof (*ch_sge_dbg) *2 +sizeof (*sge_qbase), - &temp_buff); +/* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can +* lead to SGE missing doorbells under heavy traffic. So, only +* collect them when adapter is idle. +*/ +for_each_port (padap, i) { + padap_running =netif_running (padap->port[i]); +if (padap_running) +break ; + } + + size =sizeof (*ch_sge_dbg) *2 ; +if (!padap_running) + size +=sizeof (*sge_qbase); + + rc =cudbg_get_buff (pdbg_init, dbg_buff, size, &temp_buff);if (rc)return rc;
@@ -1820,7 +1834,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, ch_sge_dbg++; } -if (CHELSIO_CHIP_VERSION (padap->params.chip) >CHELSIO_T5 ) { +if (CHELSIO_CHIP_VERSION (padap->params.chip) >CHELSIO_T5 && + !padap_running) { sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg;/* 1 addr reg SGE_QBASE_INDEX and 4 data reg * SGE_QBASE_MAP[0-3]
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +2 -1
@@ -2090,7 +2090,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size)0x1190 ,0x1194 ,0x11a0 ,0x11a4 ,0x11b0 ,0x11b4 , -0x11fc ,0x1274 , +0x11fc ,0x123c , +0x1254 ,0x1274 ,0x1280 ,0x133c ,0x1800 ,0x18fc , 0x3000, 0x302c,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 132/210 net: dsa: Fix type was not set for devlink port
In reply to Greg Kroah-HartmanFrom: Maxim Kochetkov <[email protected]>
[ Upstream commit fb6ec87f7229b92baa81b35cbc76f2626d5bfadb ]
If PHY is not available on DSA port (described at devicetree but absent or failed to detect) then kernel prints warning after 3700 secs:
[ 3707.948771] ------------[ cut here ]------------ [ 3707.948784] Type was not set for devlink port. [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8
We should unregister the devlink port as a user port and re-register it as an unused port before executing "continue" in case of dsa_port_setup error.
--- net/dsa/dsa2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/dsa/dsa2.c +7 -1
@@ -533,8 +533,14 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst)list_for_each_entry (dp, &dst->ports, list) { err =dsa_port_setup (dp); -if (err) +if (err) { +dsa_port_devlink_teardown (dp); + dp->type =DSA_PORT_TYPE_UNUSED ; + err =dsa_port_devlink_setup (dp); +if (err) + goto teardown;continue ; + } }return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 133/210 clk: qcom: camcc: Update the clock ops for the SC7180
In reply to Greg Kroah-HartmanFrom: Taniya Das <[email protected]>
[ Upstream commit e5c359f70e4b5e7b6c2bf4b0ca2d2686d543a37b ]
Some of the RCGs could be always ON from the XO source and could be used as the clock on signal for the GDSC to be operational. In the cases where the GDSCs are parked at different source with the source clock disabled, it could lead to the GDSC to be stuck at ON/OFF during gdsc disable/enable. Thus park the RCGs at XO during clock disable and update the rcg_ops to use the shared_ops.
--- drivers/clk/qcom/camcc-sc7180.c | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/clk/qcom/camcc-sc7180.c +25 -25
@@ -304,7 +304,7 @@ static struct clk_rcg2 cam_cc_bps_clk_src = { .name = "cam_cc_bps_clk_src", .parent_data = cam_cc_parent_data_2, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -325,7 +325,7 @@ static struct clk_rcg2 cam_cc_cci_0_clk_src = { .name = "cam_cc_cci_0_clk_src", .parent_data = cam_cc_parent_data_5, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -339,7 +339,7 @@ static struct clk_rcg2 cam_cc_cci_1_clk_src = { .name = "cam_cc_cci_1_clk_src", .parent_data = cam_cc_parent_data_5, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -360,7 +360,7 @@ static struct clk_rcg2 cam_cc_cphy_rx_clk_src = { .name = "cam_cc_cphy_rx_clk_src", .parent_data = cam_cc_parent_data_3, .num_parents = 6, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -379,7 +379,7 @@ static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = { .name = "cam_cc_csi0phytimer_clk_src", .parent_data = cam_cc_parent_data_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -393,7 +393,7 @@ static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = { .name = "cam_cc_csi1phytimer_clk_src", .parent_data = cam_cc_parent_data_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -407,7 +407,7 @@ static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = { .name = "cam_cc_csi2phytimer_clk_src", .parent_data = cam_cc_parent_data_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -421,7 +421,7 @@ static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = { .name = "cam_cc_csi3phytimer_clk_src", .parent_data = cam_cc_parent_data_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -443,7 +443,7 @@ static struct clk_rcg2 cam_cc_fast_ahb_clk_src = { .name = "cam_cc_fast_ahb_clk_src", .parent_data = cam_cc_parent_data_0, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -466,7 +466,7 @@ static struct clk_rcg2 cam_cc_icp_clk_src = { .name = "cam_cc_icp_clk_src", .parent_data = cam_cc_parent_data_2, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -488,7 +488,7 @@ static struct clk_rcg2 cam_cc_ife_0_clk_src = { .name = "cam_cc_ife_0_clk_src", .parent_data = cam_cc_parent_data_4, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -510,7 +510,7 @@ static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = { .name = "cam_cc_ife_0_csid_clk_src", .parent_data = cam_cc_parent_data_3, .num_parents = 6, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -524,7 +524,7 @@ static struct clk_rcg2 cam_cc_ife_1_clk_src = { .name = "cam_cc_ife_1_clk_src", .parent_data = cam_cc_parent_data_4, .num_parents = 4, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -538,7 +538,7 @@ static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = { .name = "cam_cc_ife_1_csid_clk_src", .parent_data = cam_cc_parent_data_3, .num_parents = 6, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -553,7 +553,7 @@ static struct clk_rcg2 cam_cc_ife_lite_clk_src = { .parent_data = cam_cc_parent_data_4, .num_parents = 4, .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -567,7 +567,7 @@ static struct clk_rcg2 cam_cc_ife_lite_csid_clk_src = { .name = "cam_cc_ife_lite_csid_clk_src", .parent_data = cam_cc_parent_data_3, .num_parents = 6, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -590,7 +590,7 @@ static struct clk_rcg2 cam_cc_ipe_0_clk_src = { .name = "cam_cc_ipe_0_clk_src", .parent_data = cam_cc_parent_data_2, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -613,7 +613,7 @@ static struct clk_rcg2 cam_cc_jpeg_clk_src = { .name = "cam_cc_jpeg_clk_src", .parent_data = cam_cc_parent_data_2, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -635,7 +635,7 @@ static struct clk_rcg2 cam_cc_lrme_clk_src = { .name = "cam_cc_lrme_clk_src", .parent_data = cam_cc_parent_data_6, .num_parents = 5, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -656,7 +656,7 @@ static struct clk_rcg2 cam_cc_mclk0_clk_src = { .name = "cam_cc_mclk0_clk_src", .parent_data = cam_cc_parent_data_1, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -670,7 +670,7 @@ static struct clk_rcg2 cam_cc_mclk1_clk_src = { .name = "cam_cc_mclk1_clk_src", .parent_data = cam_cc_parent_data_1, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -684,7 +684,7 @@ static struct clk_rcg2 cam_cc_mclk2_clk_src = { .name = "cam_cc_mclk2_clk_src", .parent_data = cam_cc_parent_data_1, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -698,7 +698,7 @@ static struct clk_rcg2 cam_cc_mclk3_clk_src = { .name = "cam_cc_mclk3_clk_src", .parent_data = cam_cc_parent_data_1, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -712,7 +712,7 @@ static struct clk_rcg2 cam_cc_mclk4_clk_src = { .name = "cam_cc_mclk4_clk_src", .parent_data = cam_cc_parent_data_1, .num_parents = 3, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -732,7 +732,7 @@ static struct clk_rcg2 cam_cc_slow_ahb_clk_src = { .parent_data = cam_cc_parent_data_0, .num_parents = 4, .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 179/210 net/mlx5: Fix placement of log_max_flow_counter
In reply to Greg Kroah-HartmanFrom: Raed Salem <[email protected]>
[ Upstream commit a14587dfc5ad2312dabdd42a610d80ecd0dc8bea ]
The cited commit wrongly placed log_max_flow_counter field of mlx5_ifc_flow_table_prop_layout_bits, align it to the HW spec intended placement.
--- include/linux/mlx5/mlx5_ifc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/mlx5/mlx5_ifc.h +3 -3
@@ -437,11 +437,11 @@ struct mlx5_ifc_flow_table_prop_layout_bits {u8 reserved_at_60[0x18 ];u8 log_max_ft_num[0x8 ]; -u8 reserved_at_80[0x18 ]; +u8 reserved_at_80[0x10 ]; +u8 log_max_flow_counter[0x8 ];u8 log_max_destination[0x8 ]; -u8 log_max_flow_counter[0x8 ]; -u8 reserved_at_a8[0x10 ]; +u8 reserved_at_a0[0x18 ];u8 log_max_flow[0x8 ];u8 reserved_at_c0[0x40 ];
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 175/210 platform/x86: intel-hid: Fix spurious wakeups caused by tablet-mode events during suspend
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit a3790a8a94fc0234c5d38013b48e74ef221ec84c ]
Some devices send (duplicate) tablet-mode events when moved around even though the mode has not changed; and they do this even when suspended.
Change the tablet-mode event handling when priv->wakeup_mode is set to update the switch state in case it changed and then return immediately (without calling pm_wakeup_hard_event()) to avoid spurious wakeups.
--- drivers/platform/x86/intel-hid.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/platform/x86/intel-hid.c +9 -7
@@ -483,11 +483,16 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) goto wakeup;/* -* Switch events will wake the device and report the new switch -* position to the input subsystem. +* Some devices send (duplicate) tablet-mode events when moved +* around even though the mode has not changed; and they do this +* even when suspended. +* Update the switch state in case it changed and then return +* without waking up to avoid spurious wakeups. */ -if (priv->switches && (event ==0xcc || event ==0xcd )) - goto wakeup; +if (event ==0xcc || event ==0xcd ) { +report_tablet_mode_event (priv->switches, event); +return ; + }/* Wake up on 5-button array events only. */ if (event ==0xc0 || !priv->array)
@@ -501,9 +506,6 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) wakeup:pm_wakeup_hard_event (&device->dev); -if (report_tablet_mode_event (priv->switches, event)) -return ; -return ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 176/210 tipc: increment the tmp aead refcnt before attaching it
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 2a2403ca3add03f542f6b34bef9f74649969b06d ]
Li Shuang found a NULL pointer dereference crash in her testing:
[] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 [] RIP: 0010:tipc_crypto_rcv_complete+0xc8/0x7e0 [tipc]
[] Call Trace:
[] <IRQ> [] tipc_crypto_rcv+0x2d9/0x8f0 [tipc] [] tipc_rcv+0x2fc/0x1120 [tipc] [] tipc_udp_recv+0xc6/0x1e0 [tipc] [] udpv6_queue_rcv_one_skb+0x16a/0x460 [] udp6_unicast_rcv_skb.isra.35+0x41/0xa0 [] ip6_protocol_deliver_rcu+0x23b/0x4c0 [] ip6_input+0x3d/0xb0 [] ipv6_rcv+0x395/0x510 [] __netif_receive_skb_core+0x5fc/0xc40
This is caused by NULL returned by tipc_aead_get(), and then crashed when dereferencing it later in tipc_crypto_rcv_complete(). This might happen when tipc_crypto_rcv_complete() is called by two threads at the same time:
the tmp attached by tipc_crypto_key_attach() in one thread may be released by the one attached by that in the other thread.
This patch is to fix it by incrementing the tmp's refcnt before attaching it instead of calling tipc_aead_get() after attaching it.
--- net/tipc/crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/tipc/crypto.c +2 -1
@@ -1941,12 +1941,13 @@ static void tipc_crypto_rcv_complete(struct net *net, struct tipc_aead *aead, goto rcv;if (tipc_aead_clone (&tmp, aead) <0 ) goto rcv; +WARN_ON (!refcount_inc_not_zero (&tmp->refcnt));if (tipc_crypto_key_attach (rx, tmp, ehdr->tx_key, false) <0 ) {tipc_aead_free (&tmp->rcu); goto rcv; }tipc_aead_put (aead); - aead =tipc_aead_get (tmp); + aead = tmp; }if (unlikely (err)) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 177/210 net: hns3: clear VF down state bit before request link status
In reply to Greg Kroah-HartmanFrom: Guangbin Huang <[email protected]>
[ Upstream commit ed7bedd2c3ca040f1e8ea02c6590a93116b1ec78 ]
Currently, the VF down state bit is cleared after VF sending link status request command. There is problem that when VF gets link status replied from PF, the down state bit may still set as 1. In this case, the link status replied from PF will be ignored and always set VF link status to down.
To fix this problem, clear VF down state bit before VF requests link status.
--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 -2
@@ -2575,14 +2575,14 @@ static int hclgevf_ae_start(struct hnae3_handle *handle) {struct hclgevf_dev *hdev =hclgevf_ae_get_hdev (handle); +clear_bit (HCLGEVF_STATE_DOWN , &hdev->state); +hclgevf_reset_tqp_stats (handle);hclgevf_request_link_info (hdev);hclgevf_update_link_mode (hdev); -clear_bit (HCLGEVF_STATE_DOWN , &hdev->state); -return 0 ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 178/210 net/mlx5: Fix HW spec violation configuring uplink
In reply to Greg Kroah-HartmanFrom: Eli Cohen <[email protected]>
[ Upstream commit 1a73704c82ed4ee95532ac04645d02075bd1ce3d ]
Make sure to modify uplink port to follow only if the uplink_follow capability is set as required by the HW spec. Failure to do so causes traffic to the uplink representor net device to cease after switching to switchdev mode.
--- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +3 -2
@@ -1103,8 +1103,9 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)mlx5e_rep_tc_enable (priv); -mlx5_modify_vport_admin_state (mdev,MLX5_VPORT_STATE_OP_MOD_UPLINK , -0 ,0 ,MLX5_VPORT_ADMIN_STATE_AUTO ); +if (MLX5_CAP_GEN (mdev, uplink_follow)) +mlx5_modify_vport_admin_state (mdev,MLX5_VPORT_STATE_OP_MOD_UPLINK , +0 ,0 ,MLX5_VPORT_ADMIN_STATE_AUTO );mlx5_lag_add (mdev, netdev); priv->events_nb.notifier_call = uplink_rep_async_event;mlx5_notifier_register (mdev, &priv->events_nb);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 180/210 net/mlx5: Fix PPLM register mapping
In reply to Greg Kroah-HartmanFrom: Aya Levin <[email protected]>
[ Upstream commit ce28f0fd670ddffcd564ce7119bdefbaf08f02d3 ]
Add reserved mapping to cover all the register in order to avoid setting arbitrary values to newer FW which implements the reserved fields.
--- include/linux/mlx5/mlx5_ifc.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/mlx5/mlx5_ifc.h +2 -0
@@ -8769,6 +8769,8 @@ struct mlx5_ifc_pplm_reg_bits {u8 fec_override_admin_100g_2x[0x10 ];u8 fec_override_admin_50g_1x[0x10 ]; + +u8 reserved_at_140[0x140 ]; };struct mlx5_ifc_ppcnt_reg_bits {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 193/210 dt-bindings: net: ethernet-controller: fix typo in NVMEM
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
commit af9d316f3dd6d1385fbd1631b5103e620fc4298a upstream.
The correct property name is "nvmem-cell-names". This is what:
1. Was originally documented in the ethernet.txt
2. Is used in DTS files
3. Matches standard syntax for phandles
4. Linux net subsystem checks for
--- Documentation/devicetree/bindings/net/ethernet-controller.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/net/ethernet-controller.yaml +1 -1
@@ -49,7 +49,7 @@ properties: description: Reference to an nvmem node for the MAC address - nvmem-cells-names: + nvmem-cell-names: const: mac-address phy-connection-type:
Greg Kroah-Hartman
maintainerPATCH 167/210 clk: fix invalid usage of list cursor in unregister
In reply to Greg Kroah-HartmanFrom: Lukasz Bartosik <[email protected]>
[ Upstream commit 7045465500e465b09f09d6e5bdc260a9f1aab97b ]
Fix invalid usage of a list_for_each_entry cursor in clk_notifier_unregister(). When list is empty or if the list is completely traversed (without breaking from the loop on one of the entries) then the list cursor does not point to a valid entry and therefore should not be used. The patch fixes a logical bug that hasn't been seen in pratice however it is analogus to the bug fixed in clk_notifier_register().
The issue was dicovered when running 5.12-rc1 kernel on x86_64 with KASAN enabled:
BUG: KASAN: global-out-of-bounds in clk_notifier_register+0xab/0x230
Read of size 8 at addr ffffffffa0d10588 by task swapper/0/1
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc1 #1
Hardware name: Google Caroline/Caroline,
BIOS Google_Caroline.7820.430.0 07/20/2018
Call Trace:
dump_stack+0xee/0x15c
print_address_description+0x1e/0x2dc
kasan_report+0x188/0x1ce
? clk_notifier_register+0xab/0x230
? clk_prepare_lock+0x15/0x7b
? clk_notifier_register+0xab/0x230
clk_notifier_register+0xab/0x230
dw8250_probe+0xc01/0x10d4
...
Memory state around the buggy address:
ffffffffa0d10480: 00 00 00 00 00 03 f9 f9 f9 f9 f9 f9 00 00 00 00
ffffffffa0d10500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9
>ffffffffa0d10580: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
^
ffffffffa0d10600: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00
ffffffffa0d10680: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
==================================================================--- drivers/clk/clk.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/clk/clk.c +13 -17
@@ -4373,32 +4373,28 @@ EXPORT_SYMBOL_GPL(clk_notifier_register);*/ int clk_notifier_unregister (struct clk *clk,struct notifier_block *nb) { -struct clk_notifier *cn =NULL ; -int ret = -EINVAL ; +struct clk_notifier *cn; +int ret = -ENOENT ;if (!clk || !nb)return -EINVAL ;clk_prepare_lock (); -list_for_each_entry (cn, &clk_notifier_list, node) -if (cn->clk == clk) -break ; - -if (cn->clk == clk) { - ret =srcu_notifier_chain_unregister (&cn->notifier_head, nb); +list_for_each_entry (cn, &clk_notifier_list, node) { +if (cn->clk == clk) { + ret =srcu_notifier_chain_unregister (&cn->notifier_head, nb); - clk->core->notifier_count--; + clk->core->notifier_count--; -/* XXX the notifier code should handle this better */ -if (!cn->notifier_head.head) { -srcu_cleanup_notifier_head (&cn->notifier_head); -list_del (&cn->node); -kfree (cn); +/* XXX the notifier code should handle this better */ +if (!cn->notifier_head.head) { +srcu_cleanup_notifier_head (&cn->notifier_head); +list_del (&cn->node); +kfree (cn); + } +break ; } - - }else { - ret = -ENOENT ; }clk_prepare_unlock ();
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 168/210 workqueue: Move the position of debug_work_activate() in __queue_work()
In reply to Greg Kroah-HartmanFrom: Zqiang <[email protected]>
[ Upstream commit 0687c66b5f666b5ad433f4e94251590d9bc9d10e ]
The debug_work_activate() is called on the premise that the work can be inserted, because if wq be in WQ_DRAINING status, insert work may be failed.
--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
@@ -1412,7 +1412,6 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,*/ lockdep_assert_irqs_disabled (); -debug_work_activate (work);/* if draining, only works from the same workqueue are allowed */ if (unlikely(wq->flags & __WQ_DRAINING) &&
@@ -1494,6 +1493,7 @@ retry: worklist = &pwq->delayed_works; } +debug_work_activate (work);insert_work (pwq, work, worklist, work_flags); out:
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 200/210 drivers: net: fix memory leak in peak_usb_create_dev
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
commit a0b96b4a62745397aee662670cfc2157bac03f55 upstream.
syzbot reported memory leak in peak_usb.
The problem was in case of failure after calling ->dev_init()[2] in peak_usb_create_dev()[1]. The data allocated int dev_init() wasn't freed, so simple ->dev_free() call fix this problem.
backtrace:
[<0000000079d6542a>] kmalloc include/linux/slab.h:552 [inline]
[<0000000079d6542a>] kzalloc include/linux/slab.h:682 [inline]
[<0000000079d6542a>] pcan_usb_fd_init+0x156/0x210 drivers/net/can/usb/peak_usb/pcan_usb_fd.c:868 [2]
[<00000000c09f9057>] peak_usb_create_dev drivers/net/can/usb/peak_usb/pcan_usb_core.c:851 [inline] [1]
[<00000000c09f9057>] peak_usb_probe+0x389/0x490 drivers/net/can/usb/peak_usb/pcan_usb_core.c:949--- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 -1
@@ -857,7 +857,7 @@ static int peak_usb_create_dev(const strif (dev->adapter->dev_set_bus) { err = dev->adapter->dev_set_bus (dev,0 );if (err) - goto lbl_unregister_candev; + goto adap_dev_free; }/* get device number early */
@@ -869,6 +869,10 @@ static int peak_usb_create_dev(const strreturn 0 ; +adap_dev_free: +if (dev->adapter->dev_free) + dev->adapter->dev_free (dev); + lbl_unregister_candev:unregister_candev (netdev);
Greg Kroah-Hartman
maintainerPATCH 201/210 net: mac802154: Fix general protection fault
In reply to Greg Kroah-HartmanFrom: Pavel Skripkin <[email protected]>
commit 1165affd484889d4986cf3b724318935a0b120d8 upstream.
syzbot found general protection fault in crypto_destroy_tfm()[1]. It was caused by wrong clean up loop in llsec_key_alloc(). If one of the tfm array members is in IS_ERR() range it will cause general protection fault in clean up function [1].
Call Trace: crypto_free_aead include/crypto/aead.h:191 [inline] [1] llsec_key_alloc net/mac802154/llsec.c:156 [inline] mac802154_llsec_key_add+0x9e0/0xcc0 net/mac802154/llsec.c:249 ieee802154_add_llsec_key+0x56/0x80 net/mac802154/cfg.c:338 rdev_add_llsec_key net/ieee802154/rdev-ops.h:260 [inline] nl802154_add_llsec_key+0x3d3/0x560 net/ieee802154/nl802154.c:1584 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:800 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae
--- net/mac802154/llsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac802154/llsec.c +1 -1
@@ -152,7 +152,7 @@ err_tfm0:crypto_free_sync_skcipher (key->tfm0); err_tfm:for (i =0 ; i <ARRAY_SIZE (key->tfm); i++) -if (key->tfm[i]) +if (!IS_ERR_OR_NULL (key->tfm[i]))crypto_free_aead (key->tfm[i]);kfree_sensitive (key);
Greg Kroah-Hartman
maintainerPATCH 205/210 net: ieee802154: fix nl802154 add llsec key
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 20d5fe2d7103f5c43ad11a3d6d259e9d61165c35 upstream.
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1544,7 +1544,8 @@ static int nl802154_add_llsec_key(structstruct ieee802154_llsec_key_id id = { };u32 commands[NL802154_CMD_FRAME_NR_IDS /32 ] = { }; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ; if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
Greg Kroah-Hartman
maintainerPATCH 210/210 Revert "net: sched: bump refcount for new action in ACT replace mode"
In reply to Greg Kroah-HartmanFrom: Vlad Buslov <[email protected]>
commit 4ba86128ba077fbb7d86516ae24ed642e6c3adef upstream.
This reverts commit 6855e8213e06efcaf7c02a15e12b1ae64b9a7149.
Following commit in series fixes the issue without introducing regression in error rollback of tcf_action_destroy().
--- net/sched/act_api.c | 3 --- 1 file changed, 3 deletions(-)
net/sched/act_api.c +0 -3
@@ -1049,9 +1049,6 @@ struct tc_action *tcf_action_init_1(struif (!name) a->hw_stats = hw_stats; -if (!bind && ovr && err ==ACT_P_CREATED ) -refcount_set (&a->tcfa_refcnt,2 ); -return a; err_out:
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.11.14 release. There are 210 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 Wed, 14 Apr 2021 08:39:44 +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.11.14-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.11.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.11:
12 builds: 12 pass, 0 fail
28 boots: 28 pass, 0 fail
70 tests: 70 pass, 0 failLinux version: 5.11.14-rc1-g7ce240e32fd4
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.11.14 release. There are 210 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 Wed, 14 Apr 2021 08:39:44 +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.11.14-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.11.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.11.14 release. There are 210 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 Wed, 14 Apr 2021 08:39:44 +0000. Anything received after that time might be too late.
Build results:
total: 155 pass: 155 fail: 0 Qemu test results: total: 460 pass: 459 fail: 1
Failed tests:
sh:rts7751r2dplus_defconfig:ata:net,virtio-net:rootfs
udhcpc fails to get an IP address over virtio-net. I reported the same problem against mainline. This is a spurious problem; the test succeeds in roughly every other test. It is unknown at this time if the problem is the patch introducing the problem (commit 0f6925b3e8da ("virtio_net:
Do not pull payload in skb->head")), the sh4 kernel code, qemu, or the sh4 compiler (though I tried several compiler versions).
I see that this patch is now in pretty much all kernels, so I may report this on and off until the underlying problem has been found and fixed. Until then, I guess we'll have to live with it.
Guenter
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.11.14 release. There are 210 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 Wed, 14 Apr 2021 08:39:44 +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.11.14-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.11.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.11.14-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.11.y
* git commit: 7ce240e32fd44eb0ababbd16236a00ca7b7d005e
* git describe: v5.11.13-211-g7ce240e32fd4
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.11.y/build/v5.11.13-211-g7ce240e32fd4
## No regressions (compared to v5.11.12-46-gab8c60637a48)
## No fixes (compared to v5.11.12-46-gab8c60637a48)
## Test result summary
total: 74763, pass: 62936, fail: 1599, skip: 9939, xfail: 289,
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 192 total, 192 passed, 0 failed
* arm64: 26 total, 26 passed, 0 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 26 total, 25 passed, 1 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 21 total, 21 passed, 0 failed
* s390: 18 total, 18 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x15: 1 total, 0 passed, 1 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 26 total, 26 passed, 0 failed
## Test suites summary
* fwts
* igt-gpu-tools
* install-android-platform-tools-r2600
* kselftest-
* kselftest-android
* kselftest-bpf
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-vsyscall-mode-native-
* kselftest-vsyscall-mode-none-
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* perf
* rcutorture
* ssuite
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org