From: "Mickaël Salaün" <mic@digikod.net>
To: "Günther Noack" <gnoack@google.com>
Cc: linux-security-module@vger.kernel.org,
Jeff Xu <jeffxu@google.com>,
Jorge Lucangeli Obes <jorgelo@chromium.org>,
Allen Webb <allenwebb@google.com>,
Dmitry Torokhov <dtor@google.com>,
Paul Moore <paul@paul-moore.com>,
Konstantin Meskhidze <konstantin.meskhidze@huawei.com>,
Matt Bobrowski <repnop@google.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v6 1/9] landlock: Remove remaining "inline" modifiers in .c files
Date: Thu, 30 Nov 2023 10:27:18 +0100 [thread overview]
Message-ID: <20231130.beetuo4Chuso@digikod.net> (raw)
In-Reply-To: <20231124173026.3257122-2-gnoack@google.com>
Thanks for this cleanup. Maybe add a (one-line) explanation?
On Fri, Nov 24, 2023 at 06:30:18PM +0100, Günther Noack wrote:
> Suggested-by: Mickaël Salaün <mic@digikod.net>
> Signed-off-by: Günther Noack <gnoack@google.com>
> ---
> security/landlock/fs.c | 26 +++++++++++++-------------
> security/landlock/ruleset.c | 2 +-
> 2 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/security/landlock/fs.c b/security/landlock/fs.c
> index bc7c126deea2..9ba989ef46a5 100644
> --- a/security/landlock/fs.c
> +++ b/security/landlock/fs.c
> @@ -193,7 +193,7 @@ int landlock_append_fs_rule(struct landlock_ruleset *const ruleset,
> *
> * Returns NULL if no rule is found or if @dentry is negative.
> */
> -static inline const struct landlock_rule *
> +static const struct landlock_rule *
> find_rule(const struct landlock_ruleset *const domain,
> const struct dentry *const dentry)
> {
> @@ -220,7 +220,7 @@ find_rule(const struct landlock_ruleset *const domain,
> * sockfs, pipefs), but can still be reachable through
> * /proc/<pid>/fd/<file-descriptor>
> */
> -static inline bool is_nouser_or_private(const struct dentry *dentry)
> +static bool is_nouser_or_private(const struct dentry *dentry)
> {
> return (dentry->d_sb->s_flags & SB_NOUSER) ||
> (d_is_positive(dentry) &&
> @@ -264,7 +264,7 @@ static const struct landlock_ruleset *get_current_fs_domain(void)
> *
> * @layer_masks_child2: Optional child masks.
> */
> -static inline bool no_more_access(
> +static bool no_more_access(
> const layer_mask_t (*const layer_masks_parent1)[LANDLOCK_NUM_ACCESS_FS],
> const layer_mask_t (*const layer_masks_child1)[LANDLOCK_NUM_ACCESS_FS],
> const bool child1_is_directory,
> @@ -316,7 +316,7 @@ static inline bool no_more_access(
> *
> * Returns true if the request is allowed, false otherwise.
> */
> -static inline bool
> +static bool
> scope_to_request(const access_mask_t access_request,
> layer_mask_t (*const layer_masks)[LANDLOCK_NUM_ACCESS_FS])
> {
> @@ -335,7 +335,7 @@ scope_to_request(const access_mask_t access_request,
> * Returns true if there is at least one access right different than
> * LANDLOCK_ACCESS_FS_REFER.
> */
> -static inline bool
> +static bool
> is_eacces(const layer_mask_t (*const layer_masks)[LANDLOCK_NUM_ACCESS_FS],
> const access_mask_t access_request)
> {
> @@ -551,9 +551,9 @@ static bool is_access_to_paths_allowed(
> return allowed_parent1 && allowed_parent2;
> }
>
> -static inline int check_access_path(const struct landlock_ruleset *const domain,
> - const struct path *const path,
> - access_mask_t access_request)
> +static int check_access_path(const struct landlock_ruleset *const domain,
> + const struct path *const path,
> + access_mask_t access_request)
> {
> layer_mask_t layer_masks[LANDLOCK_NUM_ACCESS_FS] = {};
>
> @@ -565,8 +565,8 @@ static inline int check_access_path(const struct landlock_ruleset *const domain,
> return -EACCES;
> }
>
> -static inline int current_check_access_path(const struct path *const path,
> - const access_mask_t access_request)
> +static int current_check_access_path(const struct path *const path,
> + const access_mask_t access_request)
> {
> const struct landlock_ruleset *const dom = get_current_fs_domain();
>
> @@ -575,7 +575,7 @@ static inline int current_check_access_path(const struct path *const path,
> return check_access_path(dom, path, access_request);
> }
>
> -static inline access_mask_t get_mode_access(const umode_t mode)
> +static access_mask_t get_mode_access(const umode_t mode)
> {
> switch (mode & S_IFMT) {
> case S_IFLNK:
> @@ -600,7 +600,7 @@ static inline access_mask_t get_mode_access(const umode_t mode)
> }
> }
>
> -static inline access_mask_t maybe_remove(const struct dentry *const dentry)
> +static access_mask_t maybe_remove(const struct dentry *const dentry)
> {
> if (d_is_negative(dentry))
> return 0;
> @@ -1086,7 +1086,7 @@ static int hook_path_truncate(const struct path *const path)
> * Returns the access rights that are required for opening the given file,
> * depending on the file type and open mode.
> */
> -static inline access_mask_t
> +static access_mask_t
> get_required_file_open_access(const struct file *const file)
> {
> access_mask_t access = 0;
> diff --git a/security/landlock/ruleset.c b/security/landlock/ruleset.c
> index ffedc99f2b68..789c81b26a50 100644
> --- a/security/landlock/ruleset.c
> +++ b/security/landlock/ruleset.c
> @@ -305,7 +305,7 @@ int landlock_insert_rule(struct landlock_ruleset *const ruleset,
> return insert_rule(ruleset, id, &layers, ARRAY_SIZE(layers));
> }
>
> -static inline void get_hierarchy(struct landlock_hierarchy *const hierarchy)
> +static void get_hierarchy(struct landlock_hierarchy *const hierarchy)
> {
> if (hierarchy)
> refcount_inc(&hierarchy->usage);
> --
> 2.43.0.rc1.413.gea7ed67945-goog
>
>
next prev parent reply other threads:[~2023-11-30 9:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 17:30 [PATCH v6 0/9] Landlock: IOCTL support Günther Noack
2023-11-24 17:30 ` [PATCH v6 1/9] landlock: Remove remaining "inline" modifiers in .c files Günther Noack
2023-11-30 9:27 ` Mickaël Salaün [this message]
2023-12-01 14:05 ` Günther Noack
2023-11-24 17:30 ` [PATCH v6 2/9] selftests/landlock: Rename "permitted" to "allowed" in ftruncate tests Günther Noack
2023-11-24 17:30 ` [PATCH v6 3/9] landlock: Optimize the number of calls to get_access_mask slightly Günther Noack
2023-11-24 17:30 ` [PATCH v6 4/9] landlock: Add IOCTL access right Günther Noack
2023-11-30 9:28 ` Mickaël Salaün
2023-12-01 14:04 ` Günther Noack
2023-11-24 17:30 ` [PATCH v6 5/9] selftests/landlock: Test IOCTL support Günther Noack
2023-11-30 9:30 ` Mickaël Salaün
2023-11-24 17:30 ` [PATCH v6 6/9] selftests/landlock: Test IOCTL with memfds Günther Noack
2023-11-24 17:30 ` [PATCH v6 7/9] selftests/landlock: Test ioctl(2) and ftruncate(2) with open(O_PATH) Günther Noack
2023-11-24 17:30 ` [PATCH v6 8/9] samples/landlock: Add support for LANDLOCK_ACCESS_FS_IOCTL Günther Noack
2023-11-24 17:30 ` [PATCH v6 9/9] landlock: Document IOCTL support Günther Noack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231130.beetuo4Chuso@digikod.net \
--to=mic@digikod.net \
--cc=allenwebb@google.com \
--cc=dtor@google.com \
--cc=gnoack@google.com \
--cc=jeffxu@google.com \
--cc=jorgelo@chromium.org \
--cc=konstantin.meskhidze@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=repnop@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).