From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4A30C2BA83 for ; Sat, 8 Feb 2020 02:03:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A84D6222D9 for ; Sat, 8 Feb 2020 02:03:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bKX5lIYZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mSKNR7w2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A84D6222D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=iYylqHCvzy1FGHg/pEyNFijv2e+jQZxh47N5VYJ6kSY=; b=bKX5lIYZfjq4Zi N83KxjfE8Es245t8+RdBhEv9EXy/rUlc8L8eBskf0UR7YYE5utlQXer3+e7CiPWg8rb6D82ddEL7E bhM0f0Kf0AfftO62nOP/cfAyB+agW+JtR5RhGOGiEyYEDEpy3S62tv+T457jq1iVj15gqEhJwwVBk Z7Y/L7DlATYiO6VZesWW3OGl7W2foHMOGWLdhici8cnrg+pD7zZX3jt9ZZ7JLZMlnON6gEQifa0VX QYWYps1Xa57S4joDpipSwJJ6H/99KSqYR+HSE6HjmwNzY3q1UYD+Yaoh6S+ThvXIttbWLQFcNyTk3 kbgH37JjaytZoT4lfSsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j0FSU-00026K-Hp; Sat, 08 Feb 2020 02:02:58 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j0FSR-00025F-GP for linux-arm-kernel@lists.infradead.org; Sat, 08 Feb 2020 02:02:56 +0000 Received: by mail-ot1-x341.google.com with SMTP id 66so1174007otd.9 for ; Fri, 07 Feb 2020 18:02:54 -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=ZL1vw2AXxwnJQ2itrk5zfzZQ8p6ax5CM4oF2dWGGnQc=; b=mSKNR7w2E2yDs943NNg37EL3/vyyqIeWtfn+pvbMxm6Ppu9/jMXRV5puYVNqkZWAbJ IA++lHgYp8J4Ttq/NxqrwtOg4pJ+0VoUwyelqs6zdwL/XbMeKk2J/+JQwpve+qA+2B6l c6hvByKoNep9vf8QExch1b2nYfgHciDzQmhRo= 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=ZL1vw2AXxwnJQ2itrk5zfzZQ8p6ax5CM4oF2dWGGnQc=; b=MSI32VXF/kQargO88WHBfZDffqtArPjM7w7ALD9sECqfd8lS9bObUqD/1lNRdMvq4c johRWQGSv/QKkqZyYwVMn6wUFsZdB3wdC8FnMhfxVSFzX8OHahFff7koKWFIqYFqs/ep wuSC60lJsPafsvySWjeswu0euyaoWc9Eq6nJKlOd2WJerNcf3XRy3KSvgZzg1tn7DJLf WKDixhUhqMEppd48kAeip7QsuxNwQ6w+Zxlap+xoKoi8nrNTuE1sonBU/lcRry4gMjUQ H+ZA5t9yY0rnSPQ+Y9jstmMEgOwsbSlO5rLym1mUDFaepnQ4d/7Uh+TU1hCSdNmzpsls R+fQ== X-Gm-Message-State: APjAAAVZ7ZEsHWgdWO2ODd/R9IM3mB1tenXsH/btx6HgMFYRj0VVhPNd LTViuLD5QcH4/681h8p1rV8dE29T/Z33ZA== X-Google-Smtp-Source: APXvYqy16hNfOnp4HG5nW1dbIIaqb7qga2IbA8K9tC05B9Y8mof43qotvfzTXHFB7Pos82dfVCYL1w== X-Received: by 2002:a9d:5e9:: with SMTP id 96mr1788864otd.307.1581127373870; Fri, 07 Feb 2020 18:02:53 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i12sm1803428otk.11.2020.02.07.18.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 18:02:53 -0800 (PST) Date: Fri, 7 Feb 2020 18:02:51 -0800 From: Kees Cook To: Nicolas Pitre Subject: [PATCH] ARM: rename missed uaccess .fixup section Message-ID: <202002071754.F5F073F1D@keescook> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200207_180255_574538_FF225D97 X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Nick Desaulniers , Russell King - ARM Linux , linux-kernel@vger.kernel.org, clang-built-linux , Manoj Gupta , Nathan Chancellor , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org When the uaccess .fixup section was renamed to .text.fixup, one case was missed. Under ld.bfd, the orphaned section was moved close to .text (since they share the "ax" bits), so things would work normally on uaccess faults. Under ld.lld, the orphaned section was placed outside the .text section, making it unreachable. Rename the missed section. Link: https://github.com/ClangBuiltLinux/linux/issues/282 Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1020633#c44 Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.1912032147340.17114@knanqh.ubzr Fixes: c4a84ae39b4a5 ("ARM: 8322/1: keep .text and .fixup regions closer together") Cc: stable@vger.kernel.org Reported-by: Nathan Chancellor Reported-by: Manoj Gupta Debugged-by: Nick Desaulniers Signed-off-by: Kees Cook --- I completely missed this the first several times I looked at this problem. Thank you Nicolas for pushing back on the earlier patch! Manoj or Nathan, can you test this? --- arch/arm/lib/copy_from_user.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 95b2e1ce559c..f8016e3db65d 100644 --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S @@ -118,7 +118,7 @@ ENTRY(arm_copy_from_user) ENDPROC(arm_copy_from_user) - .pushsection .fixup,"ax" + .pushsection .text.fixup,"ax" .align 0 copy_abort_preamble ldmfd sp!, {r1, r2, r3} -- 2.20.1 -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6930AC35242 for ; Sat, 8 Feb 2020 02:02:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E34E22314 for ; Sat, 8 Feb 2020 02:02:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mSKNR7w2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727602AbgBHCC4 (ORCPT ); Fri, 7 Feb 2020 21:02:56 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:45296 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727585AbgBHCCy (ORCPT ); Fri, 7 Feb 2020 21:02:54 -0500 Received: by mail-ot1-f66.google.com with SMTP id 59so1161055otp.12 for ; Fri, 07 Feb 2020 18:02:54 -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=ZL1vw2AXxwnJQ2itrk5zfzZQ8p6ax5CM4oF2dWGGnQc=; b=mSKNR7w2E2yDs943NNg37EL3/vyyqIeWtfn+pvbMxm6Ppu9/jMXRV5puYVNqkZWAbJ IA++lHgYp8J4Ttq/NxqrwtOg4pJ+0VoUwyelqs6zdwL/XbMeKk2J/+JQwpve+qA+2B6l c6hvByKoNep9vf8QExch1b2nYfgHciDzQmhRo= 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=ZL1vw2AXxwnJQ2itrk5zfzZQ8p6ax5CM4oF2dWGGnQc=; b=oFmBAOWKVZRcPDCLrAdzJXUMMIhF4Gv2Po2yRIjfd6pxXFNU3MxHfxNVj4QqW61SGp QbD0C8FGf49zAvJR8pdO4LLfsFhEoxBxKy/19QMOK45XDAIKLve8GQXKbvORLhtDS59L p/mRRmIcUdjWhsN3+nHQTElztI+iIYSqcwqtiOuj3VLE0/tX/SxfhDFXlToe7ifhgKrr zDnwnDamCA6rTRZ96kZwINEkCr836sDJIzsqhWx/9y3G0QP9imfHW8aETMIUeTghtSVV Uc8+NZTSh2YIski1PrCaBmPJ2r4dJ6UsWhp9kT1VS4+Uz2xNSvqv8ExPD4QvmqD0Q4SK TiYA== X-Gm-Message-State: APjAAAVYXJYTqkICanc86WY+wxbWEamwQZIPlsO1GPUYbP2TqdP4unEw fO2/2Ioe0LSN0qt4DbA0tBUsig== X-Google-Smtp-Source: APXvYqy16hNfOnp4HG5nW1dbIIaqb7qga2IbA8K9tC05B9Y8mof43qotvfzTXHFB7Pos82dfVCYL1w== X-Received: by 2002:a9d:5e9:: with SMTP id 96mr1788864otd.307.1581127373870; Fri, 07 Feb 2020 18:02:53 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i12sm1803428otk.11.2020.02.07.18.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 18:02:53 -0800 (PST) Date: Fri, 7 Feb 2020 18:02:51 -0800 From: Kees Cook To: Nicolas Pitre Cc: Nick Desaulniers , Manoj Gupta , Nathan Chancellor , Ard Biesheuvel , Russell King - ARM Linux , clang-built-linux , Linux ARM , linux-kernel@vger.kernel.org Subject: [PATCH] ARM: rename missed uaccess .fixup section Message-ID: <202002071754.F5F073F1D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the uaccess .fixup section was renamed to .text.fixup, one case was missed. Under ld.bfd, the orphaned section was moved close to .text (since they share the "ax" bits), so things would work normally on uaccess faults. Under ld.lld, the orphaned section was placed outside the .text section, making it unreachable. Rename the missed section. Link: https://github.com/ClangBuiltLinux/linux/issues/282 Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1020633#c44 Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.1912032147340.17114@knanqh.ubzr Fixes: c4a84ae39b4a5 ("ARM: 8322/1: keep .text and .fixup regions closer together") Cc: stable@vger.kernel.org Reported-by: Nathan Chancellor Reported-by: Manoj Gupta Debugged-by: Nick Desaulniers Signed-off-by: Kees Cook --- I completely missed this the first several times I looked at this problem. Thank you Nicolas for pushing back on the earlier patch! Manoj or Nathan, can you test this? --- arch/arm/lib/copy_from_user.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 95b2e1ce559c..f8016e3db65d 100644 --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S @@ -118,7 +118,7 @@ ENTRY(arm_copy_from_user) ENDPROC(arm_copy_from_user) - .pushsection .fixup,"ax" + .pushsection .text.fixup,"ax" .align 0 copy_abort_preamble ldmfd sp!, {r1, r2, r3} -- 2.20.1 -- Kees Cook