Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8133079imu; Tue, 4 Dec 2018 03:34:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/WAwx479jyPb/yO6MgJMrCqt6s+Cv0HcUeY3HZsRYwrVtXCwXVoljWF/IFPiBbr871i4DI7 X-Received: by 2002:a17:902:ac1:: with SMTP id 59mr19422245plp.36.1543923287505; Tue, 04 Dec 2018 03:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923287; cv=none; d=google.com; s=arc-20160816; b=mnugYEaoWFk4SQ8p4C1+eia5yrQdw3/4TG4OjrpM8KIwOVlcA4m1ahAikPOdiRGbB1 kqej18qSRhAHr9w6KrRrOA9ozVTC6dfNWGTjjHvAZ3DdIsGg3K0z7hRNVuPAVe4EoIeU xjHpb1+Ouyd7PJfJTuH7R5diBQ1q1KkzWsvkdttaeNm9+qKyO0PouRC//Pm3odDdN8ZZ Q4dYzsZHmzrstOeriu1qPDsuba8M3pguBmIwf8maGWSNhAHu5tNP5sLcO3WL3Q0snchk Nbp+JHdbtkYpkpgBDZFcl0UwRG6zDrETpYNksYFl/4FlNaAEMtMTvHFGacqo3n0/zGh/ cCKQ== 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=iN6WyroQNrB2x50C3wWCZ9loehQ3IVwc1jVOjaJyrWM=; b=PH4CUP+wQpT2i5XsQmh8U8ukGi8lPydmw4ZKLepQ0r6TxMZyJ+6jS7hun1AvRwliML QjJC1A5s2DAY3v2BY9TjZEbSAUbn90bwLVa1rMcRHTlcgMY8KRRjE/AMBeCql0CPh70J vyd86tzsfeupIpzHgO9J0niiEF44pTLNJK4DTaEgBPhRXURTgqBOKZfS1mBqEnhfXdnI To7d6P62euR369hAHaSM2mig9WArc3W1fZjJA8E9KZfMb3xcF+L7UavGej3KLrqGU7cc B3iZie5cMMErnMnJYC5nJ79IJBtkh93H2RtG8ndfIaPPQgEudw1YS6sFggFmqk59G9Oq tI+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1eFOcNiX; 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 i13si15376403pgj.199.2018.12.04.03.34.31; Tue, 04 Dec 2018 03:34:47 -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=1eFOcNiX; 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 S1726286AbeLDKze (ORCPT + 99 others); Tue, 4 Dec 2018 05:55:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:38390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbeLDKzc (ORCPT ); Tue, 4 Dec 2018 05:55:32 -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 AE72B2087F; Tue, 4 Dec 2018 10:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920932; bh=2odqX/Zfd2n40SIgcoNH6WIL6pAfw0PvBQOZpTpz4gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1eFOcNiXSrD1yl5tCGxD8cgpZnhNegLH4qG8lktgNbr+30F5qiSPT2xBvf5dbydaY Ll0edHk9TKDJbmRsNbkUoGqZ5EneMJ37KeuL1qM2jbEquzxMjtX9sj8AO0uoIy93uO P3iVlznBPI8qfHVUx+UE2cDtHIly7fVG5zeT0Vuo= 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 4.19 016/139] rapidio/rionet: do not free skb before reading its length Date: Tue, 4 Dec 2018 11:48:17 +0100 Message-Id: <20181204103650.647309143@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@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 4.19-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 @@ -216,9 +216,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); } }