Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
3f6d078d
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3f6d078d
编写于
2月 24, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compat truncate/ftruncate
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
561c6731
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
29 addition
and
35 deletion
+29
-35
arch/arm64/include/asm/unistd32.h
arch/arm64/include/asm/unistd32.h
+2
-2
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/scall64-o32.S
+2
-2
arch/parisc/kernel/syscall_table.S
arch/parisc/kernel/syscall_table.S
+2
-2
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/kernel/sys_ppc32.c
+0
-12
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/compat_wrapper.S
+0
-10
arch/s390/kernel/syscalls.S
arch/s390/kernel/syscalls.S
+2
-2
arch/sparc/kernel/sys32.S
arch/sparc/kernel/sys32.S
+0
-1
arch/sparc/kernel/systbls_64.S
arch/sparc/kernel/systbls_64.S
+2
-2
arch/x86/syscalls/syscall_32.tbl
arch/x86/syscalls/syscall_32.tbl
+2
-2
fs/open.c
fs/open.c
+15
-0
include/linux/compat.h
include/linux/compat.h
+2
-0
未找到文件。
arch/arm64/include/asm/unistd32.h
浏览文件 @
3f6d078d
...
@@ -113,8 +113,8 @@ __SYSCALL(88, sys_reboot)
...
@@ -113,8 +113,8 @@ __SYSCALL(88, sys_reboot)
__SYSCALL
(
89
,
sys_ni_syscall
)
/* 89 was sys_readdir */
__SYSCALL
(
89
,
sys_ni_syscall
)
/* 89 was sys_readdir */
__SYSCALL
(
90
,
sys_ni_syscall
)
/* 90 was sys_mmap */
__SYSCALL
(
90
,
sys_ni_syscall
)
/* 90 was sys_mmap */
__SYSCALL
(
91
,
sys_munmap
)
__SYSCALL
(
91
,
sys_munmap
)
__SYSCALL
(
92
,
sys_truncate
)
__SYSCALL
(
92
,
compat_
sys_truncate
)
__SYSCALL
(
93
,
sys_ftruncate
)
__SYSCALL
(
93
,
compat_
sys_ftruncate
)
__SYSCALL
(
94
,
sys_fchmod
)
__SYSCALL
(
94
,
sys_fchmod
)
__SYSCALL
(
95
,
sys_fchown16
)
__SYSCALL
(
95
,
sys_fchown16
)
__SYSCALL
(
96
,
sys_getpriority
)
__SYSCALL
(
96
,
sys_getpriority
)
...
...
arch/mips/kernel/scall64-o32.S
浏览文件 @
3f6d078d
...
@@ -284,8 +284,8 @@ sys_call_table:
...
@@ -284,8 +284,8 @@ sys_call_table:
PTR
compat_sys_old_readdir
PTR
compat_sys_old_readdir
PTR
sys_mips_mmap
/*
4090
*/
PTR
sys_mips_mmap
/*
4090
*/
PTR
sys_munmap
PTR
sys_munmap
PTR
sys_truncate
PTR
compat_
sys_truncate
PTR
sys_ftruncate
PTR
compat_
sys_ftruncate
PTR
sys_fchmod
PTR
sys_fchmod
PTR
sys_fchown
/*
4095
*/
PTR
sys_fchown
/*
4095
*/
PTR
sys_getpriority
PTR
sys_getpriority
...
...
arch/parisc/kernel/syscall_table.S
浏览文件 @
3f6d078d
...
@@ -165,8 +165,8 @@
...
@@ -165,8 +165,8 @@
ENTRY_SAME
(
mmap2
)
ENTRY_SAME
(
mmap2
)
ENTRY_SAME
(
mmap
)
/*
90
*/
ENTRY_SAME
(
mmap
)
/*
90
*/
ENTRY_SAME
(
munmap
)
ENTRY_SAME
(
munmap
)
ENTRY_
SAME
(
truncate
)
ENTRY_
COMP
(
truncate
)
ENTRY_
SAME
(
ftruncate
)
ENTRY_
COMP
(
ftruncate
)
ENTRY_SAME
(
fchmod
)
ENTRY_SAME
(
fchmod
)
ENTRY_SAME
(
fchown
)
/*
95
*/
ENTRY_SAME
(
fchown
)
/*
95
*/
ENTRY_SAME
(
getpriority
)
ENTRY_SAME
(
getpriority
)
...
...
arch/powerpc/kernel/sys_ppc32.c
浏览文件 @
3f6d078d
...
@@ -146,18 +146,6 @@ asmlinkage long compat_sys_sendfile64_wrapper(u32 out_fd, u32 in_fd,
...
@@ -146,18 +146,6 @@ asmlinkage long compat_sys_sendfile64_wrapper(u32 out_fd, u32 in_fd,
(
off_t
__user
*
)
offset
,
count
);
(
off_t
__user
*
)
offset
,
count
);
}
}
long
compat_sys_truncate
(
const
char
__user
*
path
,
u32
length
)
{
/* sign extend length */
return
sys_truncate
(
path
,
(
int
)
length
);
}
long
compat_sys_ftruncate
(
int
fd
,
u32
length
)
{
/* sign extend length */
return
sys_ftruncate
(
fd
,
(
int
)
length
);
}
unsigned
long
compat_sys_mmap2
(
unsigned
long
addr
,
size_t
len
,
unsigned
long
compat_sys_mmap2
(
unsigned
long
addr
,
size_t
len
,
unsigned
long
prot
,
unsigned
long
flags
,
unsigned
long
prot
,
unsigned
long
flags
,
unsigned
long
fd
,
unsigned
long
pgoff
)
unsigned
long
fd
,
unsigned
long
pgoff
)
...
...
arch/s390/kernel/compat_wrapper.S
浏览文件 @
3f6d078d
...
@@ -325,16 +325,6 @@ ENTRY(sys32_munmap_wrapper)
...
@@ -325,16 +325,6 @@ ENTRY(sys32_munmap_wrapper)
llgfr
%
r3
,%
r3
#
size_t
llgfr
%
r3
,%
r3
#
size_t
jg
sys_munmap
#
branch
to
system
call
jg
sys_munmap
#
branch
to
system
call
ENTRY
(
sys32_truncate_wrapper
)
llgtr
%
r2
,%
r2
#
const
char
*
lgfr
%
r3
,%
r3
#
long
jg
sys_truncate
#
branch
to
system
call
ENTRY
(
sys32_ftruncate_wrapper
)
llgfr
%
r2
,%
r2
#
unsigned
int
llgfr
%
r3
,%
r3
#
unsigned
long
jg
sys_ftruncate
#
branch
to
system
call
ENTRY
(
sys32_fchmod_wrapper
)
ENTRY
(
sys32_fchmod_wrapper
)
llgfr
%
r2
,%
r2
#
unsigned
int
llgfr
%
r2
,%
r2
#
unsigned
int
llgfr
%
r3
,%
r3
#
mode_t
llgfr
%
r3
,%
r3
#
mode_t
...
...
arch/s390/kernel/syscalls.S
浏览文件 @
3f6d078d
...
@@ -100,8 +100,8 @@ SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)
...
@@ -100,8 +100,8 @@ SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)
SYSCALL
(
sys_ni_syscall
,
sys_ni_syscall
,
old32_readdir_wrapper
)
/
*
old
readdir
syscall
*/
SYSCALL
(
sys_ni_syscall
,
sys_ni_syscall
,
old32_readdir_wrapper
)
/
*
old
readdir
syscall
*/
SYSCALL
(
sys_old_mmap
,
sys_old_mmap
,
old32_mmap_wrapper
)
/
*
90
*/
SYSCALL
(
sys_old_mmap
,
sys_old_mmap
,
old32_mmap_wrapper
)
/
*
90
*/
SYSCALL
(
sys_munmap
,
sys_munmap
,
sys32_munmap_wrapper
)
SYSCALL
(
sys_munmap
,
sys_munmap
,
sys32_munmap_wrapper
)
SYSCALL
(
sys_truncate
,
sys_truncate
,
sys32_truncate_wrapper
)
SYSCALL
(
sys_truncate
,
sys_truncate
,
compat_sys_truncate
)
SYSCALL
(
sys_ftruncate
,
sys_ftruncate
,
sys32_ftruncate_wrapper
)
SYSCALL
(
sys_ftruncate
,
sys_ftruncate
,
compat_sys_ftruncate
)
SYSCALL
(
sys_fchmod
,
sys_fchmod
,
sys32_fchmod_wrapper
)
SYSCALL
(
sys_fchmod
,
sys_fchmod
,
sys32_fchmod_wrapper
)
SYSCALL
(
sys_fchown16
,
sys_ni_syscall
,
sys32_fchown16_wrapper
)
/
*
95
old
fchown16
syscall
*/
SYSCALL
(
sys_fchown16
,
sys_ni_syscall
,
sys32_fchown16_wrapper
)
/
*
95
old
fchown16
syscall
*/
SYSCALL
(
sys_getpriority
,
sys_getpriority
,
sys32_getpriority_wrapper
)
SYSCALL
(
sys_getpriority
,
sys_getpriority
,
sys32_getpriority_wrapper
)
...
...
arch/sparc/kernel/sys32.S
浏览文件 @
3f6d078d
...
@@ -52,7 +52,6 @@ SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0)
...
@@ -52,7 +52,6 @@ SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0)
SIGN1
(
sys32_sendmsg
,
compat_sys_sendmsg
,
%
o0
)
SIGN1
(
sys32_sendmsg
,
compat_sys_sendmsg
,
%
o0
)
SIGN2
(
sys32_sync_file_range
,
compat_sync_file_range
,
%
o0
,
%
o5
)
SIGN2
(
sys32_sync_file_range
,
compat_sync_file_range
,
%
o0
,
%
o5
)
SIGN1
(
sys32_vmsplice
,
compat_sys_vmsplice
,
%
o0
)
SIGN1
(
sys32_vmsplice
,
compat_sys_vmsplice
,
%
o0
)
SIGN1
(
sys32_truncate
,
sys_truncate
,
%
o1
)
.
globl
sys32_mmap2
.
globl
sys32_mmap2
sys32_mmap2
:
sys32_mmap2
:
...
...
arch/sparc/kernel/systbls_64.S
浏览文件 @
3f6d078d
...
@@ -43,8 +43,8 @@ sys_call_table32:
...
@@ -43,8 +43,8 @@ sys_call_table32:
/*
110
*/
.
word
sys_setresgid
,
sys_getresgid
,
sys_setregid
,
sys_nis_syscall
,
sys_nis_syscall
/*
110
*/
.
word
sys_setresgid
,
sys_getresgid
,
sys_setregid
,
sys_nis_syscall
,
sys_nis_syscall
.
word
sys_getgroups
,
compat_sys_gettimeofday
,
sys32_getrusage
,
sys_nis_syscall
,
sys_getcwd
.
word
sys_getgroups
,
compat_sys_gettimeofday
,
sys32_getrusage
,
sys_nis_syscall
,
sys_getcwd
/*
120
*/
.
word
compat_sys_readv
,
compat_sys_writev
,
compat_sys_settimeofday
,
sys_fchown16
,
sys_fchmod
/*
120
*/
.
word
compat_sys_readv
,
compat_sys_writev
,
compat_sys_settimeofday
,
sys_fchown16
,
sys_fchmod
.
word
sys_nis_syscall
,
sys_setreuid16
,
sys_setregid16
,
sys_rename
,
sys32
_truncate
.
word
sys_nis_syscall
,
sys_setreuid16
,
sys_setregid16
,
sys_rename
,
compat_sys
_truncate
/*
130
*/
.
word
sys_ftruncate
,
sys_flock
,
compat_sys_lstat64
,
sys_nis_syscall
,
sys_nis_syscall
/*
130
*/
.
word
compat_
sys_ftruncate
,
sys_flock
,
compat_sys_lstat64
,
sys_nis_syscall
,
sys_nis_syscall
.
word
sys_nis_syscall
,
sys_mkdir
,
sys_rmdir
,
compat_sys_utimes
,
compat_sys_stat64
.
word
sys_nis_syscall
,
sys_mkdir
,
sys_rmdir
,
compat_sys_utimes
,
compat_sys_stat64
/*
140
*/
.
word
sys_sendfile64
,
sys_nis_syscall
,
sys32_futex
,
sys_gettid
,
compat_sys_getrlimit
/*
140
*/
.
word
sys_sendfile64
,
sys_nis_syscall
,
sys32_futex
,
sys_gettid
,
compat_sys_getrlimit
.
word
compat_sys_setrlimit
,
sys_pivot_root
,
sys_prctl
,
sys_pciconfig_read
,
sys_pciconfig_write
.
word
compat_sys_setrlimit
,
sys_pivot_root
,
sys_prctl
,
sys_pciconfig_read
,
sys_pciconfig_write
...
...
arch/x86/syscalls/syscall_32.tbl
浏览文件 @
3f6d078d
...
@@ -98,8 +98,8 @@
...
@@ -98,8 +98,8 @@
89 i386 readdir sys_old_readdir compat_sys_old_readdir
89 i386 readdir sys_old_readdir compat_sys_old_readdir
90 i386 mmap sys_old_mmap sys32_mmap
90 i386 mmap sys_old_mmap sys32_mmap
91 i386 munmap sys_munmap
91 i386 munmap sys_munmap
92 i386 truncate sys_truncate
92 i386 truncate sys_truncate
compat_sys_truncate
93 i386 ftruncate sys_ftruncate
93 i386 ftruncate sys_ftruncate
compat_sys_ftruncate
94 i386 fchmod sys_fchmod
94 i386 fchmod sys_fchmod
95 i386 fchown sys_fchown16
95 i386 fchown sys_fchown16
96 i386 getpriority sys_getpriority
96 i386 getpriority sys_getpriority
...
...
fs/open.c
浏览文件 @
3f6d078d
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <linux/fs_struct.h>
#include <linux/fs_struct.h>
#include <linux/ima.h>
#include <linux/ima.h>
#include <linux/dnotify.h>
#include <linux/dnotify.h>
#include <linux/compat.h>
#include "internal.h"
#include "internal.h"
...
@@ -140,6 +141,13 @@ SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
...
@@ -140,6 +141,13 @@ SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
return
do_sys_truncate
(
path
,
length
);
return
do_sys_truncate
(
path
,
length
);
}
}
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2
(
truncate
,
const
char
__user
*
,
path
,
compat_off_t
,
length
)
{
return
do_sys_truncate
(
path
,
length
);
}
#endif
static
long
do_sys_ftruncate
(
unsigned
int
fd
,
loff_t
length
,
int
small
)
static
long
do_sys_ftruncate
(
unsigned
int
fd
,
loff_t
length
,
int
small
)
{
{
struct
inode
*
inode
;
struct
inode
*
inode
;
...
@@ -195,6 +203,13 @@ SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
...
@@ -195,6 +203,13 @@ SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
return
ret
;
return
ret
;
}
}
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2
(
ftruncate
,
unsigned
int
,
fd
,
compat_ulong_t
,
length
)
{
return
do_sys_ftruncate
(
fd
,
length
,
1
);
}
#endif
/* LFS versions of truncate are only needed on 32 bit machines */
/* LFS versions of truncate are only needed on 32 bit machines */
#if BITS_PER_LONG == 32
#if BITS_PER_LONG == 32
SYSCALL_DEFINE
(
truncate64
)(
const
char
__user
*
path
,
loff_t
length
)
SYSCALL_DEFINE
(
truncate64
)(
const
char
__user
*
path
,
loff_t
length
)
...
...
include/linux/compat.h
浏览文件 @
3f6d078d
...
@@ -536,6 +536,8 @@ asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
...
@@ -536,6 +536,8 @@ asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
asmlinkage
long
compat_sys_open_by_handle_at
(
int
mountdirfd
,
asmlinkage
long
compat_sys_open_by_handle_at
(
int
mountdirfd
,
struct
file_handle
__user
*
handle
,
struct
file_handle
__user
*
handle
,
int
flags
);
int
flags
);
asmlinkage
long
compat_sys_truncate
(
const
char
__user
*
,
compat_off_t
);
asmlinkage
long
compat_sys_ftruncate
(
unsigned
int
,
compat_ulong_t
);
asmlinkage
long
compat_sys_pselect6
(
int
n
,
compat_ulong_t
__user
*
inp
,
asmlinkage
long
compat_sys_pselect6
(
int
n
,
compat_ulong_t
__user
*
inp
,
compat_ulong_t
__user
*
outp
,
compat_ulong_t
__user
*
outp
,
compat_ulong_t
__user
*
exp
,
compat_ulong_t
__user
*
exp
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录