From e55f589191162eb40f44696c77e569049313d381 Mon Sep 17 00:00:00 2001 From: Wang Yufen Date: Tue, 11 Nov 2014 15:59:11 +0800 Subject: add argument check in mknod mknod() in glibc/eglibc will check the argument, like this, ... if (k_dev != dev) { __set_errno (EINVAL); return -1; } ... So add argument check in uclibc's mknod() too. Signed-off-by: Wang Yufen Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/mknod.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/mknod.c b/libc/sysdeps/linux/common/mknod.c index 416cab6d0..e0c54e6e3 100644 --- a/libc/sysdeps/linux/common/mknod.c +++ b/libc/sysdeps/linux/common/mknod.c @@ -24,6 +24,10 @@ int mknod(const char *path, mode_t mode, dev_t dev) /* We must convert the value to dev_t type used by the kernel. */ k_dev = (dev) & ((1ULL << 32) - 1); + if (k_dev != dev) { + __set_errno(EINVAL); + return -1; + } return INLINE_SYSCALL(mknod, 3, path, mode, (unsigned int)k_dev); } #endif -- cgit v1.2.3 From d88e1855ff2828fbad0335fc8e06dd295e1c1130 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 24 Jan 2015 20:50:02 +0100 Subject: libc: ppc64 etc: Fix sync_file_range Fix copy'n paste error for ppc64 and other sync_file_range2 arches Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/sync_file_range.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index 8d4ed9210..267b922eb 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -23,10 +23,13 @@ static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigned int flags) { # if defined __powerpc__ && __WORDSIZE == 64 - return INLINE_SYSCALL(sync_file_range, 4, fd, offset, nbytes, flags); + return INLINE_SYSCALL(sync_file_range, 4, fd, flags, offset, nbytes); # elif defined __mips__ && _MIPS_SIM == _ABIO32 return INLINE_SYSCALL(sync_file_range, 7, fd, 0, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags); +# elif defined __NR_sync_file_range2 + return INLINE_SYSCALL(sync_file_range, 6, fd, flags + OFF64_HI_LO(offset), OFF64_HI_LO(nbytes)); # else return INLINE_SYSCALL(sync_file_range, 6, fd, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags); -- cgit v1.2.3 From 92de8a5f6ffb1ff9f7183fd08d872aa098b75ae2 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 26 Jan 2015 16:50:29 +0100 Subject: libc: sync_file_range missing comma Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/sync_file_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index 267b922eb..6cd7e94d6 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -28,7 +28,7 @@ static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigne return INLINE_SYSCALL(sync_file_range, 7, fd, 0, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags); # elif defined __NR_sync_file_range2 - return INLINE_SYSCALL(sync_file_range, 6, fd, flags + return INLINE_SYSCALL(sync_file_range, 6, fd, flags, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes)); # else return INLINE_SYSCALL(sync_file_range, 6, fd, -- cgit v1.2.3