Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1095894imm; Fri, 12 Oct 2018 11:40:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV61eCzXqOiJp8IRiCMM4eSl2FCnHJVIJbbpSj5+aWWxnracloKlEAlo4dUevAdMKcktfXoVP X-Received: by 2002:a17:902:ea:: with SMTP id a97-v6mr6981673pla.164.1539369638481; Fri, 12 Oct 2018 11:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539369638; cv=none; d=google.com; s=arc-20160816; b=Oz7T78vRU3lB07gSWImsF/zGVHhpmH75hzVkxvBFq9UwUaucb/uBVA7skcyelyzCSt +FdlZ+Q7HB4wvKpmztL9/jWHV5FITlq6kfk494uC9B8e/4OuB4Rk7zXcjts02IEe3vCQ CC4HMd9CgER24Kckfey87rEOSOeoC71s5AOmJo8NksOI9698j2345qusFskRzmt5M9+k GkNc5CEjyHmjRQ8bZv/74SFBR46wqWOUOJXIDRrv0Nq4Zt6bCPcvH0kNEnIW/KPv2JJU Q/GnJtLajj09z0c8Bw16y6PUl32m7x+/7MKcQ7UucGJoPwt5Rzm8+5teGe7iGVMDZ1q1 Mc5Q== 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=9lK1p+yKCg807ip8R1qJBOm8Q080zyC38JR2CGpeqQw=; b=hxNzE1Io23ldbL6ZeoLSXT43NmPb3V2HTd0Eu/qkeJDIXgWcnfZy9B2/G8UXffASJv qlx0GKy3MMk53Eez6pKD1ksCycYP1sa4kzyX/mz+N/s9HM9Qg6GhBawpQD1ai+MxL0YY VVXS4D/kZsNtR8iMCOmomTjHZKYKbXNHze9QKbR2ONCt3ZLqA8MZq0nlr84IGor9fBZn drICCU7+jhLqn2G5L3XqJQyJcaDM83Y2juhn//+yAVwPq2YWybtIOIzcuyXx7W5N1m16 P87t/JGAEUZXtAVlAkchZvqdaq4fHSc+vsHH9r3/QKn/yVWVDz6/A8dSrSly6r1EoIBY VjbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RdUbXrOO; 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 d131-v6si2033736pga.37.2018.10.12.11.40.21; Fri, 12 Oct 2018 11:40:38 -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=RdUbXrOO; 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 S1726727AbeJMCNu (ORCPT + 99 others); Fri, 12 Oct 2018 22:13:50 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37085 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbeJMCNt (ORCPT ); Fri, 12 Oct 2018 22:13:49 -0400 Received: by mail-pg1-f194.google.com with SMTP id c10-v6so6238516pgq.4 for ; Fri, 12 Oct 2018 11:39:59 -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=9lK1p+yKCg807ip8R1qJBOm8Q080zyC38JR2CGpeqQw=; b=RdUbXrOOFiufwf5+6cWV+QGczne5bL1DWXSfXGMK8Bnjp5qJmp44NLNbNsXzDrYvY5 mytnD+v6dKP6IO/jTkWZD2nIGVrGhRi0gTQ2HWFrjVO62CqN7LNW5Ck46HkIzYb/nrM1 xlVnpbvYPkVr0I3CkElGR9OkV7iM8E7QgYMsQvqyttGERgKOPaUJ7kg3xTCX8cCtA20S yaxMfvczTxLnj8JoPb3nZHPYq75OmOkHEkSAKdRkiPjNbmMKssB2JhaA5bUKzX4R6e/U /OFuNorwSbWF51B8VsaHJZY4q2CeRc89tZePXbp3YBWA1pBQxzVA6jV2rfeiXyom7MEv 0aPw== 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=9lK1p+yKCg807ip8R1qJBOm8Q080zyC38JR2CGpeqQw=; b=jWUyRdm0fJQjrvsDOK7nz4ATC79ysciYexL3EQRJLQ+3kxDEemskTlUvz4PFMMhlmz rrzvj+8bggVN6eDbs0kWBKX6cdD6wca/wZeHvtGYZRNRDM7mjO4fmO6ADpq8iXiZMlg6 oaovPBA+UBhpI4+eSaBhujC6R3uBFvWurEP2SpP2OhDzg3pZex3HFtKwO8rGadhxBh+O 7/Yf4RoEPz/RK55l1AuV5DHnuWQRTouXouKNqeD5SDb7JZZV25fAyEGfSVaVBLDwtFwA nalkKgceYp2k08Qa3+oqozhwCW3Cv6YsF+HzZ0c02QK5m897ZDKabEbBq/0SKWljONJs dUoQ== X-Gm-Message-State: ABuFfoiiOShS0ALXxrr8Gza0RitzdbmMULvU7hkOmDqc1MSIMWIgxbWg 4hxrZiGkkXiJGtJpcI+0HmtcvtSYWlieM48nMXfeZQ== X-Received: by 2002:a63:a047:: with SMTP id u7-v6mr6591478pgn.145.1539369599299; Fri, 12 Oct 2018 11:39:59 -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> <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com> In-Reply-To: <80837c90-0425-aadd-38d7-c3c866d29a0a@gmail.com> From: Nick Desaulniers Date: Fri, 12 Oct 2018 11:39:47 -0700 Message-ID: Subject: Re: [PATCH] KEYS: trusted: fix -Wvarags warning To: denkenz@gmail.com Cc: jejb@linux.ibm.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 10:27 AM Denis Kenzior wrote: > > Hi Nick, > > >> So maybe I'm misunderstanding something, but the issue seems to be that > >> unsigned char is promoted to 'unsigned char *' by Clang and probably > >> unsigned int or int by gcc. > > > > No. This is extremely well defined behavior in C. In C, integral > > types are NEVER promoted to pointer to integer types, only to larger > > integral types through rules more complicated than the correct flags > > to pass to `tar`. > > https://xkcd.com/1168/ > > > > Ah right. Thanks for the correction. So looks like bool won't work for > the same reasons. But unsigned int should work right? But then again > this is a boolean value and if we want to be paranoid we can simply > tweak the 'c = h3' assignment to be something like: > > c = !!h3; > > So in the end, I'm happy with int or unsigned int. Thanks for the feedback. I'll wait wait to see if James is also cool with that approach, and if so, send a v2 based on the next-keys branch in the security tree as per Nathan, with yours and his Suggested-by tags. -- Thanks, ~Nick Desaulniers