Re: [PATCH] Fix NULL handler for compat_ioctl

Andrew Morton (akpm@digeo.com)
Wed, 30 Apr 2003 19:41:24 -0700


Ben Collins <bcollins@debian.org> wrote:
>
> - t->handler = handler;
> + if (!handler)
> + t->handler = (void *)sys_ioctl;
> + else
> + t->handler = handler;

Is that safe?

- sys_ioctl takes three args, but this vector is going to be called with
four. That's making assumptions about arg passing conventions which may
not be true.

- sys_ioctl() is asmlinkage, but the caller of this vector doesn't know
that. Arguments may get put in the wrong place.

Is a little wrapper function needed?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/