Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp799451imu; Tue, 11 Dec 2018 07:46:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/WCAx6us88+xrs540JCzbnyRXUBewkl2t5H08YP+uUUQf8IDtZFJ7qAAAIMZqa+/6fn4o6W X-Received: by 2002:a63:5f95:: with SMTP id t143mr15254672pgb.395.1544543218844; Tue, 11 Dec 2018 07:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543218; cv=none; d=google.com; s=arc-20160816; b=QYrgmvj6a9ZiloBgaplKJ/EWLhZ4xSUmJcI/tag88xX9YWZ3jAm8Uav72HOBBbEtz4 p5wBXZlY8b2thPKVll3yoPXjBO/s9Cl0vAgiyldNgT6IvmGl0sDGZ/mnnjtd77CmCD3i CDXpU7OhxGShBvP4rQRqWI8wPP/9hhPZBR9xQrr4cbkMla2k2Qn1iilkMDjzbDEIVDfw 5oMA3GHcgLiJi0BoLJVofDxeVJLeskJz9AX8M0Qs/2MLhzkBkFj7cT74F5ybGVsBczlL u+b17091pKedU15frgEQ9U+UZ8COesb679BUBQSkgAoR6YFi14KwVtLsQhomrgmygS+U 1c3A== 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=6LSvHZxpJBk7wJU+P666AVjby6tqoewV5/OYGCHS8wQ=; b=k91dSksTpaeYK6qfGC+FgwCH2/OhON8Sba5xF/hQClprxIAgfgXw+jIjXiS0PCw0Wv m1Cahh/gHu4ohCRNvn1Zstyj/W1cemGlHRftjGF/1GpODXEPzHAB93fPjI06SvDDdBC9 Fnod0f94owoOkyEQeKD0LB47qXPWkJLQREXYNMCdm4tyFRTjRXHi76EE/mClyf5pmu/C YqVGHHDT6gEbWvXq32JJUt+I+1T4Ez6r1zdjHCVtVl+uMyY319cQEeDUzHVwZ72EH+Uh w5bwvKF+s5N46wC0Q7N/8LCecrKvAWjWD/JAw2t40OysltwHrwrYfgoMuwzAR5YZwpOB UKXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=flqt2nBy; 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 d9si11909626pgb.105.2018.12.11.07.46.44; Tue, 11 Dec 2018 07:46:58 -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=flqt2nBy; 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 S1728013AbeLKPpF (ORCPT + 99 others); Tue, 11 Dec 2018 10:45:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:33468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbeLKPpD (ORCPT ); Tue, 11 Dec 2018 10:45:03 -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 DC16120855; Tue, 11 Dec 2018 15:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543103; bh=N27+A5qJ/phjZpWjOrC/NhRNC9kE4AZ66J7Ry8WNVY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=flqt2nByYCJ4O4XswtvtHXtnsDl7BU5MlG1tC8rare0N/ll+Kyey8nPTxkRZmy9uS 3nKjSofhjD4PoSY60Mg4ff7ktRzs1ZjW363Xe7OqNBsv9NZD93H8rqsHPjI3doDZT2 9jZno2gsdc7CpMR8D+Ne/OdiP3XFA6ZVehd4+ONo= 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.4 03/91] rapidio/rionet: do not free skb before reading its length Date: Tue, 11 Dec 2018 16:40:22 +0100 Message-Id: <20181211151606.243224733@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@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.4-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); } }