[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEksrgKGRAS0zbgO@hoboy.vegasvil.org>
Date: Wed, 26 Apr 2023 06:52:46 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
netdev@...r.kernel.org, Andrii Staikov <andrii.staikov@...el.com>,
Sunitha Mekala <sunithax.d.mekala@...el.com>
Subject: Re: [PATCH net 1/1] i40e: fix PTP pins verification
On Wed, Apr 26, 2023 at 10:18:12AM +0300, Leon Romanovsky wrote:
> On Tue, Apr 25, 2023 at 10:04:06AM -0700, Tony Nguyen wrote:
> > From: Andrii Staikov <andrii.staikov@...el.com>
> >
> > Fix PTP pins verification not to contain tainted arguments. As a new PTP
> > pins configuration is provided by a user, it may contain tainted
> > arguments that are out of bounds for the list of possible values that can
> > lead to a potential security threat. Change pin's state name from 'invalid'
> > to 'empty' for more clarification.
>
> And why isn't this handled in upper layer which responsible to get
> user input?
It is.
long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
{
...
switch (cmd) {
case PTP_PIN_SETFUNC:
case PTP_PIN_SETFUNC2:
if (copy_from_user(&pd, (void __user *)arg, sizeof(pd))) {
err = -EFAULT;
break;
}
...
pin_index = pd.index;
if (pin_index >= ops->n_pins) {
err = -EINVAL;
break;
}
...
}
...
}
Powered by blists - more mailing lists