From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C7E7C32750 for ; Fri, 2 Aug 2019 09:49:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D167206A2 for ; Fri, 2 Aug 2019 09:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739375; bh=NZBYPz9/upGof+pf+7aPQwh2oUQ15oTbaqLDqA5xc1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tKpqognH20OVdk4gW4zayhYAaKFHJjHypnJc6Yc0ttqAha5BuIRN60OQfvt6oh0M2 UUT9ueRIfmEvVEWsZPsq0DvRgzdbYWHQFC/0zt7DQBvcsxnN+jXhU17mXviUVng+W3 J5tJMkHK5K7o5KlBX45HEuMVwZadBzbM2FStcQME= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392061AbfHBJqr (ORCPT ); Fri, 2 Aug 2019 05:46:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:51170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405599AbfHBJql (ORCPT ); Fri, 2 Aug 2019 05:46:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 60CEE2086A; Fri, 2 Aug 2019 09:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739200; bh=NZBYPz9/upGof+pf+7aPQwh2oUQ15oTbaqLDqA5xc1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRQOhlXoNdQIRTUzn/zfkE3k7dYCGQz0hfzCJh0zxPW8FrBGzkbd26zOiKLzXAMpd UzSp06/hae9/sWjqUxBt/qdoTx8BUlXtgN+DmuwBWo3/P5gQYZpNf8b0FS58pxTLLH iCx+YaP51l/dYk9u52nC0Pvmg1E3Q0kCFTWd6TmE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Wei , "David S. Miller" Subject: [PATCH 4.9 138/223] nfc: fix potential illegal memory access Date: Fri, 2 Aug 2019 11:36:03 +0200 Message-Id: <20190802092247.734370576@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yang Wei [ Upstream commit dd006fc434e107ef90f7de0db9907cbc1c521645 ] The frags_q is not properly initialized, it may result in illegal memory access when conn_info is NULL. The "goto free_exit" should be replaced by "goto exit". Signed-off-by: Yang Wei Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/nfc/nci/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/nfc/nci/data.c +++ b/net/nfc/nci/data.c @@ -119,7 +119,7 @@ static int nci_queue_tx_data_frags(struc conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id); if (!conn_info) { rc = -EPROTO; - goto free_exit; + goto exit; } __skb_queue_head_init(&frags_q);