Re: [PATCH] clone.2: Fix the erroneous statement about CLONE_NEWPID

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

 



On Sat, Aug 12, 2023 at 07:51:43PM +0200, Alejandro Colomar wrote:
> Does this depend on any recent kernel version?  In my system,
> the assertion fails.
> 
> 
> $ cat clone.c 
> ...
> 
> $ cc -Wall -Wextra clone.c 
> $ ./a.out 
> main program:  pid: 18783, and ppid: 18703
> a.out: clone.c:24: main: Assertion `ret != -1' failed.
> Aborted

On my systerm I get the same result. strace says this:

clone3({flags=CLONE_PARENT|CLONE_NEWPID, exit_signal=0, stack=NULL, stack_size=0}, 88) = -1 EPERM (Operation not permitted)

However when running as root it works.

John.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux