View Issue Details

IDProjectCategoryView StatusLast Update
0018240CentOS-7kernelpublic2021-07-13 03:33
ReporterAlexeySaff Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version7.9.2009 
Summary0018240: ulimit stack size when running via cgexec
DescriptionFound a very weird situation.

setting ulimit with ulimit command:

ulimit -s 5100000
ulimit -c 1000000
ulimit -n 4096
checking ulimit - all good

[lt@lt-hkg1-tsr01 ~]$ ulimit -a
core file size (blocks, -c) 1000000
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 255870
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 5100000
cpu time (seconds, -t) unlimited
max user processes (-u) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[lt@lt-hkg1-tsr01 ~]$
now checking ulimit via cgexec

[lt@lt-hkg1-tsr03 ~]$ cgexec -g cpuset:/lt/default /bin/bash -c "ulimit -a"
core file size (blocks, -c) 1000000
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1031435
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[lt@lt-hkg1-tsr03 ~]$
as you can see core files and open files are correct but stack size reset back to default (even I have a different value in /etc/security/limits.conf)

I found that this is a case in kernel 5.x (5.4 / 5.10 /5.12) but worked as expected in 3.x and 4.x

removing setgid from cgexec resolves situation, but it's not an ideal solution
Tagskernel 5.x
abrt_hash
URL

Activities

AlexeySaff

AlexeySaff

2021-07-13 03:33

reporter   ~0038533

any ideas?

Issue History

Date Modified Username Field Change
2021-07-07 06:21 AlexeySaff New Issue
2021-07-07 06:21 AlexeySaff Tag Attached: kernel 5.x
2021-07-13 03:33 AlexeySaff Note Added: 0038533