From patchwork Wed Dec 26 14:54:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Roberts X-Patchwork-Id: 10743185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70CA51399 for ; Wed, 26 Dec 2018 14:54:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E424284D4 for ; Wed, 26 Dec 2018 14:54:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FF3B285A8; Wed, 26 Dec 2018 14:54:51 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8536284D4 for ; Wed, 26 Dec 2018 14:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbeLZOyk (ORCPT ); Wed, 26 Dec 2018 09:54:40 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42112 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeLZOyk (ORCPT ); Wed, 26 Dec 2018 09:54:40 -0500 Received: by mail-pl1-f195.google.com with SMTP id y1so7613597plp.9 for ; Wed, 26 Dec 2018 06:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xdSOQYTilgeq+j6a1W5blPb0T5vwCBaMapoI57QPMKM=; b=dkFrLMDdDAg7CVwDGqDfekojq/MdgzPbpqZFNQopzu57pgOaC8NPNtA/FQ408UwBSF hGx6exyCZWISTqZziPCzYaBpws01WXfJGqK7i43VWnWBvX5YZnAhhQWx06sLHaaSh1Ty rFBueg70jLnTLBXerrs3qNkBzOEuwBBP83R/z1Q0yUehSnWwQZ9lpsA1yz42hlUMUXEa b4CQatGtR4o1KIIbq2faFq0jZx05KB+3Wk3rYZVltYyhlt85hy5W9SMTZEEGlDXW+G0K YSM9BxMiejK+4hJukiKKC+qzur0dNvFK3uDHWuwfRRBJtZzbYWFvtq4kkWdXnXjWIY0L fWgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xdSOQYTilgeq+j6a1W5blPb0T5vwCBaMapoI57QPMKM=; b=S05LoZmv/9H3TIQ/hQ/IAD0xxo9xXITYCFbnfPGiAu/9S0Q1qzYpAIavkEYmwVg4Ng PVSlcfZ5KAdrmatR/L1WR6ZqUMkNjfpao2LzT1FBRoff1mFNe6h9YFSzf4Qc5ScLQlH8 cv0bs+7OmmIiz1s/yqZ29hhQi+4BLB2l8Y4aU7kyt2WUiTjn51HSbOzpOS0S/IL+q+s4 4mcPylgMEsEf+eG/tYpglVYhqf+WTt99G955cH+LCb7YBG1Ap6nZO+m6RyOpSlZ4RkNg 9vCfyS34KoHoPDC4hLdLCfddlsVXosA0kFkHj1vc+c6jR69m2AsT8hWi8GgGy7i99ft6 uGfQ== X-Gm-Message-State: AJcUukeQTDugmoLqkGDw+RrhevnpHSmEKcGJJGTBkjiDuluRPlSdcLAz Bd6q5j7Noyz9s3nYWUjlRD7EECHQ X-Google-Smtp-Source: ALg8bN4sOHniO//4iDAwe0J0xoGasidz1vKbXDbrAwB44d7jmZ9z+5/aaNRXpyMG8s03jg2JXkaB5w== X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr19941162plb.238.1545836078812; Wed, 26 Dec 2018 06:54:38 -0800 (PST) Received: from wcrobert-MOBL1.amr.corp.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id 125sm45110583pfg.39.2018.12.26.06.54.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Dec 2018 06:54:37 -0800 (PST) From: bill.c.roberts@gmail.com X-Google-Original-From: william.c.roberts@intel.com To: selinux@vger.kernel.org Cc: sds@tycho.nsa.gov, William Roberts Subject: [V2 PATCH 1/3] Makefile: fix _FORTIFY_SOURCE redefined build error Date: Wed, 26 Dec 2018 06:54:26 -0800 Message-Id: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 2.7.4 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: William Roberts Certain builds of gcc enable _FORTIFY_SOURCE which results in the error: :0:0: warning: "_FORTIFY_SOURCE" redefined :0:0: note: this is the location of the previous definition Correct this by undefining it first and redefining it. Also, the previous command line option was using -Wp which is passing the value *AS IS* to the pre-processor rather than to the compiler driver. The C pre-processor has an undocumented interface subject to change per man 1 gcc. Just use the -D option to specify this value. Signed-off-by: William Roberts Acked-by: Jason Zaman --- libselinux/src/Makefile | 2 +- libselinux/utils/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 977b5c8cfcca..6263d11393e6 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -64,7 +64,7 @@ ifeq ($(COMPILER), gcc) EXTRA_CFLAGS = -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \ -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \ - -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wp,-D_FORTIFY_SOURCE + -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE else EXTRA_CFLAGS = -Wunused-command-line-argument endif diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index d06ffd66893b..890ff36f3bbc 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile @@ -30,7 +30,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \ -Woverflow -Wpointer-to-int-cast -Wpragmas \ -Wno-missing-field-initializers -Wno-sign-compare \ - -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -Wp,-D_FORTIFY_SOURCE \ + -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE \ -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \ -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \ -Werror -Wno-aggregate-return -Wno-redundant-decls \ From patchwork Wed Dec 26 14:54:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Roberts X-Patchwork-Id: 10743181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A78336C2 for ; Wed, 26 Dec 2018 14:54:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9371228599 for ; Wed, 26 Dec 2018 14:54:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86E8B285E1; Wed, 26 Dec 2018 14:54:43 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D6F028599 for ; Wed, 26 Dec 2018 14:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbeLZOym (ORCPT ); Wed, 26 Dec 2018 09:54:42 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46619 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeLZOym (ORCPT ); Wed, 26 Dec 2018 09:54:42 -0500 Received: by mail-pg1-f196.google.com with SMTP id w7so7635623pgp.13 for ; Wed, 26 Dec 2018 06:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rsWmmcHo9Fq+rgmwGo0dVrXm+j/6Vle5tFvSFkQruyg=; b=n0tn7AFw0X0FAorGaRo7feztouqQNHZt3PuDEF09T4uxSlGAVfwnTDqkK3euNoa23Q 8mK07TflP50f8U2aGdRqgMhRYd3kCBMDi2B67BQzCOHJ+7l9MU77/psVwLGkm24FMu/n 36teEFk4YYEv0iUHSzZdQBdeKyPWfZEeZByGK5yNUTl5UsLyTeGZAQWbt1DEeOHcGKtQ cnw5Lq0UYhLMYHESwqepw33GLxLutCUou3nw3thro/XArqekPD1v657eyPUO8g5U85S/ csWjziXP5lFbCe9TuwqtOTPD6Y3Uqj/rEX6JKOV17ck4zmc2Hyld152ZumZOec3IBiw/ QF1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rsWmmcHo9Fq+rgmwGo0dVrXm+j/6Vle5tFvSFkQruyg=; b=rl5L+QTK0ePWowC6YjL+kEr3kysfTwsTj8bC5OdIQSqDyI6RFrZqMcs18UnHzXbKDt iIsBTRkf5ZR3OOkj4RVG38V6JrnQsZVsQm8fykyx1OA9vIMciWvHkAOyko+94mgO2eqL OEYxpWbeYhGSwOL5TEbdkXGZTgrOu7NSPefCRvz/XwViccChGFjzM7i3fm1Xjgh4FZCn 5Ph+WRKsgO/eC6nodgqAhEHdHjqsctMSV1/wMhThsLJY6lir4FoNrdaM/xJMVXR2d9Dx rkHApMETSBGFQotgTILPUAa3ihO2eSFyQp8OXEb2CPB+JKYeHlj9G9OvVMgF74/SN4RL eqOg== X-Gm-Message-State: AA+aEWYXd0e3RFR9DpzI9EAJ2S7+9J+u0FIdRCIbHN2WBVJIgzrGLRBn TZuq1XHYiWX/p7le2jbuNeT0jzUM X-Google-Smtp-Source: AFSGD/X9RFMDlHy5sFtmQy4ZX++ieGnMDpRldG5hGsTXMS6XyYjpMo4dbosPDGc4QhzVaYv8OGiP5g== X-Received: by 2002:a62:b24a:: with SMTP id x71mr20900648pfe.148.1545836080716; Wed, 26 Dec 2018 06:54:40 -0800 (PST) Received: from wcrobert-MOBL1.amr.corp.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id 125sm45110583pfg.39.2018.12.26.06.54.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Dec 2018 06:54:40 -0800 (PST) From: bill.c.roberts@gmail.com X-Google-Original-From: william.c.roberts@intel.com To: selinux@vger.kernel.org Cc: sds@tycho.nsa.gov, William Roberts Subject: [V2 PATCH 2/3] build: set _FORTIFY_SOURCE=2 in libselinux Date: Wed, 26 Dec 2018 06:54:27 -0800 Message-Id: <1545836068-7824-2-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> References: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: William Roberts Use -D_FO0RTIFY_SOURCE=2 when building libselinux and it's util library. Note that this can be overridden by setting CFLAGS during the build. Signed-off-by: William Roberts --- libselinux/src/Makefile | 2 +- libselinux/utils/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 6263d11393e6..1a9223c0027d 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -64,7 +64,7 @@ ifeq ($(COMPILER), gcc) EXTRA_CFLAGS = -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \ -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \ - -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE + -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 else EXTRA_CFLAGS = -Wunused-command-line-argument endif diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index 890ff36f3bbc..e7a75121f049 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile @@ -30,7 +30,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \ -Woverflow -Wpointer-to-int-cast -Wpragmas \ -Wno-missing-field-initializers -Wno-sign-compare \ - -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE \ + -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \ -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \ -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \ -Werror -Wno-aggregate-return -Wno-redundant-decls \ From patchwork Wed Dec 26 14:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Roberts X-Patchwork-Id: 10743183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C4891399 for ; Wed, 26 Dec 2018 14:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5918328599 for ; Wed, 26 Dec 2018 14:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D3F1285E1; Wed, 26 Dec 2018 14:54:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA9B628599 for ; Wed, 26 Dec 2018 14:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbeLZOyn (ORCPT ); Wed, 26 Dec 2018 09:54:43 -0500 Received: from mail-pl1-f177.google.com ([209.85.214.177]:37353 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeLZOyn (ORCPT ); Wed, 26 Dec 2018 09:54:43 -0500 Received: by mail-pl1-f177.google.com with SMTP id b5so7631461plr.4 for ; Wed, 26 Dec 2018 06:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CRT+gmnzz8170KIqVT+admga/R3uP0x76KWDbSknrQw=; b=J6+Db4X+l6URRNx3+Cr34O0zpvfsj1M0VTbcwVS3zX5lrlXeg07DB9GdF6J5TFp9aE fWRwLm/Mw73CNeeE7q3LPgIrh+tl2Ny4Cq2DyG0SCLRnPo2w6Gf3EcUE45m2JY+iw740 PBhtccW1tUPAM+gmGzFQcD2L2JBcfRqvYhNdWjn+V5gOcQix/Wmp/dYa0yGKgTYskxM6 Tf97//+/tR4M0px2tEag1CSbbBQv74jfH9YNNVNmSxHJqmxEBn9jJIIZ1DKUFfGC1KcI yjYWEzL+nzFEM45sEuGVHTc+pVRxgNVSkW8ELaCqUt0YLlcdFR2fbjNZLq4ZE8Z2kza2 TJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CRT+gmnzz8170KIqVT+admga/R3uP0x76KWDbSknrQw=; b=SYWf92+PqMXkB4vynqrhDB/PtzGD02bYvM+8uYEw9Lv3dgeP1FdGtDXWOPTrPAr4Jw Clt20AjgrbCNjgKBKa7M0o3YlQiCy4MmNFJMxoK33f+au0zB8fPJcDSGMB5vdDFZaag6 8SINl4K3806OAXLY+w16o1Ka6DMM7wWmxG1/HoVtH60uEXhr6K6JydXI2Wm9ldFQY+Yu 1nC5t0HLb+cMrTo+B+vNbigufydu9tuNuYJXhadDj7Xkvyc7572nEzR0L3jYuOEZXxjz SBodK27c0lbHk/fRSymOuztbcxBMnqcfjDqmU8Ti3ZP+nG/9VplwVkmqPMXNQssjQ9mv MPxQ== X-Gm-Message-State: AJcUukcaV2PkpsUPEWhzpsKNa8aLWK9dVlJtP0gVaZmBFVVDbb3r853z bBKAvweaaJa1Iwgr5QwRcV1P7IJq X-Google-Smtp-Source: ALg8bN51LveVM60xBjKxMhLM3gERhm5cmpVVbKra5m9fiF259Zqdom6JGDiMZvHdW4E8eZVM8foTtQ== X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr19153429plq.278.1545836082268; Wed, 26 Dec 2018 06:54:42 -0800 (PST) Received: from wcrobert-MOBL1.amr.corp.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id 125sm45110583pfg.39.2018.12.26.06.54.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Dec 2018 06:54:41 -0800 (PST) From: bill.c.roberts@gmail.com X-Google-Original-From: william.c.roberts@intel.com To: selinux@vger.kernel.org Cc: sds@tycho.nsa.gov, William Roberts Subject: [V2 PATCH 3/3] Makefile: add -Wstrict-overflow=5 to CFLAGS Date: Wed, 26 Dec 2018 06:54:28 -0800 Message-Id: <1545836068-7824-3-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> References: <1545836068-7824-1-git-send-email-william.c.roberts@intel.com> Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: William Roberts Build with strict overflow checking enabled. If the compiler optimizes code that could be removed due to undefined signed overflow, then the compiler will issue a warning. Signed-off-by: William Roberts --- libselinux/src/Makefile | 3 ++- libselinux/utils/Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 1a9223c0027d..8891086e4af6 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -64,7 +64,8 @@ ifeq ($(COMPILER), gcc) EXTRA_CFLAGS = -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \ -Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \ - -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 + -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \ + -Wstrict-overflow=5 else EXTRA_CFLAGS = -Wunused-command-line-argument endif diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index e7a75121f049..361506384d08 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile @@ -33,7 +33,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi -Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \ -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \ -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time \ - -Werror -Wno-aggregate-return -Wno-redundant-decls \ + -Werror -Wno-aggregate-return -Wno-redundant-decls -Wstrict-overflow=5 \ $(EXTRA_CFLAGS) LD_SONAME_FLAGS=-soname,$(LIBSO),-z,defs,-z,relro