public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: "Andreas K. Huettel" <dilfridge@gentoo.org>,
	"Cristian Rodríguez" <cristian@rodriguez.im>,
	"Paul Eggert" <eggert@cs.ucla.edu>,
	"Carlos O'Donell" <carlos@redhat.com>,
	"Adhemerval Zanella Netto" <adhemerval.zanella@linaro.org>
Cc: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: gcc-14 Wflex-array-member-not-at-end may-be-ub in struct pthread
Date: Wed, 19 Jul 2023 15:04:34 -0400	[thread overview]
Message-ID: <cbd72881-30ff-5052-d2f0-268845e1be41@gotplt.org> (raw)
In-Reply-To: <847701083.0ifERbkFSE@pinacolada>

On 2023-07-19 14:36, Andreas K. Huettel via Libc-alpha wrote:
> Am Mittwoch, 19. Juli 2023, 16:17:50 CEST schrieb Adhemerval Zanella Netto:
>>>>
>>>> this happens because:
>>>>
>>>> #ifdef __has_include
>>>> # if __has_include ("linux/rseq.h")
>>>> #  define __GLIBC_HAVE_KERNEL_RSEQ --> that is defined
>>>> # endif
>>>>
>>>>
>>>>> Perhaps you tried to nest 'struct pthread' inside another struct? If so,
>>>>> the C standard doesn't allow that but the attached untested patch should
>>>>> be a trivial fix.
>>>>>
>>>>
>>>> Your patch does indeed silence this particular warning, thanks.
>>>>
>>>
>>> I suggest you add this patch to the release queue. because as far as I can
>>> tell, It is UB when the kernel headers are present on the system.
>>
>> The flexible array on rseq was added on linux 6.3, should we treat this as
>> release blocker?
>>
> 
> Yes IMHO (unless someone convinces me otherwise).
> 

Paul's patch fixes this by dropping the end_padding flex array and 
fixing up PTHREAD_STRUCT_END_PADDING.  That fix looks correct to me and 
is only really relevant for ia64.  Paul, could you please push your fix?

Thanks,
Sid

  reply	other threads:[~2023-07-19 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 13:46 Cristian Rodríguez
2023-07-05 15:53 ` Paul Eggert
2023-07-05 18:13   ` Cristian Rodríguez
2023-07-08 19:21     ` Cristian Rodríguez
2023-07-19 14:17       ` Adhemerval Zanella Netto
2023-07-19 14:22         ` Adhemerval Zanella Netto
2023-07-19 14:55           ` Mathieu Desnoyers
2023-07-19 15:28             ` Adhemerval Zanella Netto
2023-07-19 18:36         ` Andreas K. Huettel
2023-07-19 19:04           ` Siddhesh Poyarekar [this message]
2023-07-19 21:16             ` Paul Eggert
2023-07-19 21:49               ` Andreas K. Huettel

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=cbd72881-30ff-5052-d2f0-268845e1be41@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=cristian@rodriguez.im \
    --cc=dilfridge@gentoo.org \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).