From: Florian Westphal <fw@strlen.de>
To: Sunny73Cr <Sunny73Cr@protonmail.com>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: payload expressions, netlink debug output
Date: Fri, 14 Feb 2025 08:20:20 +0100 [thread overview]
Message-ID: <20250214072020.GB9861@breakpoint.cc> (raw)
In-Reply-To: <iUf9BfY67Kl_ry63O6gOxJ2YHKmO-OFslzCRzfWVOxIe15iVlUV2G07XiT0qu5bsF9vvyrDRT4TQODjt2ksTfpiv1-nYlhgG5ryzcidhdug=@protonmail.com>
Sunny73Cr <Sunny73Cr@protonmail.com> wrote:
> It appears that the incorrect register is accepted when data is modified.
>
> Running Debian 12.9.
>
> /etc/nftables.conf:
>
> #!/usr/sbin/nft -f
> flush ruleset
> table inet filter {
> chain output {
> type filter hook output priority filter;
>
> @ih,0,128 set 0 \
> accept;
> }
> }
>
> output (viewable with /usr/sbin/nft -d all -f /etc/nftables.conf):
>
> [ immediate reg 1 0x00000000 0x00000000 0x00000000 0x00000000 ]
> [ payload write reg 1 => 16b @ inner header + 0 csum_type 0 csum_off 0 csum_flags 0x1 ]
> [ immediate reg 0 accept ]
>
> If reg 1 was modified, I believe it should be reg 1 that is accepted.
No, never. reg0 is the verdict register.
"immediate reg 1 0x0000...." means we store 0 in reg 1.
"immediate reg 0 accept" means we store "accept" in reg 0.
Those are stores, not loads.
next prev parent reply other threads:[~2025-02-14 7:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 4:17 payload expressions, netlink debug output Sunny73Cr
2025-02-14 7:20 ` Florian Westphal [this message]
2025-02-15 4:04 ` Sunny73Cr
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=20250214072020.GB9861@breakpoint.cc \
--to=fw@strlen.de \
--cc=Sunny73Cr@protonmail.com \
--cc=netfilter-devel@vger.kernel.org \
/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.