From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by sourceware.org (Postfix) with ESMTPS id B20873858C60 for ; Mon, 10 Jan 2022 18:38:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B20873858C60 Received: by mail-ua1-x932.google.com with SMTP id x33so23833426uad.12 for ; Mon, 10 Jan 2022 10:38:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:references:in-reply-to :content-transfer-encoding; bh=98R5sDAM6PRr2vLrenNXEaviv7dulob15q4oHE6EwQ8=; b=SOYHeETpVqlqOwTixv8YlUWVu51Yb0gT66IYJpLO6OTgoEvplwCa8vqhK/SWo6+DqZ rTI+MLIScNW9lW5zstVTZEnp4s7WQFdtmNzEYOo4h9RFm+x5GJplaJ5AsH2niFuRR7ni yN2lEzjzWWc57tRDEp1pvJblEY7E1grRNVuzbZWt4U53OzE8t27QYO2qZRTdHrfdcxE+ 4jflzWbfcspGySfZx+nhibNeydnZ/46wAAPaYmCEJT6MMedso6DKMo7ZvA92X2zo6II8 Ut9OaixV+fWDGiuCQ8lRCxZoWtW6oirwjT8Q3yK5WkS0BVuAogYL+iqKjz+ht1BL+rgQ lG2A== X-Gm-Message-State: AOAM530vDLh/JR+JWBThYKU0Pm+ZyIRObEMMtGiR0i+GBRB74SY6jokQ w969Vgxix5XxOnZg0uSe8e5EMDTt3yFwSQ== X-Google-Smtp-Source: ABdhPJw+dXSlLZcAIaWM99npJRqTCOsJd+okegXWndNm97dtqsjZZT9SfQ9Kk/WqDe754mwJtZLepg== X-Received: by 2002:a9f:24b0:: with SMTP id 45mr499375uar.65.1641839936140; Mon, 10 Jan 2022 10:38:56 -0800 (PST) Received: from ?IPV6:2804:431:c7ca:9d3:3f97:8103:cbb:d524? ([2804:431:c7ca:9d3:3f97:8103:cbb:d524]) by smtp.gmail.com with ESMTPSA id f65sm4131888vka.19.2022.01.10.10.38.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jan 2022 10:38:55 -0800 (PST) Message-ID: <7980c095-843f-79f0-af44-8e8732ae506b@linaro.org> Date: Mon, 10 Jan 2022 15:38:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] debug: Improve error message on fdelt_chk Content-Language: en-US From: Adhemerval Zanella To: =?UTF-8?Q?Cristian_Rodr=c3=adguez?= , libc-alpha@sourceware.org References: <20220103223851.12354-1-crrodriguez@opensuse.org> <8b1dac83-d3a5-84ff-4f08-16394a631444@linaro.org> In-Reply-To: <8b1dac83-d3a5-84ff-4f08-16394a631444@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2022 18:38:58 -0000 On 04/01/2022 14:22, Adhemerval Zanella wrote: >=20 >=20 > On 03/01/2022 19:38, Cristian Rodr=C3=ADguez wrote: >> There is really no buffer overflow, but an invalid bit on fd_set >> >> Signed-off-by: Cristian Rodr=C3=ADguez >=20 > LGTM, thanks. >=20 > Reviewed-by: Adhemerval Zanella >=20 >> --- >> 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 >=3D FD_SETSIZE) >> - __chk_fail (); >> + __fortify_fail ("invalid bit detected on fd_set"); >> =20 >> return d / __NFDBITS; >> } The buildbot accused an issue: gcc -m32 fdelt_chk.c -c -std=3Dgnu11 -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=3Di686 -ftls-model=3Dinitial-exec -I../i= nclude -I/build/debug -I/build -I../sysdeps/unix/sysv/linux/i386/i686 = -I../sysdeps/i386/i686/nptl -I../sysdeps/unix/sysv/linux/i386 -I../sysd= eps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86 -I../sy= sdeps/x86/nptl -I../sysdeps/i386/nptl -I../sysdeps/unix/sysv/linux/incl= ude -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/i3= 86/i686/fpu/multiarch -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686= /multiarch -I../sysdeps/i386/i686 -I../sysdeps/i386/fpu -I../sysdeps/x= 86/fpu -I../sysdeps/i386 -I../sysdeps/x86/include -I../sysdeps/x86 -I.= =2E/sysdeps/wordsize-32 -I../sysdeps/ieee754/float128 -I../sysdeps/ieee= 754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/db= l-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/gen= eric -I.. -I../libio -I. -D_LIBC_REENTRANT -include /build/libc-modules= =2Eh -DMODULE_NAME=3Dlibc -include ../include/libc-symbols.h -DPIC -= DTOP_NAMESPACE=3Dglibc -o /build/debug/fdelt_chk.o -MD -MP -MF /build/deb= ug/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=3Dimplicit-function-declaration] 25 | __fortify_fail ("invalid bit detected on fd_set"); You need to include 'stdio.h'. Please send a newer version with this fix= ed.