From: "Michael S. Tsirkin" <mst@redhat.com>
To: Lin Ma <linma@zju.edu.cn>
Cc: xuanzhuo@linux.alibaba.com, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Eli Cohen <elic@nvidia.com>
Subject: Re: [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check
Date: Sun, 23 Jul 2023 06:02:16 -0400 [thread overview]
Message-ID: <20230723055820-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <8ecec51.e40ad.1898226c545.Coremail.linma@zju.edu.cn>
On Sun, Jul 23, 2023 at 05:48:46PM +0800, Lin Ma wrote:
>
> > Sure, that is another undergoing task I'm working on. If the nlattr is parsed with
> > NL_VALIDATE_UNSPEC, any forgotten nlattr will be rejected, therefore (which is the default
> > for modern nla_parse).
>
> For the general netlink interface, the deciding flag should be genl_ops.validate defined in
> each ops. The default validate flag is strict, while the developer can overwrite the flag
> with GENL_DONT_VALIDATE_STRICT to ease the validation. That is to say, safer code should
> enforce NL_VALIDATE_STRICT by not overwriting the validate flag.
>
> Regrads
> Lin
Oh I see.
It started here:
commit 33b347503f014ebf76257327cbc7001c6b721956
Author: Parav Pandit <parav@nvidia.com>
Date: Tue Jan 5 12:32:00 2021 +0200
vdpa: Define vdpa mgmt device, ops and a netlink interface
which did:
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
which was most likely just a copy paste from somewhere, right Parav?
and then everyone kept copying this around.
Parav, Eli can we drop these? There's a tiny chance of breaking something
but I feel there aren't that many users outside mlx5 yet, so if you
guys can test on mlx5 and confirm no breakage, I think we are good.
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-07-23 10:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230723080507.3716924-1-linma@zju.edu.cn>
2023-07-23 9:22 ` [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check Michael S. Tsirkin
[not found] ` <729f5c17.e4079.18982192866.Coremail.linma@zju.edu.cn>
2023-07-23 9:55 ` Michael S. Tsirkin
[not found] ` <8ecec51.e40ad.1898226c545.Coremail.linma@zju.edu.cn>
2023-07-23 10:02 ` Michael S. Tsirkin [this message]
2023-07-24 7:11 ` Jason Wang
2023-07-24 8:38 ` Dragos Tatulea via Virtualization
2023-07-24 9:16 ` Michael S. Tsirkin
2023-07-24 11:42 ` Dragos Tatulea via Virtualization
2023-07-24 20:08 ` Michael S. Tsirkin
2023-07-25 8:26 ` Dragos Tatulea via Virtualization
2023-07-26 11:47 ` Michael S. Tsirkin
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=20230723055820-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=elic@nvidia.com \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=xuanzhuo@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).