Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp708654pxb; Thu, 2 Sep 2021 13:10:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMrEcMMWACOFYmPYc1EHfOVq+JP8XKzhZRQWlNxDdvf9vz2YAgn30pQ0/xLnOau6fQxSeb X-Received: by 2002:aa7:c4ce:: with SMTP id p14mr101226edr.175.1630613457708; Thu, 02 Sep 2021 13:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630613457; cv=none; d=google.com; s=arc-20160816; b=NYUN9r1r0pA2oEsu/IFp4ZTU4heljFgFoVRUEj26PTWq8I1ExCxWoBMj2VJ4+yzcCU JQ1VpqsvgjmLFn6pUL6FdnHXq5RMjOTWRZJ5BtdAwid6MCU6P9VVJf9HUlWwOLjXate9 SvzzAdTKRNQdIWu+pSCclTTWIq/D/zdBlsAhJf68o4q+RYyvx4eMoE8+MPNjxyRh63Uk q0lvfd+dIu8HzvcLe3pEyT80qG0qlNaNEQFg/f1qeyOZSjU9a6TXSf9M62uvNbXmz8B1 wYBViOidCh3IQBI/kPgCkIWq/uCO62JOJHopi0leSqcWOT8chm/7HB6C6FjMBVsgNazq LwFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VleJPFXhbF8WRqOsaBBQPjzgoQ2bIzoPQ5j5gsdJ/N4=; b=EVnH0hZlg9mst8AU2TJhmzPyCw4kyJP/FachZQvt4ZuZePtzS6kYjjyK50gr8XD2dB kgSgxeh6l3od8XSvZEPHfY+BlmdxBBVNNeFNeHQIOtxxrMkMAf6FK+KVfu/v5k4VaDpF p83cUO7qEKht1V8PcooFRLWduXU2DASRe2pNR8/bc9eSda0EdT/yCQfXMNah6LcDW7WI yPrdI2xvlaVjsj9KBKefAirESeFBFgYZR6cWM+LofSiXH1jCL+zWT+HKFOR7uN5yH9gY v9YuGITO4elws1cZp6sQRRqElBJ/0U6TTtd/A8naMd7xP7sMjHWLEcvxZ52QxAzAqcDX mUHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Cz8RabjQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si2989495edt.397.2021.09.02.13.10.21; Thu, 02 Sep 2021 13:10:57 -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=@gmail.com header.s=20210112 header.b=Cz8RabjQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346344AbhIBQmh (ORCPT + 99 others); Thu, 2 Sep 2021 12:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234436AbhIBQmg (ORCPT ); Thu, 2 Sep 2021 12:42:36 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BCC6C061575; Thu, 2 Sep 2021 09:41:38 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id s29so2098089pfw.5; Thu, 02 Sep 2021 09:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VleJPFXhbF8WRqOsaBBQPjzgoQ2bIzoPQ5j5gsdJ/N4=; b=Cz8RabjQzuMJtB8RAsceldQG5nNB5DV0r/TRNB6W4SHV0C7nj2fupVpn1nAt6PO5F0 jOppsn8OM5ApPZjPQVVAl7sLfx+B8ktsABfi/5YeAX9HMb5XP7e0PI3MfqBAxnJ4PVi0 b9u07dUzUxkDHikaB2qwGUKzV1HSRSGOHGoy3VXOBmgfz2OUBx8nKqkhfGJvEH1Kfue/ IsPXFKGhsyrcSigiBUFGazrK0ySWJhF38AcwqaHjUk87HCr7ghGUjWGCkywXVrezq+VR c/SWbHlMAHii1BbzBCAUMg3Zq7WnFh7jpKvwN4CKmpJru5haf74WfBjqPeEMWzgvITd4 icOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VleJPFXhbF8WRqOsaBBQPjzgoQ2bIzoPQ5j5gsdJ/N4=; b=INbrfIJpOfz+oxEMYiOma98ZveTxR3N+ioigcPM9HEhxTl/qiQiWl0J51ghXdVkBel 0QlRtrF07NCtLOGahIz/tBvzlpXSvVbzeMm17s8xGIoBgP29lOj3sCAOf5V2O1CZWALb eGdrLNXvtde/m6TANsBFYulpD5WOytR7OfZphwOTnW/SYLG9XEBU2/UueA1TzaGQJMAG tU96Zz0PQSLo6dbYuN6Ol2NRnZ+zbflDZrcEYFK2UnfFIPdMWhTWaAcUUmYch606+zi+ OCcw7zaPOOHkqwCBaH8pjQAoF38EGZ4hjXjevPEbisyL+fQH5UR5+KHAK3sewep9+iy0 YA3g== X-Gm-Message-State: AOAM533zxADhpB/4Vw3ovHydkIINdgXhBm7gDquvwB+rMUHhnikprlqB /1VaF/Khhge+6Ytf2qrx06wGEsAASo4= X-Received: by 2002:a63:34c6:: with SMTP id b189mr3964133pga.122.1630600897300; Thu, 02 Sep 2021 09:41:37 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([8.45.42.119]) by smtp.googlemail.com with ESMTPSA id v8sm2774059pjh.24.2021.09.02.09.41.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Sep 2021 09:41:36 -0700 (PDT) Subject: Re: [PATCH linux-next] ipv4: Fix NULL deference in fnhe_remove_oldest() To: Eric Dumazet , Tim Gardner Cc: netdev , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , LKML References: <20210902163205.17164-1-tim.gardner@canonical.com> From: David Ahern Message-ID: <9a1962e2-fa9f-f423-c16d-8ba529a931eb@gmail.com> Date: Thu, 2 Sep 2021 09:41:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/21 9:38 AM, Eric Dumazet wrote: > On Thu, Sep 2, 2021 at 9:32 AM Tim Gardner wrote: >> >> Coverity complains that linux-next commit 67d6d681e15b5 ("ipv4: make >> exception cache less predictible") neglected to check for NULL before >> dereferencing 'oldest'. It appears to be possible to fall through the for >> loop without ever setting 'oldest'. > > Coverity is wrong. > > fnhe_remove_oldest() is only called when there are at least 6 items > in the list. > > There is no way oldest could be NULL, or that oldest_p could contain garbage. > +1