Re: [PATCH] ipvs: Add boundary check on ioctl arguments

From: Arjan van de Ven
Date: Wed Sep 30 2009 - 11:18:23 EST


On Wed, 30 Sep 2009 15:38:12 +0200
Hannes Eder <heder@xxxxxxxxxx> wrote:
> > @@ -2353,17 +2357,25 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd,
> > void __user
> *user, int *len)
> > {
> > unsigned char arg[128];
>
> can MAX_ARG_LEN be used here?

I am not convinced... it is a different numerical value,
so it could be an ABI change. Rather not do that in this
type of patch...

> > + copylen = get_arglen[GET_CMDID(cmd)];
> > + if (copylen > 128)
>
> I think it's better to use 'copylen > sizeof(arg)' here.

fair enough; updated patch below