From patchwork Thu Feb 16 00:36:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9576101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6153F600C5 for ; Thu, 16 Feb 2017 00:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538DE28580 for ; Thu, 16 Feb 2017 00:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4841228587; Thu, 16 Feb 2017 00:36:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BEB228580 for ; Thu, 16 Feb 2017 00:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UPBJqz0KgCLXG25AcKZgiRDe6iCxlo6zvUbLy7w1GGI=; b=Ly2z6A72rjIhTJ j20NOemwEadRUIEErGFFf9zFfa6DQvBSPa5UanAgA4kcH7jFWVy+kU2RCc3UOs+v2i+ScaneF849+ etH2r7Bd2n/9ChgKDJ8e3aNXWJXtMIBJKhhZQHCmUe+PsrWcsdlDxack7oKL1MlhNrji3HIt4HWi6 wVFQWXouee2tPZMeLIwUT7gL3ohJVeBNUYj2p+CYqaEJn31aXBOxSFrZqMD82zVP47aX8/DFpMMZG LjCT5WT116EsMjLOuUigsnCXjkw4iaMKii+U7HiNNpzUc56cy6MZUcQKDQJKWMPaYf2WzIAuEfXUu e3vVkJkD1EgHzeAmB8Tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ceA3x-0005TJ-TX; Thu, 16 Feb 2017 00:36:45 +0000 Received: from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ceA3t-0005QB-Ko for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2017 00:36:43 +0000 Received: by mail-pg0-x236.google.com with SMTP id v184so863541pgv.3 for ; Wed, 15 Feb 2017 16:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=H0zaLApBsvTp+JDo+drsoPtoDCQIzvfos1QdVyo8VM4=; b=B/rNfmAxldFqD/F4gELTBbdwU6rGdYwi7Uh2x5kJ7nY2rqtzvuQ8AUiAiZo6zo9Je+ rUKkS6DzVsXKMgNRqyMKUZb0IdOqeSTqPaDLkrISmK5WsSY79DxftU6QKyJKeHfuclne 4ZTxhZwre2mMRIM0UgT8ukWwbR7+mbL2RP4vE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=H0zaLApBsvTp+JDo+drsoPtoDCQIzvfos1QdVyo8VM4=; b=Y83MZm75X3UDugT8C6I+QtQyjV5rm+TifPVWvKWRwnJnxmeMBmVp4AVxa11rG90Jix Q80Htc5KB9QQeq3VpMnjB3mEumEfL1TXm8aPTnSR1taBVPirCObd7CPYSWRjxpxo46z3 qrI92sFWOOLdKaNlAqBJBU7/lVxUg+cbLZkAoWn7GEMmAdkUzvKc6pCaQvuAt9FiUhES Wm8BCYv8khimjwTNMDyCNqBbMLFMN8aryJ7rbZkIT8m9uRYqZCiTPtvWq2TDedJdhmP5 SnQAIvge1BMSqvrGJIxJOpDimZjeRLJOET/PJLpc3q/j7jO8sSnhSkpkugMnNka9osIh tpDw== X-Gm-Message-State: AMke39kpxkA6KPlVhJT+JlHr+24B43W08EkNKoa6H10wgdHGSTF85UhNAORSejIAPE0Njg8M X-Received: by 10.99.140.77 with SMTP id q13mr42069630pgn.179.1487205380331; Wed, 15 Feb 2017 16:36:20 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id p17sm9519461pfi.97.2017.02.15.16.36.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 16:36:19 -0800 (PST) Date: Wed, 15 Feb 2017 16:36:19 -0800 From: Kees Cook To: Russell King Subject: [PATCH] ARM: uaccess: fix zeroing of 64-bit get_user() Message-ID: <20170216003619.GA142955@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170215_163641_714612_456E97C5 X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-hardening@lists.openwall.com, Hoeun Ryu , Al Viro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The 64-bit get_user() wasn't clearing the high word due to a typo in the error handler. The exception handler entry was already correct, though. Noticed during recent usercopy test additions in lib/test_user_copy.c. Signed-off-by: Kees Cook --- arch/arm/lib/getuser.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 8ecfd15c3a02..df73914e81c8 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S @@ -67,7 +67,7 @@ ENTRY(__get_user_4) ENDPROC(__get_user_4) ENTRY(__get_user_8) - check_uaccess r0, 8, r1, r2, __get_user_bad + check_uaccess r0, 8, r1, r2, __get_user_bad8 #ifdef CONFIG_THUMB2_KERNEL 5: TUSER(ldr) r2, [r0] 6: TUSER(ldr) r3, [r0, #4]