From patchwork Sat Feb 9 23:11:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2121161 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 592673FCD5 for ; Sat, 9 Feb 2013 23:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760861Ab3BIXLv (ORCPT ); Sat, 9 Feb 2013 18:11:51 -0500 Received: from mout.gmx.net ([212.227.17.20]:60408 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760860Ab3BIXLv (ORCPT ); Sat, 9 Feb 2013 18:11:51 -0500 Received: from mailout-de.gmx.net ([10.1.76.24]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LoscP-1Uat701dOt-00gqTB for ; Sun, 10 Feb 2013 00:11:49 +0100 Received: (qmail invoked by alias); 09 Feb 2013 23:11:49 -0000 Received: from p54AD0F54.dip0.t-ipconnect.de (EHLO p100.box) [84.173.15.84] by mail.gmx.net (mp024) with SMTP; 10 Feb 2013 00:11:49 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1/0HRp32Jb0lWM5kWicWHpZE25a7J0bVs2dI9pY2O /ZXIPif9/9YPRF Date: Sun, 10 Feb 2013 00:11:46 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley Subject: [PATCH] parisc: fix personality on 32bit kernel Message-ID: <20130209231146.GA23219@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Process personality is stored together with other flags like UNAME26 in an integer variable. Overwriting this value with PER_LINUX drops all other existing flags and as such broke tools like the uname26 tool. Actually this was only broken on 32bit kernels, since for 32bit-ELF binaries on 64-bit kernels the SET_PERSONALITY macro from arch/parisc/kernel/binfmt_elf32.c is used which does not modifies the personality value at all (which is wrong as long as we don't run HPUX binaries or similiar). Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h index 19f6cb1..ad2b503 100644 --- a/arch/parisc/include/asm/elf.h +++ b/arch/parisc/include/asm/elf.h @@ -247,7 +247,7 @@ typedef unsigned long elf_greg_t; #define ELF_PLATFORM ("PARISC\0") #define SET_PERSONALITY(ex) \ - current->personality = PER_LINUX; \ + set_personality((current->personality & ~PER_MASK) | PER_LINUX); \ current->thread.map_base = DEFAULT_MAP_BASE; \ current->thread.task_size = DEFAULT_TASK_SIZE \