Message ID | 20200319123941.236811843@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=1QoN=5E=vger.kernel.org=stable-owner@kernel.org> 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, 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 2B34AC4332D for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:28:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1FFB2080C for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584624519; bh=jJkSqg+i9P7iPzHlRnCaYYKLwrXSs46x9cFnO80Ekvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qLer4JNkGN8j9aJIrRWwzq3Q/NK5BAMvYefIrw3T0OrI//ZFrPns3KaaMTWWxxhGv 0fTbcEHtc3UBqZQxmJGJG6eRNdSNEBRM9VmGt/gNQwJAFt42NvcIF+hD8Hyt8I6rXL zYPPm58bo3yJI0QC+b9l3yUcex+PTd8198H33PzY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730469AbgCSN0h (ORCPT <rfc822;stable@archiver.kernel.org>); Thu, 19 Mar 2020 09:26:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:54636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730795AbgCSN0g (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 19 Mar 2020 09:26:36 -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 5101E20658; Thu, 19 Mar 2020 13:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584624395; bh=jJkSqg+i9P7iPzHlRnCaYYKLwrXSs46x9cFnO80Ekvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHLc4gijUgZuClmceHp+cWKVgrdM0DwVHX6W7xMFksIOzpeQevCkIsOGzNWa6AcRM O+4s069WcFnHhlCm86dTwCnFe5HfXi9iewGVaPjhM9rJsZy2sayAGo1TUegBWOvvG7 yneji/Ltop9DwD91CrLYjJYSNjhCd/uICSmoPSf4= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Taehee Yoo <ap420073@gmail.com>, "David S. Miller" <davem@davemloft.net>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 5.5 47/65] net: rmnet: fix NULL pointer dereference in rmnet_changelink() Date: Thu, 19 Mar 2020 14:04:29 +0100 Message-Id: <20200319123941.236811843@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123926.466988514@linuxfoundation.org> References: <20200319123926.466988514@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: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c index 471e3b2a1403a..ac58f584190bd 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c @@ -300,10 +300,8 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[], if (!dev) return -ENODEV; - real_dev = __dev_get_by_index(dev_net(dev), - nla_get_u32(tb[IFLA_LINK])); - - if (!real_dev || !rmnet_is_real_dev_registered(real_dev)) + real_dev = priv->real_dev; + if (!rmnet_is_real_dev_registered(real_dev)) return -ENODEV; port = rmnet_get_port_rtnl(real_dev);