From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH] Syscall arguments are unsigned long (full registers) Date: Mon, 4 Jul 2016 07:28:02 -0700 Message-ID: <20160704142802.GL25121@tassilo.jf.intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Tautschnig, Michael" Cc: "x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jaswinder Singh List-Id: linux-api@vger.kernel.org On Mon, Jul 04, 2016 at 01:52:58PM +0000, Tautschnig, Michael wrote: > All syscall arguments are passed in as types of the same byte size as > unsigned long (width of full registers). Using a smaller type without a > cast may result in losing bits of information. In all other instances > apart from the ones fixed by the patch the code explicitly introduces > type casts (using, e.g., SYSCALL_DEFINE1). > > While goto-cc reported these problems at build time, it is noteworthy > that the calling conventions specified in the System V AMD64 ABI do > ensure that parameters 1-6 are passed via registers, thus there is no > implied risk of misaligned stack access. Does this actually fix anything? It seems a big dangerous to me, potentially breaking some existing binaries that rely on these arguments being truncated. -Andi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512AbcGDO2I (ORCPT ); Mon, 4 Jul 2016 10:28:08 -0400 Received: from mga02.intel.com ([134.134.136.20]:15091 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750808AbcGDO2E (ORCPT ); Mon, 4 Jul 2016 10:28:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,575,1459839600"; d="scan'208";a="133637827" Date: Mon, 4 Jul 2016 07:28:02 -0700 From: Andi Kleen To: "Tautschnig, Michael" Cc: "x86@kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jaswinder Singh Subject: Re: [PATCH] Syscall arguments are unsigned long (full registers) Message-ID: <20160704142802.GL25121@tassilo.jf.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 04, 2016 at 01:52:58PM +0000, Tautschnig, Michael wrote: > All syscall arguments are passed in as types of the same byte size as > unsigned long (width of full registers). Using a smaller type without a > cast may result in losing bits of information. In all other instances > apart from the ones fixed by the patch the code explicitly introduces > type casts (using, e.g., SYSCALL_DEFINE1). > > While goto-cc reported these problems at build time, it is noteworthy > that the calling conventions specified in the System V AMD64 ABI do > ensure that parameters 1-6 are passed via registers, thus there is no > implied risk of misaligned stack access. Does this actually fix anything? It seems a big dangerous to me, potentially breaking some existing binaries that rely on these arguments being truncated. -Andi