|
|
9d47f9 |
Index: strace-5.1/evdev.c
|
|
|
9d47f9 |
===================================================================
|
|
|
9d47f9 |
--- strace-5.1.orig/evdev.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
9d47f9 |
+++ strace-5.1/evdev.c 2019-06-13 23:40:59.136316390 +0200
|
|
|
9d47f9 |
@@ -151,25 +151,36 @@
|
|
|
9d47f9 |
tprints(", ");
|
|
|
9d47f9 |
|
|
|
9d47f9 |
unsigned int size;
|
|
|
9d47f9 |
- if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
|
|
|
9d47f9 |
- size = max_nr;
|
|
|
9d47f9 |
+ unsigned int size_bits;
|
|
|
9d47f9 |
+
|
|
|
9d47f9 |
+ if ((kernel_ulong_t) tcp->u_rval > max_nr / CHAR_BIT)
|
|
|
9d47f9 |
+ size_bits = max_nr;
|
|
|
9d47f9 |
else
|
|
|
9d47f9 |
- size = tcp->u_rval * 8;
|
|
|
9d47f9 |
+ size_bits = tcp->u_rval * CHAR_BIT;
|
|
|
9d47f9 |
+
|
|
|
9d47f9 |
+ size = ROUNDUP(ROUNDUP_DIV(size_bits, CHAR_BIT), current_wordsize);
|
|
|
9d47f9 |
+
|
|
|
9d47f9 |
+ if (syserror(tcp) || !size) {
|
|
|
9d47f9 |
+ printaddr(arg);
|
|
|
9d47f9 |
+
|
|
|
9d47f9 |
+ return RVAL_IOCTL_DECODED;
|
|
|
9d47f9 |
+ }
|
|
|
9d47f9 |
+
|
|
|
9d47f9 |
char decoded_arg[size];
|
|
|
9d47f9 |
|
|
|
9d47f9 |
- if (umove_or_printaddr(tcp, arg, &decoded_arg))
|
|
|
9d47f9 |
+ if (umoven_or_printaddr(tcp, arg, size, decoded_arg))
|
|
|
9d47f9 |
return RVAL_IOCTL_DECODED;
|
|
|
9d47f9 |
|
|
|
9d47f9 |
tprints("[");
|
|
|
9d47f9 |
|
|
|
9d47f9 |
int bit_displayed = 0;
|
|
|
9d47f9 |
- int i = next_set_bit(decoded_arg, 0, size);
|
|
|
9d47f9 |
+ int i = next_set_bit(decoded_arg, 0, size_bits);
|
|
|
9d47f9 |
if (i < 0) {
|
|
|
9d47f9 |
tprints(" 0 ");
|
|
|
9d47f9 |
} else {
|
|
|
9d47f9 |
printxval_dispatch(decode_nr, decode_nr_size, i, dflt, xt);
|
|
|
9d47f9 |
|
|
|
9d47f9 |
- while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) {
|
|
|
9d47f9 |
+ while ((i = next_set_bit(decoded_arg, i + 1, size_bits)) > 0) {
|
|
|
9d47f9 |
if (abbrev(tcp) && bit_displayed >= 3) {
|
|
|
9d47f9 |
tprints(", ...");
|
|
|
9d47f9 |
break;
|
|
|
9d47f9 |
Index: strace-5.1/tests-m32/ioctl_evdev-success.c
|
|
|
9d47f9 |
===================================================================
|
|
|
9d47f9 |
--- strace-5.1.orig/tests-m32/ioctl_evdev-success.c 2018-12-25 00:46:43.000000000 +0100
|
|
|
9d47f9 |
+++ strace-5.1/tests-m32/ioctl_evdev-success.c 2019-06-13 22:24:38.738650209 +0200
|
|
|
9d47f9 |
@@ -191,17 +191,17 @@
|
|
|
9d47f9 |
# endif
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set more than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR };
|
|
|
9d47f9 |
+ unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR, 0 };
|
|
|
9d47f9 |
/* we use the first element to indicate the number of set bits */
|
|
|
9d47f9 |
/* ev_more_str[0] is "5" so the number of set bits is 5 */
|
|
|
9d47f9 |
const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set less than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED };
|
|
|
9d47f9 |
+ unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED, 0 };
|
|
|
9d47f9 |
const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set zero bit */
|
|
|
9d47f9 |
- unsigned long ev_zero[] = { 0x0 };
|
|
|
9d47f9 |
+ unsigned long ev_zero[] = { 0x0, 0 };
|
|
|
9d47f9 |
const char *ev_zero_str[] = { "0", " 0 " };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* KEY_MAX is 0x2ff which is greater than retval * 8 */
|
|
|
9d47f9 |
Index: strace-5.1/tests-mx32/ioctl_evdev-success.c
|
|
|
9d47f9 |
===================================================================
|
|
|
9d47f9 |
--- strace-5.1.orig/tests-mx32/ioctl_evdev-success.c 2018-12-25 00:46:43.000000000 +0100
|
|
|
9d47f9 |
+++ strace-5.1/tests-mx32/ioctl_evdev-success.c 2019-06-13 22:24:58.239273608 +0200
|
|
|
9d47f9 |
@@ -191,17 +191,17 @@
|
|
|
9d47f9 |
# endif
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set more than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR };
|
|
|
9d47f9 |
+ unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR, 0 };
|
|
|
9d47f9 |
/* we use the first element to indicate the number of set bits */
|
|
|
9d47f9 |
/* ev_more_str[0] is "5" so the number of set bits is 5 */
|
|
|
9d47f9 |
const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set less than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED };
|
|
|
9d47f9 |
+ unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED, 0 };
|
|
|
9d47f9 |
const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set zero bit */
|
|
|
9d47f9 |
- unsigned long ev_zero[] = { 0x0 };
|
|
|
9d47f9 |
+ unsigned long ev_zero[] = { 0x0, 0 };
|
|
|
9d47f9 |
const char *ev_zero_str[] = { "0", " 0 " };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* KEY_MAX is 0x2ff which is greater than retval * 8 */
|
|
|
9d47f9 |
Index: strace-5.1/tests/ioctl_evdev-success.c
|
|
|
9d47f9 |
===================================================================
|
|
|
9d47f9 |
--- strace-5.1.orig/tests/ioctl_evdev-success.c 2019-06-13 22:23:53.864516831 +0200
|
|
|
9d47f9 |
+++ strace-5.1/tests/ioctl_evdev-success.c 2019-06-13 22:24:19.210027351 +0200
|
|
|
9d47f9 |
@@ -191,17 +191,17 @@
|
|
|
9d47f9 |
# endif
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set more than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR };
|
|
|
9d47f9 |
+ unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR, 0 };
|
|
|
9d47f9 |
/* we use the first element to indicate the number of set bits */
|
|
|
9d47f9 |
/* ev_more_str[0] is "5" so the number of set bits is 5 */
|
|
|
9d47f9 |
const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set less than 4 bits */
|
|
|
9d47f9 |
- unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED };
|
|
|
9d47f9 |
+ unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED, 0 };
|
|
|
9d47f9 |
const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* set zero bit */
|
|
|
9d47f9 |
- unsigned long ev_zero[] = { 0x0 };
|
|
|
9d47f9 |
+ unsigned long ev_zero[] = { 0x0, 0 };
|
|
|
9d47f9 |
const char *ev_zero_str[] = { "0", " 0 " };
|
|
|
9d47f9 |
|
|
|
9d47f9 |
/* KEY_MAX is 0x2ff which is greater than retval * 8 */
|