From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764399AbcIOBfd (ORCPT ); Wed, 14 Sep 2016 21:35:33 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57888 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755183AbcIOBfc (ORCPT ); Wed, 14 Sep 2016 21:35:32 -0400 Date: Thu, 15 Sep 2016 02:35:29 +0100 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org Subject: Re: [git pull] uaccess fixes Message-ID: <20160915013529.GH2356@ZenIV.linux.org.uk> References: <20160914154746.GD2356@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160914154746.GD2356@ZenIV.linux.org.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2016 at 04:47:47PM +0100, Al Viro wrote: > Fixes for broken uaccess primitives - mostly lack of proper zeroing > in copy_from_user()/get_user()/__get_user(), but for several architectures > there's more (broken clear_user() on frv and strncpy_from_user() on hexagon). > All of that is rc2-based stable fodder; usercopy stuff that went into mainline > since then has added 3 conflicts - in parisc, ppc and itanic uaccess.h. > Conflicts are trivial; I've pushed my variant of conflict resolution into > #proposed-merge. And a bit that has sat in a different branch since mid-August: [x86] fix minor infoleak in get_user_ex() get_user_ex(x, ptr) should zero x on failure. It's not a lot of a leak (at most we are leaking uninitialized 64bit value off the kernel stack, and in a fairly constrained situation, at that), but the fix is trivial, so... Cc: stable@vger.kernel.org Signed-off-by: Al Viro --- diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index a0ae610..7821921 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -433,7 +433,11 @@ do { \ #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ asm volatile("1: mov"itype" %1,%"rtype"0\n" \ "2:\n" \ - _ASM_EXTABLE_EX(1b, 2b) \ + ".section .fixup,\"ax\"\n" \ + "3:xor"itype" %"rtype"0,%"rtype"0\n" \ + " jmp 2b\n" \ + ".previous\n" \ + _ASM_EXTABLE_EX(1b, 3b) \ : ltype(x) : "m" (__m(addr))) #define __put_user_nocheck(x, ptr, size) \