All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH net] netlabel: fix duplicate IPv4 entries in the staticlist dump
Date: Fri, 27 Nov 2026 09:27:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-236976@kernel.org> (raw)
In-Reply-To: <20261127092325.3563681-2-xiaolinkui@126.com>

> From: Linkui Xiao <xiaolinkui@kylinos.cn>
> 
> netlbl_unlabel_staticlist() keeps its dump progress in cb->args[]: the
> bucket, the offset of the interface in that bucket, and the IPv4 and IPv6
> offsets in that interface.  It clears iter_addr4 once the whole IPv4 list
> of an interface has been walked, so if the skb fills up while the IPv6
> list of the same interface is being dumped, cb->args[2] is saved as zero.
> The next round resumes on that interface and dumps its IPv4 entries a
> second time, which shows up as duplicated lines in "netlbl_unlabel -l".
> 
> This needs an interface that carries both IPv4 and IPv6 static entries and
> a configuration large enough for the dump to span more than one netlink
> message, but once it does the duplication is reproducible on every dump.
> 
> Clear both address counters when an interface is started instead of when
> it is finished.  The skip counters still have to be cleared only after
> their own list has been walked in full, otherwise the offset saved for the
> interface where the previous dump stopped would also be applied to the
> interfaces that follow it.
> 
> netlbl_unlabel_staticlistdef() dumps a single interface and never resets
> these counters, so it is not affected.
> 
> Fixes: 866358ec331f ("netlabel: fix our progress tracking in netlbl_unlabel_staticlist()")
> Signed-off-by: Linkui Xiao <xiaolinkui@kylinos.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127092325.3563681-2-xiaolinkui@126.com?part=1

  reply	other threads:[~2026-11-27  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  9:23 [PATCH net] netlabel: fix a race in netlbl_unlhsh_condremove_iface() Linkui Xiao
2026-11-27  9:23 ` [PATCH net] netlabel: fix duplicate IPv4 entries in the staticlist dump Linkui Xiao
2026-11-27  9:27   ` sashiko-bot [this message]
2026-11-27  9:30   ` netdev-bot+sinfo
2026-11-30  8:12     ` Linkui Xiao
2026-11-27  9:28 ` [PATCH net] netlabel: fix a race in netlbl_unlhsh_condremove_iface() sashiko-bot
2026-11-27  9:30 ` netdev-bot+sinfo
2026-11-30  8:11   ` Linkui Xiao

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=sashiko-outbox-236976@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.