Re: [PATCH] cgroup1: don't allow '\n' in renaming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 09, 2021 at 10:17:19AM +0300, Alexander Kuznetsov wrote:
> cgroup_mkdir() have restriction on newline usage in names:
> $ mkdir $'/sys/fs/cgroup/cpu/test\ntest2'
> mkdir: cannot create directory
> '/sys/fs/cgroup/cpu/test\ntest2': Invalid argument
> 
> But in cgroup1_rename() such check is missed.
> This allows us to make /proc/<pid>/cgroup unparsable:
> $ mkdir /sys/fs/cgroup/cpu/test
> $ mv /sys/fs/cgroup/cpu/test $'/sys/fs/cgroup/cpu/test\ntest2'
> $ echo $$ > $'/sys/fs/cgroup/cpu/test\ntest2'
> $ cat /proc/self/cgroup
> 11:pids:/
> 10:freezer:/
> 9:hugetlb:/
> 8:cpuset:/
> 7:blkio:/user.slice
> 6:memory:/user.slice
> 5:net_cls,net_prio:/
> 4:perf_event:/
> 3:devices:/user.slice
> 2:cpu,cpuacct:/test
> test2
> 1:name=systemd:/
> 0::/
> 
> Signed-off-by: Alexander Kuznetsov <wwfq@xxxxxxxxxxxxxx>
> Reported-by: Andrey Krasichkov <buglloc@xxxxxxxxxxxxxx>
> Acked-by: Dmitry Yakunin <zeil@xxxxxxxxxxxxxx>

Applied to cgroup/for-5.13-fixes

Thanks.

-- 
tejun



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux