Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1565566ybv; Sat, 8 Feb 2020 00:57:18 -0800 (PST) X-Google-Smtp-Source: APXvYqz6f1mpn6eWxAj0a2lLLBkBKg1xmPdH3+xi7wDxZr7PlyGCbrpxiEgN+dh7t2ZubF+fP/xc X-Received: by 2002:aca:e106:: with SMTP id y6mr4907606oig.131.1581152238655; Sat, 08 Feb 2020 00:57:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581152238; cv=none; d=google.com; s=arc-20160816; b=f9p41M8pcJJuKQWi2KaTgKrJ0Sz0oXaoPiPoVYfyUnZO04YZm4WuZVrA4mDDJ+jAPs aUe1xG70CrntfnzuB6YmwAIK2FBW3t2fmKnRakb5fQeExJj1QPkioWiHCsyl/Jbq7UFA gngwILxgEh2jb4ABQuO2xazBftYxaV9bpSArsVZ1KRyaUZ1/qbXMyGlnXn4zUNdPHXhO zEyGj0tHaQbU0iWBkGz5QCZ4f1Z/uVX3JV9axevVJ1D1GGeP+1riNOMFzAQSNPGSin0z TFmebmAACiKLgWMaAt40uLO2eR0tnp+PURD3aB/hYtlV0EUvl7c6VjlCICbMImKL+RhH m5Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mYQGK6YXfcZc98jtf4E/uGifjg8qJuSxlB3RUf5LzII=; b=OOCi6765Sipid/EhX49tKik9kmiJgxVgLi+ft1axHW/F7jqaJ3BfwAdpM5yjkpF78d y3txKJVEOOJI36EsRJpOl6iARMszl2kym8OkYqsxPuGKwNkNDHzjHVfUjtCQaUBDlQJH Gt6lF1GpQAiHqjIN6g30bI7dVzjs60EKdDKCZdH3qdVDrAw8QmycqiZGWKFRZR61sRH/ CQk2wFSLnAsiaRCxz+/Kj1Rlv6Ilnt8PFbpODtuhh0XfPOYuz4ZrbQPtF3JzUUCQjgH1 2LaqvuwgPLaHxh3lIaW7iXKR/xfaYg6URH2x+CZRVPLDdBX0KtoMsQDttHbVnWfdK8tX g3rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SO93iRw4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h203si5589258oif.3.2020.02.08.00.57.01; Sat, 08 Feb 2020 00:57:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SO93iRw4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbgBHIzP (ORCPT + 99 others); Sat, 8 Feb 2020 03:55:15 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:35664 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbgBHIzP (ORCPT ); Sat, 8 Feb 2020 03:55:15 -0500 Received: by mail-oi1-f193.google.com with SMTP id b18so4519258oie.2 for ; Sat, 08 Feb 2020 00:55:14 -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:references:mime-version :content-disposition:in-reply-to; bh=mYQGK6YXfcZc98jtf4E/uGifjg8qJuSxlB3RUf5LzII=; b=SO93iRw417Yoski/EyoEHUBuzH4+hduutcUTwTVnt6bZfgQ2f0QSp/1fS+w7xvyL7a H6ANRscSn1szpp3VfSBq3vWHi+IrHLGmTTqqUz7YHd+1h8wMNpEGbz7eUN6u61Jk69+3 hy69FvKnhSqSWLxHtnaPjX9Wo20zQ/exzSfCE= 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:references :mime-version:content-disposition:in-reply-to; bh=mYQGK6YXfcZc98jtf4E/uGifjg8qJuSxlB3RUf5LzII=; b=DOx+KNBFHJSevoaGUKb0rrtm1+RFghMuKnLHWFUAUmS2U6Oza7asSqqNv/JosQd0my wuT/hkW4VLXXhQJChFDV9dWBpKijcFpPHfww+K2cwHjYkoShJ+8ZpI8YeQcgKWnEmXST ZnI9zS4j5wLEBLdYmOEhxtL1Oi8SS6QiRZrBciR8P74NQKG64pBNzD2NyIQFF5SVmJWT +oOY6Nnuq73lCV3GnbGSdNMBogSKweW06UBeJBixp5uI/kqcL3MqUzWWGmm/vTR6I4+C kbDAKaWUca+QB28jYXAtspII1AMn1O6AhYC29l/ePfJlXZhsDOkSfl6EjCNnKBkFbktc 245g== X-Gm-Message-State: APjAAAV+PzbvGqGaoHmKO08lTAhWC5LvKJsUhpmbqEDv+h5Novlv9Wi7 kk7bK3vuAWeCXF3KO0wvTVzwbQ== X-Received: by 2002:aca:c70b:: with SMTP id x11mr4907987oif.29.1581152114456; Sat, 08 Feb 2020 00:55:14 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n17sm2063897otq.46.2020.02.08.00.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Feb 2020 00:55:13 -0800 (PST) Date: Sat, 8 Feb 2020 00:55:10 -0800 From: Kees Cook To: Ard Biesheuvel Cc: Nicolas Pitre , Nick Desaulniers , Manoj Gupta , Nathan Chancellor , Russell King - ARM Linux , clang-built-linux , Linux ARM , Linux Kernel Mailing List Subject: Re: [PATCH] ARM: rename missed uaccess .fixup section Message-ID: <202002080054.CBBE423@keescook> References: <202002071754.F5F073F1D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 08, 2020 at 07:54:39AM +0000, Ard Biesheuvel wrote: > On Sat, 8 Feb 2020 at 02:02, Kees Cook wrote: > > > > 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 > > Reviewed-by: Ard Biesheuvel Thanks! > As Nick points out, the *(.fixup) line still appears in the > decompressor's linker script, but this is harmless, given that we > don't ever emit anything into that section. But while we're at it, we > might just remove it as well. Agreed. I'll send a separate patch for that. -Kees > > > > --- > > 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 -- Kees Cook