From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Add leading underscores to filldir, fillonedir, compat_fillonedir, filldir64
Date: Mon, 25 Feb 2013 15:54:11 -0500 [thread overview]
Message-ID: <20130225205411.GB13157@Krystal> (raw)
Document that these functions expect access_ok() to be performed on
dirent between reception from user-space and call to these functions.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Al Viro <viro@ZenIV.linux.org.uk>
---
fs/compat.c | 4 ++--
fs/readdir.c | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
Index: linux/fs/compat.c
===================================================================
--- linux.orig/fs/compat.c
+++ linux/fs/compat.c
@@ -834,7 +834,7 @@ struct compat_readdir_callback {
int result;
};
-static int compat_fillonedir(void *__buf, const char *name, int namlen,
+static int __compat_fillonedir(void *__buf, const char *name, int namlen,
loff_t offset, u64 ino, unsigned int d_type)
{
struct compat_readdir_callback *buf = __buf;
@@ -879,7 +879,7 @@ asmlinkage long compat_sys_old_readdir(u
buf.result = 0;
buf.dirent = dirent;
- error = vfs_readdir(f.file, compat_fillonedir, &buf);
+ error = vfs_readdir(f.file, __compat_fillonedir, &buf);
if (buf.result)
error = buf.result;
Index: linux/fs/readdir.c
===================================================================
--- linux.orig/fs/readdir.c
+++ linux/fs/readdir.c
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(vfs_readdir);
*
* "count=1" is a special case, meaning that the buffer is one
* dirent-structure in size and that the code can't handle more
- * anyway. Thus the special "fillonedir()" function for that
+ * anyway. Thus the special "__fillonedir()" function for that
* case (the low-level handlers don't need to care about this).
*/
@@ -70,7 +70,7 @@ struct readdir_callback {
int result;
};
-static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
+static int __fillonedir(void * __buf, const char * name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
{
struct readdir_callback * buf = (struct readdir_callback *) __buf;
@@ -115,7 +115,7 @@ SYSCALL_DEFINE3(old_readdir, unsigned in
buf.result = 0;
buf.dirent = dirent;
- error = vfs_readdir(f.file, fillonedir, &buf);
+ error = vfs_readdir(f.file, __fillonedir, &buf);
if (buf.result)
error = buf.result;
@@ -143,7 +143,7 @@ struct getdents_callback {
int error;
};
-static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
+static int __filldir(void * __buf, const char * name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
{
struct linux_dirent __user * dirent;
@@ -206,7 +206,7 @@ SYSCALL_DEFINE3(getdents, unsigned int,
buf.count = count;
buf.error = 0;
- error = vfs_readdir(f.file, filldir, &buf);
+ error = vfs_readdir(f.file, __filldir, &buf);
if (error >= 0)
error = buf.error;
lastdirent = buf.previous;
@@ -227,7 +227,7 @@ struct getdents_callback64 {
int error;
};
-static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,
+static int __filldir64(void * __buf, const char * name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
{
struct linux_dirent64 __user *dirent;
@@ -286,7 +286,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int
buf.count = count;
buf.error = 0;
- error = vfs_readdir(f.file, filldir64, &buf);
+ error = vfs_readdir(f.file, __filldir64, &buf);
if (error >= 0)
error = buf.error;
lastdirent = buf.previous;
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
reply other threads:[~2013-02-25 20:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130225205411.GB13157@Krystal \
--to=mathieu.desnoyers@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®