All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 24 Jul 2023 16:08:53 -0400	[thread overview]
Message-ID: <20230724160836-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <280068e9c684f0ae644d195d3a4d3f5a1351c366.camel@nvidia.com>

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?

-- 
MST

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Dragos Tatulea <dtatulea@nvidia.com>
Cc: "virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linma@zju.edu.cn" <linma@zju.edu.cn>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Eli Cohen <elic@nvidia.com>,
	"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
	Parav Pandit <parav@nvidia.com>
Subject: Re: [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check
Date: Mon, 24 Jul 2023 16:08:53 -0400	[thread overview]
Message-ID: <20230724160836-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <280068e9c684f0ae644d195d3a4d3f5a1351c366.camel@nvidia.com>

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?

-- 
MST


  reply	other threads:[~2023-07-24 20:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23  8:05 [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check Lin Ma
2023-07-23  9:22 ` Michael S. Tsirkin
2023-07-23  9:22   ` Michael S. Tsirkin
2023-07-23  9:33   ` Lin Ma
2023-07-23  9:48     ` Lin Ma
2023-07-23 10:02       ` Michael S. Tsirkin
2023-07-23 10:02         ` Michael S. Tsirkin
2023-07-24  7:11         ` Jason Wang
2023-07-24  7:11           ` Jason Wang
2023-07-24  8:38           ` Dragos Tatulea via Virtualization
2023-07-24  8:38             ` Dragos Tatulea
2023-07-24  9:16             ` Michael S. Tsirkin
2023-07-24  9:16               ` Michael S. Tsirkin
2023-07-24 11:42               ` Dragos Tatulea via Virtualization
2023-07-24 11:42                 ` Dragos Tatulea
2023-07-24 20:08                 ` Michael S. Tsirkin [this message]
2023-07-24 20:08                   ` Michael S. Tsirkin
2023-07-25  8:26                   ` Dragos Tatulea via Virtualization
2023-07-25  8:26                     ` Dragos Tatulea
2023-07-26 11:47                     ` Michael S. Tsirkin
2023-07-26 11:47                       ` Michael S. Tsirkin
2023-07-23  9:55     ` Michael S. Tsirkin
2023-07-23  9:55       ` 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=20230724160836-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 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.