[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210115192718.GB10895@khazad-dum.debian.net>
Date: Fri, 15 Jan 2021 16:27:18 -0300
From: Henrique de Moraes Holschuh <hmh@....eng.br>
To: Joe Perches <joe@...ches.com>
Cc: YANG LI <abaci-bugfix@...ux.alibaba.com>, hdegoede@...hat.com,
mgross@...ux.intel.com, ibm-acpi@....eng.br,
ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thinkpad_acpi: fix: use scnprintf instead of snprintf.
On Wed, 06 Jan 2021, Joe Perches wrote:
> On Wed, 2021-01-06 at 14:36 +0800, YANG LI wrote:
> > The snprintf() function returns the number of characters which would
> > have been printed if there were enough space, but the scnprintf()
> > returns the number of characters which were actually printed. If the
> > buffer is not large enough, then using snprintf() would result in a
> > read overflow and an information leak. This error was found with the
> > help of coccicheck.
>
> In all cases, the buffer _is_ large enough.
Thank you for double-checking!
> _show function lengths are OK for all the uses with PAGE_SIZE.
> And it's probably better to use sysfs_emit for all the _show functions
Indeed.
--
Henrique Holschuh
Powered by blists - more mailing lists