Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2595329imu; Thu, 29 Nov 2018 07:23:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/U8GLpzcue8vKVjCybpCQOkKJY8Z23g24YaUZWrX9fQFNk2bhY+OeqGbcukPEG9LKPxV3Gn X-Received: by 2002:a62:130c:: with SMTP id b12mr1779556pfj.247.1543505002155; Thu, 29 Nov 2018 07:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543505002; cv=none; d=google.com; s=arc-20160816; b=gocBuq7FkEQCaUgY0ckNyH95jOuPfet0zy2gb3tqP42Q7zjcl1vFl9JYSIwcAXSTIJ l7/STVDBGGRn8laQyl/SmkKsZNX6sa2TP9NQH/JJrkPFmT9IofIoKikxgIjwfvCXHqsj uwci0fwJP3GlHy6uf3vUNtiKLS1hIdH3A05EjGGGt1mfOgUUS04ogGWVFfVWeSrk9n5I zcqmPHhN0ZGl6oTccJ4sngbLlgWbnp3H+U+xNasWrq/MLASh4zpG07abQoCuXpML0Iry 8TrSfdYu7c6f8RtWboH2moUkdc46YdPF33RrQjnAaODolnKKu6HNiQTM9P++uwSPdZwM 4MFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fP0LHs2qUhNDHhTzhIcoFZKO1hND1tyxLoWP4oahsTE=; b=ilpIoHhWOFvoK4UwfdClLSJlkF+5myjxu3aG+q9wCapOCIpLaubm5qGh45XSUd+0N0 PoVHNKrn47IOy6UmI22gLPzXi05yqeq5dNKka4sTGvU43A1Uoms71FKSo0EM8MGwe6ts /0pwizDmA+5GdPw9WWCQ3LxmraiJg0kKyG1BwufksnCALGKfkJciikFy347Iimr2n/ZK Z9yAXJFnskxPCo6auo7wyQ0rf44edLprK70mWbRmzkvWEj4FNxWfllBflCYvk6rdXwf0 llDK2hcSjNJgVzEXS41uCLzh6IIQ0fF8Bhr0xO4Cd8bzykcAWp2Gsk/zWC5eNj+VHpyp 5OZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si2259526pgf.527.2018.11.29.07.22.48; Thu, 29 Nov 2018 07:23:22 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728739AbeK3C1o (ORCPT + 99 others); Thu, 29 Nov 2018 21:27:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbeK3C1n (ORCPT ); Thu, 29 Nov 2018 21:27:43 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A1703097074; Thu, 29 Nov 2018 15:22:01 +0000 (UTC) Received: from shodan.usersys.redhat.com (unknown [10.43.17.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 510AC5D736; Thu, 29 Nov 2018 15:22:01 +0000 (UTC) Received: by shodan.usersys.redhat.com (Postfix, from userid 1000) id 8A8C72C136D; Thu, 29 Nov 2018 16:22:00 +0100 (CET) Date: Thu, 29 Nov 2018 16:22:00 +0100 From: Artem Savkov To: Josh Poimboeuf Cc: x86@kernel.org, Thomas Gleixner , "Eric W . Biederman" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/tools/relocs: fix big section header tables Message-ID: <20181129152200.GA1776@shodan.usersys.redhat.com> References: <20181129135133.31369-1-asavkov@redhat.com> <20181129142312.kz2l5gm33yeaglnn@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181129142312.kz2l5gm33yeaglnn@treble> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 29 Nov 2018 15:22:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 08:23:12AM -0600, Josh Poimboeuf wrote: > On Thu, Nov 29, 2018 at 02:51:33PM +0100, Artem Savkov wrote: > > In case when the number of entries in the section header table is larger > > then or equal to SHN_LORESERVE the size of the table is held in the sh_size > > member of the initial entry in section header table instead of e_shnum. > > Same with the string table index which is located in sh_link instead of > > e_shstrndx. > > > > This case is easily reproducible with KCFLAGS="-ffunction-sections", > > bzImage build fails with "String table index out of bounds" error. > > > > Signed-off-by: Artem Savkov > > --- > > arch/x86/tools/relocs.c | 58 +++++++++++++++++++++++++++++------------ > > 1 file changed, 41 insertions(+), 17 deletions(-) > > > > diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c > > index b629f6992d9f..5275ea0a0d13 100644 > > --- a/arch/x86/tools/relocs.c > > +++ b/arch/x86/tools/relocs.c > > @@ -11,7 +11,9 @@ > > #define Elf_Shdr ElfW(Shdr) > > #define Elf_Sym ElfW(Sym) > > > > -static Elf_Ehdr ehdr; > > +static Elf_Ehdr ehdr; > > I think there's a tab missing here, it doesn't line up with the other > variables. This seems to be a vim bug. It aligns perfectly in cat/less/lore.kernel.org which all seem to use tabstop=8 by default, but it does not align in vim, but it does align with tabstop=7 in vim. -- Artem