linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Guenter Roeck <groeck@google.com>, Jeff Xu <jeffxu@google.com>
Cc: linux-security-module@vger.kernel.org,
	Jorge Lucangeli Obes <jorgelo@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] selftests/landlock: skip ptrace_test when YAMA is enabled
Date: Mon, 18 Jul 2022 23:24:48 +0200	[thread overview]
Message-ID: <b851a37a-f5f1-3ee0-edf7-582d848c915b@digikod.net> (raw)
In-Reply-To: <CABXOdTdzHu6CkNvOLvFoxH13MBo=r+TCr56xJsK3oXCbuOp4NA@mail.gmail.com>


On 16/07/2022 23:45, Guenter Roeck wrote:
> On Fri, Jul 15, 2022 at 5:17 PM Jeff Xu <jeffxu@google.com> wrote:
>>
>>> Maybe the error code returned from mount gives a hint.
>>
>> It returns -1
>>
> Sorry, I meant errno, not the return value.
> 
>>>
>>> Also, how about
>>> /proc/filesystems ?
>>
>> Yes. it has what I want:
>> nodev overlay
>>
> Excellent.
> 
> Guenter
> 
>> Thanks for your help! I can use this at runtime check.
>>
>> Jeff
>>
>>
>> On Fri, Jul 15, 2022 at 3:42 PM Guenter Roeck <groeck@google.com> wrote:
>>>
>>> On Fri, Jul 15, 2022 at 2:42 PM Jeff Xu <jeffxu@google.com> wrote:
>>>>
>>>> Jeff Xu <jeffxu@google.com>
>>>>
>>>>> Jul 14, 2022, 5:35 PM (20 hours ago)
>>>>> to Guenter, Mickaël, linux-security-module, Jorge, Guenter, Kees
>>>>>> On Thu, Jul 14, 2022 at 11:37 AM Jeff Xu <jeffxu@google.com> wrote:
>>>>>>>
>>>>>>>>>> Hmm, well, it is not related to Yama then. Could it be linked to other
>>>>>>>>>> Chromium OS non-upstream patches?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> fs_test.c 47 and 48 are failing in chromeOS because OVERLAYFS is not
>>>>>>>>> enabled in chromeOS.
>>>>>>>>> If there is a reliable way of detecting OVERLAYFS (checking mount
>>>>>>>>> overlayfs is successful ? ), this is a good candidate to add SKIP.
>>>>>>>>>
>>>>>>>
>>>>>>>> IS_ENABLED(CONFIG_OVERLAY_FS) ?
>>>>>>>
>>>>>>> Could be. Landlock selftest currently is a user space program though,
>>>>>>> IS_ENABLED will depend on the kernel header during compile time.
>>>>>>>
>>>>
>>>>
>>>>
>>>>>> Ah, sorry, I thought it was an in-kernel test. Userspace should be
>>>>>> able to determine if overlayfs is supported by checking /sys/fs/ or
>>>>>> possibly /proc/fs/.
>>>>
>>>>
>>>>> Thanks for clarifying.
>>>>
>>>>
>>>>> lsmod might be the one, such as:
>>>>> lsmod | grep overlayfs
>>>>
>>>>
>>>> I built a kernel with overlayfs on chromeos, and lsmod didn't give me
>>>> what I wanted.
>>>> /sys/fs and /proc/fs also doesn't show anything about overlayfs
>>>>
>>>> @Mickaël Salaün
>>>> Are you OK with SKIP the overlay test when mount("overlay",...) fails
>>>> in FIXTURE_SETUP() ? Mount failure can be used as an indication.

In a normal scenario, all configurations in 
tools/testing/selftests/landlock/config should be enabled, but I think 
it makes sense for some use cases like chromeOS to be able to not fail 
if overlayfs is not supported. Please patch 
FIXTURE_SETUP(layout2_overlay) to skip these tests if the related 
filesystem string is present (with or without "nodev") in 
/proc/filesystems . You can create a is_filesystem_supported(const char 
*filesystem) helper before prepare_layout() for this check, we'll need 
it for future tests.


>>>>
>>>
>>> Maybe the error code returned from mount gives a hint. Also, how about
>>> /proc/filesystems ?
>>>
>>> Guenter

      reply	other threads:[~2022-07-18 21:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 22:29 [PATCH] selftests/landlock: skip ptrace_test when YAMA is enabled Jeff Xu
2022-06-30 15:09 ` Mickaël Salaün
2022-06-30 15:31 ` Mickaël Salaün
2022-07-05 21:49   ` Jeff Xu
2022-07-06 23:41     ` Jeff Xu
2022-07-07 14:24     ` Mickaël Salaün
     [not found]     ` <CALmYWFvcSn_wks0bXo3_DUyYGtVW_MHrrO1dRoYcxY4uiB1KEA@mail.gmail.com>
2022-07-07 14:25       ` Mickaël Salaün
2022-07-13 23:44         ` Jeff Xu
2022-07-14  0:30           ` Guenter Roeck
2022-07-14 18:36             ` Jeff Xu
2022-07-14 20:39               ` Guenter Roeck
2022-07-15  0:35                 ` Jeff Xu
2022-07-15 21:41                   ` Jeff Xu
2022-07-15 22:42                     ` Guenter Roeck
2022-07-16  0:16                       ` Jeff Xu
2022-07-16 21:45                         ` Guenter Roeck
2022-07-18 21:24                           ` Mickaël Salaün [this message]

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=b851a37a-f5f1-3ee0-edf7-582d848c915b@digikod.net \
    --to=mic@digikod.net \
    --cc=groeck@chromium.org \
    --cc=groeck@google.com \
    --cc=jeffxu@google.com \
    --cc=jorgelo@chromium.org \
    --cc=keescook@chromium.org \
    --cc=linux-security-module@vger.kernel.org \
    /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).