From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by sourceware.org (Postfix) with ESMTPS id 28C39384B806 for ; Fri, 10 Jul 2020 08:32:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 28C39384B806 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 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MOzKk-1kEnn62e7Q-00PPzT for ; Fri, 10 Jul 2020 10:32:36 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id C6A01A80B92; Fri, 10 Jul 2020 10:32:32 +0200 (CEST) Date: Fri, 10 Jul 2020 10:32:32 +0200 From: Corinna Vinschen To: David Allsopp Cc: cygwin-patches@cygwin.com Subject: Re: [PATCH] Fix incorrect sign-extension of pointer in 32-bit acl __to_entry Message-ID: <20200710083232.GD514059@calimero.vinschen.de> Reply-To: cygwin-patches@cygwin.com Mail-Followup-To: David Allsopp , cygwin-patches@cygwin.com References: <001101d65627$6b726260$42572720$@cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <001101d65627$6b726260$42572720$@cl.cam.ac.uk> X-Provags-ID: V03:K1:b8oqVYfSrU2N8pnxCTaPIE8uBEHqmO4eUoS6gMctVoyQipux89P CLPxRmrsfyWfBP8WaI0Zcs91puqsspe2qkcqGTw1rMfgkoXZ1m4qO3OEp6u0l8Nmq96eEI4 2vtdWkVsLjBxAUvHfnqsHaPNyleiW/Q83LiA8Wfwet6aUNC/dpmXXVmxS/UFIHF1KDw9+mV WUuDTpoeZAKhLEHSCOtGA== X-UI-Out-Filterresults: notjunk:1;V03:K0:hPMsjx4tvRI=:yAFPdnsW7VWqC7wR+cn68W NidzFoQp8Y0hW/Ay4+IFoBtNCWjD6Uh5MWnDtOVW8iy6AYw16KkNsEtq+A0fGR/JqcBE82qSw zI5sK7oKeUB9GkGNSTZz5irH8fR1eeZ5W6/xIKmAiU2IighKv03l1YNxX4H3g7BZ+KVT+N7KM HB1is+MQSfyvOSfOjh05pd7Z+hJoUUqcbsMLWrfYMSAvr24+aN+v/DcRWX/dwZc6zFz+W9VG6 h7T46m5E/kMOuQZxnX8JOTKw7y6YbS2lZtx+qK0olUy2CVtQwi6YL28Ng87NtJQXhfaGookGG kjVKyaJQWrK4nJP9s/o+hUQrXX7SFKA4B4kKhWVg2ywzmIT2o+62LXJCFGufSP3uxwkEg92x9 iGgUVj9yMrenEPfMbpCVLyPF4jmNTKcpB9owY2fPXHHAI06nJKUg15enET99N27428XaNHSt9 c1oc6LYsw0ltwF2gzbPO+23YMVmKHKSz67LPQVwpzJqU1Sn77MKbWLo7wKYouUtZFuXUkBCFT iYVNkm6+KweA6GH/TAWZF3A2DdxfJm2Zu4/jLh9ZZB63ukfUHeHxVHg1M5BXEI8EMM6DRkpU6 km39awWHtWdffYvMdkQwDvleDC9FfSdfxMxdQA8hWbAA+TNBlFiI/yilWGhmheM9MycThuWnk 9Q72gJB2iSGFv+EsYZcMaqcc3o/2xRnGluo4ciwaFMLjBg/5UEKgwuWwk8317qFkhN/2sebSQ GCKiRy3bfaArhVVBRwLYTOrI5n5mPbPTn2WYe5zZXNHM00bndeEa8BEOlDDHBKVMh6gWLNFoS VjF/WTiPgCK6sW+99+4Cse+n7yp3qe152xrBbl6758Thz2egZPL6qrOFejpvxxdlgTjifMB+X Pt7rT1f+2C/pOt3Mn+1A== X-Spam-Status: No, score=-98.3 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, 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 08:32:39 -0000 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. Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer