lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nycvar.YFH.7.76.2308141126330.14207@cbobk.fhfr.pm>
Date:   Mon, 14 Aug 2023 11:26:53 +0200 (CEST)
From:   Jiri Kosina <jikos@...nel.org>
To:     Riwen Lu <luriwen@...mail.com>
cc:     benjamin.tissoires@...hat.com, dmitry.torokhov@...il.com,
        linux@...ssschuh.net, hdegoede@...hat.com, rrangel@...omium.org,
        u.kleine-koenig@...gutronix.de, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org, Riwen Lu <luriwen@...inos.cn>
Subject: Re: [PATCH v1] HID: i2c-hid: use print_hex_dump_debug to print report
 descriptor

On Mon, 3 Jul 2023, Riwen Lu wrote:

> From: Riwen Lu <luriwen@...inos.cn>
> 
> The format '%*ph' print up to 64 bytes long as a hex string with ' '
> sepatator. Usually the size of report descriptor is larger than 64
> bytes, so consider using print_hex_dump_debug to print out all of it for
> better debugging.
> 
> Signed-off-by: Riwen Lu <luriwen@...inos.cn>
> ---
>  drivers/hid/i2c-hid/i2c-hid-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index efbba0465eef..8e97fc01c852 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -772,7 +772,9 @@ static int i2c_hid_parse(struct hid_device *hid)
>  		}
>  	}
>  
> -	i2c_hid_dbg(ihid, "Report Descriptor: %*ph\n", rsize, rdesc);
> +	i2c_hid_dbg(ihid, "Report Descriptor\n");
> +	print_hex_dump_debug("  ", DUMP_PREFIX_OFFSET, 16, 1,
> +			rdesc, rsize, false);

But that would dump it unconditionally, while i2c_hid_dbg() is 
conditional.

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ