Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9207366rwd; Wed, 21 Jun 2023 04:39:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IDvosijCz3hpOOvljenWw1daZ5t41y+YrOunWRAW0yh1AtYbuqFdQIVd7LvbX2klY78C3 X-Received: by 2002:a05:6359:67aa:b0:131:fb9:2378 with SMTP id sq42-20020a05635967aa00b001310fb92378mr1396564rwb.5.1687347540618; Wed, 21 Jun 2023 04:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687347540; cv=none; d=google.com; s=arc-20160816; b=q54uRBk3Cv9rIo59Qm4fZVu3O2jh3QKpnaQ2CrWKJBRDX7iCNRfVzwqxZLje/9PU7r SbyCAMnRIHaE90N9Ry8F9cIj6ssG8Ofnn415H6DNYRMHjvd52iQl+0W9B9B/UWM5LrBo Qr/741odqRfuWJfoLVI+5wJ2mHLZxmlKfg7fQxYSEY7XZ6uyBdnpx8biyj7foiMdi2Qq W3tDFSrLGiXSMwo3DNfkPTNBoCc3Ur/BvzR/GC94UWpiKFYOh5xRGeqcsQqHOuLawaTl F6P7AZtu22Tv785sEuVuwBZZbk3CRNqTSXgru2X8HjH30Q3yRW4Dka2226BYhJCkZLnW F4og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cuvavCQNpVzqHLc3OiTaBjtm7JoRocO1HLBGVGIKL/k=; b=XZgmvBJEy6U/a/OU2yeVfEO6PVuttmvJqSKaKK4pf9/kfPBinWabw/x88DUcGUrLYu oBFY/GMH8jSfN2B25Eme2AoUuVXXT7msYrLZmcEs8+XANdUktY6giylBQNs0TQlEAwOv Lfi/GSJCgpCABBMFyehY9g9RZWrBgR9530l/RiEeMFST5UzA3e7+zyQ63GyQlMdxZN4M mBoW9HvuxRNbTYQpN7SNid1PSZexBm5WH5DxitwE5pj4XLIbt70xSs1u8+UMpEGHReZU AIexjUHUsI+UaOQGHZpr96N3DHbEbSXaHQMzWZUV07smtWE6P38IcJr9UIGsmu4ODRGu jtSg== 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 l70-20020a638849000000b0054481da6ee5si4030263pgd.418.2023.06.21.04.38.45; Wed, 21 Jun 2023 04:39:00 -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 S232587AbjFUKsO (ORCPT + 99 others); Wed, 21 Jun 2023 06:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjFUKri (ORCPT ); Wed, 21 Jun 2023 06:47:38 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B26281BDF; Wed, 21 Jun 2023 03:46:14 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qBvLf-0006WT-QB; Wed, 21 Jun 2023 12:46:03 +0200 Date: Wed, 21 Jun 2023 12:46:03 +0200 From: Florian Westphal To: "Igor A. Artemiev" Cc: Florian Westphal , Pablo Neira Ayuso , Jozsef Kadlecsik , "David S . Miller" , Paolo Abeni , Jakub Kicinski , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [lvc-project] [PATCH] netfilter: ebtables: remove unnecessary NULL check Message-ID: <20230621104603.GA24035@breakpoint.cc> References: <20230620152549.2109063-1-Igor.A.Artemiev@mcst.ru> <20230620163806.GB3799@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Igor A. Artemiev wrote: > On 6/20/23 19:38, Florian Westphal wrote: > > Igor Artemiev wrote: > > > In ebt_do_table() 'private->chainstack' cannot be NULL > > > and the 'cs' pointer is dereferenced below, so it does not make > > > sense to compare 'private->chainstack' with NULL. > > ? Why do you think that? > > > The 'cs' pointer is dereferenced below without checking, as it is assumed to > always be initialized with 'private->chainstack[smp_processor_id()]'. No, its not. The dereferencing is conditional, as is the allocation of the chainstack. No user defined chains, no chain stack. With this change, "ebtables-legacy -A INPUT" causes kernel panic.