31334a05 | 08-Jun-2021 |
Matthew Dillon <dillon@apollo.backplane.com> |
libc - Fix intermediate path elements if used in shm_open()
* Our shm_open() places the path relative to /var/run/shm, but if the directory structure for miscellaneous prefixes (such as "/tmp/bl
libc - Fix intermediate path elements if used in shm_open()
* Our shm_open() places the path relative to /var/run/shm, but if the directory structure for miscellaneous prefixes (such as "/tmp/blahblah", "/dev/shm/blahblah", etc) do not exist under /var/run/shm then shm_open() fails when it should not.
* Change shm_open() to automatically create any intermediate directory elements under /var/run/shm/ that are missing. The elements will be created mode 1777.
* Fixes chromium-90 and any other packages that still use directory prefixes in shm_open() calls.
show more ...
|
95347633 | 31-Mar-2021 |
Matthew Dillon <dillon@apollo.backplane.com> |
kernel - More fixes to libc's uname
* Remove no no-longer-used buf[] (and fix syntax error during compilation).
* Do not parse garbage data in buffers in case the sysctls fail. This would not h
kernel - More fixes to libc's uname
* Remove no no-longer-used buf[] (and fix syntax error during compilation).
* Do not parse garbage data in buffers in case the sysctls fail. This would not have been fatal anyway since we always ensure that the buffers are zero-terminated, but it wasn't clean either. Clean it up.
* Use the proper name->arrayname for a pointer to the array instead of &name->arrayname. We could also use &name->arrayname[0] but just stick with the first method.
Pointed-out-by: dan
show more ...
|
631c21f2 | 31-Mar-2021 |
Matthew Dillon <dillon@apollo.backplane.com> |
kernel - Adjust varsym API to match manual page, remove from uname
* Adjust the varsym system call to match the manual page. It now returns 0 on success instead of the length, and returns -1 wi
kernel - Adjust varsym API to match manual page, remove from uname
* Adjust the varsym system call to match the manual page. It now returns 0 on success instead of the length, and returns -1 with an errno of EOVERFLOW if the supplied buffer is too small.
* The uname*() code in libc actually assumed 0 would be returned on success, and thus never actually allowed varsym overrides. Just remove the functionality (that nobody uses) entirely.
Reported-by: dan
show more ...
|
941642e8 | 17-Feb-2021 |
Aaron LI <aly@aaronly.me> |
fexecve(2): Return ENOENT if exec a script opened with O_CLOEXEC
If a script (i.e., interpreter file) is opened with the O_CLOEXEC flag, it would be closed by the time the interpreter is executed, a
fexecve(2): Return ENOENT if exec a script opened with O_CLOEXEC
If a script (i.e., interpreter file) is opened with the O_CLOEXEC flag, it would be closed by the time the interpreter is executed, and then the executation would fail. So just return ENOENT from fexecve(2). This behavior aligns with Linux's.
See Linux's fexecve(2) man page.
See also: https://bugzilla.kernel.org/show_bug.cgi?id=74481
Thank dillon for implementing the holdvnode2() function to obtain the fileflags together with the fp from fd.
show more ...
|
337acc44 | 17-Feb-2021 |
Aaron LI <aly@aaronly.me> |
Implement the fexecve(2) system call
The fexecve(2) function is equivalent to execve(2), except that the file to be executed is determined by the file descriptor fd instead of a pathname.
The purpo
Implement the fexecve(2) system call
The fexecve(2) function is equivalent to execve(2), except that the file to be executed is determined by the file descriptor fd instead of a pathname.
The purpose of fexecve(2) is to enable executing a file which has been verified to be the intended file. It is possible to actively check the file by reading from the file descriptor and be sure that the file is not exchanged for another between the reading and the execution.
See https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html
This work is partially based on swildner's patch and FreeBSD's implementation (revisions 177787, 182191, 238220).
XXX: We're missing O_EXEC support in open(2).
Reviewed-by: dillon
show more ...
|