debug: Improve error message on fdelt_chk
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
fail
|
Patch series failed to build
|
Commit Message
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(-)
Comments
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;
> }
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.
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.
@@ -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;
}