Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4729592iob; Sun, 8 May 2022 23:31:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFrD4KhSwkEBsqKR3WWTKd6zZEK4rhgJQaUHf7Fn5yPkq+1kpifLt7jA0wXwKsJLqx69px X-Received: by 2002:a17:902:cf0f:b0:15a:24e0:d9b0 with SMTP id i15-20020a170902cf0f00b0015a24e0d9b0mr14806176plg.42.1652077880107; Sun, 08 May 2022 23:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652077880; cv=none; d=google.com; s=arc-20160816; b=hsSE/fIjMH9NhqSBZ1u9aLjgAwmA7inFzMS+v2OtuxY0SaOYCoinDCGG0EBkfaH378 2qmoN1jbBMcBhpPAdXIG+MlxIgk7/vdaUmy2VPZufwDWFwIDFy9N9i4nB9IttB8uIjcE gbC+HumEcecKbY6PJ8PWO1rDfqPrWv0MSp8gfytyryooqh6iEKQQvJ/+frz2SiJ6DIIq SU+XhrueRoCNGKiC0ldeeclH0yarG0AHNOkcP2/IN0EErfmYziu52yrdugrJxO/ni98q 5xluSMWhMgKXnYPsq4XWGzviQUBa7cNF7fLpd4lcsTCAXk1Sbe4lDpYOqTIsPtm4J20s 0YSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=94O/M/oVWudeOrNhpO9THj8UaAHa12LxmxbV8U5NnL4=; b=ruXTI8EaD0VutGChIlA7oyRvT188fL9xdPVSuO1sEjsol1FRMXBR5g3JpdJmgy+WNl fJhg6/he5zTn1P8DdRSxJOJxgikVgD1mAC/Jxmg6pLnPy+9yRho+3YdLWnDcq+qi3Py+ gsO1yoylzRpD09r+djiaRZq8wWGmYqXKy/w16gbqWAWSDVw6K06QU7UQzkbPdfgzOXWj 9OnYK8qtwQeaAUPV6cDJ+2SCy6fJtLlcWPxdTtwwXBh0U6EeBPbmNIYhekproAuA2ESE tl5F7BtigQtNIG6mLxT39BRWmx6gDMvDreiy2MT+bYxSuEdlbzzSSbfv8/m9v8tKGZgO DA4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=iYHG1Hlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h19-20020a635313000000b003c670739820si8013207pgb.277.2022.05.08.23.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:31:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=iYHG1Hlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA576146770; Sun, 8 May 2022 23:26:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443347AbiEFQHg (ORCPT + 99 others); Fri, 6 May 2022 12:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238563AbiEFQHe (ORCPT ); Fri, 6 May 2022 12:07:34 -0400 Received: from smtp-bc0d.mail.infomaniak.ch (smtp-bc0d.mail.infomaniak.ch [45.157.188.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E6A369CCB for ; Fri, 6 May 2022 09:03:50 -0700 (PDT) Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4KvwNN4jhtzMqKsD; Fri, 6 May 2022 18:03:48 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4KvwNN2ZszzljsTF; Fri, 6 May 2022 18:03:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1651853028; bh=b8DXJhHh0abOxq3vv6dVqiGLZkdpmtAtsCbdnpcP6hs=; h=From:To:Cc:Subject:Date:From; b=iYHG1HlcrZ5Ja8YnLx0lGGv3m9j+8LE2QQO6osFAB4NUlzesZybjwaZa4tvog+ilo OHp4SJo3BXzO2aoZ5zhsMNNM4gRcQZTU+7KWwMnmlvx1IASZI1HgWyi9/Y1eqpRQqO j/9Dt9FPBq8qDewcItrM9p2tsbEbQvCpf4v38LIQ= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: James Morris , "Serge E . Hallyn" Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Kees Cook , Konstantin Meskhidze , Miguel Ojeda , Paul Moore , Shuah Khan , Tom Rix , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH v1 0/7] Landlock: Clean up coding style with clang-format Date: Fri, 6 May 2022 18:05:06 +0200 Message-Id: <20220506160513.523257-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I used a simple coding style for the initial Landlock code. However, this may be subject to different interpretations. To avoid relying on tacit knowledge or text editors for these kind of rules, let's automate it as much as possible thanks to clang-format. This makes the code formatting simple, consistent and impersonal. Several versions of clang-format can be use but they may have (small) different behaviors for undefined/new configuration parts. After testing different versions, I picked clang-format-14 which is relatively new and fixes a bug present in version 11 to 13 (visible in the Landlock formatted code). I'll backport these patches and enforce this formatting for all the new Landlock patches. This series uses a patched clang-format configuration to make it compatible with checkpatch.pl: https://lore.kernel.org/r/20220506160106.522341-1-mic@digikod.net It can be applied on v5.18-rc5 . Regards, Mickaël Salaün (7): landlock: Add clang-format exceptions landlock: Format with clang-format selftests/landlock: Add clang-format exceptions selftests/landlock: Normalize array assignment selftests/landlock: Format with clang-format samples/landlock: Add clang-format exceptions samples/landlock: Format with clang-format include/uapi/linux/landlock.h | 4 + samples/landlock/sandboxer.c | 104 ++-- security/landlock/cred.c | 4 +- security/landlock/cred.h | 8 +- security/landlock/fs.c | 80 +-- security/landlock/fs.h | 11 +- security/landlock/limits.h | 4 + security/landlock/object.c | 6 +- security/landlock/object.h | 6 +- security/landlock/ptrace.c | 10 +- security/landlock/ruleset.c | 80 +-- security/landlock/ruleset.h | 15 +- security/landlock/syscalls.c | 60 +- tools/testing/selftests/landlock/base_test.c | 80 +-- tools/testing/selftests/landlock/common.h | 66 ++- tools/testing/selftests/landlock/fs_test.c | 532 ++++++++++-------- .../testing/selftests/landlock/ptrace_test.c | 38 +- 17 files changed, 615 insertions(+), 493 deletions(-) base-commit: 5c22d35e0cc57032edd92df16f530e3c9a33c027 -- 2.35.1