Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp318699ima; Wed, 24 Oct 2018 01:37:45 -0700 (PDT) X-Google-Smtp-Source: AJdET5fcdqwZSHulvabfjZUBRwSagjxU/Hqm+CXqFgdpSyUFl4ophouiz9P4yVgqvWXbxXTw1/iI X-Received: by 2002:a63:5c22:: with SMTP id q34-v6mr1651900pgb.417.1540370264944; Wed, 24 Oct 2018 01:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540370264; cv=none; d=google.com; s=arc-20160816; b=f9UFh4jJ10P8stkxf608INFXkxXxE0YaOcr6cRpvvuXMJsD/9ajsYJhlaVKUYWSire fvKTpcriQFFgrXqjpAjeX1X7Nop3Ku0urkg3VGA6lK8mzOjeD11tyuzFBb50jMrfK6c8 uZPUoBML16lRD94thWCHOnl/rztnYCvHSN8sFByCu0lR5Wmd+45Q88ChdL7AZLrdO18F fhQi0sXs+WFJkkqEvOlQssqhyc79MJJRYkCwLFRgAY6ubKjX4K/TOZQMPMY6AnfaWeI6 Zjx7YkvtYKpgy0J5gAE6WFbsPSQOL1FxjJdGV73sg/sPmfqRy8VKLzjnsuows2MRquvg RUWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=nlNQ73u+lyVkvd9H7t2lc/Of0bonAWE/8F1XOos6J9c=; b=EHsoPK9Qrr/u08r9x99qJ52c34KpG+zMi+00TPEcq2Eft0XaDkCn166XikZQD7I8dY deQ78f0r6D68XPezAxZxtgh+m7qxiQBcOhtF4JifIm+7VSNA3tihvFHZRIopuprcLPd2 VVMbveqf4mKqMlq9Kw5ZdNu62zXLNSoh7hV1ByztSXW/Z8gvgx26lAIIsfc57uO/0b4r FQsIoy5SAZHqgvw9GlH83MJTSKIFsMPeM4eMXsJEPDkTKnmLWNCFX2Tjov5BeIKHFBxp f1/28ycjjs1VBR8Q0/VrWz10B9wbHK5vxJSpn3fytO2kC19K3lwaob+HmPhh5vAFlOsD zk9Q== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8-v6si4100023pge.545.2018.10.24.01.37.29; Wed, 24 Oct 2018 01:37:44 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbeJXRES (ORCPT + 99 others); Wed, 24 Oct 2018 13:04:18 -0400 Received: from mga14.intel.com ([192.55.52.115]:3922 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726732AbeJXRES (ORCPT ); Wed, 24 Oct 2018 13:04:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 01:37:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,419,1534834800"; d="scan'208";a="102185655" Received: from sakethyx-mobl2.gar.corp.intel.com ([10.249.254.29]) by orsmga001.jf.intel.com with ESMTP; 24 Oct 2018 01:37:00 -0700 Date: Wed, 24 Oct 2018 11:36:57 +0300 (EEST) From: Jarkko Sakkinen X-X-Sender: jsakkine@jsakkine-mobl1 To: Nick Desaulniers cc: dhowells@redhat.com, jejb@linux.vnet.ibm.com, natechancellor@gmail.com, David.Laight@aculab.com, denkenz@gmail.com, Jarkko Sakkinen , Mimi Zohar , James Morris , "Serge E. Hallyn" , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v2] [PATCH] KEYS: trusted: fix -Wvarags warning In-Reply-To: <20181022234357.82217-1-ndesaulniers@google.com> Message-ID: References: <0147a993d4a94426afa469a8dcc4e5d7@AcuMS.aculab.com> <20181022234357.82217-1-ndesaulniers@google.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Oct 2018, ndesaulniers@google.com wrote: > Fixes the warning reported by Clang: > security/keys/trusted.c:146:17: warning: passing an object that > undergoes default > argument promotion to 'va_start' has undefined behavior [-Wvarargs] > va_start(argp, h3); > ^ > security/keys/trusted.c:126:37: note: parameter of type 'unsigned > char' is declared here > unsigned char *h2, unsigned char h3, ...) > ^ > Specifically, it seems that both the C90 (4.8.1.1) and C11 (7.16.1.4) > standards explicitly call this out as undefined behavior: > > The parameter parmN is the identifier of the rightmost parameter in > the variable parameter list in the function definition (the one just > before the ...). If the parameter parmN is declared with ... or with a > type that is not compatible with the type that results after > application of the default argument promotions, the behavior is > undefined. > > Link: https://github.com/ClangBuiltLinux/linux/issues/41 > Link: https://www.eskimo.com/~scs/cclass/int/sx11c.html > Suggested-by: David Laight > Suggested-by: Denis Kenzior > Suggested-by: James Bottomley > Suggested-by: Nathan Chancellor > Signed-off-by: Nick Desaulniers Reviewed-by: Jarkko Sakkinen /Jarkko