[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yc4wkyr7QTs8ao5x@kunai>
Date: Thu, 30 Dec 2021 23:20:03 +0100
From: Wolfram Sang <wsa@...nel.org>
To: Pavel Skripkin <paskripkin@...il.com>
Cc: viro@...iv.linux.org.uk, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
syzbot+e417648b303855b91d8a@...kaller.appspotmail.com
Subject: Re: [PATCH v2] i2c: don't pass 0 nmsgs to i2c_transfer
> - if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
> + if (!rdwr_arg.nmsgs || rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
> return -EINVAL;
Shouldn't we check the msgs pointer as well while we are here? Like in
the non-compat IOCTL code:
443 if (!rdwr_arg.msgs || rdwr_arg.nmsgs == 0)
444 return -EINVAL;
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists