Menu

#19 Possible bug in uw7_setrlimit64

open
kernel (18)
5
2003-01-15
2003-01-15
Anonymous
No

I sent the following email, but maybe this is a better
place for it to go:

Date: Tue, 14 Jan 2003 15:31:51 +1100
From: Kingsley Cheung <kingsley@aurema.com>
To: hch@users.sourceforge.net
Cc: hch@infradead.org
Subject: [PATCH] Possible bug in uw7_setrlimit64

Hi Christoph,

I think there is a bug in uw7_setrlimit64
(abi/uw7/lfs.c) where there
is no translation of the index 'resource' using the array
uw7_to_linux_rlimit. (I think the SuSE kernel I'm
playing with has
the linux-abi-2.4.18.0.patch applied to it : ) Maybe
the code should
be as follows:

diff -u -r SuSE_x86_2_4_19_79/abi/uw7/lfs.c
+SuSE_x86_2_4_19_79patched/abi/uw7/lfs.c
--- SuSE_x86_2_4_19_79/abi/uw7/lfs.c Fri Jul 5
16:18:23 2002
+++ SuSE_x86_2_4_19_79patched/abi/uw7/lfs.c Tue Jan
14 15:14:20 2003
@@ -173,13 +173,15 @@
int
uw7_setrlimit64(int resource, const struct uw7_rlim64
*rlimp)
{
- struct rlimit *lxrlim = current->rlim
+ resource;
+ struct rlimit *lxrlim;
struct uw7_rlim64 rlim;

if (resource > ARRAY_SIZE(uw7_to_linux_rlimit))
return -EINVAL;
if (copy_from_user(&rlim, rlimp, sizeof(struct
uw7_rlim64)))
return -EFAULT;
+ resource = uw7_to_linux_rlimit[resource];
+ lxrlim = current->rlim + resource;
if (uw7_check_rlimit64(resource, &rlim, lxrlim))
return -EPERM;

--
Kingsley

Discussion


Log in to post a comment.

MongoDB Logo MongoDB