lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] i8042: Add debug_kbd option
From
Date
On Thu, 2015-06-25 at 15:25 -0400, cpaul@redhat.com wrote:
> From: Stephen Chandler Paul <cpaul@redhat.com>
>
> A big problem with the current i8042 debugging option is that it outputs
> data going to and from the keyboard by default. As a result, many dmesg
> logs uploaded by users will unintentionally contain sensitive information
> such as their password, as such it's probably a good idea not to output
> data coming from the keyboard unless specifically enabled by the user.

Seems sensible. Coupla trivial bits:

> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
[]
> @@ -88,6 +88,23 @@ MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");
> static bool i8042_debug;
> module_param_named(debug, i8042_debug, bool, 0600);
> MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");
> +
> +static bool i8042_debug_kbd;
> +module_param_named(debug_kbd, i8042_debug_kbd, bool, 0600);
> +MODULE_PARM_DESC(i8042_kbd, "Turn i8042 kbd debugging output on or off");

It's unclear this depends on i8042_debug.
Maybe add something like " (enabling requires i8042_debug=1)"

> +#define str_dbg(str, data, format, args...) \
> + do { \
> + if (!i8042_debug) \
> + break; \
> + \
> + if (str & I8042_STR_AUXDATA || i8042_debug_kbd) \
> + dbg("%02x " format, data, ##args); \
> + else \
> + dbg("** " format, ##args); \
> + } while (0)
> +#else
> +#define str_dbg(str, data, format, args...) do { } while (0)
> #endif

This should probably go into i8042.h
where the dbg macro is #defined




\
 
 \ /
  Last update: 2015-06-25 22:21    [W:0.045 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site