[LTP] [PATCH 1/2] clock_nanosleep01: Avoid dereferencing bad pointers in libc on 32bit
Jan Stancek
jstancek@redhat.com
Mon Oct 4 12:16:21 CEST 2021
On Mon, Oct 4, 2021 at 8:07 AM Petr Vorel <pvorel@suse.cz> wrote:
> Hi Richie,
>
> > In 32-bit (regardless of kernel bits) glibc and musl will usually
> > dereference the timespec pointers and try to read them. In some cases
> > this might be avoidable, but they must do it in others.
>
> > Passing invalid pointers is undefined in POSIX. In any case, AFAICT
> > libc would have to catch the signal in order to guarantee EFAULT is
> > returned.
>
> LGTM.
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> > Possibly we shouldn't test things like this at all through libc
> > wrappers.
> Only for 32bit or also for 64 bit? Anyway, there has always been some cases
> where bad addr testing was problematic (e.g. non-intel arch).
>
I'd skip it for both, I recall that some implementations
were crashing.
Acked-by: Jan Stancek <jstancek@redhat.com>
>
> Kind regards,
> Petr
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211004/889fef49/attachment.htm>
More information about the ltp
mailing list