lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Sep 2023 10:18:24 +0800
From:   Cai Xinchen <caixinchen1@...wei.com>
To:     Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
        Johannes Weiner <hannes@...xchg.org>,
        <cgroups@...r.kernel.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>,
        <linux-fsdevel@...r.kernel.org>, <dhowells@...hat.com>,
        <linux-kernel@...r.kernel.org>
Subject: [BUG?] fsconfig restart_syscall failed

Hello:
   I am doing some test for kernel 6.4, util-linux version:2.39.1.
Have you encountered similar problems? If there is a fix, please
let me know.
Thank you very much

--------------------------------------------------

util-linux version 2.39.1 call mount use fsopen->fsconfig->fsmount->close
instead of mount syscall.

And use this shell test:

#!/bin/bash
mkdir -p /tmp/cgroup/cgrouptest
while true
do
         mount -t cgroup -o none,name=foo cgroup /tmp/cgroup/cgrouptest
         ret=$?
         if [ $ret -ne 0 ];then
                 echo "mount failed , $ret"
         fi
         umount /tmp/cgroup/cgrouptest
         ret=$?
         if [ $ret -ne 0 ];then
                 echo "umount failed, $ret"
         fi
done

And as a result, we mount cgroup immediately after umount, it will return
failed.

in fsconfig syscall, we find this stack:

SYSCALL_DEFINE5(fsconfig, ...)
         vfs_fsconfig_locked
                 if (fc->phase != FS_CONTEXT_CREATE_PARAMS)
                         return -EBUSY;

                 vfs_get_tree
                         fc->ops->get_tree // cgroup1_get_tree
                                 if (!ret && !percpu_ref_tryget_live
(&ctx->root->cgrp.self.refcnt))
                                         ret = 1;
                                 ...
                                 if (unlikely(ret > 0)) {
                                         msleep(10);
                                         restart_syscall();
                                 }
                 ...
                 fc->phase = FS_CONTEXT_FAILED;

in mount syscall, no function will check fs->phase, and fc is recreate
in monnt syscall. However, in fdconfig syscall, fc->phase is not initial as
FS_CONTEXT_CREATE_PARAMS, restart_syscall will return -EBUSY. fc is created
in fsopen syscall.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ