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>] [day] [month] [year] [list]
Date:   Fri, 15 Oct 2021 07:13:58 +0000
From:   王擎 <wangqing@...o.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     Jiri Slaby <jirislaby@...nel.org>, Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...id.au>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 回复: [PATCH] tty: 8250: replace snprintf in show functions with sysfs_emit


>> show() must not use snprintf() when formatting the value to be
>> returned to user space.
>
>Why must it not?  What is broken in the existing code?

Replyed in another email.

>
>> 
>> Fix the coccicheck warnings:
>> WARNING: use scnprintf or sprintf.
>> 
>> Signed-off-by: Qing Wang <wangqing@...o.com>
>> ---
>>  drivers/tty/serial/8250/8250_aspeed_vuart.c | 6 +++---
>>  drivers/tty/serial/8250/8250_port.c         | 2 +-
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
>> index 2350fb3..082b9bd 100644
>> --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
>> +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
>> @@ -82,7 +82,7 @@ static ssize_t lpc_address_show(struct device *dev,
>>        addr = (aspeed_vuart_readb(vuart, ASPEED_VUART_ADDRH) << 8) |
>>                (aspeed_vuart_readb(vuart, ASPEED_VUART_ADDRL));
>>  
>> -     return snprintf(buf, PAGE_SIZE - 1, "0x%x\n", addr);
>> +     return sysfs_emit(buf - 1, "0x%x\n", addr);
>
>what is the buf-1 thing here for?
>
>Doing a tree-wide change for this type of thing might not be wanted by
>many maintainers, especially if you introduce bugs like this :(

Sorry for this, my tool needs to be optimized.
Please ignore this patch.

Thanks,

Qing
>
>greg k-h
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ