From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 2EC5E3842400 for ; Fri, 10 Jul 2020 15:59:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2EC5E3842400 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N4yyQ-1kuajh2Z5o-010wDc; Fri, 10 Jul 2020 17:59:01 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 00F2AA80B92; Fri, 10 Jul 2020 17:58:58 +0200 (CEST) Date: Fri, 10 Jul 2020 17:58:58 +0200 From: Corinna Vinschen To: David Allsopp Cc: "cygwin-patches@cygwin.com" , JonY <10walls@gmail.com> Subject: Re: [PATCH] Fix incorrect sign-extension of pointer in 32-bit acl __to_entry Message-ID: <20200710155858.GG514059@calimero.vinschen.de> Reply-To: cygwin-patches@cygwin.com Mail-Followup-To: David Allsopp , "cygwin-patches@cygwin.com" , JonY <10walls@gmail.com> References: <001101d65627$6b726260$42572720$@cl.cam.ac.uk> <20200710083232.GD514059@calimero.vinschen.de> <17ec8f4865d648ab80d259266f315de7@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <17ec8f4865d648ab80d259266f315de7@metastack.com> X-Provags-ID: V03:K1:xq2mOZpo5WLVFchRu49sFAuTX9UmeaPvkLV97Z2nua6J3kxYL5X xCf69JTa0fmZkxnDLPJrnX36nsc/Bn1cSdCLHkEJypmfCmdZXkB+bV4W+DujhCWmvw+oD1r Tpj6bY1h6QhZuU8jcnDI7aP0hz/p9u8taMH6b5yraYCpAJBr+aZ+n3+QAde7ShT7DC7pmnt /QRRipdKJfJO8HLFxv8mQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Un5yF8uhmOo=:YCzGCU+xt0alhKIaYu/KTB 5L6G5UqbLfA62gy23Ak1fIhkemrkOxOQMnTgJQqvHnT7g7XrB0i8MpTdxo/Bu9H6GefAm5Wu8 7YxO2tiXvGr7fYFm7ik34bLtuBmzvLHtk7RZvweGuIP+38eIzrDm4AzzI3S19iXWwfiY7nbz0 j8/zCfrUj1unAuwpens3Lmw73mZkdpJ+b2rNt9804LdfK9bIkWhCyq5Is7i0r801jgap3vXTG 1Tnq9Vpv/vj91mKHZhsMF4INLrrjS4c4EqLBPXcgUEPHgMOcDxLp5BLFdF/vsSCnKyDGDvSfD qk+HhlTjOuNd6UNd9hnF9GVteUs1uUCVZVwOrBNq7q7HB44grr+dqAHxIYyW+5W2rVL1fLaaC Xot2Z38QKJcMjc6S8lM8+SPsRdAs/xYzqO+Yn+itI3deALgiT9HRvms4VWgx0D2wtFgI53tED cN4SFYhjjQV6fJ8A2DIMqH2kS8AVGOLyyXOrm9xFcCxL3MfdaNuyo8DdFgT399SwaYn26wzZC X6I6m+V2D3K1kNP6Wyh3ldiADU/8us8aAIvt8E0drdu0fFazO5lhgSf+qT1uH/NkdVM8l10Bx byE9A6T3APsYGF3XJwqCOkxwvIRRQs0xJjhpJPOJDAKsCEON/q1DSivf3iBE44D4YhtegwHeI zt5c8vijEo2kAYtoh1GwuCZ9NNLJRR4sg/1m7FqGvp4ZnXIl1fewyU0nDVO5vLwr1o0MVYeRp hYYAs2ris6TfejQhbTqo8DK2hJK7L0izTBWUG2pF7AttntAtWEKtVYNUFqPIve5SpIEMSvaTc wfrEI5Lq3gKwemiM3bn7v4v1eB3+t1DDdI6uVvds5Y6UL1saHar+3pI52jXzEAjKACSonu5yb BqrOV7PyvFPJrJ0sNZig== X-Spam-Status: No, score=-98.3 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, 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: cygwin-patches@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component patch submission and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 15:59:06 -0000 On Jul 10 15:22, David Allsopp via Cygwin-patches wrote: > Corinna Vinschen wrote: > > On Jul 9 20:30, David Allsopp via Cygwin-patches wrote: > > > I have some code where the acl_t returned by get_file_acl is allocated > > > at 0x80038248. As a result the acl_entry_t generated by acl_get_entry > > > has an "index" of -1, since the pointer was sign-extended to 64-bits. > > > > > > My fix is trivial and simply casts the pointer to uintptr_t first. > > > > Pushed. I still don't quite understand what the compiler is thinking > > there, sign-extending a pointer when casted to an unsigend int type, but > > your patch works, so all is well, I guess. > > Thank you - it is indeed hard to imagine when you'd ever want that behaviour! I wonder if this is a bug in x86 gcc... Jon? > Would it be possible to have a snapshot with it, just for continuous > integration servers which need the fix, please? Sure, done. Corinna -- Corinna Vinschen Cygwin Maintainer