Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Miko Larsson <mikoxyzzz@gmail.com>
Cc: minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org,
	axboe@kernel.dk, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, hch@infradead.org
Subject: Re: [PATCH v2 2/2] zram: zram_drv: replace 'strlcpy()'
Date: Tue, 21 Dec 2021 00:59:09 -0800	[thread overview]
Message-ID: <YcGXXQhB8YUMXI3O@infradead.org> (raw)
In-Reply-To: <20211217063224.3474-3-mikoxyzzz@gmail.com>

On Fri, Dec 17, 2021 at 07:32:24AM +0100, Miko Larsson wrote:
> 'strlcpy()' shouldn't be used, and should be replaced with safer
> alternatives. Cristoph Hellwig suggested [1] that 'kmemdup_nul()' should
> be used in two cases instead of 'strscpy()', and that a regular
> 'strcpy()' should be used in the third case. [2][3]

Not that strcpy isn't really safer, but if your plan is to get rid
of strlcpy I think it makes more sense there.

Reviewed-by: Christoph Hellwig <hch@lst.de>

      reply	other threads:[~2021-12-21  8:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  6:32 [PATCH v2 0/2] Fix some formatting problems Miko Larsson
2021-12-17  6:32 ` [PATCH v2 1/2] zram: zram_drv: add SPDX license identifiers Miko Larsson
2021-12-21  8:58   ` Christoph Hellwig
2021-12-21  9:33   ` Joe Perches
2021-12-24 13:13     ` Miko Larsson
2021-12-24 16:33       ` Joe Perches
2021-12-17  6:32 ` [PATCH v2 2/2] zram: zram_drv: replace 'strlcpy()' Miko Larsson
2021-12-21  8:59   ` Christoph Hellwig [this message]

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=YcGXXQhB8YUMXI3O@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikoxyzzz@gmail.com \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=senozhatsky@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox