Message ID | 20161206012627.10415-3-xose.vazquez@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | christophe varoqui |
Headers | show
Return-Path: <dm-devel-bounces@redhat.com> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E02E6071F for <patchwork-dm-devel@patchwork.kernel.org>; Tue, 6 Dec 2016 01:28:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E8FA2831B for <patchwork-dm-devel@patchwork.kernel.org>; Tue, 6 Dec 2016 01:28:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6BD72832C; Tue, 6 Dec 2016 01:28:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C4E62831B for <patchwork-dm-devel@patchwork.kernel.org>; Tue, 6 Dec 2016 01:28:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB61QiIe018707; Mon, 5 Dec 2016 20:26:44 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uB61QgFo031156 for <dm-devel@listman.util.phx.redhat.com>; Mon, 5 Dec 2016 20:26:42 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB61QgA9020755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <dm-devel@redhat.com>; Mon, 5 Dec 2016 20:26:42 -0500 Received: from mail-wj0-f196.google.com (mail-wj0-f196.google.com [209.85.210.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECD84445D6 for <dm-devel@redhat.com>; Tue, 6 Dec 2016 01:26:40 +0000 (UTC) Received: by mail-wj0-f196.google.com with SMTP id kp2so41669981wjc.0 for <dm-devel@redhat.com>; Mon, 05 Dec 2016 17:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0/DfeOxgjcDRx8yVgHVbD9+zLfi/1233ncZ7wdRuj9Q=; b=tP4y9q9lzfdSYUR+zq0dgaKjghbOOOTZRBFB6ns9UH51S6LuKSwR757OnkEbx985D7 fBCnHgpNaHU0rNIKfTeBx2P9JfbYINxHhZZ+56D5OXaIsiwvdpqrGF/hvfn1rgWPGlVC wqSAdV0+GVEpECmlniUJqeBvRCbbcaU9MRCicoG5dcEtXd/cryJMFV/BzHAVs3/hyQMO d9lgAFcWIbD0ueRrDkoFm8xEbTLGyrOgBaot84/lFipeoAZmjqwnJq8xO0EHGZjlH4kI gM9TxV64ufTIzBMbuJx6ot1kAtvSPtLIuVRMgNHi15bbaa+41RRsMAGuXb85OOaK3p8D tDWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0/DfeOxgjcDRx8yVgHVbD9+zLfi/1233ncZ7wdRuj9Q=; b=dBL7UzjMnLcaubO3rDbRyqHfsbVCdcf0yMj/b77Qk9ARgxD2N6iGUMQahUqkQJiakU 5UC2vln0NpQz/W1tkCEWVyDOFty2bV7l8Xy27YTUJolrE5+OXSvKzT5xriEyDX8a8BOe 9WPTN4km7CGOO2Eylai5bCqpJ5sGjjxdiYGpHL+OTOJsNf1Qt/VsPsH1wugUyFgDqcTe Xe/OyBiBiIeX+2IVZewYqOCpxiDLH9c2a3d9X+6VJG5q+PUrSElDHim6RHs/cXxzDPxQ aHhH2FzldV/GEZtXydEbbhxvyE9GbbDh80jBWc5H46S2DlDKIfVJhPosBKd8jQJT2ZKZ nyRQ== X-Gm-Message-State: AKaTC00jyJJrLTfFVLaWk9SeffmnePgfFvuSey/t1u4KIHlTcuAn1JBjQGNcmS+ca6E8Bg== X-Received: by 10.194.22.170 with SMTP id e10mr49962837wjf.125.1480987599610; Mon, 05 Dec 2016 17:26:39 -0800 (PST) Received: from localhost (232.196.218.87.dynamic.jazztel.es. [87.218.196.232]) by smtp.gmail.com with ESMTPSA id f134sm1279472wmf.19.2016.12.05.17.26.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Dec 2016 17:26:38 -0800 (PST) From: Xose Vazquez Perez <xose.vazquez@gmail.com> To: Date: Tue, 6 Dec 2016 02:26:27 +0100 Message-Id: <20161206012627.10415-3-xose.vazquez@gmail.com> In-Reply-To: <20161206012627.10415-1-xose.vazquez@gmail.com> References: <20161206012627.10415-1-xose.vazquez@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Dec 2016 01:26:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Dec 2016 01:26:41 +0000 (UTC) for IP:'209.85.210.196' DOMAIN:'mail-wj0-f196.google.com' HELO:'mail-wj0-f196.google.com' FROM:'xose.vazquez@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.210.196 mail-wj0-f196.google.com 209.85.210.196 mail-wj0-f196.google.com <xose.vazquez@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: dm-devel@redhat.com Cc: device-mapper development <dm-devel@redhat.com>, Xose Vazquez Perez <xose.vazquez@gmail.com> Subject: [dm-devel] [PATCH 2/2] multipath-tools: Add -Werror compilation flags X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development <dm-devel.redhat.com> List-Unsubscribe: <https://www.redhat.com/mailman/options/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=unsubscribe> List-Archive: <https://www.redhat.com/archives/dm-devel> List-Post: <mailto:dm-devel@redhat.com> List-Help: <mailto:dm-devel-request@redhat.com?subject=help> List-Subscribe: <https://www.redhat.com/mailman/listinfo/dm-devel>, <mailto:dm-devel-request@redhat.com?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/Makefile.inc b/Makefile.inc index fa3c595..8f8e53e 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -61,7 +61,8 @@ RM = rm -f LN = ln -sf INSTALL_PROGRAM = install -OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 \ +OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ + -Werror=implicit-function-declaration -Werror=format-security \ -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong \ --param=ssp-buffer-size=4
Add -Werror=format-security: GCC will refuse to compile code that could be vulnerable to a string format security flaw. At present, this warns about calls to "printf" and "scanf" from untrusted input and contains %n. Add -Werror=implicit-function-declaration: Implicit function declarations allows a programmer to call functions without declaring them (or including the relevant header files). The official C language specification has not supported implicit function declarations for almost two decades now. GCC still supports them as a GNU extension. Implicit function declarations introduce bugs because these functions use a different calling convention and have a fixed return type of int. Resulting issues are pointer truncation (on 64-bit architectures), exposure of padding bits (particular for bool-returning functions on x86_64), and unexpected lack of hardening. Implicit function declarations are not part of C++ (with or without GNU extensions), and adjusting C code accordingly simplifies reuse in C++ projects. Add -Werror=implicit-int: Implicit ints were removed from the C programming language at the same time as implicit function definitions, and were also retained as a GNU extension. Implicit ints are usually source code bugs, and the presence of such code may interfere with future C language directions (for example, consider how C++ reused the auto keyword and an omitted type specifier). These flags are used by default in Fedora. More info: https://fedoraproject.org/wiki/Changes/FormatSecurity https://fedoraproject.org/wiki/Format-Security-FAQ https://fedoraproject.org/wiki/Changes/Fedora26CFlags Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> Cc: device-mapper development <dm-devel@redhat.com> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> --- Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)