Re: [PATCH ipsec] xfrm: account XFRMA_MARK in xfrm_sa_len()
From: Yasuaki Torimaru
Date: Thu Nov 12 2026 - 00:40:33 EST
Thanks. Here is the information the series is missing.
Discovered by manual code inspection: xfrm_notify_sa() sizes its message
with xfrm_sa_len(), while copy_to_user_state_extra() appends XFRMA_MARK
whenever the state carries a mark, and xfrm_sa_len() does not count that
attribute. The issue was not triggered on a running system. There is no
syzbot report and nothing was observed on a machine in real use.
It was then confirmed by instrumenting xfrm_notify_sa() on an x86-64 KASAN
build under qemu: adding a marked state raised the accounted length by
exactly 12 bytes (348 -> 360), matching
nla_total_size(sizeof(struct xfrm_mark)). The shortfall itself was not
reproduced as -EMSGSIZE, because the skb allocation has slack and
km_state_notify() discards the return value; the commit message states
this.
On testing: the change only alters the computed length, so it was tested by
building and booting the patched kernel with the same instrumentation, where
the accounted length includes the mark. No selftest covers xfrm_sa_len(),
and this is core networking code, so no hardware was involved.
Yasuaki Torimaru
2026年11月10日(火) 20:52 <netdev-bot+sinfo@xxxxxxxxxx>:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.