From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by sourceware.org (Postfix) with ESMTPS id C1BBB3858C27 for ; Mon, 10 May 2021 20:31:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C1BBB3858C27 Received: by mail-qt1-x82d.google.com with SMTP id t20so8717411qtx.8 for ; Mon, 10 May 2021 13:31:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eImtYbBPh/UPHD6wyLDlSBjRftgkf7om2XjF3cNbzbU=; b=uCtE60AkhZtwQ0bp077mCMViJJw6WfleuWMHBPWcMz/uuFIdoieD5hCpJOC4aQeKju UvV0TI9+atsxy2GgASWaHCVzfCzRkwOWSB3B4sJzjP1lMuzhXbRuuAJ5roe+Yy2eZvcv lWFZTCyEqhkxIfTroP5VyDP+2gYy/DQNVb4mN92prZPnPh8317gTJYegpFMuXKP7aTWW iSPJkoG8oVUP9y8x83Pll1nCUIhyPhjHJVZwm8bsgxjuDwWiuLb/JXkxQLDurh7AtpBT TjQRSEHLaWI6I8znL4ubTRIa/hcuTVhDW+BBU6e2r6vORNkr+T6Sup/f3JJE3Md3OwoE Gsiw== X-Gm-Message-State: AOAM53283Mu+x8dhdrX+MSTzx8BiI67BJhhEwP0lRZcvO/i8Itj8mh4+ Jd4kczZMxbI65j17eJqcoS4= X-Google-Smtp-Source: ABdhPJw+j2hFp4iZaK971ERlSza2RpGowPCNtht6WGlY9RXugCL+4WHv2sPxfd9LuqEOo5KQhoZL5A== X-Received: by 2002:ac8:1098:: with SMTP id a24mr23663956qtj.291.1620678681371; Mon, 10 May 2021 13:31:21 -0700 (PDT) Received: from [192.168.0.41] (71-218-14-121.hlrn.qwest.net. [71.218.14.121]) by smtp.gmail.com with ESMTPSA id c20sm13929260qtg.84.2021.05.10.13.31.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 May 2021 13:31:20 -0700 (PDT) Subject: Re: [PATCH] more out of bounds checking improvements To: Florian Weimer , Andreas Schwab Cc: Martin Sebor via Libc-alpha , Joseph Myers References: <176ba75f-4299-073f-8319-66dbf9fe3f42@gmail.com> <87k0ot9trs.fsf@oldenburg.str.redhat.com> <87v98d6ldm.fsf@oldenburg.str.redhat.com> <2a7e377d-60c8-313b-9422-6cd0b4f5224c@gmail.com> <87fsyvf04w.fsf@oldenburg.str.redhat.com> <7da0198c-a478-d877-4b64-da5a50e7e87b@gmail.com> <871rae7a2o.fsf@oldenburg.str.redhat.com> <1f4620a7-c0db-23f7-c5a8-f47c2d7b2c36@gmail.com> <877dk64cmx.fsf@igel.home> <877dk65pwz.fsf@oldenburg.str.redhat.com> From: Martin Sebor Message-ID: Date: Mon, 10 May 2021 14:31:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <877dk65pwz.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 May 2021 20:31:23 -0000 On 5/10/21 1:50 PM, Florian Weimer wrote: > * Andreas Schwab: > >> On Mai 10 2021, Martin Sebor via Libc-alpha wrote: >> >>> It doesn't need to be disabled for GCC 11 but I don't know how to >>> be this selective with these version macros. If it's okay to use >>> __GNUC__ then this works: >>> >>> index 9389f6b548..6a061e6457 100644 >>> --- a/nss/makedb.c >>> +++ b/nss/makedb.c >>> @@ -792,7 +792,15 @@ write_output (int fd) >>> + nhashentries_total * sizeof (stridx_t))); >>> header->allocate = file_offset; >>> >>> - /* Help GCC 10 see iov_nelts doesn't overflow the writev argument. */ >>> + assert (iov_nelts <= INT_MAX); >>> + >>> +#if __GNUC__ == 10 >> >> You can use __GNUC_PREREQ (10, 0) && !__GNUC_PREREQ (11, 0) > > That works for me too. > > I've tested the previous version (partially quoted above) with GCC 11 > and GCC 10, and it builds. > > It's too late for me to test Andreas' proposal today, but I think it > should be safe to push it. I can retest it tomorrow with GCC 9/10/11, > just to be sure. I have pushed the change. Martin