From patchwork Tue Mar 14 13:44:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Zhandarovich X-Patchwork-Id: 6621 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1786921wrd; Tue, 14 Mar 2023 07:20:13 -0700 (PDT) X-Google-Smtp-Source: AK7set8/tkOiaFa1MXVlwC6QGdEP6k2Zk9ZCupvLn+aNFu3M7n1IhiRuQH3Wt+ckTyhWJVDvLoJt X-Received: by 2002:a17:902:cece:b0:19c:d316:309a with SMTP id d14-20020a170902cece00b0019cd316309amr47549502plg.4.1678803613230; Tue, 14 Mar 2023 07:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678803613; cv=none; d=google.com; s=arc-20160816; b=MkE7cPkJ1ORHM9Prmbd628Gpofypal+1NWHQw3vEG3TqbV7TIVwuZYssYnNpT4XDlx DecoCWEpZr/M7nvhLJBjLiwktIF3GKYP5tzW1WV7gOskCNlRcwPTPWXcTesRlB8atzNU 5h7CVpKksK2cg3lMSemRHLh5jp9OYjVcY1KXUsjQ9tAzHiUeYb1yILw+PbSJ/GABzMj0 ayCuI1g7UzYnfuYWmLiwQY92bKyiw9RY/c2I/7QdOMk33zdwpM7hzbvSg+YNHqbQkePI fKTmKXOaHZbVC+AvIuM5ezE6ziy7VrLdeNTigK3zHgWuwgIhGcWRrxn8/qep5Y2akOqQ Nrnw== 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 :message-id:date:subject:cc:to:from; bh=H+0Bna8eYSnniS7EPrWyUd40bqlNkOchESL4kPZ9UNo=; b=lg/ScB4D0aODP2zwm0DRJNFmpgttr3nPMuht9YdCU+Upl9qrkdvlEP+M/pGX48zv/A zOIRxOrCDcKCb/MiBB0Ifj5ft0CrxQefVkdTMYjP2f4sztL+S02+tzitbwgd4sCH6rJS P5hj3XFpjFy6v+7eHXUWqT0iV+Z2pg/1ZEXccVPLsHcdHsNiYzhAC1qO1NS9MTcFQuAk CVE5h5t//RDpKW6oyKBM80sao/HfeiI3Jxb3gjwoMltQPB9DJzUl84G/806uJrCq4sM0 yG7tpWJW0VWwNR9Dhr0XrUCjPfCcEg9Dh0rhdby8vh8Lm3hpj0ohyIdo1del8rtCfbp+ ofzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a17090aa40b00b00229f5cf70f9si2620569pjp.107.2023.03.14.07.19.57; Tue, 14 Mar 2023 07:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbjCNNss (ORCPT + 99 others); Tue, 14 Mar 2023 09:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbjCNNsX (ORCPT ); Tue, 14 Mar 2023 09:48:23 -0400 Received: from exchange.fintech.ru (e10edge.fintech.ru [195.54.195.159]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D40E9BE35; Tue, 14 Mar 2023 06:45:22 -0700 (PDT) Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 14 Mar 2023 16:45:20 +0300 Received: from localhost (10.0.253.157) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 14 Mar 2023 16:45:20 +0300 From: Nikita Zhandarovich To: , Greg Kroah-Hartman CC: Nikita Zhandarovich , Mustafa Ismail , Shiraz Saleem , "Jason Gunthorpe" , Leon Romanovsky , , , Subject: [PATCH 5.4/5.10 0/1] RDMA/i40iw: Fix potential NULL-ptr-dereference Date: Tue, 14 Mar 2023 06:44:55 -0700 Message-ID: <20230314134456.3557-1-n.zhandarovich@fintech.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.0.253.157] X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-01.fintech.ru (10.0.10.18) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760352495331050482?= X-GMAIL-MSGID: =?utf-8?q?1760353177855330077?= This is a modified backport of upstream commit 5d9745cead1f. It corrects NULL pointer dereference in in_dev_for_each_ifa_rtnl() caused by potential device unavailability. This issue can be triggered on 5.4/5.10 stable branches. Changes had to be made to the modified source file in question. Patch drivers/infiniband/hw/i40iw/i40iw_cm.c instead of: drivers/infiniband/hw/irdma/cm.c due to switch from i40iw to irdma driver in commit fa0cf568fd76. i40iw driver was removed and irdma was introduced as an alias to i40iw. Other than the filename change, the patch remains the same and can be cleanly applied to stable branches listed above.