mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Vaughan Cao <vaughan.cao@oracle.com>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] block: register_blkdev doesn't check name against NULL
Date: Mon, 23 Sep 2013 10:56:27 -0400	[thread overview]
Message-ID: <x49mwn3y4bo.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1378866250-22679-1-git-send-email-vaughan.cao@oracle.com> (Vaughan Cao's message of "Wed, 11 Sep 2013 10:24:10 +0800")

Vaughan Cao <vaughan.cao@oracle.com> writes:

> register_blkdev(0, NULL) can result kernel Oops by copying from NULL
> in strlcpy(). Fix it by checking NULL pointer at the beginning and
> WARN when encountered in unregister_blkdev.

Uhh, so yeah, this is an exported function, so I could see maybe wanting
to do the argument checking.  But honestly, if your driver can't even
get this right, is there any hope of it actually working?

This seems like a pointless patch to me, but ultimately it's up to Jens.

Cheers,
Jeff

p.s. the kerneldoc tells you what to put there:
 * @name: the name of the new block device as a zero terminated string

  reply	other threads:[~2013-09-23 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 10:40 [PATCH] " Vaughan Cao
2013-09-11  2:24 ` [PATCH v2] " Vaughan Cao
2013-09-23 14:56   ` Jeff Moyer [this message]
2013-09-29  6:55     ` vaughan
2013-09-30  2:19       ` chaiwen

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=x49mwn3y4bo.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vaughan.cao@oracle.com \
    /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

all inboxes | Powered by JetHome®