From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvme: fix KASAN warning when parsing host nqn
Date: Fri, 25 May 2018 01:53:13 -0700 [thread overview]
Message-ID: <20180525085313.GA10951@infradead.org> (raw)
In-Reply-To: <20180514124414.GA25689@lst.de>
On Mon, May 14, 2018@02:44:14PM +0200, Christoph Hellwig wrote:
> On Mon, May 14, 2018@02:23:12PM +0200, Hannes Reinecke wrote:
> > - host = kmalloc(sizeof(*host), GFP_KERNEL);
> > + host = kzalloc(sizeof(*host), GFP_KERNEL);
> > if (!host)
> > goto out_unlock;
> >
> > kref_init(&host->ref);
> > - memcpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
> > + memcpy(host->nqn, hostnqn, strlen(hostnqn));
>
> That pattern is called strcpy :) And we better use strlcpy here,
> just in case.
Can you resend a fixed up version?
next prev parent reply other threads:[~2018-05-25 8:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 12:23 [PATCH] nvme: fix KASAN warning when parsing host nqn Hannes Reinecke
2018-05-14 12:44 ` Christoph Hellwig
2018-05-25 8:53 ` Christoph Hellwig [this message]
2018-05-25 9:04 Hannes Reinecke
2018-05-25 13:48 ` Christoph Hellwig
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=20180525085313.GA10951@infradead.org \
--to=hch@infradead.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.