From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id A3FF038555A5 for ; Mon, 31 Oct 2022 16:03:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3FF038555A5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-13ba86b5ac0so13954139fac.1 for ; Mon, 31 Oct 2022 09:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Fk2mWGeA1mxxaLIcYi1wlrOr38URDEVOHBOVFK+8L3w=; b=JzJusmUCJFX3LgLNo30q7n1w1ZQYI4fS2N3nYgR3A5UdRFX3pnnta0mUbNRP/cFi7C RSTav9yDFMqYNxSShikdbcYhW1Oiwrv90n2frEiWuTB6sa0JIMVizuH3gxN0YzgExPpz R++LOtEE0+auLnJA1dbVW8pOjgoLBgRFfpX7HzOgHSewWGBlCn432lTwEStYfyKRdD5z zeEq6H2XZduISQ3W0/60etlJYRq0xmmQhPmlC7E60YtoWazXTT96Om3ouBGta4va64nW dBj2/UixvIc4KJWB6kjVI4Z2pW8hlbKdmUF5L1Ppb+Ulzti94RNGTmA610vAvDdScub6 7CJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fk2mWGeA1mxxaLIcYi1wlrOr38URDEVOHBOVFK+8L3w=; b=1Zvqgt1Xi32CK7nTvA4rOcZ+gpyj/nwBDnbg7UxLD6fzapzqWGYZ+6+8O8OSpUFe1+ J6kFswrcSgJMKdS7MnJwXD0GwkHlZPVF3mmzZb6olLm8y13eR2+7n23qycCSOFBfpejq 0Kq5fRgLAP1gXtr1RybbLCke9uT7FKgI38scrb5letxiPbyIQzf86TFMSYbxILGbnkPt hfE31jlg9P+D017QyRwLiUj+MSEwVKOKvEzStPCdyUEMK7PeBuShqaH12OwXR8HuwN08 TE6bgCMTA3q4IBuQGpbljUszp43HIICqkg2l9RgnF82dKcnulKbqB5uK3NhgsSRtDy/Z S2Dg== X-Gm-Message-State: ACrzQf3dHV58hXqtCvVpAceckYkRkSlhqEyNpDhg1YkZpSJbud8IjP1O uXchGMR2+G5b4YlGfxIU0haxtchzw6BZRt7K X-Google-Smtp-Source: AMsMyM4ddWpKz+A4fNSBzo6E9jEznhdpca9ycQXhZF9R1m4/+nQ/2XqHbDZLnS8oxu3sf479xWrYYg== X-Received: by 2002:a05:6870:51a:b0:130:ae8d:daaf with SMTP id j26-20020a056870051a00b00130ae8ddaafmr16470817oao.103.1667232191973; Mon, 31 Oct 2022 09:03:11 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:17c8:29c8:c66:a795:b2b1? ([2804:1b3:a7c0:17c8:29c8:c66:a795:b2b1]) by smtp.gmail.com with ESMTPSA id z8-20020a056870d68800b00136a0143de8sm3194820oap.40.2022.10.31.09.03.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 09:03:11 -0700 (PDT) Message-ID: <85bbb5fa-735e-254e-4467-e2726fd0ecc3@linaro.org> Date: Mon, 31 Oct 2022 13:03:09 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] linux: Fix fstatat with !XSTAT_IS_XSTAT64 and __TIMESIZE=64 (BZ #29730) Content-Language: en-US To: Aurelien Jarno , libc-alpha@sourceware.org References: <20221028205440.1091298-1-aurelien@aurel32.net> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20221028205440.1091298-1-aurelien@aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 28/10/22 17:54, Aurelien Jarno wrote: > Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit > systems") changed in_time_t_range to assume a 32-bit time_t. Therefore > stop calling it from __fstatat for systems with 64-bit time_t. > > Resolves: BZ #29730 Although this change is not incorrect, I think the fix I just sent [1] is slight better because it just alias non-LFS stat to LFS stat for mips (which is also a small runtime and code optimization), while avoiding touching generic code (so we need to check if trigger another issue on different architecture). [1] https://sourceware.org/pipermail/libc-alpha/2022-October/143089.html > --- > sysdeps/unix/sysv/linux/fstatat.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/unix/sysv/linux/fstatat.c b/sysdeps/unix/sysv/linux/fstatat.c > index 055fb4762e..afe93b6cf4 100644 > --- a/sysdeps/unix/sysv/linux/fstatat.c > +++ b/sysdeps/unix/sysv/linux/fstatat.c > @@ -33,9 +33,13 @@ __fstatat (int fd, const char *file, struct stat *buf, int flag) > if (! in_ino_t_range (st64.st_ino) > || ! in_off_t_range (st64.st_size) > || ! in_blkcnt_t_range (st64.st_blocks) > +/* in_time_t_range assumes that all usages are for sizeof(time_t) == 32. */ > +# if __TIMESIZE != 64 > || ! in_time_t_range (st64.st_atim.tv_sec) > || ! in_time_t_range (st64.st_mtim.tv_sec) > - || ! in_time_t_range (st64.st_ctim.tv_sec)) > + || ! in_time_t_range (st64.st_ctim.tv_sec) > +# endif > + ) > return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW); > > /* Clear internal pad and reserved fields. */