From: Tadeusz Struk <tadeusz.struk@linaro.org>
To: Marco Elver <elver@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Jonathan Lemon <jonathan.lemon@gmail.com>,
Alexander Lobakin <alobakin@pm.me>,
Willem de Bruijn <willemb@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Cong Wang <cong.wang@bytedance.com>,
Kevin Hao <haokexin@gmail.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Kees Cook <keescook@chromium.org>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH] skbuff: suppress clang object-size-mismatch error
Date: Thu, 11 Nov 2021 08:01:26 -0800 [thread overview]
Message-ID: <931f1038-d7ab-f236-8052-c5e5b9753b18@linaro.org> (raw)
In-Reply-To: <CANpmjNNuWfauPoUxQ6BETrZ8JMjWgrAAhAEqEXW=5BNsfWfyDA@mail.gmail.com>
On 11/11/21 07:52, Marco Elver wrote:
>> The other way to fix it would be to make the struct sk_buff_head
>> equal in size with struct sk_buff:
>>
>> struct sk_buff_head {
>> - /* These two members must be first. */
>> - struct sk_buff *next;
>> - struct sk_buff *prev;
>> + union {
>> + struct {
>> + /* These two members must be first. */
>> + struct sk_buff *next;
>> + struct sk_buff *prev;
>>
>> - __u32 qlen;
>> - spinlock_t lock;
>> + __u32 qlen;
>> + spinlock_t lock;
>> + };
>> + struct sk_buff __prv;
>> + };
>> };
>>
>> but that's much more invasive, and I don't even have means to
>> quantify this in terms of final binary size and performance
>> impact. I think that would be a flat out no go.
>>
>> From the other hand if you look at the __skb_queue functions
>> they don't do much and at all so there is no much room for
>> other issues really. I followed the suggestion in [1]:
>>
>> "if your function deliberately contains possible ..., you can
>> use __attribute__((no_sanitize... "
> That general advice might not be compatible with what the kernel
> wants, especially since UBSAN_OBJECT_SIZE is normally disabled and I
> think known to cause these issues in the kernel.
>
> I'll defer to maintainers to decide what would be the preferred way of
> handling this.
Sure, I would also like to know if there is a better way of fixing this.
Thanks for your feedback.
--
Thanks,
Tadeusz
next prev parent reply other threads:[~2021-11-11 16:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 0:35 [PATCH] skbuff: suppress clang object-size-mismatch error Tadeusz Struk
2021-11-11 9:51 ` Marco Elver
2021-11-11 15:46 ` Tadeusz Struk
2021-11-11 15:52 ` Marco Elver
2021-11-11 16:01 ` Tadeusz Struk [this message]
2021-11-11 17:54 ` Jakub Kicinski
2021-11-12 15:42 ` David Miller
2021-11-18 16:05 ` Tadeusz Struk
2021-11-18 16:38 ` Jakub Kicinski
2021-11-18 17:09 ` Tadeusz Struk
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=931f1038-d7ab-f236-8052-c5e5b9753b18@linaro.org \
--to=tadeusz.struk@linaro.org \
--cc=alobakin@pm.me \
--cc=cong.wang@bytedance.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elver@google.com \
--cc=haokexin@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jonathan.lemon@gmail.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/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.