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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzRO0xrzlrHAYdaI@smile.fi.intel.com>
Date:   Wed, 28 Sep 2022 16:40:35 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Thierry Reding <thierry.reding@...il.com>
Cc:     linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
Subject: Re: [PATCH v2 3/4] pwm: sysfs: Replace sprintf() with sysfs_emit()

On Wed, Sep 28, 2022 at 02:28:41PM +0200, Thierry Reding wrote:
> On Fri, Aug 26, 2022 at 08:07:15PM +0300, Andy Shevchenko wrote:
> > For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
> > instead of the raw sprintf() & co. This patch replaces such a
> > sprintf() call straightforwardly with the new helper.

> How exactly is sysfs_emit() safer here? In all of these cases, the
> values that sprintf() writes are the only values that are written into
> the buffer and we know that none of them exceed PAGE_SIZE. So the
> additional checks that sysfs_emit() performs are useless.

This is a recommended way to use sysfs_emit() mentioned in Documentation.
Care to fix documentation?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ