All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: David Laight <David.Laight@aculab.com>
Cc: 'Herbert Xu' <herbert@gondor.apana.org.au>,
	Zhangfei Gao <zhangfei.gao@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	wangzhou1 <wangzhou1@hisilicon.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"kbuild-all@lists.01.org" <kbuild-all@lists.01.org>
Subject: Re: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy
Date: Tue, 9 Jun 2020 23:56:00 -0700	[thread overview]
Message-ID: <20200610065600.GC6286@sol.localdomain> (raw)
In-Reply-To: <8c0d8f4e21794d8b80d0a3852830debb@AcuMS.aculab.com>

On Sun, Jun 07, 2020 at 01:03:45PM +0000, David Laight wrote:
> From: Herbert Xu
> > Sent: 05 June 2020 13:17
> ...
> > Better yet use strscpy which will even return an error for you.
> 
> It really ought to return the buffer length on truncation.
> Then you can loop:
> 	while(...)
> 		buf += strxxxcpy(buf, src, buf_end - buf);
> and only check right at the end.
> 
> 	David

scnprintf() can be used for that.

But that doesn't seem relevant to this patch.

- Eric

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy
Date: Tue, 09 Jun 2020 23:56:00 -0700	[thread overview]
Message-ID: <20200610065600.GC6286@sol.localdomain> (raw)
In-Reply-To: <8c0d8f4e21794d8b80d0a3852830debb@AcuMS.aculab.com>

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

On Sun, Jun 07, 2020 at 01:03:45PM +0000, David Laight wrote:
> From: Herbert Xu
> > Sent: 05 June 2020 13:17
> ...
> > Better yet use strscpy which will even return an error for you.
> 
> It really ought to return the buffer length on truncation.
> Then you can loop:
> 	while(...)
> 		buf += strxxxcpy(buf, src, buf_end - buf);
> and only check right at the end.
> 
> 	David

scnprintf() can be used for that.

But that doesn't seem relevant to this patch.

- Eric

  reply	other threads:[~2020-06-10  6:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 13:32 drivers/crypto/hisilicon/qm.c:1579:2: warning: 'strncpy' specified bound 64 equals destination size kernel test robot
2020-06-03 13:32 ` kernel test robot
2020-06-04  3:32 ` [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy Zhangfei Gao
2020-06-04  3:32   ` Zhangfei Gao
2020-06-04  3:39   ` Herbert Xu
2020-06-04  3:39     ` Herbert Xu
2020-06-04  6:10     ` Zhangfei Gao
2020-06-04  6:10       ` Zhangfei Gao
2020-06-04  6:18       ` Herbert Xu
2020-06-04  6:18         ` Herbert Xu
2020-06-04  6:44         ` Zhangfei Gao
2020-06-04  6:44           ` Zhangfei Gao
2020-06-04  6:50           ` Herbert Xu
2020-06-04  6:50             ` Herbert Xu
2020-06-04 13:52             ` Zhou Wang
2020-06-04 13:52               ` Zhou Wang
2020-06-05  9:34             ` Zhangfei Gao
2020-06-05  9:34               ` Zhangfei Gao
2020-06-05 12:17               ` Herbert Xu
2020-06-05 12:17                 ` Herbert Xu
2020-06-05 15:26                 ` Zhangfei Gao
2020-06-05 15:26                   ` Zhangfei Gao
2020-06-05 15:49                   ` Eric Biggers
2020-06-05 15:49                     ` Eric Biggers
2020-06-06  1:42                     ` Zhangfei Gao
2020-06-06  1:42                       ` Zhangfei Gao
2020-06-07 13:03                 ` David Laight
2020-06-10  6:56                   ` Eric Biggers [this message]
2020-06-10  6:56                     ` Eric Biggers
2020-06-15  3:38   ` [PATCH v2] crypto: hisilicon - fix strncpy warning with strscpy Zhangfei Gao
2020-06-15  3:38     ` Zhangfei Gao
2020-06-26  6:06     ` Herbert Xu
2020-06-26  6:06       ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200610065600.GC6286@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=zhangfei.gao@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.