Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1015633imm; Fri, 12 Oct 2018 10:15:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SESprvNXe11LBk0CLtUkGeS6sOXnHqYRtoe2RiQhbhHx/Hx+9Pmpc7eYbuYpUzKnKLenh X-Received: by 2002:a62:7788:: with SMTP id s130-v6mr6909304pfc.189.1539364541348; Fri, 12 Oct 2018 10:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539364541; cv=none; d=google.com; s=arc-20160816; b=EzlmmS/bf+5b4YWHPjsM41MCVqdLRwYCocMkY6py8mI8ToJUZadiZuR5lmRZcdDwWM EPBrjPs0W2j4x3xemqdGTb/Rkd4oj+x+AH/koaCi4jgIZzuTrBtPoGkn3l73oXXIg+/8 9NzKmPjRrF1LtgcPkjeh1tD1Ui5Hc0Vz7R7jv/4TLUe2emn+A4L+c4I4pdVZ9ldNSw5g wE4X2EdSiy7Juk83wKMz7FvLScZV46Ixh5U9lOUoQm+vAGxkSlsJzgls7v23dzZEo4H6 vgVDnRHEaO03OPZSfiZ7ZbhEMe5ZTXnHh2KIEGzy/+w8GIkDrkA8xdO1+cLwkYgOM1Qk XkTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ujwWbrimNp669KOEB8if5RkxRpiCrikk2Qz5VOA/j6M=; b=Te1cP2XPxrTyi2f7v190AN7rHzCl3QJknK1whdKmIZw0+DeKhwz4/m2EzsjrCrcYeu SB0fA0euJsTCaH5/e2pgBAEjelM3TtNc9Cp8FQkGKpkp2AWZ+79Ofr+9iRMONB8vhjgw tRnvPclhTujSO7qP5xKUVaC2Ka55TuMzw+etBTujJWj/zdrNm3e3Cw1abyyjtjscbvFL DNVNGwyLOv3fOAv8qesqxdmJXEpqDRvwn91WhyGN03pMB9fwNo0rwl9J+BqYKQ7e22ig si0ggEu07Jp1P2sPq6bKBI5Dz6VJuLSN+QW+CekzSEj05vt9uMzQgVZ9+LO6aW3RYPal tndw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gQDfm7IN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y190-v6si1902560pfy.147.2018.10.12.10.15.24; Fri, 12 Oct 2018 10:15:41 -0700 (PDT) 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=@google.com header.s=20161025 header.b=gQDfm7IN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727242AbeJMAsd (ORCPT + 99 others); Fri, 12 Oct 2018 20:48:33 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44794 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbeJMAsc (ORCPT ); Fri, 12 Oct 2018 20:48:32 -0400 Received: by mail-pl1-f195.google.com with SMTP id p25-v6so6217881pli.11 for ; Fri, 12 Oct 2018 10:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ujwWbrimNp669KOEB8if5RkxRpiCrikk2Qz5VOA/j6M=; b=gQDfm7IN81M960Ohrzsq4aoqd93BSCaPEZcF2sfrgrANy7gC5gGxReonl2EwxTCl/k dKWs62xXYmi/xdzeol/ZBE6rjEo507pq6v855f+7UQG0Nj7xPAkdnbjrmpG+tGsqcMPl EmgMn3sFwOc0BMqiGHt/wFuRT2DzC/RWT5OsKL9S+HkUeq1DTCiazsVWgm+NFoCZAGgN VL98vlVj9jyJ32CfxNOa9WxO43zjU0mWyKaFEpSm1hhU4a1Rje4aLCA4+TIe6BtA/x6V IOtVuHnlgmNSdd3dXe8rEXJAOmSsVvCveIFNHd9J0P692EbuhukRr8P/R8IpqID+qijz IfAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ujwWbrimNp669KOEB8if5RkxRpiCrikk2Qz5VOA/j6M=; b=BPfj4xchlRxGlw4t760GmUr4dfklihj0rO5yXqcPN3FmzavfB0Pc66+SQ23/whM6Fg Yj/FTsTnRpOXPgGKkVYqMBry3VNE2IF7zU4h16C0G7R/dAQeBEKj/y7O6YPCXy73WvUV McK7g33K1zWq0SChqxXMhsjJIE0aragBrNHYhb3YtPJVn1P1eb/rCdsZgx5sqNDjZOWA AMnTRFh542N5EA0coOsct8EzJCSkgk7wU+JChFaCetMFHPpw+AOfsj/BGQOgoZ86wbEd ewaq2nxu9gtnfk6dg1YQXUPiwF5CHSMrj7RYxaKjEiiesjmnGxTHLKriz+bhwKQfSqkR Bn8g== X-Gm-Message-State: ABuFfoiQdVWgYJMEBN/83FIlDhIupR7OELJDLRcCyaB/D7eZHF52MM1h NBFwUYgA21NK76M0myb8M+TjBAuHCpOzUB1jqQqs0Q== X-Received: by 2002:a17:902:109:: with SMTP id 9-v6mr6664670plb.320.1539364503709; Fri, 12 Oct 2018 10:15:03 -0700 (PDT) MIME-Version: 1.0 References: <1539274203.2623.56.camel@linux.vnet.ibm.com> <20181011203126.15338-1-ndesaulniers@google.com> <1539356751.2656.5.camel@linux.ibm.com> <1539357759.2656.7.camel@linux.ibm.com> <16de2bb3-815a-f534-4618-af854c906017@gmail.com> <1539359181.2656.13.camel@linux.ibm.com> <1539360075.2656.18.camel@linux.ibm.com> In-Reply-To: <1539360075.2656.18.camel@linux.ibm.com> From: Nick Desaulniers Date: Fri, 12 Oct 2018 10:14:52 -0700 Message-ID: Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning To: jejb@linux.ibm.com Cc: denkenz@gmail.com, dhowells@redhat.com, Nathan Chancellor , Eric Biggers , zohar@linux.vnet.ibm.com, jmorris@namei.org, serge@hallyn.com, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 9:01 AM James Bottomley wrote: > > On Fri, 2018-10-12 at 10:53 -0500, Denis Kenzior wrote: > > Hi James, > > > > > > From the links provided in the patch it seems that one cannot > > > > pass char/float/short to va_start(). Fair enough. So if we make > > > > h3 an unsigned int, the issue goes away, no? > > > > > > For the current version of clang, yes. However, if we're fixing > > > this for good a char * pointer is the only guaranteed thing because > > > it mirrors current use in printf. > > > > > > > All right. I guess I wasn't aware that non-printf like variadic > > functions are now considered harmful or of the impending crusade > > against them :) > > It's not, it's just a maintainer issue: The original problem is because > we coded for gcc specifically; it doesn't complain and does the right > thing, so everyone was happy. Now Clang comes along and is unhappy > with this, so the question a good maintainer should ask is "how do I > fix this so it never comes back again?", not "what's the easiest > bandaid to get both Clang and gcc to work?" because the latter is how > we got here in the first place. Clang is simply pointing out that this is explicitly undefined behavior by the C90 spec. As such, not only may the implementation be different between compilers, but it is free to change between versions of the same compiler (I haven't witnessed such a case yet in my limited career, but I would never say never when it comes to relying on undefined behavior). > > James > > > But in the context of this patch, can we please use something less > > invasive than changing all the arguments around? Promoting h3 to a > > bool (if possible) or int/unsigned int would get my vote. > > > > Regards, > > -Denis > > > -- Thanks, ~Nick Desaulniers