Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2798570pxt; Mon, 9 Aug 2021 09:09:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg5RJyIpHrPneTFuMwdDmefDe5WxtpsCVKcHE7rsl6isBiucV3+rVX+1Smi+eGDWmIN4w3 X-Received: by 2002:a02:caa1:: with SMTP id e1mr23293328jap.107.1628525375682; Mon, 09 Aug 2021 09:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628525375; cv=none; d=google.com; s=arc-20160816; b=e9DSfAWdUE4PXyf5wtGdFlkIbUe1QSmGAafVSQDrVXDafkq4Rfp8vATqttQwllq5iD j6ACQoWl4uYGhsmRnhIv0jWlQJiyWhDkjuhdXnFpmPJ6KRuDVUuJGFpceksupuZsbuSz a++LWYg+HeCYCbBgEkCzyLSGszCU7yENiWdIwAYPfO/7T4QDM3ASip97WXmKyy4YdgHo xE2bDeN0apHjUc0eFAviH6d83o6xibrBRSqwBmOfl/aqI5v+/InQh/sULJUjKun/Z/OO /CTHr3XKUopxFUPaYFbjD6U8qI7BnPzLiVcxMiZ8hzzap3oWttmcrItW/cYxNuE/lcB6 wc2Q== 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:dkim-signature; bh=mSPkW/SIwIdTR1Auqes9W6f3wVDiaTmpv2xaOSvJWvI=; b=0XzhxA3e9+lUCOt9y9jSvyEX63nllzqXc/El8JiPuHTgUt/J66ZQYcsZ5cAalMJZLQ 4n0lXIgx/URwJ13zMf9MkCu4kmiyg6Z1raUiD7jOt/gFW/AjmB6WSebAQz1gsevQKhLr aVTBENmUZrouygLc7NnpPtIJX8vKgX1IF16dV3etEfi9Tt3+gxrgVSEDj9f/UxgXbFjw YDD3ElzvyQgvS7AB9KaYyFokKwAPM1nddwEp9lhJ1moEvVuTfKDG1ERQNrhqf5Pa+wbS 3LzA5iwdqu3t4YsGZCROqWe+d3awfVZYVvfJwICsEoNNJm15MZUVGC7ob22BQrhE8Ajo vyiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=novI017m; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si22124381ils.22.2021.08.09.09.09.14; Mon, 09 Aug 2021 09:09:35 -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=@kernel.org header.s=k20201202 header.b=novI017m; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231648AbhHIQGk (ORCPT + 99 others); Mon, 9 Aug 2021 12:06:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhHIQGj (ORCPT ); Mon, 9 Aug 2021 12:06:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 044BB60F56; Mon, 9 Aug 2021 16:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628525179; bh=+5/Y9P/eIIGPo/tVm7vmNewM1ZvHkw3Lisdlnp9j9PU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=novI017mbiCI3gHlv9eV1IAefmm1s+AWi9G2DCHEehIDESUgpkh1B6cRFOX1RmRc3 ITbzvChwICa88Yh7VwISQli68BUtyRMjhfKOYlqMF9BDcKg0IKVRVVsxgiLhBjpHKN uybdioZ2Zqr9aAUX7828CPIOJpTsLFOU+G/V3OjpKGu1KAc1LiUhi3eCfD53Ra3cGH 2R2PtHouptwXRNkswf67eCG7JoQsz4yllIQqq38zHpqh6KljY8S/wpgyh06hqNXhFP 7M2eyi0Gnd+90gxhbVQZr0V3/LsqrNrXorQNXTic0SLhXBPikmfJdxgPzVP8sd+ab0 ndeNvy1oXFD6w== Date: Mon, 9 Aug 2021 12:06:17 -0400 From: Sasha Levin To: Eric Dumazet Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, gushengxian , gushengxian <13145886936@163.com>, "David S . Miller" , netdev@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.13 184/189] flow_offload: action should not be NULL when it is referenced Message-ID: References: <20210706111409.2058071-1-sashal@kernel.org> <20210706111409.2058071-184-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 06, 2021 at 11:30:04AM +0200, Eric Dumazet wrote: >On 7/6/21 1:14 PM, Sasha Levin wrote: >> From: gushengxian >> >> [ Upstream commit 9ea3e52c5bc8bb4a084938dc1e3160643438927a ] >> >> "action" should not be NULL when it is referenced. >> >> Signed-off-by: gushengxian <13145886936@163.com> >> Signed-off-by: gushengxian >> Signed-off-by: David S. Miller >> Signed-off-by: Sasha Levin >> --- >> include/net/flow_offload.h | 12 +++++++----- >> 1 file changed, 7 insertions(+), 5 deletions(-) >> >> diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h >> index dc5c1e69cd9f..69c9eabf8325 100644 >> --- a/include/net/flow_offload.h >> +++ b/include/net/flow_offload.h >> @@ -319,12 +319,14 @@ flow_action_mixed_hw_stats_check(const struct flow_action *action, >> if (flow_offload_has_one_action(action)) >> return true; >> >> - flow_action_for_each(i, action_entry, action) { >> - if (i && action_entry->hw_stats != last_hw_stats) { >> - NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); >> - return false; >> + if (action) { >> + flow_action_for_each(i, action_entry, action) { >> + if (i && action_entry->hw_stats != last_hw_stats) { >> + NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); >> + return false; >> + } >> + last_hw_stats = action_entry->hw_stats; >> } >> - last_hw_stats = action_entry->hw_stats; >> } >> return true; >> } >> > >This patch makes no sense really. > >If action is NULL, a crash would happen earlier anyway in > >if (flow_offload_has_one_action(action)) > return true; > >Also, I wonder why it has been backported to stable version, >there was no Fixes: tag in the submission. That's the AUTOSEL logic: it will attempt to find fixes in commits that don't have a fixes: tag. Those get longer review times and aren't backported as quickly as commits with a stable tag or a fixes tag. -- Thanks, Sasha