Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4710840ybl; Mon, 13 Jan 2020 19:13:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwj5veij0TTLCXQi5nzYpfTV2f4IW/I4eX/N9vGyYGCQnijK9Izuc39TCHEedN+BFw6b3Hb X-Received: by 2002:a05:6830:1294:: with SMTP id z20mr15100096otp.60.1578971615459; Mon, 13 Jan 2020 19:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578971615; cv=none; d=google.com; s=arc-20160816; b=z2jQBAqHx2jJpAlLUGmlPGtVrGB6qoFEKs/dpWjnUmDWNNe7oU7F5x1QOheJ31fdPn tnjVhl6rkkWM+gc/azqWfjQhp0j+ILErWKmNqj8kCPUZfLM4LNgqBR6ZeUgcyCzaDlia uTark9JHK8FahekBXn36hDVdseUB0r9q46GdcSgf25nzfFnMzAcMinj9cA9N/lBiFGl3 KapHV1hilQt0ySKUg3/3O8DQSmRNbcngrQkCSb6a9+JHIKVwq8pfQYhPjaf6cXB9LBw7 5ZbTac0wCU1oK7YFKUjc+BGUGpx+DQCEzqp7wo6Qo7AZCCTzHRFFcGtm7aUoFpAxgngp okiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=73sdd0gKwzsK+W5DK5KjaAPkEWXgfp6lmaX6TIBl45s=; b=tkCdhJCSYYQf+qmFvWuJcBaJG716Gy6YBUS0m2K/EEaeyygNdplmPQ8lHTYkUG2A+v Ro6eJ06J5SbQ+6OF3bP6sBN730eTHal3MzmknscPUZFVzf0PikwXt4Q2Psf5BCUa/geR qrSJM4FSemCvsAAucO13xWm05owIo67RRpat5R+COpNudVJ3zdMJZuXpMMcggvzo97OG 7jooshzq+FO49F0xC7oYOhbCP1AW+aq7jbau7oY9FHiXtC89dz4doR4SDL0+UE2+ZI2w b2fn3Q0BN5sVg180ImXH9P+sfObjP2LkMZ6Tl82uCmoir9lyoBDZQpVdKjwiW+GzmrAI Ih4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019122001 header.b=MzJVhEfU; 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=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si8002917otd.292.2020.01.13.19.13.23; Mon, 13 Jan 2020 19:13:35 -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=@zytor.com header.s=2019122001 header.b=MzJVhEfU; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729260AbgANB5z (ORCPT + 99 others); Mon, 13 Jan 2020 20:57:55 -0500 Received: from terminus.zytor.com ([198.137.202.136]:44201 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729040AbgANB5y (ORCPT ); Mon, 13 Jan 2020 20:57:54 -0500 Received: from carbon-x1.hos.anvin.org ([IPv6:2601:646:8600:3281:e7ea:4585:74bd:2ff0]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 00E1vSqQ1582716 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 13 Jan 2020 17:57:28 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 00E1vSqQ1582716 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019122001; t=1578967049; bh=73sdd0gKwzsK+W5DK5KjaAPkEWXgfp6lmaX6TIBl45s=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=MzJVhEfUnp/Ys8ckWAFzhRGYURhonr2Q9hWGSdWR04Jr57keXilDA7+WG/tSAnoFr TmEgFiKdkULKEe6LPNqhaAffJ9+2bx1kwN3DqwIxmn0MVvF35Hr9NT9nULqIjYQB0j 35GcW2/gSDI+KbF+dLMaef3o3r+VsWDGDWM59fac/6j9E00JndWk6VTcHUU4gnzYDq PWq4unzGORLkvhhlz1WnPuH/pqaV3CABiwK9Uk/O6jonmmks/GnGmE3ATRbRtzBbaw W74mEB4pj4x3QtyRSsQg3Y/UZUn5AfkvXs6X+w1IqzRil4S8ULmEJ60bQ6Evy4t9yi lvmI1OuAbGunA== Subject: Re: [PATCH v3] x86/vmlinux: Fix vmlinux.lds.S with pre-2.23 binutils To: Kees Cook , Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Lendacky , Mauro Rossi , Michael Matz References: <20200113161310.GA191743@rani.riverdale.lan> <20200113195337.604646-1-nivedita@alum.mit.edu> <202001131750.C1B8468@keescook> From: "H. Peter Anvin" Message-ID: <261ae869-4169-296e-f673-5c08ff34bdde@zytor.com> Date: Mon, 13 Jan 2020 17:57:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001131750.C1B8468@keescook> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-13 17:53, Kees Cook wrote:>> >> diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S >> index 3a1a819da137..bad4e22384dc 100644 >> --- a/arch/x86/kernel/vmlinux.lds.S >> +++ b/arch/x86/kernel/vmlinux.lds.S >> @@ -144,10 +144,12 @@ SECTIONS >> *(.text.__x86.indirect_thunk) >> __indirect_thunk_end = .; >> #endif >> + >> + /* End of text section */ >> + _etext = .; >> } :text =0xcccc >> >> - /* End of text section, which should occupy whole number of pages */ >> - _etext = .; >> + /* .text should occupy whole number of pages */ >> . = ALIGN(PAGE_SIZE); > > NAK: linkers can add things at the end of .text that will go missing from > the kernel if _etext isn't _outside_ the .text section, truly beyond the > end of the .text section. This patch will break Control Flow Integrity > checking since the jump tables are at the end of .text. > > Boris, we're always working around weird linker problems; I don't see a > problem with the v2 patch to fix up old binutils... > Why not add the marker into a separate section instead of leaving it as an absolute "floater"? Very old binutils would botch that case, but I think that has been long since addressed well below our current minimum version. -hpa