From patchwork Thu Aug 3 16:23:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 13340291 X-Patchwork-Delegate: plautrba@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24993C04A6A for ; Thu, 3 Aug 2023 16:23:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236041AbjHCQXe (ORCPT ); Thu, 3 Aug 2023 12:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236414AbjHCQXd (ORCPT ); Thu, 3 Aug 2023 12:23:33 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B8AD30D5 for ; Thu, 3 Aug 2023 09:23:32 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so1461677a12.1 for ; Thu, 03 Aug 2023 09:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1691079810; x=1691684610; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2T+4o5IqM1ckjv1vB6Hj+yuZO8zxIn1UbsF72lQnCa4=; b=NJ3r4C8epSqMA5Y0ij5563ebDDj4KB6wNygl28VMxB0J0Tdn8t4vQZLwE+z0qsy6qn iah71iHYLKJxeVvz3eZsecDSiTYlKQe8XL6fXLB4re3Vg/5E8Latqf7zPmkhkzHZc4Jg 1QcH1aQfhOGCQjF4lIBW4j88TJOvpReVXA+rrEwvhQX/W1SkDpPrVEzfAH1vhSwF+s7Q g+maoCk3G+VeKdHOFx28v03fTjdnsLKaURPDI/aFRcFt5ATPYZX+NY6um5NFplu31lTQ BLtPwATfrjxi0kst5A5Votxo6ZLdKVt4LOoxDKHuVIzrbKz33A37LYow7uG13Zp8czNY M+Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691079810; x=1691684610; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2T+4o5IqM1ckjv1vB6Hj+yuZO8zxIn1UbsF72lQnCa4=; b=P2ullN7OQqER9neVgEmiNhSQWO77ZZl3/StnvA2qcqh8510TSXBAgh+pP7ZaQn7ZlE 26obAxvstyYAIbtUZGXq0/pGTSSI80UMxlEr1S+O+aEIksT9DCfywnY2fWAstu7pj3P7 fEeUDm5igRhmxfzVIYMfHbImw2DMmMjl+hOXthogi9iETwM5CvHiYG4eV+ptSXXtsFkw 1ck5vUszaqcQqoB0GURkVKIrmJ8FJpHQs7qalSC8IXAXGQdxeEfsuroBQyRHETdu1QjX Qr7rC33XbXXD2BovZz+ZZM9bqW5YrfEJDTBl4dJRjAyfo6T+UWHCnF8AHKzuIOOphs7k LAlw== X-Gm-Message-State: ABy/qLYUfamXEA9PrO1TnvDhZ6MPQFzvNm7yEQjQqi/I0XC7UUsMUIsD wB2RXWBufYIlQ49qnkPNQ12SNsKbk1fpjsSz/hk= X-Google-Smtp-Source: APBJJlFDzd8R2gki70N43uEEzdKhYQ30Z8NZukVUeJRULzGEArkeb25EnsmMVKTtzs6RaPFEqdNFTA== X-Received: by 2002:aa7:c994:0:b0:522:2d1b:5a38 with SMTP id c20-20020aa7c994000000b005222d1b5a38mr8074960edt.10.1691079810454; Thu, 03 Aug 2023 09:23:30 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-000-150-191.77.0.pool.telefonica.de. [77.0.150.191]) by smtp.gmail.com with ESMTPSA id u4-20020a05640207c400b0051d9ee1c9d3sm348edy.84.2023.08.03.09.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:23:30 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 1/4] libselinux/utils: update selabel_partial_match Date: Thu, 3 Aug 2023 18:23:23 +0200 Message-Id: <20230803162326.302824-1-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Print usage information and exit if required path option is not given or superfluous arguments are given. Constify read-only variables assigned command line arguments. Simplify bool evaluation. Signed-off-by: Christian Göttsche Acked-by: James Carter --- libselinux/utils/selabel_partial_match.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libselinux/utils/selabel_partial_match.c b/libselinux/utils/selabel_partial_match.c index 7bbd5777..0df2627a 100644 --- a/libselinux/utils/selabel_partial_match.c +++ b/libselinux/utils/selabel_partial_match.c @@ -28,7 +28,7 @@ int main(int argc, char **argv) { int opt; bool partial_match; - char *validate = NULL, *path = NULL, *file = NULL; + const char *validate = NULL, *path = NULL, *file = NULL; struct selabel_handle *hnd; struct selinux_opt selabel_option[] = { @@ -55,6 +55,9 @@ int main(int argc, char **argv) } } + if (!path || optind != argc) + usage(argv[0]); + selabel_option[0].value = file; selabel_option[1].value = validate; @@ -69,7 +72,7 @@ int main(int argc, char **argv) partial_match = selabel_partial_match(hnd, path); printf("Match or Partial match: %s\n", - partial_match == 1 ? "TRUE" : "FALSE"); + partial_match ? "TRUE" : "FALSE"); selabel_close(hnd); return partial_match; From patchwork Thu Aug 3 16:23:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 13340293 X-Patchwork-Delegate: plautrba@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51433C001DB for ; Thu, 3 Aug 2023 16:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236471AbjHCQXf (ORCPT ); Thu, 3 Aug 2023 12:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236444AbjHCQXe (ORCPT ); Thu, 3 Aug 2023 12:23:34 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E4330DB for ; Thu, 3 Aug 2023 09:23:32 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-522bd411679so1421926a12.0 for ; Thu, 03 Aug 2023 09:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1691079811; x=1691684611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ZBLHW0O+U7ltOxkiaFrPl4r80XrqUswnN0F1DvZlWLA=; b=mB8w1jQbaC8Q1WlNj/4u2wL8hOjcm1/8ypR5btJc19g9yJcVb+sKE8ql2bSToUL/zd yfwBhCex1rK0PF94R4zy2g9JVkXaJ7esMLlqCMc3mqQaylkXgDM2cTAdL6jaNWkkHAdo 8Hi65/ssUO68Pya9bZJCNDUHwhvI2W3hecsoY1rvxt8DwVsnqMORkpTAlDOcqjJBugp5 jOjsSkFmfTjnFHiALh/kv+TAmrdWquKPOuMwlbGbNpxz9I9etFaw176CYRWqGpIJWrO3 EuknuVFn8+dbSgXtAnkiZnKKeJwSoSGOAeo2+7t1OpB6QtcNSeihiyPEWnPlmPYf5AsM A2SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691079811; x=1691684611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZBLHW0O+U7ltOxkiaFrPl4r80XrqUswnN0F1DvZlWLA=; b=hvzTd2//HfCAfV89fEq16Y854P/YSrKpyezbk7qxjjC1ZIA7KY2J01nzOF72nJFlAY 2h9pXGYLrNq4UOlxRNlOikI35TzWWW32rmAemU+tlPXSDo+mX6NwhrIjSg3USbOyU2kz 61TGQQP8zGvVmX4Nsx/D6//wPJNU9tBUnDZ+ga2gGHFyvyKvVjpzfmfOZsmMKzTGXyo/ yrHCi28u9oJYybEKjTrB+dq1iyiJ8fFcoaghQtXu36mBOj0Q56q2YPl5kRdAzVQX+m+W 1TEVNIh4hHIw9CJK48qfgSB3xUQjmRgGZUND3gWpTI0L4jmQxd1cMTf8ggW8XFrFS1W6 QMaA== X-Gm-Message-State: ABy/qLaAGaXJRQz82PUkoNUB6IRXSco2L4mnyPE1rmLzPUAX//WL3eLb tJJt6vdJiO2csnA9rHPPuDxUwtD0uSIZ9stiN7Y= X-Google-Smtp-Source: APBJJlG7RWPPi3QFRApq/pCxEbT8RTUyN1XcvgB839p4/1HRkvONhFhsKItY216hKA6wVxAwupRvEQ== X-Received: by 2002:a05:6402:1b05:b0:522:3a89:a79d with SMTP id by5-20020a0564021b0500b005223a89a79dmr7726482edb.2.1691079810936; Thu, 03 Aug 2023 09:23:30 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-000-150-191.77.0.pool.telefonica.de. [77.0.150.191]) by smtp.gmail.com with ESMTPSA id u4-20020a05640207c400b0051d9ee1c9d3sm348edy.84.2023.08.03.09.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:23:30 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 2/4] libselinux: misc label cleanup Date: Thu, 3 Aug 2023 18:23:24 +0200 Message-Id: <20230803162326.302824-2-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230803162326.302824-1-cgzones@googlemail.com> References: <20230803162326.302824-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Drop unused parameter from selabel_is_digest_set(). It is only written to but writes to the function local copy of the pointer are void. Constify read-only handle parameter of selabel_validate() and compat_validate(). Constify read-only from-address parameter of digest_add_specfile(). Constify read-only function pointer array initfuncs. Merge malloc(3) and memset(3) calls into calloc(3). Simplify boolean assignment. Drop duplicate include file. Drop return at end of void function. Signed-off-by: Christian Göttsche --- libselinux/src/label.c | 17 +++++++---------- libselinux/src/label_internal.h | 6 +++--- libselinux/src/label_support.c | 4 +--- libselinux/src/matchpathcon.c | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/libselinux/src/label.c b/libselinux/src/label.c index 586e5e5e..a2efa99c 100644 --- a/libselinux/src/label.c +++ b/libselinux/src/label.c @@ -45,7 +45,7 @@ typedef int (*selabel_initfunc)(struct selabel_handle *rec, const struct selinux_opt *opts, unsigned nopts); -static selabel_initfunc initfuncs[] = { +static const selabel_initfunc initfuncs[] = { &selabel_file_init, CONFIG_MEDIA_BACKEND(selabel_media_init), CONFIG_X_BACKEND(selabel_x_init), @@ -56,8 +56,7 @@ static selabel_initfunc initfuncs[] = { static inline struct selabel_digest *selabel_is_digest_set (const struct selinux_opt *opts, - unsigned n, - struct selabel_digest *entry) + unsigned n) { struct selabel_digest *digest = NULL; @@ -77,8 +76,7 @@ static inline struct selabel_digest *selabel_is_digest_set if (!digest->specfile_list) goto err; - entry = digest; - return entry; + return digest; } } return NULL; @@ -121,7 +119,7 @@ static inline int selabel_is_validate_set(const struct selinux_opt *opts, return 0; } -int selabel_validate(struct selabel_handle *rec, +int selabel_validate(const struct selabel_handle *rec, struct selabel_lookup_rec *contexts) { int rc = 0; @@ -133,7 +131,7 @@ int selabel_validate(struct selabel_handle *rec, if (rc < 0) goto out; - contexts->validated = 1; + contexts->validated = true; out: return rc; } @@ -215,15 +213,14 @@ struct selabel_handle *selabel_open(unsigned int backend, goto out; } - rec = (struct selabel_handle *)malloc(sizeof(*rec)); + rec = (struct selabel_handle *)calloc(1, sizeof(*rec)); if (!rec) goto out; - memset(rec, 0, sizeof(*rec)); rec->backend = backend; rec->validating = selabel_is_validate_set(opts, nopts); - rec->digest = selabel_is_digest_set(opts, nopts, rec->digest); + rec->digest = selabel_is_digest_set(opts, nopts); if ((*initfuncs[backend])(rec, opts, nopts)) { if (rec->digest) diff --git a/libselinux/src/label_internal.h b/libselinux/src/label_internal.h index 782c6aa8..273a630a 100644 --- a/libselinux/src/label_internal.h +++ b/libselinux/src/label_internal.h @@ -63,7 +63,7 @@ struct selabel_digest { }; extern int digest_add_specfile(struct selabel_digest *digest, FILE *fp, - char *from_addr, + const char *from_addr, size_t buf_len, const char *path); extern void digest_gen_hash(struct selabel_digest *digest); @@ -118,7 +118,7 @@ struct selabel_handle { * Validation function */ extern int -selabel_validate(struct selabel_handle *rec, +selabel_validate(const struct selabel_handle *rec, struct selabel_lookup_rec *contexts) ; /* @@ -136,7 +136,7 @@ extern void __attribute__ ((format(printf, 1, 2))) } while (0) extern int -compat_validate(struct selabel_handle *rec, +compat_validate(const struct selabel_handle *rec, struct selabel_lookup_rec *contexts, const char *path, unsigned lineno) ; diff --git a/libselinux/src/label_support.c b/libselinux/src/label_support.c index 54fd49a5..df474cba 100644 --- a/libselinux/src/label_support.c +++ b/libselinux/src/label_support.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "label_internal.h" /* @@ -138,7 +137,6 @@ void digest_gen_hash(struct selabel_digest *digest) Sha1Finalise(&context, (SHA1_HASH *)digest->digest); free(digest->hashbuf); digest->hashbuf = NULL; - return; } /** @@ -154,7 +152,7 @@ void digest_gen_hash(struct selabel_digest *digest) * Return %0 on success, -%1 with @errno set on failure. */ int digest_add_specfile(struct selabel_digest *digest, FILE *fp, - char *from_addr, size_t buf_len, + const char *from_addr, size_t buf_len, const char *path) { unsigned char *tmp_buf; diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c index bf2da083..9a9bafb0 100644 --- a/libselinux/src/matchpathcon.c +++ b/libselinux/src/matchpathcon.c @@ -35,7 +35,7 @@ void set_matchpathcon_printf(void (*f) (const char *fmt, ...)) myprintf_compat = 1; } -int compat_validate(struct selabel_handle *rec, +int compat_validate(const struct selabel_handle *rec, struct selabel_lookup_rec *contexts, const char *path, unsigned lineno) { From patchwork Thu Aug 3 16:23:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 13340292 X-Patchwork-Delegate: plautrba@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA579C04E69 for ; Thu, 3 Aug 2023 16:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbjHCQXf (ORCPT ); Thu, 3 Aug 2023 12:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235307AbjHCQXe (ORCPT ); Thu, 3 Aug 2023 12:23:34 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB3330DD for ; Thu, 3 Aug 2023 09:23:32 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5230d2b8128so1392407a12.0 for ; Thu, 03 Aug 2023 09:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1691079811; x=1691684611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ctTkIdOjUgd2oh0NelDXrU+PaUXy4eDCWNhDrSSQWFo=; b=Fy904Jog177MqOrUVW8ij0JBLV4ctR2mMHDnS801zpqw7SUjQpAfJMkoeTtDWpwYir EMlg7/eVqu5/RggfymyDFsm7IYl6nODm+2Ai81/lZA8hmwfD8MaTih2bMEAqhv+6Yfvv w2V0t9e6SDhtWSjpovhRpP/8uFpzC/42QJhxTbUmLyWz2D5Eo3CoyPJ7Cy3wGdo4iUKa prM/Se7bdQ0b7ydwk2w6QzxCMy573dfu0MKuTJbv6HUza8oyEYR94a6/aKxT9PVJukcL UewV5yue/VPhrU8RUUNZXcyUX+PfBD9he/QTRPRHtyINCwbVVFH9pwi4lKODWD0fMsGi 0LVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691079811; x=1691684611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ctTkIdOjUgd2oh0NelDXrU+PaUXy4eDCWNhDrSSQWFo=; b=Qf7vH9IS0diLSvPYuXAJd0fvyj8N2nW8/WwNHBCkmGOFP2Ym4655riEgkNAgShXw1q bc9zIyUI7s+fYkqGNahdagutUSiJo5ERmhCwjHAToePCAIH2FVdPyiYGIFtj+IMF37Wg Rwah94ugtymmDX6WkTehfwtjESBQMCYU6avXior4qyLD7EY6FpsNpQaWexoN4dvMoQ/O uYl2gsTF6lIFR8gWWDaLvj9c8b0On9YpFvmCNxyfaeVFcG9Liq/KpqRXvQ8kDNdseWk3 rlClOZQWzMdS1RQYlHyXBYyRxCpzbphFG/9dpiC8CYAMwjZUY0zdeDqQpVfpWCKVoOo2 EI1A== X-Gm-Message-State: ABy/qLYZgXMUpnw+cU/B8mRfmGse0t8gxh62J6NNJzSHT/rrVTsYHhOr j6VmFobjeQxufThtQOSDY7H/8vWaUlQbsbXM9wY= X-Google-Smtp-Source: APBJJlHy7EvdHwJElzlbbAOkRINVD2HecMkFgznLmmMJ6BITUuHgfulZEWNoyh/neRfyJQ6ZO7jfdQ== X-Received: by 2002:aa7:cfcf:0:b0:522:abc0:2f1c with SMTP id r15-20020aa7cfcf000000b00522abc02f1cmr7173176edy.42.1691079811466; Thu, 03 Aug 2023 09:23:31 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-000-150-191.77.0.pool.telefonica.de. [77.0.150.191]) by smtp.gmail.com with ESMTPSA id u4-20020a05640207c400b0051d9ee1c9d3sm348edy.84.2023.08.03.09.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:23:31 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 3/4] libselinux: drop obsolete optimization flag Date: Thu, 3 Aug 2023 18:23:25 +0200 Message-Id: <20230803162326.302824-3-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230803162326.302824-1-cgzones@googlemail.com> References: <20230803162326.302824-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org The flag -fipa-pure-const is enabled by default in GCC at -O0 and above. The flag is not supported by Clang, which might result in issues if a compilation database was created via GCC. --- libselinux/src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index f9a1e5f5..b1620113 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -61,7 +61,7 @@ SRCS= $(filter-out $(GENERATED) audit2why.c, $(sort $(wildcard *.c))) MAX_STACK_SIZE=32768 ifeq ($(COMPILER), gcc) -EXTRA_CFLAGS = -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \ +EXTRA_CFLAGS = -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 \ From patchwork Thu Aug 3 16:23:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 13340294 X-Patchwork-Delegate: plautrba@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80B8EC04A6A for ; Thu, 3 Aug 2023 16:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236414AbjHCQXh (ORCPT ); Thu, 3 Aug 2023 12:23:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236464AbjHCQXe (ORCPT ); Thu, 3 Aug 2023 12:23:34 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EE8430D3 for ; Thu, 3 Aug 2023 09:23:33 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so4876319a12.1 for ; Thu, 03 Aug 2023 09:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1691079812; x=1691684612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lRlSHmOv3URj2X0zO+/PjgKRlSp4lVJgKRtEMaqdh2M=; b=WNYYUu40VkuIVHtZvSTvWL+AAiZh1wrRoHtV4pew5XmUPNETGSNGXUwoaFPwPsNi6O t9LuWoBfdpTRjCiOQyFigJI5OLs5uQdcBb9YrX6l8IF0Ow5I7DOVKeeBoRk7+Lzl5NTT QkLYgBYZQFTaVeCKWLicxt4Qn8ZTc+uS2TGAIeQLqwcEfgAWsZYwgYb+lFjcQ4yPgIZE IBiDXZp1L0fr6pcOLlB8tosMGHlUbNX9SFkQ8tc5tDPkisd8eHZll+N3TzrfaIvJTdHp czc9RX4OdIEp1xiRp+UMYuT4eMilX9sCkVO5bdVijgUWdFBj2/Ezrciqg/6xSb6EBRAl xSzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691079812; x=1691684612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lRlSHmOv3URj2X0zO+/PjgKRlSp4lVJgKRtEMaqdh2M=; b=P4DjfHX66G9hgAAgXKWCQahOKSLdKCgwZ9CG3MgaMfAVOyoFTxLXMlb2Jwtu/tU+79 v2j7h8wF3DHsr+v9wzqwMSs3NMU6vM3LwbRgBE4YqxKuOeNSqmHOTK0j9THfbTXCcNe7 wvQ1u+O1m1GWVXaNtL41vkMgz0TX5cNxrASYI69LeCbtIjzceDPQwr52dp8y8dSuP4zr HyW696jkULwXoEv0STZpx6fTuWOl4KklBX7VZ82tUGRIq6E0tZksCbVNt90Pa8cuajJW 7D29aHMooEajTstdg/i0T4hugcNox0YMWZeAOiKXsFuClJ/7zZKAeLXpUokFoZ8xdVPc Lsrg== X-Gm-Message-State: ABy/qLbscW8Hc9STun7TFjVIn396ANijqQxDaSCTsjCDYqfdzleZWUGX fPHMVnxCbsQ+IZtSw5K+lhu/bRNk2OA9OumyrD4= X-Google-Smtp-Source: APBJJlG53KinwEdoOAOMwMMjK1OaIwU7X/sWKxrUFkJrzzhnEQgXHJlBc5BtVGT/PPngTtAOuBIFUw== X-Received: by 2002:a05:6402:3507:b0:51e:5aac:6bad with SMTP id b7-20020a056402350700b0051e5aac6badmr11405668edd.11.1691079811916; Thu, 03 Aug 2023 09:23:31 -0700 (PDT) Received: from debian_development.DebianHome (dynamic-077-000-150-191.77.0.pool.telefonica.de. [77.0.150.191]) by smtp.gmail.com with ESMTPSA id u4-20020a05640207c400b0051d9ee1c9d3sm348edy.84.2023.08.03.09.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:23:31 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 4/4] libselinux: drop unnecessary warning overrides Date: Thu, 3 Aug 2023 18:23:26 +0200 Message-Id: <20230803162326.302824-4-cgzones@googlemail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230803162326.302824-1-cgzones@googlemail.com> References: <20230803162326.302824-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Drop overrides of warning flags which are not triggered by any code. Signed-off-by: Christian Göttsche --- libselinux/src/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index b1620113..20d79312 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -83,11 +83,10 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra \ -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) \ + -Wframe-larger-than=$(MAX_STACK_SIZE) \ -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \ -fasynchronous-unwind-tables -fdiagnostics-show-option \ - -Werror -Wno-aggregate-return -Wno-redundant-decls \ + -Werror -Wno-aggregate-return \ $(EXTRA_CFLAGS) LD_SONAME_FLAGS=-soname,$(LIBSO),--version-script=libselinux.map,-z,defs,-z,relro