All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kashavkin <akashavkin@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Alexey Kashavkin <akashavkin@gmail.com>
Subject: Re: [PATCH] netfilter: nft_exthdr: fix offset with ipv4_find_option()
Date: Wed, 12 Mar 2025 16:56:57 +0300	[thread overview]
Message-ID: <297363AA-9DF3-47C6-9DA8-BC60E7BC8CA8@gmail.com> (raw)
In-Reply-To: <20250312091540.GA15366@breakpoint.cc>

> This is wrong, the array should be aligned to fit struct
> requirements, so u32 is needed, or __aligned annotation is needed
> for optbuf.

This is the old common case of initialising the variable structure ip_options, as in ip_sockglue.c or cipso_ipv4.c. But I don't understand how best to do it, because if we change the optbuf type to u32, it might be redundant if we don't change the array size, and therefore I have no idea what boundary to align it on.

> Can you make a second patch that places optbuf in the
> stack frame of the calling function instead?

Into the ipv4_find_option() function?


  reply	other threads:[~2025-03-12 13:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01 21:14 [PATCH] netfilter: nft_exthdr: fix offset with ipv4_find_option() Alexey Kashavkin
2025-03-01 22:04 ` Alexey Kashavkin
2025-03-13 12:41   ` Alexey Kashavkin
2025-03-12  9:15 ` Florian Westphal
2025-03-12 13:56   ` Alexey Kashavkin [this message]
2025-03-12 14:16     ` Florian Westphal
2025-03-12 14:16   ` Florian Westphal

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=297363AA-9DF3-47C6-9DA8-BC60E7BC8CA8@gmail.com \
    --to=akashavkin@gmail.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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.