From fd4d81dd04b4e606ce40a41d66368ba77c77c753 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Fri, 19 Jun 2009 10:39:36 +0300 Subject: [PATCH 1/8] linux-user: increment MAX_ARG_PAGES There's a error When doing something like that : find / -type f -print0 | xargs -0 echo [ done in a arm chroot with qemu-arm and linux binfmt stuff or with find / -type f -print0 | qemu-arm -L /usr/bin/xargs -0 echo ] Doing this outsite qemu is fine. The problem was the huge number of parameters. Increasing MAX_ARG_PAGES is fixing that. While I was at it, I've modified linux-user/main.c to report error code of loader_exec. It helps to debug/know what's wrong. Signed-off-by: Arnaud Patard Signed-off-by: Riku Voipio --- linux-user/main.c | 8 +++++--- linux-user/qemu.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 7eabd0c22f..345d338a1e 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2372,6 +2372,7 @@ int main(int argc, char **argv, char **envp) envlist_t *envlist = NULL; const char *argv0 = NULL; int i; + int ret; if (argc <= 1) usage(); @@ -2576,9 +2577,10 @@ int main(int argc, char **argv, char **envp) env->opaque = ts; task_settid(ts); - if (loader_exec(filename, target_argv, target_environ, regs, - info, &bprm) != 0) { - printf("Error loading %s\n", filename); + ret = loader_exec(filename, target_argv, target_environ, regs, + info, &bprm); + if (ret != 0) { + printf("Error %d while loading %s\n", ret, filename); _exit(1); } diff --git a/linux-user/qemu.h b/linux-user/qemu.h index e04a31c69c..83ad443c23 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -140,7 +140,7 @@ extern const char *qemu_uname_release; * and envelope for the new program. 32 should suffice, this gives * a maximum env+arg of 128kB w/4KB pages! */ -#define MAX_ARG_PAGES 32 +#define MAX_ARG_PAGES 33 /* * This structure is used to hold the arguments that are From 917507b01efea8017bfcb4188ac696612e363e72 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Fri, 19 Jun 2009 10:44:45 +0300 Subject: [PATCH 2/8] linux-user: check some parameters for some socket syscalls. This patch is fixing following issues : - commit 8fea36025b9d6d360ff3b78f88a84ccf221807e8 was applied to do_getsockname instead of do_accept. - Some syscalls were not checking properly the memory addresses passed as argument - Add check before syscalls made for cases like do_getpeername() where we're using the address parameter after doing the syscall - Fix do_accept to return EINVAL instead of EFAULT when parameters invalid to match with linux behaviour Signed-off-by: Arnaud Patard Signed-off-by: Riku Voipio --- linux-user/syscall.c | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 11564fd0bc..a96e86ae72 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1498,13 +1498,17 @@ static abi_long do_bind(int sockfd, abi_ulong target_addr, socklen_t addrlen) { void *addr; + abi_long ret; if (addrlen < 0) return -TARGET_EINVAL; addr = alloca(addrlen+1); - target_to_host_sockaddr(addr, target_addr, addrlen); + ret = target_to_host_sockaddr(addr, target_addr, addrlen); + if (ret) + return ret; + return get_errno(bind(sockfd, addr, addrlen)); } @@ -1513,13 +1517,17 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr, socklen_t addrlen) { void *addr; + abi_long ret; if (addrlen < 0) return -TARGET_EINVAL; addr = alloca(addrlen); - target_to_host_sockaddr(addr, target_addr, addrlen); + ret = target_to_host_sockaddr(addr, target_addr, addrlen); + if (ret) + return ret; + return get_errno(connect(sockfd, addr, addrlen)); } @@ -1543,8 +1551,12 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg, if (msgp->msg_name) { msg.msg_namelen = tswap32(msgp->msg_namelen); msg.msg_name = alloca(msg.msg_namelen); - target_to_host_sockaddr(msg.msg_name, tswapl(msgp->msg_name), + ret = target_to_host_sockaddr(msg.msg_name, tswapl(msgp->msg_name), msg.msg_namelen); + if (ret) { + unlock_user_struct(msgp, target_msg, send ? 0 : 1); + return ret; + } } else { msg.msg_name = NULL; msg.msg_namelen = 0; @@ -1586,12 +1598,19 @@ static abi_long do_accept(int fd, abi_ulong target_addr, void *addr; abi_long ret; + if (target_addr == 0) + return get_errno(accept(fd, NULL, NULL)); + + /* linux returns EINVAL if addrlen pointer is invalid */ if (get_user_u32(addrlen, target_addrlen_addr)) - return -TARGET_EFAULT; + return -TARGET_EINVAL; if (addrlen < 0) return -TARGET_EINVAL; + if (!access_ok(VERIFY_WRITE, target_addr, addrlen)) + return -TARGET_EINVAL; + addr = alloca(addrlen); ret = get_errno(accept(fd, addr, &addrlen)); @@ -1617,6 +1636,9 @@ static abi_long do_getpeername(int fd, abi_ulong target_addr, if (addrlen < 0) return -TARGET_EINVAL; + if (!access_ok(VERIFY_WRITE, target_addr, addrlen)) + return -TARGET_EFAULT; + addr = alloca(addrlen); ret = get_errno(getpeername(fd, addr, &addrlen)); @@ -1636,15 +1658,15 @@ static abi_long do_getsockname(int fd, abi_ulong target_addr, void *addr; abi_long ret; - if (target_addr == 0) - return get_errno(accept(fd, NULL, NULL)); - if (get_user_u32(addrlen, target_addrlen_addr)) return -TARGET_EFAULT; if (addrlen < 0) return -TARGET_EINVAL; + if (!access_ok(VERIFY_WRITE, target_addr, addrlen)) + return -TARGET_EFAULT; + addr = alloca(addrlen); ret = get_errno(getsockname(fd, addr, &addrlen)); @@ -1688,7 +1710,11 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags, return -TARGET_EFAULT; if (target_addr) { addr = alloca(addrlen); - target_to_host_sockaddr(addr, target_addr, addrlen); + ret = target_to_host_sockaddr(addr, target_addr, addrlen); + if (ret) { + unlock_user(host_msg, msg, 0); + return ret; + } ret = get_errno(sendto(fd, host_msg, len, flags, addr, addrlen)); } else { ret = get_errno(send(fd, host_msg, len, flags)); From 7b8118e82381b813767a47fed7003a4f949f4226 Mon Sep 17 00:00:00 2001 From: vibi sreenivasan Date: Fri, 19 Jun 2009 13:34:39 +0530 Subject: [PATCH 3/8] =?UTF-8?q?linux-user/syscall.c:=20remove=20warning:?= =?UTF-8?q?=20=E2=80=98array=E2=80=99=20may=20be=20used=20uninitialized=20?= =?UTF-8?q?in=20this=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the following warning CC i386-linux-user/syscall.o cc1: warnings being treated as errors /media/nfs/qemu/linux-user/syscall.c: In function ‘do_syscall’: /media/nfs/qemu/linux-user/syscall.c:2219: warning: ‘array’ may be used uninitialized in this function Signed-off-by: Vibi Sreenivasan Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a96e86ae72..6aaf9caf4f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2241,7 +2241,7 @@ static inline abi_long do_semctl(int semid, int semnum, int cmd, { union semun arg; struct semid_ds dsarg; - unsigned short *array; + unsigned short *array = NULL; struct seminfo seminfo; abi_long ret = -TARGET_EINVAL; abi_long err; From 67ba57f63da7cfbc6f34917ff5875f67dfbea9ba Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Mon, 29 Jun 2009 17:26:11 +0300 Subject: [PATCH 4/8] configure: remove bogus linux-user check linux-user=yes is not a reliable identifier that linux-user targets have been selected. user targets can be selected via --target-list as well. --- configure | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 54eb0bf947..b3f39dd848 100755 --- a/configure +++ b/configure @@ -1249,8 +1249,7 @@ fi # have syscall stubs for these implemented. # atfile=no -if [ "$linux_user" = "yes" ] ; then - cat > $TMPC << EOF +cat > $TMPC << EOF #define _ATFILE_SOURCE #include #include @@ -1263,9 +1262,8 @@ main(void) return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); } EOF - if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then - atfile=yes - fi +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then + atfile=yes fi # Check for inotify functions when we are building linux-user @@ -1274,8 +1272,7 @@ fi # don't provide them even if kernel supports them. # inotify=no -if [ "$linux_user" = "yes" ] ; then - cat > $TMPC << EOF +cat > $TMPC << EOF #include int @@ -1285,9 +1282,8 @@ main(void) return inotify_init(); } EOF - if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then - inotify=yes - fi +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null > /dev/null ; then + inotify=yes fi # check if utimensat and futimens are supported From 784ccfdb3675e6524ba277f41889577e4530282b Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 3 Jul 2009 17:09:26 +0200 Subject: [PATCH 5/8] pipe argument should not be signed pipedes is an address, it should not be signed (breaks for addresses > 0x80000000) Signed-off-by: Ulrich Hecht Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6aaf9caf4f..23a42adff5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -953,7 +953,7 @@ static abi_long do_pipe2(int host_pipe[], int flags) #endif } -static abi_long do_pipe(void *cpu_env, int pipedes, int flags) +static abi_long do_pipe(void *cpu_env, abi_ulong pipedes, int flags) { int host_pipe[2]; abi_long ret; From 98818189ea9a8e7abd4d8699289da6b14d8190ee Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 3 Jul 2009 17:09:28 +0200 Subject: [PATCH 6/8] 64-bit clean socketcall syscall makes socketcall 64-bit clean so it works on 64-bit big-endian systems Signed-off-by: Ulrich Hecht Signed-off-by: Riku Voipio --- linux-user/syscall.c | 130 +++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 23a42adff5..40ccb10acc 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1777,11 +1777,11 @@ static abi_long do_socketcall(int num, abi_ulong vptr) switch(num) { case SOCKOP_socket: { - int domain, type, protocol; + abi_ulong domain, type, protocol; - if (get_user_s32(domain, vptr) - || get_user_s32(type, vptr + n) - || get_user_s32(protocol, vptr + 2 * n)) + if (get_user_ual(domain, vptr) + || get_user_ual(type, vptr + n) + || get_user_ual(protocol, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_socket(domain, type, protocol); @@ -1789,13 +1789,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_bind: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(addrlen, vptr + 2 * n)) + || get_user_ual(addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_bind(sockfd, target_addr, addrlen); @@ -1803,13 +1803,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_connect: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(addrlen, vptr + 2 * n)) + || get_user_ual(addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_connect(sockfd, target_addr, addrlen); @@ -1817,10 +1817,10 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_listen: { - int sockfd, backlog; + abi_ulong sockfd, backlog; - if (get_user_s32(sockfd, vptr) - || get_user_s32(backlog, vptr + n)) + if (get_user_ual(sockfd, vptr) + || get_user_ual(backlog, vptr + n)) return -TARGET_EFAULT; ret = get_errno(listen(sockfd, backlog)); @@ -1828,12 +1828,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_accept: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_accept(sockfd, target_addr, target_addrlen); @@ -1841,12 +1841,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getsockname: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_getsockname(sockfd, target_addr, target_addrlen); @@ -1854,12 +1854,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getpeername: { - int sockfd; + abi_ulong sockfd; abi_ulong target_addr, target_addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(target_addr, vptr + n) - || get_user_u32(target_addrlen, vptr + 2 * n)) + || get_user_ual(target_addrlen, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_getpeername(sockfd, target_addr, target_addrlen); @@ -1867,12 +1867,12 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_socketpair: { - int domain, type, protocol; + abi_ulong domain, type, protocol; abi_ulong tab; - if (get_user_s32(domain, vptr) - || get_user_s32(type, vptr + n) - || get_user_s32(protocol, vptr + 2 * n) + if (get_user_ual(domain, vptr) + || get_user_ual(type, vptr + n) + || get_user_ual(protocol, vptr + 2 * n) || get_user_ual(tab, vptr + 3 * n)) return -TARGET_EFAULT; @@ -1881,15 +1881,15 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_send: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n)) + || get_user_ual(flags, vptr + 3 * n)) return -TARGET_EFAULT; ret = do_sendto(sockfd, msg, len, flags, 0, 0); @@ -1897,15 +1897,15 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_recv: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n)) + || get_user_ual(flags, vptr + 3 * n)) return -TARGET_EFAULT; ret = do_recvfrom(sockfd, msg, len, flags, 0, 0); @@ -1913,19 +1913,19 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_sendto: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; abi_ulong addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n) + || get_user_ual(flags, vptr + 3 * n) || get_user_ual(addr, vptr + 4 * n) - || get_user_u32(addrlen, vptr + 5 * n)) + || get_user_ual(addrlen, vptr + 5 * n)) return -TARGET_EFAULT; ret = do_sendto(sockfd, msg, len, flags, addr, addrlen); @@ -1933,19 +1933,19 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_recvfrom: { - int sockfd; + abi_ulong sockfd; abi_ulong msg; size_t len; - int flags; + abi_ulong flags; abi_ulong addr; socklen_t addrlen; - if (get_user_s32(sockfd, vptr) + if (get_user_ual(sockfd, vptr) || get_user_ual(msg, vptr + n) || get_user_ual(len, vptr + 2 * n) - || get_user_s32(flags, vptr + 3 * n) + || get_user_ual(flags, vptr + 3 * n) || get_user_ual(addr, vptr + 4 * n) - || get_user_u32(addrlen, vptr + 5 * n)) + || get_user_ual(addrlen, vptr + 5 * n)) return -TARGET_EFAULT; ret = do_recvfrom(sockfd, msg, len, flags, addr, addrlen); @@ -1953,10 +1953,10 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_shutdown: { - int sockfd, how; + abi_ulong sockfd, how; - if (get_user_s32(sockfd, vptr) - || get_user_s32(how, vptr + n)) + if (get_user_ual(sockfd, vptr) + || get_user_ual(how, vptr + n)) return -TARGET_EFAULT; ret = get_errno(shutdown(sockfd, how)); @@ -1965,13 +1965,13 @@ static abi_long do_socketcall(int num, abi_ulong vptr) case SOCKOP_sendmsg: case SOCKOP_recvmsg: { - int fd; + abi_ulong fd; abi_ulong target_msg; - int flags; + abi_ulong flags; - if (get_user_s32(fd, vptr) + if (get_user_ual(fd, vptr) || get_user_ual(target_msg, vptr + n) - || get_user_s32(flags, vptr + 2 * n)) + || get_user_ual(flags, vptr + 2 * n)) return -TARGET_EFAULT; ret = do_sendrecvmsg(fd, target_msg, flags, @@ -1980,17 +1980,17 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_setsockopt: { - int sockfd; - int level; - int optname; + abi_ulong sockfd; + abi_ulong level; + abi_ulong optname; abi_ulong optval; socklen_t optlen; - if (get_user_s32(sockfd, vptr) - || get_user_s32(level, vptr + n) - || get_user_s32(optname, vptr + 2 * n) + if (get_user_ual(sockfd, vptr) + || get_user_ual(level, vptr + n) + || get_user_ual(optname, vptr + 2 * n) || get_user_ual(optval, vptr + 3 * n) - || get_user_u32(optlen, vptr + 4 * n)) + || get_user_ual(optlen, vptr + 4 * n)) return -TARGET_EFAULT; ret = do_setsockopt(sockfd, level, optname, optval, optlen); @@ -1998,17 +1998,17 @@ static abi_long do_socketcall(int num, abi_ulong vptr) break; case SOCKOP_getsockopt: { - int sockfd; - int level; - int optname; + abi_ulong sockfd; + abi_ulong level; + abi_ulong optname; abi_ulong optval; socklen_t optlen; - if (get_user_s32(sockfd, vptr) - || get_user_s32(level, vptr + n) - || get_user_s32(optname, vptr + 2 * n) + if (get_user_ual(sockfd, vptr) + || get_user_ual(level, vptr + n) + || get_user_ual(optname, vptr + 2 * n) || get_user_ual(optval, vptr + 3 * n) - || get_user_u32(optlen, vptr + 4 * n)) + || get_user_ual(optlen, vptr + 4 * n)) return -TARGET_EFAULT; ret = do_getsockopt(sockfd, level, optname, optval, optlen); From 719f908e3adaba68054dd072cfa969e5d94ac1d0 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 3 Jul 2009 17:09:29 +0200 Subject: [PATCH 7/8] wrap path for access syscall Signed-off-by: Ulrich Hecht Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 40ccb10acc..df3016f9af 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4555,7 +4555,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_access: if (!(p = lock_user_string(arg1))) goto efault; - ret = get_errno(access(p, arg2)); + ret = get_errno(access(path(p), arg2)); unlock_user(p, arg1, 0); break; #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat) From 666bcd913b1f3e4be8f92995c217498e05379493 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 3 Jul 2009 17:09:30 +0200 Subject: [PATCH 8/8] getrlimit conversion mix-up Fixes getrlimit implementation that overwrote the result of the syscall instead of converting it Signed-off-by: Ulrich Hecht Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index df3016f9af..000962328e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5047,8 +5047,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, if (!is_error(ret)) { if (!lock_user_struct(VERIFY_WRITE, target_rlim, arg2, 0)) goto efault; - rlim.rlim_cur = tswapl(target_rlim->rlim_cur); - rlim.rlim_max = tswapl(target_rlim->rlim_max); + target_rlim->rlim_cur = tswapl(rlim.rlim_cur); + target_rlim->rlim_max = tswapl(rlim.rlim_max); unlock_user_struct(target_rlim, arg2, 1); } }