Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
25cd22ca
Commit
25cd22ca
authored
Apr 09, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate fs/stat.c with user pointer annotations.
parent
898df34c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
fs/stat.c
fs/stat.c
+15
-15
include/linux/fs.h
include/linux/fs.h
+1
-1
No files found.
fs/stat.c
View file @
25cd22ca
...
@@ -56,7 +56,7 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
...
@@ -56,7 +56,7 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
return
0
;
return
0
;
}
}
int
vfs_stat
(
char
*
name
,
struct
kstat
*
stat
)
int
vfs_stat
(
char
__user
*
name
,
struct
kstat
*
stat
)
{
{
struct
nameidata
nd
;
struct
nameidata
nd
;
int
error
;
int
error
;
...
@@ -69,7 +69,7 @@ int vfs_stat(char *name, struct kstat *stat)
...
@@ -69,7 +69,7 @@ int vfs_stat(char *name, struct kstat *stat)
return
error
;
return
error
;
}
}
int
vfs_lstat
(
char
*
name
,
struct
kstat
*
stat
)
int
vfs_lstat
(
char
__user
*
name
,
struct
kstat
*
stat
)
{
{
struct
nameidata
nd
;
struct
nameidata
nd
;
int
error
;
int
error
;
...
@@ -102,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
...
@@ -102,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
* For backward compatibility? Maybe this should be moved
* For backward compatibility? Maybe this should be moved
* into arch/i386 instead?
* into arch/i386 instead?
*/
*/
static
int
cp_old_stat
(
struct
kstat
*
stat
,
struct
__old_kernel_stat
*
statbuf
)
static
int
cp_old_stat
(
struct
kstat
*
stat
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
{
static
int
warncount
=
5
;
static
int
warncount
=
5
;
struct
__old_kernel_stat
tmp
;
struct
__old_kernel_stat
tmp
;
...
@@ -134,7 +134,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat * statbuf)
...
@@ -134,7 +134,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat * statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
}
asmlinkage
long
sys_stat
(
char
*
filename
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_stat
(
char
__user
*
filename
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
@@ -144,7 +144,7 @@ asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
...
@@ -144,7 +144,7 @@ asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_lstat
(
char
*
filename
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_lstat
(
char
__user
*
filename
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
@@ -154,7 +154,7 @@ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
...
@@ -154,7 +154,7 @@ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_fstat
(
unsigned
int
fd
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_fstat
(
unsigned
int
fd
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
@@ -167,7 +167,7 @@ asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf)
...
@@ -167,7 +167,7 @@ asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf)
#endif
#endif
static
int
cp_new_stat
(
struct
kstat
*
stat
,
struct
stat
*
statbuf
)
static
int
cp_new_stat
(
struct
kstat
*
stat
,
struct
stat
__user
*
statbuf
)
{
{
struct
stat
tmp
;
struct
stat
tmp
;
...
@@ -197,7 +197,7 @@ static int cp_new_stat(struct kstat *stat, struct stat *statbuf)
...
@@ -197,7 +197,7 @@ static int cp_new_stat(struct kstat *stat, struct stat *statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
}
asmlinkage
long
sys_newstat
(
char
*
filename
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newstat
(
char
__user
*
filename
,
struct
stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
@@ -207,7 +207,7 @@ asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
...
@@ -207,7 +207,7 @@ asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_newlstat
(
char
*
filename
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newlstat
(
char
__user
*
filename
,
struct
stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
@@ -217,7 +217,7 @@ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
...
@@ -217,7 +217,7 @@ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_newfstat
(
unsigned
int
fd
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newfstat
(
unsigned
int
fd
,
struct
stat
__user
*
statbuf
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
@@ -228,7 +228,7 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf)
...
@@ -228,7 +228,7 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_readlink
(
const
char
*
path
,
cha
r
*
buf
,
int
bufsiz
)
asmlinkage
long
sys_readlink
(
const
char
__user
*
path
,
char
__use
r
*
buf
,
int
bufsiz
)
{
{
struct
nameidata
nd
;
struct
nameidata
nd
;
int
error
;
int
error
;
...
@@ -257,7 +257,7 @@ asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz)
...
@@ -257,7 +257,7 @@ asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz)
/* ---------- LFS-64 ----------- */
/* ---------- LFS-64 ----------- */
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
static
long
cp_new_stat64
(
struct
kstat
*
stat
,
struct
stat64
*
statbuf
)
static
long
cp_new_stat64
(
struct
kstat
*
stat
,
struct
stat64
__user
*
statbuf
)
{
{
struct
stat64
tmp
;
struct
stat64
tmp
;
...
@@ -284,7 +284,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 *statbuf)
...
@@ -284,7 +284,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 *statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
}
asmlinkage
long
sys_stat64
(
char
*
filename
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_stat64
(
char
__user
*
filename
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
@@ -294,7 +294,7 @@ asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags)
...
@@ -294,7 +294,7 @@ asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags)
return
error
;
return
error
;
}
}
asmlinkage
long
sys_lstat64
(
char
*
filename
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_lstat64
(
char
__user
*
filename
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
@@ -304,7 +304,7 @@ asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags
...
@@ -304,7 +304,7 @@ asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags
return
error
;
return
error
;
}
}
asmlinkage
long
sys_fstat64
(
unsigned
long
fd
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_fstat64
(
unsigned
long
fd
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
{
struct
kstat
stat
;
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
...
include/linux/fs.h
View file @
25cd22ca
...
@@ -738,7 +738,7 @@ struct inode_operations {
...
@@ -738,7 +738,7 @@ struct inode_operations {
int
(
*
mknod
)
(
struct
inode
*
,
struct
dentry
*
,
int
,
dev_t
);
int
(
*
mknod
)
(
struct
inode
*
,
struct
dentry
*
,
int
,
dev_t
);
int
(
*
rename
)
(
struct
inode
*
,
struct
dentry
*
,
int
(
*
rename
)
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
);
struct
inode
*
,
struct
dentry
*
);
int
(
*
readlink
)
(
struct
dentry
*
,
char
*
,
int
);
int
(
*
readlink
)
(
struct
dentry
*
,
char
__user
*
,
int
);
int
(
*
follow_link
)
(
struct
dentry
*
,
struct
nameidata
*
);
int
(
*
follow_link
)
(
struct
dentry
*
,
struct
nameidata
*
);
void
(
*
truncate
)
(
struct
inode
*
);
void
(
*
truncate
)
(
struct
inode
*
);
int
(
*
permission
)
(
struct
inode
*
,
int
);
int
(
*
permission
)
(
struct
inode
*
,
int
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment