All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] syscalls/{fanotify17, getxattr05}: Fix the ENOSPC error
Date: Mon, 4 Nov 2024 17:38:45 +0100	[thread overview]
Message-ID: <20241104163845.GA1417282@pevik> (raw)
In-Reply-To: <ZvVDCJfV931oLIe2@yuki.lan>

Hi Cyril, Xiao Yang,

> Hi!
> > If the value of max_user_namespaces is set to 10 but more than
> > 10 user namspaces are currently used on system.  In this case,
> > these tests fail with ENOSPC. for example:

> > # lsns -t user -n | wc -l
> > 17

> > # ./fanotify17
> > ...
> > fanotify17.c:174: TINFO: Test #0: Global groups limit in init user ns
> > fanotify17.c:130: TPASS: Created 128 groups - below groups limit (128)
> > fanotify17.c:174: TINFO: Test #1: Global groups limit in privileged user ns
> > fanotify17.c:154: TFAIL: unshare(CLONE_NEWUSER) failed: ENOSPC (28)
> > tst_test.c:452: TBROK: Invalid child (6958) exit value 1

> That's strange the test seems to work for me even if it's over the
> limit.

> $ lsns -t user -n | wc -l
> 14

I'm able to reproduce as well on VM.

I get problems with 9 for fanotify17 ...

# for i in {0..7}; do unshare -U & done

# lsns -t user -n | wc -l
9

# ./fanotify17
...
fanotify17.c:154: TFAIL: unshare(CLONE_NEWUSER) failed: ENOSPC (28)
tst_test.c:452: TBROK: Invalid child (1916) exit value 1

and with 10 for getxattr05:

# unshare -U  &

# lsns -t user -n | wc -l
10

# ./getxattr05
getxattr05.c:88: TPASS: Got same data when acquiring the value of system.posix_acl_access twice
getxattr05.c:88: TPASS: Got same data when acquiring the value of system.posix_acl_access twice
getxattr05.c:88: TPASS: Got same data when acquiring the value of system.posix_acl_access twice

> I suppose that since the test is executed as a root since it has
> .require_root the limits does not apply. It's strange that they apply in
> your case. Which kernel is this?

Testing on 6.12.0-rc4-1.gf83465d-default and 6.11.5-1-default (both openSUSE
Tumbleweed) and 6.9.9-amd64 (Debian).

Yes, root access is required for rw to /proc/sys/user/max_user_namespaces:

getxattr05.c:159: TBROK: Failed to open FILE '/proc/sys/user/max_user_namespaces' for writing: EACCES (13)
getxattr05.c:167: TWARN: Failed to open FILE '/proc/sys/user/max_user_namespaces' for writing: EACCES (13)

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-11-04 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25  8:49 [LTP] [PATCH v2] syscalls/{fanotify17, getxattr05}: Fix the ENOSPC error Xiao Yang
2024-09-26 11:18 ` Cyril Hrubis
2024-11-04 16:38   ` Petr Vorel [this message]
2024-11-04 16:45 ` Petr Vorel
2025-01-27 17:14 ` Petr Vorel
2025-04-29  9:47 ` Cyril Hrubis

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=20241104163845.GA1417282@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.