Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757915AbcDHHOH (ORCPT ); Fri, 8 Apr 2016 03:14:07 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38030 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756788AbcDHHOE (ORCPT ); Fri, 8 Apr 2016 03:14:04 -0400 Date: Fri, 8 Apr 2016 09:13:54 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Borislav Petkov , security@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Rudolf Marek , Denys Vlasenko , Thomas Gleixner , "H. Peter Anvin" Subject: Re: [PATCH v3 2/7] x86/arch_prctl: Fix ARCH_GET_FS and ARCH_GET_GS Message-ID: <20160408071354.GB22579@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 19 * Andy Lutomirski wrote: > ARCH_GET_FS and ARCH_GET_GS attempted to figure out the fsbase and > gsbase respectively from saved thread state. This was wrong: fsbase > and gsbase live in registers while a thread is running, not in > memory. So I'm wondering, the current code looks totally broken,what user-space code can possibly use this? I checked glibc and Wine, and neither of them does. Wine uses ARCH_SET_GS and glibc uses ARCH_SET_FS, but that's all - neither actually tries to use the ARCH_GET_* reading APIs. So for backporting purposes I'd be much happier about simply returning -EINVAL or -ENOSYS, and we could re-introduce this code in v4.7. Thanks, Ingo