mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf.kernel@gmail.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	sdf@fomichev.me, bobbyeshleman@meta.com, almasrymina@google.com,
	linux-kernel@vger.kernel.org
Subject: Re:  Re: [PATCH net-next v3 1/3] net: devmem: replace gen_pool with freelist
Date: Mon, 21 Sep 2026 09:58:18 -0700	[thread overview]
Message-ID: <7286d84a0b3b4098219acc0cf9803e6e@gmail.com> (raw)
In-Reply-To: <178993807798.2160803.6987249829072277558@kernel.org>

> gen_pool_free() -> gen_pool_free_owner() -> bitmap_clear_ll()
> 	BUG_ON(remain);
>
> Reaching this requires a separate page_pool refcount bug, since
> mp_dmabuf_devmem_release_page() rejects refcount != 1, so this is
> only a loss of a fail-stop diagnostic. Is dropping that check
> intentional to match io_uring zcrx, which uses the same unguarded
> LIFO?

Working as intended. A duplicate return already violates page_pool ownership.

> This is a pre-existing issue and not introduced here, since the
> return value of page_pool_set_dma_addr_netmem() is dropped.
>
> Would it be worth failing the bind here as well?

I plan to follow up with 2 more patches to cleanup freelist and will
fix it there (convert to the helpers). Let's consider this a pre-existing
issue that I'll fix separately?

> [Severity: Medium]
> Can this walk overrun owner->area.niovs[], binding->freelist[] and
> binding->tx_vec[]?
>
> Would adding the sum check or the post-loop equality check be
> worthwhile?

Same feedback as on patch 1: let's not do defensive programming. We
do have a contract where dmabuf->len == sum(sg->len) and it is
maintained for the in-tree dmabufs.

  reply	other threads:[~2026-09-21 16:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 18:11 [PATCH net-next v3 0/3] net: devmem: remove gen_pool from dma-buf allocations Stanislav Fomichev
2026-09-17 18:11 ` [PATCH net-next v3 1/3] net: devmem: replace gen_pool with freelist Stanislav Fomichev
2026-09-20 21:01   ` netdev-bot+sashiko
2026-09-21 16:58     ` Stanislav Fomichev [this message]
2026-09-21 23:29   ` Jakub Kicinski
2026-09-21 23:34   ` Mina Almasry
2026-09-17 18:11 ` [PATCH net-next v3 2/3] net: devmem: embed net_iov_area in binding Stanislav Fomichev
2026-09-20 21:01   ` netdev-bot+sashiko
2026-09-21 16:58     ` Stanislav Fomichev
2026-09-17 18:11 ` [PATCH net-next v3 3/3] net: devmem: batch net_iov allocations into the page_pool cache Stanislav Fomichev
2026-09-21 23:50 ` [PATCH net-next v3 0/3] net: devmem: remove gen_pool from dma-buf allocations 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=7286d84a0b3b4098219acc0cf9803e6e@gmail.com \
    --to=sdf.kernel@gmail.com \
    --cc=almasrymina@google.com \
    --cc=bobbyeshleman@meta.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /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

all inboxes | Powered by JetHome®