Blame SOURCES/0001-evdev-fix-decoding-of-bit-sets.patch
|
|
4d44fe |
From ba803931948fe89ddf9e3ec407e5e16c689863ad Mon Sep 17 00:00:00 2001
|
|
|
4d44fe |
From: Zhibin Li <08826794brmt@gmail.com>
|
|
|
4d44fe |
Date: Wed, 1 Aug 2018 17:53:57 +0800
|
|
|
4d44fe |
Subject: [PATCH 01/27] evdev: fix decoding of bit sets
|
|
|
4d44fe |
|
|
|
4d44fe |
According to drivers/input/evdev.c:bits_to_user(),
|
|
|
4d44fe |
the Linux kernel returns the number of bytes, not bits.
|
|
|
4d44fe |
|
|
|
4d44fe |
* evdev.c (decode_bitset_): Treat syscall return value as the number
|
|
|
4d44fe |
of bytes.
|
|
|
4d44fe |
|
|
|
4d44fe |
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
|
|
|
4d44fe |
Fixes: v4.10~89 "Add decoding for evdev ioctls"
|
|
|
4d44fe |
---
|
|
|
4d44fe |
evdev.c | 4 ++--
|
|
|
4d44fe |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
4d44fe |
|
|
|
4d44fe |
diff --git a/evdev.c b/evdev.c
|
|
|
4d44fe |
index 7ca15c9..3c1aaa8 100644
|
|
|
4d44fe |
--- a/evdev.c
|
|
|
4d44fe |
+++ b/evdev.c
|
|
|
4d44fe |
@@ -171,10 +171,10 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
|
|
4d44fe |
tprints(", ");
|
|
|
4d44fe |
|
|
|
4d44fe |
unsigned int size;
|
|
|
4d44fe |
- if ((kernel_ulong_t) tcp->u_rval > max_nr)
|
|
|
4d44fe |
+ if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
|
|
|
4d44fe |
size = max_nr;
|
|
|
4d44fe |
else
|
|
|
4d44fe |
- size = tcp->u_rval;
|
|
|
4d44fe |
+ size = tcp->u_rval * 8;
|
|
|
4d44fe |
char decoded_arg[size];
|
|
|
4d44fe |
|
|
|
4d44fe |
if (umove_or_printaddr(tcp, arg, &decoded_arg))
|
|
|
4d44fe |
--
|
|
|
4d44fe |
2.1.4
|
|
|
4d44fe |
|