From: "Konstantin Meskhidze (A)" <konstantin.meskhidze@huawei.com>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: <willemdebruijn.kernel@gmail.com>, <gnoack3000@gmail.com>,
<linux-security-module@vger.kernel.org>, <netdev@vger.kernel.org>,
<netfilter-devel@vger.kernel.org>, <yusongping@huawei.com>,
<artem.kuzin@huawei.com>
Subject: Re: [PATCH v10 03/13] landlock: Remove unnecessary inlining
Date: Thu, 20 Apr 2023 14:45:26 +0300 [thread overview]
Message-ID: <b4e81d2d-3418-3aba-57b4-07aa66a7f844@huawei.com> (raw)
In-Reply-To: <72ef81d8-b7a0-de1e-83b6-1bfe7028ad25@digikod.net>
4/16/2023 7:09 PM, Mickaël Salaün пишет:
> Unfortunately this patch could not be easily backported because it
> changes too much as the same time, and it would then be an issue for
> patches on top of it that would need to be backported. Please remove
> this patch for the next series, but keep the required changes for the
> function that are modified by the following patches, i.e.
> opportunistically remove inline function when changing their signature
> (which should be a subset of the same patch for v9). I'll take care of
> doing the remaining clean up.
Ok. I will remove inlining for the functions I deal with.
>
>
> On 23/03/2023 09:52, Konstantin Meskhidze wrote:
>> Remove all "inline" keywords in all .c files. This should be simple
>> for the compiler to inline them automatically, and it makes the
>> code cleaner.
>>
>> Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
>> ---
>>
>> Changes since v9:
>> * Splits commit.
>>
>> ---
>> 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 05a339bf2a7c..b5fa6f56665f 100644
>> --- a/security/landlock/fs.c
>> +++ b/security/landlock/fs.c
>> @@ -191,7 +191,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)
>> {
>> @@ -217,7 +217,7 @@ find_rule(const struct landlock_ruleset *const domain,
>> * Returns true if the request is allowed (i.e. relevant layer masks for the
>> * request are empty).
>> */
>> -static inline bool
>> +static bool
>> unmask_layers(const struct landlock_rule *const rule,
>> const access_mask_t access_request,
>> layer_mask_t (*const layer_masks)[LANDLOCK_NUM_ACCESS_FS])
>> @@ -269,7 +269,7 @@ unmask_layers(const struct landlock_rule *const rule,
>> * 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) &&
>> @@ -301,7 +301,7 @@ get_raw_handled_fs_accesses(const struct landlock_ruleset *const domain)
>> * Returns: An access mask where each access right bit is set which is handled
>> * in any of the active layers in @domain.
>> */
>> -static inline access_mask_t
>> +static access_mask_t
>> init_layer_masks(const struct landlock_ruleset *const domain,
>> const access_mask_t access_request,
>> layer_mask_t (*const layer_masks)[LANDLOCK_NUM_ACCESS_FS])
>> @@ -357,7 +357,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,
>> @@ -409,7 +409,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])
>> {
>> @@ -428,7 +428,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)
>> {
>> @@ -639,9 +639,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] = {};
>>
>> @@ -662,7 +662,7 @@ static 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:
>> @@ -687,7 +687,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;
>> @@ -1171,7 +1171,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 1f3188b4e313..1f432a809ad5 100644
>> --- a/security/landlock/ruleset.c
>> +++ b/security/landlock/ruleset.c
>> @@ -243,7 +243,7 @@ int landlock_insert_rule(struct landlock_ruleset *const ruleset,
>> return insert_rule(ruleset, object, &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.25.1
>>
> .
next prev parent reply other threads:[~2023-04-20 11:45 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 8:52 [PATCH v10 00/13] Network support for Landlock Konstantin Meskhidze
2023-03-23 8:52 ` [PATCH v10 01/13] landlock: Make ruleset's access masks more generic Konstantin Meskhidze
2023-03-23 8:52 ` [PATCH v10 02/13] landlock: Allow filesystem layout changes for domains without such rule type Konstantin Meskhidze
2023-04-16 16:09 ` Mickaël Salaün
2023-04-20 11:42 ` Konstantin Meskhidze (A)
2023-04-20 17:32 ` Mickaël Salaün
2023-04-21 7:54 ` Konstantin Meskhidze (A)
2023-03-23 8:52 ` [PATCH v10 03/13] landlock: Remove unnecessary inlining Konstantin Meskhidze
2023-04-16 16:09 ` Mickaël Salaün
2023-04-20 11:45 ` Konstantin Meskhidze (A) [this message]
2023-03-23 8:52 ` [PATCH v10 04/13] landlock: Refactor landlock_find_rule/insert_rule Konstantin Meskhidze
2023-03-23 8:52 ` [PATCH v10 05/13] landlock: Refactor merge/inherit_ruleset functions Konstantin Meskhidze
2023-04-16 16:09 ` Mickaël Salaün
2023-04-20 11:46 ` Konstantin Meskhidze (A)
2023-03-23 8:52 ` [PATCH v10 06/13] landlock: Move and rename layer helpers Konstantin Meskhidze
2023-03-23 8:52 ` [PATCH v10 07/13] landlock: Refactor " Konstantin Meskhidze
2023-04-16 16:11 ` Mickaël Salaün
2023-04-20 16:05 ` Konstantin Meskhidze (A)
2023-03-23 8:52 ` [PATCH v10 08/13] landlock: Refactor landlock_add_rule() syscall Konstantin Meskhidze
2023-03-23 8:52 ` [PATCH v10 09/13] landlock: Add network rules and TCP hooks support Konstantin Meskhidze
2023-03-31 17:24 ` Mickaël Salaün
2023-03-31 17:30 ` Mickaël Salaün
2023-04-04 9:33 ` Konstantin Meskhidze (A)
2023-04-04 9:31 ` Konstantin Meskhidze (A)
2023-04-04 16:42 ` Mickaël Salaün
2023-04-04 17:02 ` Mickaël Salaün
2023-04-05 19:19 ` Konstantin Meskhidze (A)
2023-04-06 10:31 ` Mickaël Salaün
2023-04-06 10:37 ` Konstantin Meskhidze (A)
2023-04-05 17:42 ` Konstantin Meskhidze (A)
2023-04-06 10:28 ` Mickaël Salaün
2023-04-06 10:30 ` Konstantin Meskhidze (A)
2023-04-16 16:11 ` Mickaël Salaün
2023-04-21 9:39 ` Konstantin Meskhidze (A)
2023-04-26 14:15 ` Mickaël Salaün
2023-03-23 8:52 ` [PATCH v10 10/13] selftests/landlock: Share enforce_ruleset() Konstantin Meskhidze
2023-04-16 16:12 ` Mickaël Salaün
2023-04-20 16:06 ` Konstantin Meskhidze (A)
2023-03-23 8:52 ` [PATCH v10 11/13] selftests/landlock: Add 10 new test suites dedicated to network Konstantin Meskhidze
2023-04-16 16:13 ` Mickaël Salaün
2023-04-21 10:02 ` Konstantin Meskhidze (A)
2023-04-26 19:10 ` Mickaël Salaün
2023-03-23 8:52 ` [PATCH v10 12/13] samples/landlock: Add network demo Konstantin Meskhidze
2023-04-16 16:13 ` Mickaël Salaün
2023-04-21 10:04 ` Konstantin Meskhidze (A)
2023-03-23 8:52 ` [PATCH v10 13/13] landlock: Document Landlock's network support Konstantin Meskhidze
2023-04-16 16:13 ` Mickaël Salaün
2023-04-21 10:07 ` Konstantin Meskhidze (A)
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=b4e81d2d-3418-3aba-57b4-07aa66a7f844@huawei.com \
--to=konstantin.meskhidze@huawei.com \
--cc=artem.kuzin@huawei.com \
--cc=gnoack3000@gmail.com \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=yusongping@huawei.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