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] [day] [month] [year] [list]
Date:   Mon, 26 Apr 2021 09:06:48 +0200
From:   Rasmus Villemoes <rasmus.villemoes@...vas.dk>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Input: atkbd - simplify atkbd_show_force_release()

On 25/04/2021 04.27, Dmitry Torokhov wrote:
> Hi Rasmus,
> 
> On Wed, Apr 21, 2021 at 10:16:39PM +0200, Rasmus Villemoes wrote:
>> We can just include the newline in the format string, and scnprintf()
>> guarantees nul-termination. These days, sysfs_emit() is
>> preferred in sysfs ->show methods, so switch to that.
> 
> Technically speaking the conversion is not 100% equivalent - original
> code ensured that there is always a newline in the output. I kind of
> like this, so maybe we need sysfs_emit_nl() or similar?

(1) From a UX perspective, it actually seems better to have lack of
trailing newline as a (though subtle) indicator that the output was
truncated

(2) Given that ATKBD_KEYMAP_SIZE is 512, I don't see how that could
actually ever happen. AFAICT, the worst case %pbl representation is when
the bitmap consists of a series two set bits and one unset bit, yielding
a pattern of "xxx-yyy," (with yyy=xxx+1) for 8 characters per 3 bits, or
about 1365 characters (slight overestimate because of one- and two-digit
numbers).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ