From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755269AbcETHGI (ORCPT ); Fri, 20 May 2016 03:06:08 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33285 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbcETHGF (ORCPT ); Fri, 20 May 2016 03:06:05 -0400 Date: Fri, 20 May 2016 09:05:59 +0200 From: Ingo Molnar To: Dave Hansen Cc: linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, tony.luck@intel.com, bp@alien8.de, linux-edac@vger.kernel.org, x86@kernel.org, luto@kernel.org Subject: Re: [PATCH] x86, signals: add missing signal_compat code for x86 features Message-ID: <20160520070559.GA4003@gmail.com> References: <20160518235720.1C70C3AD@viggo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160518235720.1C70C3AD@viggo.jf.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dave Hansen wrote: > Sending this out early so folks can have a look. I haven't let > it run through a full set of tests, so buyer beware, but it would > have a hard time hurting anything other than the already-broken > 32-bit compat signal code. > > --- > > From: Dave Hansen > > The 32-bit siginfo is a different binary format than the 64-bit > one. So, when running 32-bit binaries on 64-bit kernels, we have > to convert the kernel's 64-bit version to a 32-bit version that > userspace can grok. > > We've added a few features to siginfo over the past few years and > neglected to add them to arch/x86/kernel/signal_compat.c: > > 1. The si_addr_lsb used in SIGBUS's sent for machine checks > 2. The upper/lower bounds for MPX SIGSEGV faults > 3. The protection key for pkey faults > > I caught this with some protection keys unit tests and realized > it affected a few more features. Hm, while fixing this, could we please also add individual unit tests to tools/testing/selftests/x86/, and also structure the code in a fashion or add a comment or so to make sure future extensions add both a compat handler and a unit test as well? I.e. perhaps do a (build time) fixed-size check of siginfo structure in the compat code, and break the build if that check has not been updated? Or something like that. Thanks, Ingo