-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undeclared identifier during make : PR_SET_MM_ARG_START, PR_SET_MM_ARG_END #1
Comments
The macros should be defined in <sys/prctl.h> with kernel version above 3.5, but actually, the header file is belonged to glibc. So I think maybe your glibc version is too old. #ifndef PR_SET_MM_ARG_START
#define PR_SET_MM_ARG_START 8
#endif
#ifndef PR_SET_MM_ARG_END
#define PR_SET_MM_ARG_END 9
#endif |
thanks. these errors are solved. but.... [ 17%] Building C object src/CMakeFiles/libcjail.dir/simple_seccomp.c.o I think I don't have enough library.. right? |
It seems that memfd_create() is added in glibc 2.27 and require kernel version 3.17. |
I have completed the 'make' process with no errors on Ubuntu 18.04. Please let me know the next step in detail.. |
I have these errors as follows during installation make install[ 53%] Built target libcjail Makefile:128: recipe for target 'install' failed |
Oh, that's my fault. I shouldn't write cmake list strings in multiple lines. Cmake mistakes the newline and indent spaces as a part of the file path. Instead, I should declare a list variable or just place the second header file in the same line. |
I just pushed a hotfix version to fix this issue. And it can be installed successfully now. |
the installation is complete. thanks. Could you let me know the command usage of cjail in details? I'd like to judge the code that submitted by any user. Especially, I'd like to know the case of interpreter language such as python, java, javascript. thanks in advance. |
Typically, you need to place the code that you want to run in a directory which can be access by the user you specifying. Then compile (if needed) and run it.
sudo cjail -d /home/foobar -u 10001 -g 10001 -- /bin/gcc foobar.c And here is an example of running the code: sudo cjail -d /home/foobar -u 10001 -g 10001 -- ./a.out By default, it would be run as uid 65534(nobody) and gid 65534(nobody) if you don't specify the -u or -g options. cjail --help |
Thanks a lot. What are the return values of cjail when a user code is trying to access other directories or to exceed the limit of resource.. |
Sorry for that. Currently, It would return 0 even if user code not successfully return when using the command line interface. This is a to-do improvement in the next release.
|
cmake ..
-- build type not set, default to release
Build Type: Release
-- Checking for module 'libseccomp'
-- Found libseccomp, version 1.0.1
-- Found Criterion library.
-- Test Enabled.
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/cjail-master/build
make
[ 3%] Building C object src/CMakeFiles/libcjail.dir/init.c.o
/usr/cjail-master/src/init.c: In function ‘setprocname’:
/usr/cjail-master/src/init.c:94:32: error: ‘PR_SET_MM_ARG_START’ undeclared (first use in this function)
ret = prctl(PR_SET_MM, PR_SET_MM_ARG_START, argv, 0, 0) ||
^
/usr/cjail-master/src/init.c:94:32: note: each undeclared identifier is reported only once for each function it appears in
/usr/cjail-master/src/init.c:95:30: error: ‘PR_SET_MM_ARG_END’ undeclared (first use in this function)
prctl(PR_SET_MM, PR_SET_MM_ARG_END, argv + strlen(argv) + 1, 0, 0);
^
/usr/cjail-master/src/init.c: In function ‘child_init’:
/usr/cjail-master/src/init.c:385:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ep.resultpipe[1], &result, sizeof(result));
^
make[2]: *** [src/CMakeFiles/libcjail.dir/init.c.o] error 1
make[1]: *** [src/CMakeFiles/libcjail.dir/all] error 2
make: *** [all] error 2
please, your solution...
I don't know why these error ocuur.
my linux kernel version: 3.13.0-117-generic
libseccomp version : 1.0.1
The text was updated successfully, but these errors were encountered: