From nobody Fri Jun 17 19:38:29 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 90BE985B4D8; Fri, 17 Jun 2022 19:38:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq8j5XpJz3QRR; Fri, 17 Jun 2022 19:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yNh5xtNv/T5xIZcoOLsZCGBD7uQ+PFYFEj5aIbPXHg=; b=npiDBlAgsnC8QY9+phOhVanEWWgv2JfclrycbwT1QiF4P+l9odD+2YrhxeybVM3eHQje76 lqgqbsKeYEZzt54mtOOuCIKRXPuh2lUubfcsUuXmlPQfF80/XUX8h4KLzYf+JbSdusR1vE UuOp+qqfi/d11A6qklFsR8zwh249X+2cxFHZWvsXLliwZhwFQHXNrOvShWjizAc+qzoi9S ZU0Q5f7cxt399425Ftl+iKDRLpaTJnAM7TpSDNu/kKq1Mo1liMsaxrjDCMuka5zV+sVEIU VCIaLsKKEI+Jibp6MdgJX5newsn6ROvliVBSDBbIkhv/BKLv4m04G0JlKMvuHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 830A8259C1; Fri, 17 Jun 2022 19:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJcTP9014749; Fri, 17 Jun 2022 19:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJcT2h014748; Fri, 17 Jun 2022 19:38:29 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:29 GMT Message-Id: <202206171938.25HJcT2h014748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 753605353d79 - stable/13 - linux: remove the always curthread argument from lconvpath List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 753605353d79d1dde655779273013b6400daaaf7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yNh5xtNv/T5xIZcoOLsZCGBD7uQ+PFYFEj5aIbPXHg=; b=YKRKdW8e1SvfXEbDeFfEkZa5nkhJf+6Df0HxYUOebyCCxPLCU1Ve/gYDuPA1xXspnkywW7 LcqpEOnoIly6LffIazCoK14R9ta9gV6Qm7rVDZ1Njnz+kUAmKFwkEQpWDuXgvTwfLjmAYw jatWZO0Owzw1aqj7MThs9ah2SNm6pC8mi4aR2KO7e6WGyNSdoa59PlVaL9Sn1fvLCDCmdj LCJwsM6SZC778lWoXPTVkpdBNrvtMTehUyVus8O53jxwcB+BbbLKpE7FDyR0IfTT3A5ym/ ZfIcNJZP81a/jiRU98AMlouoUIEPvesXRBRzoI693AB12MW84bHNuqOyt0+zAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494709; a=rsa-sha256; cv=none; b=n84JhwrzfAS/MP4kNWjB+5/6lyZk3KrzHSNZeo2DoY40VmS09KnEdF2PFFy6iX2xSxrz7T uFRlPSASIXA3NrMWShy0wDvfmAZR0r2ACoTpIPVBff7Of1/ki9heouoCiVrVbwBOxtJzhG 3QZGX5fKBq92abYXpVVZRd6CTCCTxQ5BR/E36AZZCsdjh6ZgK1SnsbryhOQ5erwbt13RXw NHoZGicSdloasR5Nrq87jTVf+ljGQURiUXFQu9e7cedHJK++8G6Pn4GrFhudLfVLYDx1am RgXIqvyYWaLffh5iLCQQf+/aZZFh4cv8Y/nfTZzfKAaVxwOnlkmda1eonbHdEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=753605353d79d1dde655779273013b6400daaaf7 commit 753605353d79d1dde655779273013b6400daaaf7 Author: Mateusz Guzik AuthorDate: 2021-11-25 21:42:13 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:39 +0000 linux: remove the always curthread argument from lconvpath (cherry picked from commit af4051d25055fee086c0f78421e68fec20640f17) --- sys/amd64/linux/linux_machdep.c | 2 +- sys/amd64/linux32/linux32_machdep.c | 2 +- sys/arm64/linux/linux_machdep.c | 2 +- sys/compat/linux/linux_emul.c | 5 ++- sys/compat/linux/linux_file.c | 70 ++++++++++++++++++------------------- sys/compat/linux/linux_misc.c | 14 ++++---- sys/compat/linux/linux_stats.c | 22 ++++++------ sys/compat/linux/linux_uid16.c | 4 +-- sys/compat/linux/linux_util.c | 4 +-- sys/compat/linux/linux_util.h | 18 +++++----- sys/i386/linux/linux_machdep.c | 2 +- 11 files changed, 72 insertions(+), 73 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 67429a1c049f..18be62dab9ae 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -111,7 +111,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args) error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE, args->argp, args->envp); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); LFREEPATH(path); diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 86f7bdc918d8..9dd988452a1c 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -134,7 +134,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args) char *path; int error; - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 317807ba2e45..420f50cb3055 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -76,7 +76,7 @@ linux_execve(struct thread *td, struct linux_execve_args *uap) error = exec_copyin_args(&eargs, uap->path, UIO_USERSPACE, uap->argp, uap->envp); } else { - LCONVPATHEXIST(td, uap->path, &path); + LCONVPATHEXIST(uap->path, &path); error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, uap->envp); LFREEPATH(path); diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 86688d50c8a8..e7576ed2b16f 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -238,9 +238,8 @@ linux_exec_imgact_try(struct image_params *imgp) * alternate path is found, use our stringspace to store it. */ if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); + linux_emul_convpath(imgp->interpreter_name, UIO_SYSSPACE, + &rpath, 0, AT_FDCWD); if (rpath != NULL) imgp->args->fname_buf = imgp->interpreter_name = rpath; diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index bda843286b26..285faaf8927b 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -115,7 +115,7 @@ linux_creat(struct thread *td, struct linux_creat_args *args) return (kern_openat(td, AT_FDCWD, args->path, UIO_USERSPACE, O_WRONLY | O_CREAT | O_TRUNC, args->mode)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, O_WRONLY | O_CREAT | O_TRUNC, args->mode); LFREEPATH(path); @@ -234,9 +234,9 @@ linux_openat(struct thread *td, struct linux_openat_args *args) args->mode, UIO_USERSPACE)); } if (args->flags & LINUX_O_CREAT) - LCONVPATH_AT(td, args->filename, &path, 1, dfd); + LCONVPATH_AT(args->filename, &path, 1, dfd); else - LCONVPATH_AT(td, args->filename, &path, 0, dfd); + LCONVPATH_AT(args->filename, &path, 0, dfd); error = linux_common_open(td, dfd, path, args->flags, args->mode, UIO_SYSSPACE); @@ -256,9 +256,9 @@ linux_open(struct thread *td, struct linux_open_args *args) args->mode, UIO_USERSPACE)); } if (args->flags & LINUX_O_CREAT) - LCONVPATHCREAT(td, args->path, &path); + LCONVPATHCREAT(args->path, &path); else - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = linux_common_open(td, AT_FDCWD, path, args->flags, args->mode, UIO_SYSSPACE); @@ -299,7 +299,7 @@ linux_name_to_handle_at(struct thread *td, } else { char *path; - LCONVPATH_AT(td, args->name, &path, 0, fd); + LCONVPATH_AT(args->name, &path, 0, fd); error = kern_getfhat(td, bsd_flags, fd, path, UIO_SYSSPACE, &fh, UIO_SYSSPACE); LFREEPATH(path); @@ -665,7 +665,7 @@ linux_access(struct thread *td, struct linux_access_args *args) error = kern_accessat(td, AT_FDCWD, args->path, UIO_USERSPACE, 0, args->amode); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, args->amode); LFREEPATH(path); @@ -690,7 +690,7 @@ linux_do_accessat(struct thread *td, int ldfd, const char *filename, if (!LUSECONVPATH(td)) { error = kern_accessat(td, dfd, filename, UIO_USERSPACE, flags, amode); } else { - LCONVPATHEXIST_AT(td, filename, &path, dfd); + LCONVPATHEXIST_AT(filename, &path, dfd); error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flags, amode); LFREEPATH(path); } @@ -747,7 +747,7 @@ linux_unlink(struct thread *td, struct linux_unlink_args *args) } } } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_funlinkat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0, 0); if (error == EPERM) { /* Introduce POSIX noncompliant behaviour of Linux */ @@ -797,7 +797,7 @@ linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args) return (linux_unlinkat_impl(td, UIO_USERSPACE, args->pathname, dfd, args)); } - LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + LCONVPATHEXIST_AT(args->pathname, &path, dfd); error = linux_unlinkat_impl(td, UIO_SYSSPACE, path, dfd, args); LFREEPATH(path); return (error); @@ -811,7 +811,7 @@ linux_chdir(struct thread *td, struct linux_chdir_args *args) if (!LUSECONVPATH(td)) { return (kern_chdir(td, args->path, UIO_USERSPACE)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_chdir(td, path, UIO_SYSSPACE); LFREEPATH(path); return (error); @@ -828,7 +828,7 @@ linux_chmod(struct thread *td, struct linux_chmod_args *args) return (kern_fchmodat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->mode, 0)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode, 0); LFREEPATH(path); return (error); @@ -846,7 +846,7 @@ linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) return (kern_fchmodat(td, dfd, args->filename, UIO_USERSPACE, args->mode, 0)); } - LCONVPATHEXIST_AT(td, args->filename, &path, dfd); + LCONVPATHEXIST_AT(args->filename, &path, dfd); error = kern_fchmodat(td, dfd, path, UIO_SYSSPACE, args->mode, 0); LFREEPATH(path); return (error); @@ -862,7 +862,7 @@ linux_mkdir(struct thread *td, struct linux_mkdir_args *args) if (!LUSECONVPATH(td)) { return (kern_mkdirat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->mode)); } - LCONVPATHCREAT(td, args->path, &path); + LCONVPATHCREAT(args->path, &path); error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode); LFREEPATH(path); return (error); @@ -879,7 +879,7 @@ linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args) if (!LUSECONVPATH(td)) { return (kern_mkdirat(td, dfd, args->pathname, UIO_USERSPACE, args->mode)); } - LCONVPATHCREAT_AT(td, args->pathname, &path, dfd); + LCONVPATHCREAT_AT(args->pathname, &path, dfd); error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode); LFREEPATH(path); return (error); @@ -896,7 +896,7 @@ linux_rmdir(struct thread *td, struct linux_rmdir_args *args) return (kern_frmdirat(td, AT_FDCWD, args->path, FD_NONE, UIO_USERSPACE, 0)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_frmdirat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0); LFREEPATH(path); return (error); @@ -912,9 +912,9 @@ linux_rename(struct thread *td, struct linux_rename_args *args) return (kern_renameat(td, AT_FDCWD, args->from, AT_FDCWD, args->to, UIO_USERSPACE)); } - LCONVPATHEXIST(td, args->from, &from); + LCONVPATHEXIST(args->from, &from); /* Expand LCONVPATHCREATE so that `from' can be freed on errors */ - error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); + error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); if (to == NULL) { LFREEPATH(from); return (error); @@ -973,9 +973,9 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args) return (kern_renameat(td, olddfd, args->oldname, newdfd, args->newname, UIO_USERSPACE)); } - LCONVPATHEXIST_AT(td, args->oldname, &from, olddfd); + LCONVPATHEXIST_AT(args->oldname, &from, olddfd); /* Expand LCONVPATHCREATE so that `from' can be freed on errors */ - error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, newdfd); + error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, newdfd); if (to == NULL) { LFREEPATH(from); return (error); @@ -997,9 +997,9 @@ linux_symlink(struct thread *td, struct linux_symlink_args *args) return (kern_symlinkat(td, args->path, AT_FDCWD, args->to, UIO_USERSPACE)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ - error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); + error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); if (to == NULL) { LFREEPATH(path); return (error); @@ -1022,9 +1022,9 @@ linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args) return (kern_symlinkat(td, args->oldname, dfd, args->newname, UIO_USERSPACE)); } - LCONVPATHEXIST(td, args->oldname, &path); + LCONVPATHEXIST(args->oldname, &path); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ - error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, dfd); + error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, dfd); if (to == NULL) { LFREEPATH(path); return (error); @@ -1046,7 +1046,7 @@ linux_readlink(struct thread *td, struct linux_readlink_args *args) return (kern_readlinkat(td, AT_FDCWD, args->name, UIO_USERSPACE, args->buf, UIO_USERSPACE, args->count)); } - LCONVPATHEXIST(td, args->name, &name); + LCONVPATHEXIST(args->name, &name); error = kern_readlinkat(td, AT_FDCWD, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE, args->count); LFREEPATH(name); @@ -1065,7 +1065,7 @@ linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) return (kern_readlinkat(td, dfd, args->path, UIO_USERSPACE, args->buf, UIO_USERSPACE, args->bufsiz)); } - LCONVPATHEXIST_AT(td, args->path, &name, dfd); + LCONVPATHEXIST_AT(args->path, &name, dfd); error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE, args->bufsiz); LFREEPATH(name); @@ -1081,7 +1081,7 @@ linux_truncate(struct thread *td, struct linux_truncate_args *args) if (!LUSECONVPATH(td)) { return (kern_truncate(td, args->path, UIO_USERSPACE, args->length)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_truncate(td, path, UIO_SYSSPACE, args->length); LFREEPATH(path); return (error); @@ -1104,7 +1104,7 @@ linux_truncate64(struct thread *td, struct linux_truncate64_args *args) if (!LUSECONVPATH(td)) { return (kern_truncate(td, args->path, UIO_USERSPACE, length)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_truncate(td, path, UIO_SYSSPACE, length); LFREEPATH(path); return (error); @@ -1145,9 +1145,9 @@ linux_link(struct thread *td, struct linux_link_args *args) return (kern_linkat(td, AT_FDCWD, AT_FDCWD, args->path, args->to, UIO_USERSPACE, AT_SYMLINK_FOLLOW)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ - error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); + error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD); if (to == NULL) { LFREEPATH(path); return (error); @@ -1179,9 +1179,9 @@ linux_linkat(struct thread *td, struct linux_linkat_args *args) return (kern_linkat(td, olddfd, newdfd, args->oldname, args->newname, UIO_USERSPACE, flag)); } - LCONVPATHEXIST_AT(td, args->oldname, &path, olddfd); + LCONVPATHEXIST_AT(args->oldname, &path, olddfd); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ - error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, newdfd); + error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, newdfd); if (to == NULL) { LFREEPATH(path); return (error); @@ -1775,7 +1775,7 @@ linux_chown(struct thread *td, struct linux_chown_args *args) return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->uid, args->gid, 0)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid, 0); LFREEPATH(path); @@ -1805,7 +1805,7 @@ linux_fchownat(struct thread *td, struct linux_fchownat_args *args) return (kern_fchownat(td, dfd, args->filename, UIO_USERSPACE, args->uid, args->gid, flag)); } - LCONVPATHEXIST_AT(td, args->filename, &path, dfd); + LCONVPATHEXIST_AT(args->filename, &path, dfd); error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid, flag); LFREEPATH(path); @@ -1823,7 +1823,7 @@ linux_lchown(struct thread *td, struct linux_lchown_args *args) return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->uid, args->gid, AT_SYMLINK_NOFOLLOW)); } - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid, AT_SYMLINK_NOFOLLOW); LFREEPATH(path); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 79b681ea8b62..2d4936228315 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -279,7 +279,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) UIO_USERSPACE, args->library, td); error = namei(&ni); } else { - LCONVPATHEXIST(td, args->library, &library); + LCONVPATHEXIST(args->library, &library); NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, library, td); error = namei(&ni); @@ -759,7 +759,7 @@ linux_utime(struct thread *td, struct linux_utime_args *args) error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { - LCONVPATHEXIST(td, args->fname, &fname); + LCONVPATHEXIST(args->fname, &fname); error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); LFREEPATH(fname); @@ -791,7 +791,7 @@ linux_utimes(struct thread *td, struct linux_utimes_args *args) error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { - LCONVPATHEXIST(td, args->fname, &fname); + LCONVPATHEXIST(args->fname, &fname); error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); LFREEPATH(fname); @@ -859,7 +859,7 @@ linux_common_utimensat(struct thread *td, int ldfd, const char *pathname, } if (pathname != NULL) - LCONVPATHEXIST_AT(td, pathname, &path, dfd); + LCONVPATHEXIST_AT(pathname, &path, dfd); else if (lflags != 0) return (EINVAL); @@ -978,7 +978,7 @@ linux_futimesat(struct thread *td, struct linux_futimesat_args *args) error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE, tvp, UIO_SYSSPACE); } else { - LCONVPATHEXIST_AT(td, args->filename, &fname, dfd); + LCONVPATHEXIST_AT(args->filename, &fname, dfd); error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE); LFREEPATH(fname); @@ -1154,7 +1154,7 @@ linux_mknod(struct thread *td, struct linux_mknod_args *args) path = args->path; seg = UIO_USERSPACE; } else { - LCONVPATHCREAT(td, args->path, &path); + LCONVPATHCREAT(args->path, &path); seg = UIO_SYSSPACE; } @@ -1210,7 +1210,7 @@ linux_mknodat(struct thread *td, struct linux_mknodat_args *args) path = __DECONST(char *, args->filename); seg = UIO_USERSPACE; } else { - LCONVPATHCREAT_AT(td, args->filename, &path, dfd); + LCONVPATHCREAT_AT(args->filename, &path, dfd); seg = UIO_SYSSPACE; } diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 97bace941943..9dc7686cb963 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -241,7 +241,7 @@ linux_newstat(struct thread *td, struct linux_newstat_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } @@ -260,7 +260,7 @@ linux_newlstat(struct thread *td, struct linux_newlstat_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &sb); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = linux_kern_lstat(td, path, UIO_SYSSPACE, &sb); LFREEPATH(path); } @@ -323,7 +323,7 @@ linux_stat(struct thread *td, struct linux_stat_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } @@ -343,7 +343,7 @@ linux_lstat(struct thread *td, struct linux_lstat_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); error = linux_kern_lstat(td, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } @@ -455,7 +455,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args) bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs); LFREEPATH(path); @@ -503,7 +503,7 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args) bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs); LFREEPATH(path); @@ -617,7 +617,7 @@ linux_stat64(struct thread *td, struct linux_stat64_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_stat(td, args->filename, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST(td, args->filename, &filename); + LCONVPATHEXIST(args->filename, &filename); error = linux_kern_stat(td, filename, UIO_SYSSPACE, &buf); LFREEPATH(filename); } @@ -636,7 +636,7 @@ linux_lstat64(struct thread *td, struct linux_lstat64_args *args) if (!LUSECONVPATH(td)) { error = linux_kern_lstat(td, args->filename, UIO_USERSPACE, &sb); } else { - LCONVPATHEXIST(td, args->filename, &filename); + LCONVPATHEXIST(args->filename, &filename); error = linux_kern_lstat(td, filename, UIO_SYSSPACE, &sb); LFREEPATH(filename); } @@ -681,7 +681,7 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args) error = linux_kern_statat(td, flag, dfd, args->pathname, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + LCONVPATHEXIST_AT(args->pathname, &path, dfd); error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } @@ -716,7 +716,7 @@ linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args) error = linux_kern_statat(td, flag, dfd, args->pathname, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + LCONVPATHEXIST_AT(args->pathname, &path, dfd); error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } @@ -790,7 +790,7 @@ linux_statx(struct thread *td, struct linux_statx_args *args) error = linux_kern_statat(td, flags, dirfd, args->pathname, UIO_USERSPACE, &buf); } else { - LCONVPATHEXIST_AT(td, args->pathname, &path, dirfd); + LCONVPATHEXIST_AT(args->pathname, &path, dirfd); error = linux_kern_statat(td, flags, dirfd, path, UIO_SYSSPACE, &buf); LFREEPATH(path); } diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 5d0bfdde083c..4dd4129cfa0b 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -84,7 +84,7 @@ linux_chown16(struct thread *td, struct linux_chown16_args *args) error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); /* * The DTrace probes have to be after the LCONVPATHEXIST, as * LCONVPATHEXIST may return on its own and we do not want to @@ -109,7 +109,7 @@ linux_lchown16(struct thread *td, struct linux_lchown16_args *args) error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW); } else { - LCONVPATHEXIST(td, args->path, &path); + LCONVPATHEXIST(args->path, &path); /* * The DTrace probes have to be after the LCONVPATHEXIST, as diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 9e6dea35617f..f1d33faa628d 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -99,12 +99,12 @@ SYSCTL_BOOL(_compat_linux, OID_AUTO, use_real_ifnames, CTLFLAG_RWTUN, * named file, i.e. we check if the directory it should be in exists. */ int -linux_emul_convpath(struct thread *td, const char *path, enum uio_seg pathseg, +linux_emul_convpath(const char *path, enum uio_seg pathseg, char **pbuf, int cflag, int dfd) { int retval; - retval = kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf, + retval = kern_alternate_path(curthread, linux_emul_path, path, pathseg, pbuf, cflag, dfd); return (retval); diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index d01058867f06..a29ba0bc4af1 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -51,27 +51,27 @@ MALLOC_DECLARE(M_EPOLL); extern char linux_emul_path[]; extern int linux_use_emul_path; -int linux_emul_convpath(struct thread *, const char *, enum uio_seg, char **, int, int); +int linux_emul_convpath(const char *, enum uio_seg, char **, int, int); #define LUSECONVPATH(td) atomic_load_int(&linux_use_emul_path) -#define LCONVPATH_AT(td, upath, pathp, i, dfd) \ +#define LCONVPATH_AT(upath, pathp, i, dfd) \ do { \ int _error; \ \ - _error = linux_emul_convpath(td, upath, UIO_USERSPACE, \ + _error = linux_emul_convpath(upath, UIO_USERSPACE, \ pathp, i, dfd); \ if (*(pathp) == NULL) \ return (_error); \ } while (0) -#define LCONVPATH(td, upath, pathp, i) \ - LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD) +#define LCONVPATH(upath, pathp, i) \ + LCONVPATH_AT(upath, pathp, i, AT_FDCWD) -#define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) -#define LCONVPATHEXIST_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 0, dfd) -#define LCONVPATHCREAT(td, upath, pathp) LCONVPATH(td, upath, pathp, 1) -#define LCONVPATHCREAT_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 1, dfd) +#define LCONVPATHEXIST(upath, pathp) LCONVPATH(upath, pathp, 0) +#define LCONVPATHEXIST_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 0, dfd) +#define LCONVPATHCREAT(upath, pathp) LCONVPATH(upath, pathp, 1) +#define LCONVPATHCREAT_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 1, dfd) #define LFREEPATH(path) free(path, M_TEMP) #define DUMMY(s) \ diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index c81bf1b4e2e5..dde11f22d4fe 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -108,7 +108,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args) error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE, args->argp, args->envp); } else { - LCONVPATHEXIST(td, args->path, &newpath); + LCONVPATHEXIST(args->path, &newpath); error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE, args->argp, args->envp); LFREEPATH(newpath);