From: Florian Westphal <fw@strlen.de>
To: Hui Peng <benquike@gmail.com>
Cc: pablo@netfilter.org, phil@nwl.cc, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nfnetlink_log: fix config error handling, SIT headroom OOB read, and nlmsg rollback
Date: Mon, 16 Nov 2026 20:15:26 +0100 [thread overview]
Message-ID: <avtWTqpzelp_PNmv@strlen.de> (raw)
In-Reply-To: <20260919215241.3471723-1-benquike@gmail.com>
Hui Peng <benquike@gmail.com> wrote:
> Fix three issues in net/netfilter/nfnetlink_log.c:
>
> 1. In __build_packet_message(), subtracting ETH_HLEN from skb_mac_header()
> for ARPHRD_SIT tunnels can read before skb->head or past
> skb_tail_pointer(skb), and nla_put_failure returns -1 without calling
> nlmsg_cancel(inst->skb, nlh). Remove the unsafe ETH_HLEN subtraction,
That made no sense to me. The entire ARPHRD_SIT check is dead code
nowadays and it will be removed in -next.
But how is it 'unsafe'? If it moves to before skb->head, no read will
occur.
> verify hwhdrp + hard_header_len <= skb_tail_pointer(skb), and cancel
> the partial nlmsg on error.
I don't think its expected to ever fail. There is a space-remaining
check *before* __build_packet_message() is called.
> 2. In nfulnl_log_packet(), only increment inst->qlen after
> __build_packet_message() succeeds.
See above.
> 3. In nfulnl_recv_config(), propagate errors from nfulnl_set_mode() and
> nfulnl_set_nlbufsiz() and destroy the newly created instance if
> NFULNL_CFG_CMD_BIND was processed in the same message.
Not sure about this. Could cause existing (working!) userspace
to fail.
> Fixes: 0c36b48b36dc ("netfilter: nfnetlink_log: fix mac address for 6in4 tunnels")
Not really. Most of these 'fixes' are day-0 bugs.
I suggest we wait for the ARPHRD_SIT removal series to land in nf-next.
Then at least some of the changes here could land as cleanups.
prev parent reply other threads:[~2026-11-16 19:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 21:52 [PATCH] netfilter: nfnetlink_log: fix config error handling, SIT headroom OOB read, and nlmsg rollback Hui Peng
2026-11-16 19:15 ` Florian Westphal [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=avtWTqpzelp_PNmv@strlen.de \
--to=fw@strlen.de \
--cc=benquike@gmail.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
/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.