lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 May 2021 09:05:50 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Sascha Hauer <s.hauer@...gutronix.de>
Cc:     Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
        Christoph Hellwig <hch@...radead.org>, kernel@...gutronix.de,
        Jan Kara <jack@...e.com>, Richard Weinberger <richard@....at>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <christian.brauner@...ntu.com>
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

Adding the dfd argument should be as simple as this patch (which also
moves the cmd argument later to match typical calling conventions).

It might be worth to rename the syscall to quotactlat to better match
other syscalls.  A flags argument doesn't make much sense here, as the
cmd argument can be used for extensions and is properly checked for
unknown values.

diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 05e4bd9ab6d6..940101396feb 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -968,8 +968,8 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
 	return ret;
 }
 
-SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
-		mountpoint, qid_t, id, void __user *, addr)
+SYSCALL_DEFINE5(quotactl_path, int, dfd, const char __user *, mountpoint,
+		unsigned int, cmd, qid_t, id, void __user *, addr)
 {
 	struct super_block *sb;
 	struct path mountpath;
@@ -980,8 +980,8 @@ SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
 	if (type >= MAXQUOTAS)
 		return -EINVAL;
 
-	ret = user_path_at(AT_FDCWD, mountpoint,
-			     LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, &mountpath);
+	ret = user_path_at(dfd, mountpoint, LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT,
+			   &mountpath);
 	if (ret)
 		return ret;
 
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a672bbe28577..ae34984e2ab9 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -483,8 +483,8 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags);
 /* fs/quota.c */
 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
 				qid_t id, void __user *addr);
-asmlinkage long sys_quotactl_path(unsigned int cmd, const char __user *mountpoint,
-				  qid_t id, void __user *addr);
+asmlinkage long sys_quotactl_path(int dfd, const char __user *mountpoint,
+		unsigned int cmd, qid_t id, void __user *addr);
 
 /* fs/readdir.c */
 asmlinkage long sys_getdents64(unsigned int fd,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ