From: Ido Schimmel <idosch@idosch.org>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: bpf@vger.kernel.org, jiri@resnulli.us, netdev@vger.kernel.org,
martin.lau@linux.dev, ast@kernel.org, andrii@kernel.org,
john.fastabend@gmail.com, kuba@kernel.org, andrew@lunn.ch,
toke@kernel.org, toke@redhat.com, sdf@google.com,
daniel@iogearbox.net
Subject: Re: [PATCH bpf-next 2/2] netkit: use netlink policy for mode and policy attributes validation
Date: Thu, 26 Oct 2023 17:11:09 +0300 [thread overview]
Message-ID: <ZTpzfckQ5n4o2F7D@shredder> (raw)
In-Reply-To: <20231026094106.1505892-3-razor@blackwall.org>
On Thu, Oct 26, 2023 at 12:41:06PM +0300, Nikolay Aleksandrov wrote:
> static const struct nla_policy netkit_policy[IFLA_NETKIT_MAX + 1] = {
> [IFLA_NETKIT_PEER_INFO] = { .len = sizeof(struct ifinfomsg) },
> - [IFLA_NETKIT_POLICY] = { .type = NLA_U32 },
> - [IFLA_NETKIT_MODE] = { .type = NLA_U32 },
> - [IFLA_NETKIT_PEER_POLICY] = { .type = NLA_U32 },
> + [IFLA_NETKIT_POLICY] = NLA_POLICY_VALIDATE_FN(NLA_U32,
> + netkit_check_policy),
Nik, it's problematic to use NLA_POLICY_VALIDATE_FN() with anything
other than NLA_BINARY. See commit 9e17f99220d1 ("net/sched: act_mpls:
Fix warning during failed attribute validation").
> + [IFLA_NETKIT_MODE] = NLA_POLICY_VALIDATE_FN(NLA_U32,
> + netkit_check_mode),
> + [IFLA_NETKIT_PEER_POLICY] = NLA_POLICY_VALIDATE_FN(NLA_U32,
> + netkit_check_policy),
> [IFLA_NETKIT_PRIMARY] = { .type = NLA_REJECT,
> .reject_message = "Primary attribute is read-only" },
> };
> --
> 2.38.1
>
>
next prev parent reply other threads:[~2023-10-26 14:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 9:41 [PATCH bpf-next 0/2] netkit: two minor cleanups Nikolay Aleksandrov
2023-10-26 9:41 ` [PATCH bpf-next 1/2] netkit: remove explicit active/peer ptr initialization Nikolay Aleksandrov
2023-10-26 12:12 ` Daniel Borkmann
2023-10-26 13:21 ` Jiri Pirko
2023-10-26 9:41 ` [PATCH bpf-next 2/2] netkit: use netlink policy for mode and policy attributes validation Nikolay Aleksandrov
2023-10-26 12:13 ` Daniel Borkmann
2023-10-26 13:23 ` Jiri Pirko
2023-10-26 14:11 ` Ido Schimmel [this message]
2023-10-26 14:23 ` Nikolay Aleksandrov
2023-10-26 14:25 ` Daniel Borkmann
2023-10-26 14:34 ` Nikolay Aleksandrov
2023-10-26 14:10 ` [PATCH bpf-next 0/2] netkit: two minor cleanups patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZTpzfckQ5n4o2F7D@shredder \
--to=idosch@idosch.org \
--cc=andrew@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=sdf@google.com \
--cc=toke@kernel.org \
--cc=toke@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.