Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp770861ybc; Sat, 16 Nov 2019 08:23:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwHlFsWGA0v/dvaGgHYEEr/OWB4S6W/2LiM6iEsEmTvFFFQXeqSutaMJhWEfWVvo/HFPsQH X-Received: by 2002:a17:906:95c1:: with SMTP id n1mr10851417ejy.158.1573921426598; Sat, 16 Nov 2019 08:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921426; cv=none; d=google.com; s=arc-20160816; b=nbTUj1V5S4SkTuuMmTC7+TBQjos9VLz9qHUAnezX1N85ePtnmkbT576XhrRxrW7MZy 9ctS4+TaBRWaKYgmy4oFIVLdgmsJ4XkLgrfja7442w4uchlh91rZM2jPuTZnxG/I/X9+ Ax8/7ghOB5jYXt+SM244ZoJRmHcwE3LppHO+qZL8vlYKI2oYI58cjAnb9qeMym+PDKkx N3FX/RC4wo6bftwwgtUEI1RlDI8Y8RmLs0Biw380pA4Tqhj/i7dOuJu+BFBXfdI1W2X/ 0K67c1JqJRSnzNuqrfZliY5EFkaU/lmZSL/4KAMaWjy91BwYchAXcsWj+8OXh+U3vi1r 6AMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ninuTLFME3IPveQ/mB/kI2xl/aVwO7j7MkOAth30VVk=; b=MJg4mRVe0M6Ic1jKx/CRpMSwCH7ykgQmjZTQ6hV+ddxfQ0Gtyn6CliOAF1JkmMLxDZ gY9QE2dbYj6iTg6TKb0gNvKtX4Q9yffn1XdqRbRaPpvXwtbfKc9btLZRBm5oQ+FayMwK TZ5qPThJD4gmYUJqXqS1JnsdHDD4BAtZwFX7hjNaH7Lksdjh3xrZzPm2ArB/e58Vay2B Su4tnUOSamSfVgoYjBdCcxRuzqYCF+cXyC9J4lMPfujPo6dZGFJljRBQxd9kBiX5jwj8 iBtkwhA4aJrzVNaGAmKEFn5Y1m2HGahK10treqz07JOBzSinW4Rf3NPvpbeGqzY+z4Lt UTXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lkbYshN3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si3135967eja.141.2019.11.16.08.23.22; Sat, 16 Nov 2019 08:23:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lkbYshN3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732059AbfKPQVG (ORCPT + 99 others); Sat, 16 Nov 2019 11:21:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:47936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728816AbfKPPno (ORCPT ); Sat, 16 Nov 2019 10:43:44 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DC0F20740; Sat, 16 Nov 2019 15:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919024; bh=hiiQw4GIooAvk2r6v2UyMwi5UDbrlJKGpCYFPYlAAqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkbYshN3qeXODHbeQSkKwdd7wxf4sga0yF2Jolw5/QP5tTAroyy57ZHWI6R9U6RTX QxwixILjYsygYR8aNErn5IFiZpWFOx0wAMlI7rsS1kjvIJlXwogvOZ5NOjgfVUG+Yw 0uUBkqz3Qob3eVMuu87gKT2Eh8zu8aZsYW7P7/Z0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tristram Ha , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 123/237] net: ethernet: cadence: fix socket buffer corruption problem Date: Sat, 16 Nov 2019 10:39:18 -0500 Message-Id: <20191116154113.7417-123-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tristram Ha [ Upstream commit 899ecaedd15599c22553d158f53b127cc1632dc2 ] Socket buffer is not re-created when headroom is 2 and tailroom is 1. Signed-off-by: Tristram Ha Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 74eeb3a985bf1..f175b20ac510a 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1721,7 +1721,7 @@ static int macb_pad_and_fcs(struct sk_buff **skb, struct net_device *ndev) padlen = 0; /* No room for FCS, need to reallocate skb. */ else - padlen = ETH_FCS_LEN - tailroom; + padlen = ETH_FCS_LEN; } else { /* Add room for FCS. */ padlen += ETH_FCS_LEN; -- 2.20.1