Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932160AbcDHQDe (ORCPT ); Fri, 8 Apr 2016 12:03:34 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:35014 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753387AbcDHQDd (ORCPT ); Fri, 8 Apr 2016 12:03:33 -0400 MIME-Version: 1.0 In-Reply-To: <20160408071354.GB22579@gmail.com> References: <20160408071354.GB22579@gmail.com> From: Andy Lutomirski Date: Fri, 8 Apr 2016 09:03:12 -0700 Message-ID: Subject: Re: [PATCH v3 2/7] x86/arch_prctl: Fix ARCH_GET_FS and ARCH_GET_GS To: Ingo Molnar Cc: Andy Lutomirski , Borislav Petkov , "security@kernel.org" , X86 ML , "linux-kernel@vger.kernel.org" , Linus Torvalds , Rudolf Marek , Denys Vlasenko , Thomas Gleixner , "H. Peter Anvin" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 32 On Fri, Apr 8, 2016 at 12:13 AM, Ingo Molnar wrote: > > * 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. > Let's just not backport this one. There's no security issue here. If you like the rest of the series, can you remove the stable tag from this patch when you apply it? I think the old code was at least correct enough that if you did ARCH_GET_FS after ARCH_SET_FS with no funny business in between, it would work. --Andy -- Andy Lutomirski AMA Capital Management, LLC