Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4972603rwb; Tue, 17 Jan 2023 07:41:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXv4AFT35Km386vIOfKWUGXWPl5MTReRq0VKOHQv6rd1NIhqcjWUqdP5leiPGxW1VWTTUDxe X-Received: by 2002:a17:902:b181:b0:193:1f24:a042 with SMTP id s1-20020a170902b18100b001931f24a042mr4138541plr.29.1673970070719; Tue, 17 Jan 2023 07:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673970070; cv=none; d=google.com; s=arc-20160816; b=akGFPrdls7pKWQ3JjS5bICHv+8ahZfU/ysQsJ5vF8TNj3AOR4nq7ns+4O1fiUaOxQc 849KnM9uO/CWQVdRnY9sORFJshvqFgZo7PmL+ZyzrmdwV0j8QCwvSmnrQUCisV1CSQ7q To8wUVVGicG2ro2Hjw/g4h6aj5APA+NaeXuVnvEBcH/qLH3yxD/Apvd/+gQ4BzzhXNt9 2pFhj4XWCdEvmqhZf4Ip3wGQEmpOsjCH10/9YWC/CSQVjdH3YRPAmxZLM6Ah5ZKtl2Lk xQJ/Cn0bUoMD982BLLLGAeNZAJOiWTlxJ/ovw29kec9zq9XikVp6kd/D9W2TmB/3s2in paqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=h/7XeEyVnSgpVyQtKRjdiQ2Dmg8h49JSCKuL5K7DRCM=; b=RreuOdHd0jB7I09VMYnEVLAFpSNMzNvKVTELgWbKjmpCJSH9r21MpRTMSeZUM0zyIu Q4utWG2De43igNH0cPlK1bTH2zZN5MbIpB6kVLtoEtqXd/xmmx3m3mpiRlmPq4TKcS9V LbcjPusvg+jnCvW7RK2T/f6IDuNS/SeTWTQgtAep9C8oJoKbdjtzlgdo/Aq45fnFB4m+ C0ey2NEx+tWIiSZ8CPgmEiYg47X06gELx4zlZVMDAw5UQ3WZmkNDp3W6aHG6fLkiKg0J j9IE517pDJF9kTK81tdfXNvTlIQQzsTVAFTUroD5Fe2X1Vl6utqyNis1f68XvvjuUQsA H9AQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd1-20020a170902830100b0019319c34917si29419172plb.505.2023.01.17.07.41.04; Tue, 17 Jan 2023 07:41:10 -0800 (PST) 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 S231559AbjAQP1n (ORCPT + 48 others); Tue, 17 Jan 2023 10:27:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232685AbjAQP1N (ORCPT ); Tue, 17 Jan 2023 10:27:13 -0500 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A2F5041B5A; Tue, 17 Jan 2023 07:27:04 -0800 (PST) Date: Tue, 17 Jan 2023 16:27:01 +0100 From: Pablo Neira Ayuso To: Alok Tiwari Cc: linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org Subject: Re: [PATCH 6.1] netfilter: Null pointer dereference in nf_tables_updobj Message-ID: References: <20230117134537.3400252-1-alok.a.tiwari@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 On Tue, Jan 17, 2023 at 03:17:11PM +0100, Pablo Neira Ayuso wrote: > On Tue, Jan 17, 2023 at 05:45:38AM -0800, Alok Tiwari wrote: > > static analyzer detect null pointer dereference case for 'type' > > function __nft_obj_type_get() can return NULL value which require to handle > > if type is NULL pointer return -ENOENT > > This should not ever happen, but it is good to have a failsafe in this > path. > > I'll take this into nf.git, thanks. BTW, easier to read: if (WARN_ON_ONCE(!type)) instead of: if (!WARN_ON_ONCE(type)) I'll mangle the patch here before applying, unless you prefer to send a v2.