From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031391Ab2COAdz (ORCPT ); Wed, 14 Mar 2012 20:33:55 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:46431 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757026Ab2COAdw convert rfc822-to-8bit (ORCPT ); Wed, 14 Mar 2012 20:33:52 -0400 MIME-Version: 1.0 In-Reply-To: <4F61278A.4000908@zytor.com> References: <1329696488-16970-1-git-send-email-hpa@zytor.com> <4F61278A.4000908@zytor.com> Date: Wed, 14 Mar 2012 17:33:51 -0700 Message-ID: Subject: Re: [tip:x86/x32] x32: Fix alignment fail in struct compat_siginfo From: "H.J. Lu" To: "H. Peter Anvin" Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, linux-tip-commits@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2012 at 4:19 PM, H. Peter Anvin wrote: > On 03/14/2012 04:17 PM, H.J. Lu wrote: >> >> Just for the record, although the offsets of _utime and _stime are >> multiple of 8 bytes, struct siginfo is only aligned at 4 bytes.  So >> the addresses of  _utime and _stime may not be 8byte aligned. >> But misaligned int64 load/store are OK for x86-64. >> > > Yes; the real question I guess is where struct siginfo appears and if it > is misaligned by construction.  It obviously appears in the signal stack > frame but also in a couple of system calls.  It might be possible to put > an __attribute__((aligned(8))) on the whole structure in the x32 case? It is possible to add __attribute__((aligned(8))) on struct siginfo in the x32 case. But it only affects system calls with struct siginfo. The signal stack frame may still be misaligned. -- H.J.