From: Martin Sebor <msebor@gmail.com>
To: DJ Delorie <dj@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] improve out-of-bounds checking with GCC 10 attribute access [BZ #25219]
Date: Mon, 4 May 2020 11:34:05 -0600 [thread overview]
Message-ID: <8d359caf-0522-c753-af3d-2680d54a0cb8@gmail.com> (raw)
In-Reply-To: <xnv9lf71qt.fsf@greed.delorie.com>
On 5/1/20 4:02 PM, DJ Delorie wrote:
> Martin Sebor <msebor@gmail.com> writes:
>> Thanks for the careful review!
>
> This new version LGTM.
>
> Reviewed-by: DJ Delorie <dj@redhat.com>
>
> (but IMHO a second set of eyes would be good for this one)
>
>> Yes, that's wrong. Good catch! I completely missed stdio when
>> testing so I also didn't notice I forgot to add the attribute to
>> fgets() itself. I've fixed that in the updated patch.
>
> Ok.
>
>>> IMHO comment should state that the first argument is index 1.
>>>
>>> IMHO should document what happens when size-index is missing.
>>
>> I've tweaked the comment a bit. I hesitate to go into a lot of
>> detail here and would expect people needing it to read the manual.
>
> Right, but there should be just enough info for someone adding a new use
> of it to know what to do, without requiring the gcc docs. The new
> comment is fine.
>
>>> __buf[???]
>>
>> When size-index is missing at least one byte of the array must be
>> accessible (or the pointer must be null). There's no way to specify
>> a constant size with the current syntax. In the future I'd like to
>> try to teach GCC to get it from the argument itself (for ordinary
>> arrays as well as for VLAs):
>
> Makes sense, just didn't know.
>
>>> NOTE: does not use the __attr_access macro
>>
>> Fixed, thanks.
>
> Ok.
>
Thanks. I have committed the latest patch in
06febd8c6705c816b2f32ee7aa1f4c0184b05248.
Martin
next prev parent reply other threads:[~2020-05-04 17:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 22:12 Martin Sebor
2020-04-30 22:37 ` Dmitry V. Levin
2020-05-01 2:42 ` DJ Delorie
2020-05-01 19:54 ` Martin Sebor
2020-05-01 22:02 ` DJ Delorie
2020-05-04 17:34 ` Martin Sebor [this message]
2020-05-04 18:40 ` Martin Sebor
2020-05-06 20:44 ` Joseph Myers
2020-05-06 21:08 ` DJ Delorie
2020-05-06 22:09 ` Martin Sebor
2020-05-06 22:27 ` Joseph Myers
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=8d359caf-0522-c753-af3d-2680d54a0cb8@gmail.com \
--to=msebor@gmail.com \
--cc=dj@redhat.com \
--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).