projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb47d81
)
tty/vt: consolemap: check put_user() in con_get_unimap()
author
Jiri Slaby
<jslaby@suse.cz>
Tue, 7 Jun 2022 10:49:26 +0000
(12:49 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:37:02 +0000
(13:37 +0200)
Only the return value of copy_to_user() is checked in con_get_unimap().
Do the same for put_user() of the count too.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link:
https://lore.kernel.org/r/20220607104946.18710-16-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/tty/vt/consolemap.c
b/drivers/tty/vt/consolemap.c
index 831450f2bfd1dd2e7fbfb509959c7b6d59cf3a98..92b5dddb00d983ff56782591f6189e3cd092fe34 100644
(file)
--- a/
drivers/tty/vt/consolemap.c
+++ b/
drivers/tty/vt/consolemap.c
@@
-813,7
+813,8
@@
unlock:
console_unlock();
if (copy_to_user(list, unilist, min(ect, ct) * sizeof(*unilist)))
ret = -EFAULT;
- put_user(ect, uct);
+ if (put_user(ect, uct))
+ ret = -EFAULT;
kvfree(unilist);
return ret ? ret : (ect <= ct) ? 0 : -ENOMEM;
}