Received: by 10.223.185.116 with SMTP id b49csp5487807wrg; Wed, 7 Mar 2018 12:38:16 -0800 (PST) X-Google-Smtp-Source: AG47ELseJrLLqn7kvDXXH9Sep6deoNbRnTqaQ3WWQ2gUgHwJar86FVkCwdPnQ1pE9CphMv43CjW1 X-Received: by 10.98.196.199 with SMTP id h68mr23695749pfk.42.1520455096674; Wed, 07 Mar 2018 12:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520455096; cv=none; d=google.com; s=arc-20160816; b=0pJdX+FjpH2B6Xpuy8EvUW+4ePGDgaEKiiQQyxAt3kIpTQU+hMG0OXplqtA8u4V2xj JZb5bxxZHMWYf3cBEX32OmcZOBxp5O9rZASYF7pOzcmAEGyywbKX4O5jf0rPkbCI/nj4 gP7Y8avoSy3d50PRDImVrQsBk2vjXD3Ce/MdJ4PaSa/ORgTcvRBDMoFTeK31UZEP0dKe vNfHs2D14vzLCBDfxanYcux9sqKaTqZMZmMk06v8lUmZIt5A0RmFaIE+1q5MMtSz18Q5 0WSBghtp9x7gBU8EBfbDjbXh0mjsbSgdgCrZGiyGYprNVpfg9LGbgQ6PYzNIpHgjRMC2 5ndg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=gNf0kaB3u+6Y1xfjH5UMT6V4J7gqwC1n1sGaCcg7FPE=; b=fKi+MCbgjvGGs09UJTDZnBIlYxOeolZbUmEQwirYUVikYQuYvt+Tt5bqZsW1JMdAuQ 4m/m3+TjYVtOSqNheDRU8ZrAqMO/Cz/b8Sy0HOjbx2L/y8U+1wfWsmcDFf+asJev8Rpu xGqOwuJ9PlqlAQEk+XgkVqabBh6Cmq1gAKzpgnQjyBkYIgal7VuTCkETH4B4bU9UpaUz XeUFEqapEVOiySca81g41Wu/lXOBtNs3/EFoVcLUKIiznvTBs/6nwMPQTuFZurBOyAdP T4UQi2QRDt4V/NfGtARV3egB5WC5Jb9u5hzNhlLj2EK5phTYqkC5i10C9oByl3GkKZUT pg+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si11863358pgs.166.2018.03.07.12.38.01; Wed, 07 Mar 2018 12:38:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754875AbeCGTmH (ORCPT + 99 others); Wed, 7 Mar 2018 14:42:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41704 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754826AbeCGTmD (ORCPT ); Wed, 7 Mar 2018 14:42:03 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 264251051; Wed, 7 Mar 2018 19:42:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eran Ben Elisha , Saeed Mahameed Subject: [PATCH 4.15 069/122] net/mlx5e: Verify inline header size do not exceed SKB linear size Date: Wed, 7 Mar 2018 11:38:01 -0800 Message-Id: <20180307191739.358205777@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eran Ben Elisha [ Upstream commit f600c6088018d1dbc5777d18daa83660f7ea4a64 ] Driver tries to copy at least MLX5E_MIN_INLINE bytes into the control segment of the WQE. It assumes that the linear part contains at least MLX5E_MIN_INLINE bytes, which can be wrong. Cited commit verified that driver will not copy more bytes into the inline header part that the actual size of the packet. Re-factor this check to make sure we do not exceed the linear part as well. This fix is aligned with the current driver's assumption that the entire L2 will be present in the linear part of the SKB. Fixes: 6aace17e64f4 ("net/mlx5e: Fix inline header size for small packets") Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -176,7 +176,7 @@ static inline u16 mlx5e_calc_min_inline( default: hlen = mlx5e_skb_l2_header_offset(skb); } - return min_t(u16, hlen, skb->len); + return min_t(u16, hlen, skb_headlen(skb)); } static inline void mlx5e_tx_skb_pull_inline(unsigned char **skb_data,