public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] debug: Improve error message on fdelt_chk
@ 2022-01-03 22:38 Cristian Rodríguez
  2022-01-04 17:22 ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: Cristian Rodríguez @ 2022-01-03 22:38 UTC (permalink / raw)
  To: libc-alpha

There is really no buffer overflow, but an invalid bit on fd_set

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
---
 debug/fdelt_chk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c
index c5f16462ad..a796688c5a 100644
--- a/debug/fdelt_chk.c
+++ b/debug/fdelt_chk.c
@@ -22,7 +22,7 @@ long int
 __fdelt_chk (long int d)
 {
   if (d < 0 || d >= FD_SETSIZE)
-    __chk_fail ();
+    __fortify_fail ("invalid bit detected on fd_set");
 
   return d / __NFDBITS;
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] debug: Improve error message on fdelt_chk
  2022-01-03 22:38 [PATCH] debug: Improve error message on fdelt_chk Cristian Rodríguez
@ 2022-01-04 17:22 ` Adhemerval Zanella
  2022-01-10 18:38   ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: Adhemerval Zanella @ 2022-01-04 17:22 UTC (permalink / raw)
  To: Cristian Rodríguez, libc-alpha



On 03/01/2022 19:38, Cristian Rodríguez wrote:
> There is really no buffer overflow, but an invalid bit on fd_set
> 
> Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  debug/fdelt_chk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c
> index c5f16462ad..a796688c5a 100644
> --- a/debug/fdelt_chk.c
> +++ b/debug/fdelt_chk.c
> @@ -22,7 +22,7 @@ long int
>  __fdelt_chk (long int d)
>  {
>    if (d < 0 || d >= FD_SETSIZE)
> -    __chk_fail ();
> +    __fortify_fail ("invalid bit detected on fd_set");
>  
>    return d / __NFDBITS;
>  }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] debug: Improve error message on fdelt_chk
  2022-01-04 17:22 ` Adhemerval Zanella
@ 2022-01-10 18:38   ` Adhemerval Zanella
  2022-01-14 14:43     ` Cristian Rodríguez
  0 siblings, 1 reply; 4+ messages in thread
From: Adhemerval Zanella @ 2022-01-10 18:38 UTC (permalink / raw)
  To: Cristian Rodríguez, libc-alpha



On 04/01/2022 14:22, Adhemerval Zanella wrote:
> 
> 
> On 03/01/2022 19:38, Cristian Rodríguez wrote:
>> There is really no buffer overflow, but an invalid bit on fd_set
>>
>> Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
> 
> LGTM, thanks.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
>> ---
>>  debug/fdelt_chk.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c
>> index c5f16462ad..a796688c5a 100644
>> --- a/debug/fdelt_chk.c
>> +++ b/debug/fdelt_chk.c
>> @@ -22,7 +22,7 @@ long int
>>  __fdelt_chk (long int d)
>>  {
>>    if (d < 0 || d >= FD_SETSIZE)
>> -    __chk_fail ();
>> +    __fortify_fail ("invalid bit detected on fd_set");
>>  
>>    return d / __NFDBITS;
>>  }

The buildbot accused an issue:

gcc -m32 fdelt_chk.c -c -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno    -fpie -Wa,-mtune=i686   -ftls-model=initial-exec      -I../include -I/build/debug  -I/build  -I../sysdeps/unix/sysv/linux/i386/i686  -I../sysdeps/i386/i686/nptl  -I../sysdeps/unix/sysv/linux/i386  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/i386/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/i386  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/i386/i686/fpu/multiarch  -I../sysdeps/i386/i686/fpu  -I../sysdeps/i386/i686/multiarch  -I../sysdeps/i386/i686  -I../sysdeps/i386/fpu  -I../sysdeps/x86/fpu  -I../sysdeps/i386  -I../sysdeps/x86/include -I../sysdeps/x86  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.  -D_LIBC_REENTRANT -include /build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC     -DTOP_NAMESPACE=glibc -o /build/debug/fdelt_chk.o -MD -MP -MF /build/debug/fdelt_chk.o.dt -MT /build/debug/fdelt_chk.o
fdelt_chk.c: In function '__fdelt_chk':
fdelt_chk.c:25:5: error: implicit declaration of function '__fortify_fail' [-Werror=implicit-function-declaration]
   25 |     __fortify_fail ("invalid bit detected on fd_set");

You need to include 'stdio.h'.  Please send a newer version with this fixed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] debug: Improve error message on fdelt_chk
  2022-01-10 18:38   ` Adhemerval Zanella
@ 2022-01-14 14:43     ` Cristian Rodríguez
  0 siblings, 0 replies; 4+ messages in thread
From: Cristian Rodríguez @ 2022-01-14 14:43 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

huh.. I didn't get this message..

On Mon, Jan 10, 2022 at 3:38 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 04/01/2022 14:22, Adhemerval Zanella wrote:
> >
> >
> > On 03/01/2022 19:38, Cristian Rodríguez wrote:
> >> There is really no buffer overflow, but an invalid bit on fd_set
> >>
> >> Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
> >
> > LGTM, thanks.
> >
> > Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> >
> >> ---
> >>  debug/fdelt_chk.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c
> >> index c5f16462ad..a796688c5a 100644
> >> --- a/debug/fdelt_chk.c
> >> +++ b/debug/fdelt_chk.c
> >> @@ -22,7 +22,7 @@ long int
> >>  __fdelt_chk (long int d)
> >>  {
> >>    if (d < 0 || d >= FD_SETSIZE)
> >> -    __chk_fail ();
> >> +    __fortify_fail ("invalid bit detected on fd_set");
> >>
> >>    return d / __NFDBITS;
> >>  }
>
> The buildbot accused an issue:
>
> gcc -m32 fdelt_chk.c -c -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno    -fpie -Wa,-mtune=i686   -ftls-model=initial-exec      -I../include -I/build/debug  -I/build  -I../sysdeps/unix/sysv/linux/i386/i686  -I../sysdeps/i386/i686/nptl  -I../sysdeps/unix/sysv/linux/i386  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/i386/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/i386  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/i386/i686/fpu/multiarch  -I../sysdeps/i386/i686/fpu  -I../sysdeps/i386/i686/multiarch  -I../sysdeps/i386/i686  -I../sysdeps/i386/fpu  -I../sysdeps/x86/fpu  -I../sysdeps/i386  -I../sysdeps/x86/include -I../sysdeps/x86  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.  -D_LIBC_REENTRANT -include /build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC     -DTOP_NAMESPACE=glibc -o /build/debug/fdelt_chk.o -MD -MP -MF /build/debug/fdelt_chk.o.dt -MT /build/debug/fdelt_chk.o
> fdelt_chk.c: In function '__fdelt_chk':
> fdelt_chk.c:25:5: error: implicit declaration of function '__fortify_fail' [-Werror=implicit-function-declaration]
>    25 |     __fortify_fail ("invalid bit detected on fd_set");
>
> You need to include 'stdio.h'.  Please send a newer version with this fixed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-14 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 22:38 [PATCH] debug: Improve error message on fdelt_chk Cristian Rodríguez
2022-01-04 17:22 ` Adhemerval Zanella
2022-01-10 18:38   ` Adhemerval Zanella
2022-01-14 14:43     ` Cristian Rodríguez

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).