From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 99CF9385DC02 for ; Sat, 11 Apr 2020 14:45:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 99CF9385DC02 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jNHNz-0002f0-Sg; Sat, 11 Apr 2020 14:45:31 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jNHNs-0000XN-FH; Sat, 11 Apr 2020 16:45:24 +0200 From: Florian Weimer To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" Subject: Re: [PATCH] Add SYSCALL_LONG/SYSCALL_ULONG to pass long to syscall [BZ #25810] References: <20200410212249.3529885-1-hjl.tools@gmail.com> <87k12m9w9n.fsf@mid.deneb.enyo.de> Date: Sat, 11 Apr 2020 16:45:24 +0200 In-Reply-To: (H. J. Lu's message of "Sat, 11 Apr 2020 06:26:08 -0700") Message-ID: <87v9m684jf.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Sat, 11 Apr 2020 14:45:35 -0000 * H. J. Lu: > On Sat, Apr 11, 2020 at 3:01 AM Florian Weimer wrote: >> >> * H. J. Lu via Libc-alpha: >> >> > For inline syscalls, SYSCALL_LONG and SYSCALL_ULONG are introduced as >> > wrappers for long and unsigned long arguments. >> >> Do the arguments have the correct types? Then I think you can do the > > Yes, they have correct types. But it is not the problem. Take this example: > > int munmap(void *addr, size_t length); > > The type of length is unsigned int (size_t) for x32 and is unsigned long > (64bit) in kernel. We have no way to know the type which kernel expects. Is it possible to extend all 32-bit arguments? Ot is this incorrect for negative int arguments, which must not have their upper bits set?