Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1600091ybv; Thu, 6 Feb 2020 06:45:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyIw6CuwfQr9+cVXGi/QUKKeR2nmLixuO435p1aZrBlIthhP/eY6smFwFgcfIiXsAgpeUt5 X-Received: by 2002:a9d:7509:: with SMTP id r9mr7457496otk.270.1581000337126; Thu, 06 Feb 2020 06:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581000337; cv=none; d=google.com; s=arc-20160816; b=H1RkonlnW/wgx9K+8FfZ2FHgR+BK39z9k0U5nggB72/xn6yovToE+eBezNo/wXi7Vb eTg3QgO6bYthkGuv870oGnfttQ3Wew8PS0kT9tJRSe63azbRBhgEQ83tYWIhlISc9uVx aAXJ8dmcLyJyZtroj3/4dwUPdxijYDtnScGkYobR1c6Y3a/VGrqVqwzw1RpUoI7PHyZs BBe4tiW2QA9w2iVpOs8XQX0o95z5W/SLS6+doH1iHkkbh6fpQxxiPSdB5eQOzOGX/eIW AHi73YewDjhMxhJNls5z5/aExe7RrTZ7qM+N8SvPBLsBxLLr7PHJK4TitW4iRHecS4Ba Vk4w== 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=6jPO1T6lQYmXuz/rFgYHrB+x12nlG09wpWY9E0p2rSA=; b=UM2ioLiVjlbIQaH9js/lO7Yio85oK+rV9IkQrpYeKZa02DK/IjNlSfvYFpPMb0pJ4U H3ggUy4dH8IpiOnK2qtnxeO/mx+Dzh0peD3IYVlUJ6z0z2GYmaCs3oboeuycCvbjqiBN 8vwhCAU0TgKKj6igTEreIaj5zE0OYP7iVBPfZG9gdZiS0wWzFOsh5lxg8qZCgVZ71U93 oos8pRt06E2TUvKCe6DkfbryaJ1jhw4gxtzl/RONM2QppZqNQJNJLMwAigXLlRmF7jWE E0i35RKfn/Qap0PL9uDVMwf58Mj4gNG+y7EX01PstS7w6g9Iou5MHGsEJ6qa8rEKfyF4 Zdgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TQ3RFnoZ; 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 64si1989687otx.50.2020.02.06.06.45.23; Thu, 06 Feb 2020 06:45:37 -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=TQ3RFnoZ; 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 S1727538AbgBFMjq (ORCPT + 99 others); Thu, 6 Feb 2020 07:39:46 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:42596 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727379AbgBFMjq (ORCPT ); Thu, 6 Feb 2020 07:39:46 -0500 Received: by mail-oi1-f193.google.com with SMTP id j132so4401596oih.9 for ; Thu, 06 Feb 2020 04:39:45 -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=6jPO1T6lQYmXuz/rFgYHrB+x12nlG09wpWY9E0p2rSA=; b=TQ3RFnoZKH3ZBv79/bbk5oudQBaraIuvDJKWhIJyFoOHL7MyM3+HGsuy+LmNLyqiA2 ztAbkuqDdXJjGOIIhGdS3NZksNBPvIxNlp5MK6aPSl+kIA5KyURvm8VAKmNwOAF++5bt XLVcwDF+XfS+7sNSFhRkuPEpYItkmNHN3UQrc= 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=6jPO1T6lQYmXuz/rFgYHrB+x12nlG09wpWY9E0p2rSA=; b=IbuF7QtkGtdrLA7II9zAHNlBOU+5AKKZifb2n1EOqwApwPcnwbrAb9dEqqpVV/VuMY nO59O9K8PgPYTyxQDVet/0fFpBoveLEZPltl4Eiql9kNrUDSiPffUQmCKLfJ7GyqA9d6 qRURuA0UO+rZF6jGbvpG0c1Z4ZRCkF9CuDplOwYrFXXifqVooqtIm3jyWIhM3zuKK6qf Jm7o4F37rVl4oB2N2PZocq9bS6/4bT9y5IIBWnXE1l40TTgfAe5EVIG6CWWziGMtikqR A4hd8Ths8z62K/8Zi44ws1OOA9+QxNHNoJ7046s5ublAbGlKgNgkIUAiWd4MdVr75MCc BvJg== X-Gm-Message-State: APjAAAUDitBWuKsk7dyElJoh9MFgyVmj/EiP2ZlVBm/1EzsTkQuhXSEj 9XgeqMbT9IY55kRvJxP2GX8Ghg== X-Received: by 2002:aca:3857:: with SMTP id f84mr6389157oia.150.1580992785571; Thu, 06 Feb 2020 04:39:45 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n64sm1065880otn.35.2020.02.06.04.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 04:39:44 -0800 (PST) Date: Thu, 6 Feb 2020 04:39:43 -0800 From: Kees Cook To: Kristen Carlson Accardi Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, arjan@linux.intel.com, rick.p.edgecombe@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 02/11] x86: tools/relocs: Support >64K section headers Message-ID: <202002060438.D30727DA@keescook> References: <20200205223950.1212394-1-kristen@linux.intel.com> <20200205223950.1212394-3-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205223950.1212394-3-kristen@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 05, 2020 at 02:39:41PM -0800, Kristen Carlson Accardi wrote: > While it is already supported to find the total number of section > headers if we exceed 64K sections, we need to support the > extended symbol table to get section header indexes for symbols > when there are > 64K sections. Parse the elf file to read > the extended symbol table info, and then replace all direct references > to st_shndx with calls to sym_index(), which will determine whether > we can read the value directly or whether we need to pull it out of > the extended table. > > Signed-off-by: Kristen Carlson Accardi Looks good to me. Reviewed-by: Kees Cook -Kees -- Kees Cook