Re: [PATCH 3/4] Consolidate sys32 select

From: Martin Josefsson
Date: Wed May 26 2004 - 01:11:15 EST


On Wed, 2004-05-26 at 01:10, Arnd Bergmann wrote:
> Martin Josefsson <gandalf@xxxxxxxxxxxxxx> schrieb am 26.05.2004,
> 00:29:13:
>
> > You mean in compat_sys_select() ?
> > compat_ptr() takes an u32 as argument, needs casting, ugly.
> > But you want it done that way?
>
> When using compat_ptr properly, you don't need any casts,
> see the patch below (the patch is probably messed up by my
> broken mailer, but you get the picture).

Yes, my brain didn't go the extra distance, davem responded before I
could get to bed and I just had to respond :)

Your patch will fix the problem, I don't even need to test it.
Thanks, looking forward to see a fix in mainline :)

> ===== fs/compat.c 1.24 vs edited =====
> --- 1.24/fs/compat.c Sat May 22 06:31:47 2004
> +++ edited/fs/compat.c Wed May 26 00:57:49 2004
> @@ -1300,13 +1300,15 @@
>
> asmlinkage long
> compat_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t
> __user *outp,
> - compat_ulong_t __user *exp, struct compat_timeval __user *tvp)
> + compat_ulong_t __user *exp, compat_uptr_t utv)
> {
> fd_set_bits fds;
> + struct compat_timeval __user *tvp;
> char *bits;
> long timeout;
> int ret, size, max_fdset;
>
> + tvp = compat_ptr(utv);
> timeout = MAX_SCHEDULE_TIMEOUT;
> if (tvp) {
> time_t sec, usec;
--
/Martin

Attachment: signature.asc
Description: This is a digitally signed message part