🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12724

Re: [PATCH net-next v6 1/2] netlink: specs: add ovs_flow del and set operations

#12724
From: netdev-bot+sashiko
Date: Sun, 08 Nov 2026 12:39
174 lines
13964 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 (1) · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The new ufid text in Documentation/netlink/specs/ovs_flow.yaml
  (flow-attrs/ufid) and in include/uapi/linux/openvswitch.h…

Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but the get
  reply list, now anchored as &flow-get-reply and reused for the dump…

--

netlink: specs: add ovs_flow del and set operations

This adds the del and set operations to the ovs_flow YNL spec. It also
gives the dump its own request list, changes probe to a flag, and marks
the ops dont-validate and admin-only. The key, actions and ufid docs are
rewritten in both the spec and include/uapi/linux/openvswitch.h.

> diff --git a/Documentation/netlink/specs/ovs_flow.yaml b/Documentation/netlink/specs/ovs_flow.yaml
> index 951837b72e1d2..bfdbf55bc219b 100644
> --- a/Documentation/netlink/specs/ovs_flow.yaml
> +++ b/Documentation/netlink/specs/ovs_flow.yaml

[ ... ]

> @@ -438,18 +446,22 @@ attribute-sets:

[ ... ]

>        -
>          name: ufid
>          type: binary
> +        checks:
> +          min-len: 1
>          doc: |
>            A value between 1-16 octets specifying a unique identifier for the
>            flow. Causes the flow to be indexed by this value rather than the
> -          value of the OVS_FLOW_ATTR_KEY attribute. Optional for all
> -          requests. Present in notifications if the flow was created with this
> -          attribute.
> +          value of the OVS_FLOW_ATTR_KEY attribute. A request that carries a
> +          value outside that range is treated as if it carried no ufid, so a
> +          new flow is indexed by its key. Optional for all requests. Present
> +          in notifications if the flow was created with this attribute.
> +          Ignored in a dump.

[Severity: Medium]
Is this accurate for a zero-length ufid? flow_policy in
net/openvswitch/datapath.c has:

    [OVS_FLOW_ATTR_UFID] = { .type = NLA_UNSPEC, .len = 1 },

and validate_nla() in lib/nlattr.c checks the minimum length even when
strict validation is skipped:

    case NLA_UNSPEC:
        if (validate & NL_VALIDATE_UNSPEC) {
            ...
        }
        if (attrlen < pt->len)
            goto out_err;

So for new, del, set and get, the genl core returns -ERANGE for a 0-byte
ufid before any handler runs. A del with a 0-byte ufid and no key then
gets -ERANGE and does not flush the data path.

For dumps the core skips validation. However, ovs_flow_cmd_dump() parses
with the same policy and returns the error:

    err = genlmsg_parse_deprecated(cb->nlh, &dp_flow_genl_family, a,
                                   OVS_FLOW_ATTR_MAX, flow_policy, NULL);
    if (err)
        return err;

So a 0-byte ufid makes the whole dump fail. It is not ignored.

The treated-as-absent path in get_ufid_len() in
net/openvswitch/flow_netlink.c is:

    if (len < 1 || len > MAX_UFID_LENGTH) {

After policy validation, only the len > 16 case can reach it.

The min-len: 1 check added just above also says 0 octets is rejected,
which contradicts the doc text under it. The commit message has the same
contradiction:

  "Anything outside 1-16 octets is read as if the attribute were absent,
  so a del with such a ufid and no key flushes the data path"

next to "record the minimum length the policy enforces in the attribute".

The same claim also appears in these places:

  - the del op doc ("A request that carries no key and no valid ufid
    flushes the data path")
  - the new key doc
  - @OVS_FLOW_ATTR_UFID and @OVS_FLOW_ATTR_KEY in
    include/uapi/linux/openvswitch.h

The later patch in the series ("netlink: specs: add ovs datapath and
vport set operations") does not touch ovs_flow.yaml or openvswitch.h, so
this text is still there at the end of the series.

Could the docs say that a value longer than 16 octets is treated as
absent, and that a zero-length value is rejected with -ERANGE?

>          display-hint: uuid

[ ... ]

> @@ -969,25 +981,33 @@ operations:
>        doc: Get / dump OVS flow configuration and state
>        value: 3
>        attribute-set: flow-attrs
> -      do: &flow-get-op
> +      dont-validate: [strict, dump]
> +      do:
>          request:
>            attributes:
>              - key
>              - ufid
>              - ufid-flags
> -        reply:
> +            - probe
> +        reply: &flow-get-reply
>            attributes:
>              - key
>              - ufid
>              - mask
>              - stats
>              - actions
> -      dump: *flow-get-op
> +      dump:
> +        request:
> +          attributes:
> +            - ufid-flags
> +        reply: *flow-get-reply

[Severity: Medium]
This is a pre-existing issue, not one introduced by this patch. This
reply list is now anchored and reused for the dump, so should it also
list used and tcp-flags?

ovs_flow_cmd_fill_info() always calls ovs_flow_cmd_fill_stats(). That
function puts both attributes in get replies and dump entries:

    if (used &&
        nla_put_u64_64bit(skb, OVS_FLOW_ATTR_USED, ovs_flow_used_time(used),
                          OVS_FLOW_ATTR_PAD))
        return -EMSGSIZE;
    ...
    if ((u8)ntohs(tcp_flags) &&
         nla_put_u8(skb, OVS_FLOW_ATTR_TCP_FLAGS, (u8)ntohs(tcp_flags)))
        return -EMSGSIZE;

Because they are not in the reply list, YNL-generated clients do not
parse the last-used time or the TCP flags. The dump already shared this
reply list through *flow-get-op before this patch.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261107120647.874906-1-houminxi%40gmail.com
Technical Details
Message-ID: <179414156764.994134.5410552449080338660@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358717-linux-kernel-netdev=dewy.ru
References: <20261107120647.874906-2-houminxi@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358717-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 1/2] netlink: specs: add ovs_flow del and set
 operations
Date: Sun, 08 Nov 2026 12:39:27 +0000
Organization: Usenet Network
Message-ID: <179414156764.994134.5410552449080338660@kernel.org>
References: <20261107120647.874906-2-houminxi@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="122940"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FgODzgOGcR6pufg7FrATY2CWqUs= sha256:OelvDQQJWxrTdteKnhA8eYlNyYumqkfcLGYbP1c0siE=
	sha1:gFQg7lECadVTdok99PjzO5sFsws= sha256:RMAL9vGzajVYvnLyc48Tdw3fgp9+hdmzyN6w8iUK1t0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 383E1113574; Sun,  8 Nov 2026 15:39:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id PpI7mcoyof9e;
	Sun,  8 Nov 2026 15:39:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-358717-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id F3468113543; Sun,  8 Nov 2026 15:39:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 7C4C246733; Sun,  8 Nov 2026 12:39:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794141570;
	b=zQOYvp6BwT1VJdRtkd9lZMz0IY35qUSkEKUqvmjBIVhsJTAJNH/EJuaeWFc3Vdi6HDmc
	 ru9aW8B33Gdn59fJnXzCf/CfCQCMQ0w5PrYyxkZEm6EGPm/PJbeNE7X5BcfeyFPRK7Bmm
	 4ZGJ2qSim3ZuDWL69mV7gaHHvRKpTsBfrynPlWWJ3CTM/PqWr0cqyzQ8CtZ/PyjfzJw9I
	 uZmtoi8+JyqMHB1echDIybcXcvETqsfzzVyoFhbAplI/EQpLGQ4z0DTOoXjTaJuWS/9dk
	 Bz21AIVvL3fsVX5C3mTOHgvPrj8IruA4I5HndMYsZivevIHy2GGsFNAr6H1kMJnrB3Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794141570;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=eREda5YYJE2S3LBGhMtfKgJaJUwdP06PFNJ7xCwW/JQ=;
	b=eIHo6ZDt34LnUj2lYBJxLkUyy2sIAyIb0YTHW3SZJMOp69NXxwaA6nddf+PVhGzpx/w3
	 ZUhtMZSZrG910gP8fn1fqZ2pAiZ5AHKYUB7sHjm2krX8FtswfhMyHg4S6HwlmywJ1Zjeg
	 SKK7+wR7tACgf337dndhwGSBeSlL0JeRt/aRGryg5ZAUb4SOutCvcap/LqPeQI/0Dh1Qb
	 MeblFWrs2sY+kLUPfL/m2BlQJMUjnE28sWYKyjslgEcgwZpkSa7ZwC3QYD5GEYvob41kj
	 3QtDqVvRYS06jiJS5nLPJiVyVnW6V8HM3hA7zwFtECE2rmWfWmP7RGqIZ94ezgsVLQA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QvL82ojH;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 405B2606A331;
	Sun,  8 Nov 2026 12:39:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QvL82ojH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794141569;
	b=x1/XbA1vnVDgrVSQ5sAOp1vTjGAcv7n+uOIhJoxfyUuL+Qb2T5JR1KPtQrq10tMIE9Tw
	 ZI1NlfGhUw7VGwWOhhJm6J+m9mjqE8lpvqhv11xhD5055blmFrq0HPVwKa7qKHa3Fen5X
	 SSX4uSI/7Vyb1HS8Cf/wJckm1K4/FUGyC0VRvjysYGeABEq+JwQglEzZbbRIy6NG8tiwW
	 cz5IR/mfefQv/Sx1nqgKI6z2rEIYn9sjFSm62sfP2vLIhXBt/fTD7V1F+QaSGjJvV4ZZ/
	 4kwHW8XVXSHo3yERrdjijlhA6/VkSWMmpYa/YNv79TxSOTuX00o67Yaf/6ilwnRUveg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794141569;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=eREda5YYJE2S3LBGhMtfKgJaJUwdP06PFNJ7xCwW/JQ=;
	b=1E4cQVLK0u+CdWoqs+1RtsZJPZLICVudj/WhafmA8QrBwiF0hhLXnvUfa64AuduhxF9u
	 nwphIBO5JmzV9nPTRm1/GSpP2NBvU4t/PnSDwYBrj7FBAx5mHqjo3jnIPijCo01EEEVpr
	 LvFHCVOtThXacKdZKXhk/76aecqIMtPB+Yxi6YzX3mgG2CwKhY92CDXj6uiGBneiHHUKj
	 6jX1yFK+j7sBxwtr50rb0YDctPjUe5xUy4g+zxiH7k93e1CtVYcpTHlUM6I+wPuAEFEKd
	 acczBc/jMLiO9CZ9nLWZszZuy40YEniLOyTd5c+ZE7842CRzl7uBOUHC5C6qZIcXC6g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QvL82ojH;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B9E1606A31C
	for <netdev@vger.kernel.org>; Sun,  8 Nov 2026 12:39:28 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 193D91F0089F;
	Sun,  8 Nov 2026 12:39:28 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794141568;
	bh=eREda5YYJE2S3LBGhMtfKgJaJUwdP06PFNJ7xCwW/JQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QvL82ojHkxl75mLFGUNQpFZDyMG6YJGO7dAMitN645AW4D8i/CFgAIyaPKTNBFqOQ
	 xgGdKw1j35HpuI607tYXmF8PCxbW2tDwJ1ryTs7V9jukUSmuwUgnGLpEvaTfk4EYLb
	 MBtLT0nFWb9KxY8/W1j1VDf+aFvz3ZK2CFbRrb9IErBxrpupMj9mZXDIlb/u1A4HMK
	 7jy8qAjhqMNTb5c12DwyzMyv0bFP9iUrs8wAqjx0FPBISyy+pOWFXjvdwU/XxWPCkz
	 2koZqu2eTcJ7IlZHrO1k7pXHbJDNmZ0kd2xekV/A1wobZPhIq5sHpKbi7G/bzhXxne
	 SgStZWEoI0D1Q==
X-Cc: netdev@vger.kernel.org, donald.hunter@gmail.com, kuba@kernel.org,
 davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org,
 dev@openvswitch.org, aconole@redhat.com, echaudro@redhat.com,
 i.maximets@ovn.org
X-In-Reply-To: <20261107120647.874906-2-houminxi@gmail.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list