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