From: "Michael S. Tsirkin" <mst@redhat.com>
To: Dragos Tatulea <dtatulea@nvidia.com>
Cc: "xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
Eli Cohen <elic@nvidia.com>,
"linma@zju.edu.cn" <linma@zju.edu.cn>
Subject: Re: [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check
Date: Wed, 26 Jul 2023 07:47:26 -0400 [thread overview]
Message-ID: <20230726074710-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <00e14bc9e9a1f3749be62cbefc7adfaa1ba2d81c.camel@nvidia.com>
On Tue, Jul 25, 2023 at 08:26:32AM +0000, Dragos Tatulea wrote:
> On Mon, 2023-07-24 at 16:08 -0400, Michael S. Tsirkin wrote:
> > On Mon, Jul 24, 2023 at 11:42:42AM +0000, Dragos Tatulea wrote:
> > > On Mon, 2023-07-24 at 05:16 -0400, Michael S. Tsirkin wrote:
> > > > On Mon, Jul 24, 2023 at 08:38:04AM +0000, Dragos Tatulea wrote:
> > > > >
> > > > > On Mon, 2023-07-24 at 15:11 +0800, Jason Wang wrote:
> > > > > > On Sun, Jul 23, 2023 at 6:02 PM Michael S. Tsirkin <mst@redhat.com>
> > > > > > wrote:
> > > > > > >
> > > > > > > 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.
> > > > > >
> > > > > > Adding Dragos.
> > > > > >
> > > > > I will check. Just to make sure I understand correctly: you want me to
> > > > > drop
> > > > > the
> > > > > .validate flags all together in all vdpa ops and check, right?
> > > > >
> > > > > Thanks,
> > > > > Dragos
> > > >
> > > > yes - I suspect you will then need this patch to make things work.
> > > >
> > > Yep. Adding the patch and removing the .validate config on the vdpa_nl_ops
> > > seems to work just fine.
> > >
> > > Thanks,
> > > Dragos
> >
> > OK, post a patch?
> >
> Sure, but how do I make it depend on this patch? Otherwise it will break things.
>
> Thanks,
> Dragos
Send a patch series with this as patch 1/2 that one 2/2.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
prev parent reply other threads:[~2023-07-26 11:47 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
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 [this message]
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=20230726074710-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dtatulea@nvidia.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).