Merge branch 'master' of git://git.code.sf.net/p/tomoyo/tomoyo.git

This commit is contained in:
Stephen Rothwell 2024-12-20 13:16:38 +11:00
commit a9b77c57e3
2 changed files with 10 additions and 3 deletions

View File

@ -2665,7 +2665,7 @@ ssize_t tomoyo_write_control(struct tomoyo_io_buffer *head,
if (head->w.avail >= head->writebuf_size - 1) {
const int len = head->writebuf_size * 2;
char *cp = kzalloc(len, GFP_NOFS);
char *cp = kzalloc(len, GFP_NOFS | __GFP_NOWARN);
if (!cp) {
error = -ENOMEM;

View File

@ -722,10 +722,17 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm)
ee->bprm = bprm;
ee->r.obj = &ee->obj;
ee->obj.path1 = bprm->file->f_path;
/* Get symlink's pathname of program. */
/*
* Get symlink's pathname of program, but fallback to realpath if
* symlink's pathname does not exist or symlink's pathname refers
* to proc filesystem (e.g. /dev/fd/<num> or /proc/self/fd/<num> ).
*/
exename.name = tomoyo_realpath_nofollow(original_name);
if (exename.name && !strncmp(exename.name, "proc:/", 6)) {
kfree(exename.name);
exename.name = NULL;
}
if (!exename.name) {
/* Fallback to realpath if symlink's pathname does not exist. */
exename.name = tomoyo_realpath_from_path(&bprm->file->f_path);
if (!exename.name)
goto out;