Netdev List
 help / color / mirror / Atom feed
From: Dairui Zhang <zhangdairui@gmail.com>
To: Stanislav Fomichev <sdf.kernel@gmail.com>
Cc: Mina Almasry <almasrymina@google.com>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	David Wei <dw@davidwei.uk>, Dairui Zhang <zhangdairui@gmail.com>
Subject: Re: [BUG] net: devmem: NETDEV_CMD_BIND_TX has no permission check and no accounting
Date: Tue, 22 Sep 2026 02:43:31 +0800	[thread overview]
Message-ID: <20260921184331.1415909-1-zhangdairui@gmail.com> (raw)
In-Reply-To: <arF4n8rQtVzxy0da@devvm7509.cco0.facebook.com>

Stanislav Fomichev wrote:
> I was gonna do it, but looks like you volunteered yourself? We do
> get this almost every day now:
>
> https://lore.kernel.org/netdev/20260918150858.3c98728d@kernel.org/

Thanks for the pointer - I see the same flag patch was posted just
a few days ago. Sorry for adding to the pile, I should have
searched the list harder before sending.

That leaves the accounting side as my one remaining question. With
bind-tx unprivileged on purpose, is there anything that stops a
user from exhausting memory and IOMMU mappings by binding over and
over? As far as I can see there's no per-socket or per-user limit,
the allocations don't go to memcg (GFP_KERNEL, devmem.c:214), and
repeated binds of the same dmabuf fd aren't deduplicated - but I
may well be missing a guard somewhere.

If there isn't one, is that a gap you'd want a patch for, or is it
considered acceptable in practice? Happy to help either way, just
tell me which direction you'd prefer.

Thanks,
Dairui Zhang

      reply	other threads:[~2026-09-21 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 17:47 [BUG] net: devmem: NETDEV_CMD_BIND_TX has no permission check and no accounting Dairui Zhang
2026-09-21 18:07 ` Dairui Zhang
     [not found]   ` <CAHS8izOM-Mjh_s=0K=8rDdvDdwORCsNMiKf7eoir97i95DkqEg@mail.gmail.com>
2026-09-21 18:34     ` Stanislav Fomichev
2026-09-21 18:43       ` Dairui Zhang [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=20260921184331.1415909-1-zhangdairui@gmail.com \
    --to=zhangdairui@gmail.com \
    --cc=almasrymina@google.com \
    --cc=dw@davidwei.uk \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sdf.kernel@gmail.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