Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp796163imu; Tue, 11 Dec 2018 07:43:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/V8Ez/y4cBCrNFVeK/Pdd6paxRgVKQYl4v+NBVirZtjnQimUmNynV1kaQQbf+xnxG0hM1vi X-Received: by 2002:a17:902:142:: with SMTP id 60mr16977354plb.330.1544543028796; Tue, 11 Dec 2018 07:43:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543028; cv=none; d=google.com; s=arc-20160816; b=IW1A9O6SOTFZz76ul1pkBW4Qj8BywEpXKDu9baiA/3Nb1efqwV+Hbp0q/qlz6LZT+j e1XW/zDnou7bzbVtFD+d3HdEB5EuEkKz7fwNugKTnw1xnC2CzpA/g+KpJkmt9vSW/i0g 6l87Urg7kqE9awzYkfi0MbgFgTqDNTNtcT0KvS9xZxSUcmbj2qMhAF1Sy34ngsRJ1CbY ed/M/J9HUp5uKD7oMrV76bDXeJQwYjuePaB3P3AP/4heOzkS0DK33I63ECPnEJccqmKa 9+mRRA4fXkoNIBR3zNMrMV2+YFh4ct+gzCdAuAvqZvJE2GP6x8W6mdBQoMqnUfQKIFE+ Qb7w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CJ2PdT9A6nVxbR67g6bnK0YxC1Kwvwg60U2oeDqus+k=; b=KubYZgZpK2n6bnFKROPNbTS/vCWrgBiMh7lbDlT+EGsHvOXZPtJh/nMV3tISiXXG1w tf8B2UGhUrjnUffBnzea1hzQaD2UbuESZgLFfJ+USOQW8ytTbntGkgTkTn/xn7XPBDMD h8HJk867LN/HoAgPk1B887iveZ3xMUWC0pq9LzXh11mE7VQh6oOivahvqiZ5qS3EuK+J mjuBtPdshEVgNQmirAu9CbbixSXAWKHxCXleB/Qzw+o+R6D1B4er3MTjSzYw6ym4+3dW PQOtuDuPooiihmKX7YJX4+2Yuq7SzXg2ZmymiKNCk9CrNhMxCrSCLhCT8Nsa/qREIRAl eniw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v7wZmp8K; 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 d8si12550306pgl.386.2018.12.11.07.43.33; Tue, 11 Dec 2018 07:43:48 -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=v7wZmp8K; 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 S1727260AbeLKPmd (ORCPT + 99 others); Tue, 11 Dec 2018 10:42:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:58894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbeLKPmb (ORCPT ); Tue, 11 Dec 2018 10:42:31 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74FD42082F; Tue, 11 Dec 2018 15:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544542951; bh=8cYC0oLK63JYlIjF4F+CBzceJxrjCp/Xu/qzBnDAsXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v7wZmp8KmbOmodTJbI793f9LiyGVnOgW286IG5rQ4N7CW3qo0exjZqaBIaNTnGw5d cKXoNklaxmLiozt+HKyUgl4vh6kfdF/ukUrxzkNUlIxSrWSRbRUi3Te1Bruh72IYRY STjz3B1+0vZUP6pLg5ol3drF+wA9U2eRbqpv9LTQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , "David S. Miller" Subject: [PATCH 3.18 02/54] rapidio/rionet: do not free skb before reading its length Date: Tue, 11 Dec 2018 16:40:50 +0100 Message-Id: <20181211151546.123868470@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pan Bian [ Upstream commit cfc435198f53a6fa1f656d98466b24967ff457d0 ] skb is freed via dev_kfree_skb_any, however, skb->len is read then. This may result in a use-after-free bug. Fixes: e6161d64263 ("rapidio/rionet: rework driver initialization and removal") Signed-off-by: Pan Bian Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/rionet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -215,9 +215,9 @@ static int rionet_start_xmit(struct sk_b * it just report sending a packet to the target * (without actual packet transfer). */ - dev_kfree_skb_any(skb); ndev->stats.tx_packets++; ndev->stats.tx_bytes += skb->len; + dev_kfree_skb_any(skb); } }