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>] [day] [month] [year] [list]
Date:   Fri, 15 Oct 2021 10:12:42 +0000
From:   王擎 <>
To:     Bruno Prémont <>
CC:     Jiri Kosina <>,
        Benjamin Tissoires <>,
        Stefan Achatz <>,
        Jonathan Cameron <>,
        Srinivas Pandruvada <>,
        "" <>,
        "" <>,
        "" <>
Subject: 回复: [PATCH] hid: replace snprintf in show functions with sysfs_emit

>> show() must not use snprintf() when formatting the value to be
>> returned to user space.
>> Fix the coccicheck warnings:
>> WARNING: use scnprintf or sprintf.
>> Use sysfs_emit instead of scnprintf or sprintf makes more sense.
>Looks good to me, but I have a few remarks:
>- No need to talk about "must not use" in detailled commit message.
>  Mentioning introduction of the newish sysfs_emit() functions (in
>  commit 2efc459d06f1630001e3984854848a5647086232 a Year ago) and thus
>  switching over to those would be sufficient for code predating their
>  introduction.
>- I'm wondering why picolcd_fb_update_rate_show() in
>    drivers/hid/hid-picolcd_fb.c:446
>  is not updated as well in this same patch.
>  There scnprintf() calls should be replaced with sysfs_emit_at() calls
>  according to the intent of this patch!

scnprintf is fine, but snprintf is WRONG used.
scnprintf() return the number of bytes printed into the buffer. 
snprintf() returns the length the resulting string.

>- Not sure if the patch should be split into a 5-patch series with one
>  patch per HID driver (each driver can be updated independently).

I will do this in V2.



>Acked-by: Bruno Prémont <>
>  (for picolcd code)

Powered by blists - more mailing lists