Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3419920pxf; Mon, 29 Mar 2021 01:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsBXWV1EhaB4c3xT/LylwAevmvWiqSR+sSpK615h/xApTdZgZbbJ4f/9e/oA53v/dRigfV X-Received: by 2002:aa7:d287:: with SMTP id w7mr27069747edq.23.1617006686695; Mon, 29 Mar 2021 01:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006686; cv=none; d=google.com; s=arc-20160816; b=Lp90YxL749gOq1LmzRUqx1PZwUH4rRIIi06J8NKeleIsAnbCN9ij+eBuHWGpZ+qPc/ j0neAURp30EBPKseepjSrJRPAF3N0wTq7QCl9w6HeSC31s1BjOknoAfmvfTId0zj8tFt WQso4sCPqJJGe0E4vcjxfVDix1Exe7MWUF3SFn9uFOXPLl/M9ngoTPxM9XePXSUcajbk Iv+jo4xIAh8z0KnIAWeYCfbqWnQjsto0v+rQhgEjgnvlhzkoaSTQ6/RLYNL+/emWJAKY U+JsdkuZH6zon1ENLNdp1kplt6jwxBVVzfHRuv9uXn6ReQLU6qiOpanq7IWfGIgOC9vz APpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Jg1Vg1A+AVDmKaFpnYq87qZeXRGq+BMFC71QXmsmsgI=; b=Swc9J1eyQSCgb7sX+LF6ORttFPS4T1UsLWC6hmfANTvdk58D3xeEgHjXCvgUNCTTKW AdbTSPrVcUHV36NMJ95LiLP9f6xjtWRiKzRAvAjDhs6uaFMuN+65ndx+zPa/SCSsk7nK 48gkF7h+AbYg9ccr+Dx4RX6TewnBG0XfWkp+FiACtL9YFUQ65Fs/oem/fDJrQhJJC+/Z g0je2VUvzniMZyoweBjQsOQyFN5NAXWMlKPbpzytjDMXXxRcb4PYqc75iDvahfw52I5n WXdWqSGgiZvYZS1N95TPZZ+cVminU8G9/+MuxGQEmVGk3Khzk87d17+0Ip9Emi0imjNf q8uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tvu6UpXv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si12333449ejn.151.2021.03.29.01.31.04; Mon, 29 Mar 2021 01:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tvu6UpXv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233938AbhC2IaK (ORCPT + 99 others); Mon, 29 Mar 2021 04:30:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:35952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233247AbhC2ITO (ORCPT ); Mon, 29 Mar 2021 04:19:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D10861477; Mon, 29 Mar 2021 08:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005953; bh=LMlAkPh0AFAChpebs9ayhYBjTS7ZxN6DVOA23qX1478=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tvu6UpXvT07ZqHGkjoL0ehqUCg+N+i8Ak9TcQOqTOdPwhlohg1lfdkxqOYKJd7Z1a djIQkyXb65DseyhtuP1FvF4mlsbcKiJS77PTsAlfthyHnvvTs4+nD+Dil2zw9je6c9 kAr9msL/BBB7omH5gVKj050PSEWtJjUPxdBYGHgY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 029/221] atm: idt77252: fix null-ptr-dereference Date: Mon, 29 Mar 2021 09:56:00 +0200 Message-Id: <20210329075630.143726250@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Zhang [ Upstream commit 4416e98594dc04590ebc498fc4e530009535c511 ] this one is similar to the phy_data allocation fix in uPD98402, the driver allocate the idt77105_priv and store to dev_data but later dereference using dev->dev_data, which will cause null-ptr-dereference. fix this issue by changing dev_data to phy_data so that PRIV(dev) can work correctly. Signed-off-by: Tong Zhang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/idt77105.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index 3c081b6171a8..bfca7b8a6f31 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev) { unsigned long flags; - if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) + if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) return -ENOMEM; PRIV(dev)->dev = dev; spin_lock_irqsave(&idt77105_priv_lock, flags); @@ -337,7 +337,7 @@ static int idt77105_stop(struct atm_dev *dev) else idt77105_all = walk->next; dev->phy = NULL; - dev->dev_data = NULL; + dev->phy_data = NULL; kfree(walk); break; } -- 2.30.1