Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp278351pxv; Thu, 24 Jun 2021 07:45:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+x0qIDo5hVs7Ugebt1x0qkpJmx4l53nuvm/0HAYWvuutHBTI3Kiv4sEJo6zdaQluyN27F X-Received: by 2002:aa7:db0c:: with SMTP id t12mr7729942eds.112.1624545937685; Thu, 24 Jun 2021 07:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624545937; cv=none; d=google.com; s=arc-20160816; b=T6ywZKAvVSOUVk8lt6fey3NUpi9b4MFONh+0avSkBLRo8GpbDVaVgJuD6ckRIyrWk3 0xiLw3q0DXzPkeNppjPPU9uhmfnE27G5/ln8YIkA1vZYdGUoE1nDaWmOdxBeDxrC6i8A eRY5JmdtAnGdd1BZXmEuLYn3A5rswcX5arRRhz6x4EfoTA46EbyDgyMY4Wnl/5lY7pYi EMMXwms63UhMJveazEs7TakkgPhabJM2FTAX6k+y8JYw8lxcpB6SoA5RYhfzmavTXKPC KxCt7inQk+zMpwU9jZuz0Z5NRrmNhQggy43ECqxY+A5m4zyDroNErxN3Y4v1eBJfhkYv yTNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PAanNTQ1weptegdUtZIY8d0itgFQhteAfebpwlJkSpw=; b=gKOU7COl+r5OkcmeAiafcUpVjvYrQYooAend/RBIcvImDW22EM8rfB8rstIke0V83e TbEdOY5ZSGCFCSwevKa1cJSXQE7Yb75svltFptfJIbk47dDSJYQ+c9FrpgPiUT+9fFxP wkE9ZPKYFTv+sW2Bk2KVWszbMJ6ZzGq1g3S1XtUTRdcCi3Ei8buGeyG1lBAwGnDvtxFd CM9JGCa2J5W0qRbcxnlfroQhdhWfTrJADdhC2oPFmnKdgWFfsig4Rj+icPsPMNLCCJx6 gyBWfbfpvpStCnosOKuSrGYTwdgWblnHIEa/pD+A7jGQUNW8Hb7+YB17H5VdJeTx3m6G IWYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jJiA0gFq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si2794567ejk.639.2021.06.24.07.45.03; Thu, 24 Jun 2021 07:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jJiA0gFq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231417AbhFXOq3 (ORCPT + 99 others); Thu, 24 Jun 2021 10:46:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:44526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhFXOq3 (ORCPT ); Thu, 24 Jun 2021 10:46:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BEBD86135C; Thu, 24 Jun 2021 14:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624545849; bh=fWjsPxzvKGSs1dbSs7XVG4nfqro9YAmqQ4T6r3uflIg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jJiA0gFq+zuKimTijcPHn3xd+0Y/B+L3wbg4XtCXYQtjnB9yKdrFua4hTaAiXxSzV DWiECvT0cTylVFgee6R2VuLSFb+ooaDjeqDH6X6XdlNsMgVuaHk/zDReoFcolX+wwp RvlsrucxgaNoemZ46Z9yol0e8zU72N0W10hw2bvw= Date: Thu, 24 Jun 2021 16:44:02 +0200 From: Greg Kroah-Hartman To: Borislav Petkov Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] x86/tools/relocs: add __printf attribute to die() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 02:32:43PM +0200, Borislav Petkov wrote: > On Thu, Jun 24, 2021 at 01:58:03PM +0200, Greg Kroah-Hartman wrote: > > There are a number of printf "mismatches" in the use of die() in > > x86/tools/relocs.c. Fix them up and add the printf attribute to the > > reloc.h header file to prevent them from ever coming back. > > > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: Borislav Petkov > > Cc: "H. Peter Anvin" > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman > > --- > > arch/x86/tools/relocs.c | 21 +++++++++++---------- > > arch/x86/tools/relocs.h | 1 + > > 2 files changed, 12 insertions(+), 10 deletions(-) > > > > Originally sent back in Feb, but it seems to have been missed: > > https://lore.kernel.org/r/20210227095356.603513-1-gregkh@linuxfoundation.org > > > > > > diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c > > index ce7188cbdae5..c3105a8c6cde 100644 > > --- a/arch/x86/tools/relocs.c > > +++ b/arch/x86/tools/relocs.c > > @@ -389,7 +389,8 @@ static void read_ehdr(FILE *fp) > > Elf_Shdr shdr; > > > > if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0) > > - die("Seek to %d failed: %s\n", ehdr.e_shoff, strerror(errno)); > > + die("Seek to %d failed: %s\n", > > + (int)ehdr.e_shoff, strerror(errno)); > > Instead of casting all those, I think you should use %zu as, apparently, > we're using unsigned types for Elf{32,64}_Off and Elf{32,64}_Xword, etc. Odd, I thought I tried that and something did not work. Let me try it again...