Commit 418f6ab7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper()

BugLink: https://bugs.launchpad.net/bugs/1853881

[ Upstream commit e5017716 ]

The "index + count" addition can overflow.  Both come directly from the
user.  This bug leads to an information leak.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Peter Malone <peter.malone@gmail.com>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Mathieu Malaterre <malat@debian.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 93c5b9eb
......@@ -170,7 +170,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
get_user(ublue, &c->blue))
return -EFAULT;
if (index + count > cmap->len)
if (index > cmap->len || count > cmap->len - index)
return -EINVAL;
for (i = 0; i < count; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment