Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 2/2] Return the result from user admin command IOCTL even in case of failureX
Date: Fri, 1 Mar 2013 15:05:06 -0700 (MST)	[thread overview]
Message-ID: <alpine.LRH.2.03.1303011459080.456@localhost.localdom> (raw)
In-Reply-To: <E821E2F372F08945977BD15EAE588D61097C57F2@SACMBXIP02.sdcorp.global.sandisk.com>

On Thu, 28 Feb 2013, Chayan Biswas wrote:
> -       if (!status && copy_to_user(&ucmd->result, &cmd.result,
> -                                                       sizeof(cmd.result)))
> +       if (copy_to_user(&ucmd->result, &cmd.result, sizeof(cmd.result)))
>                status = -EFAULT;

I think you want to change this to a check for 'status >= 0' before
copying the result to the user since a status < 0 means the command was
not completed by the controller (successfully or otherwise) and you'd
be copying uninitialized data to the user in that case.

  reply	other threads:[~2013-03-01 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 19:49 [PATCH 2/2] Return the result from user admin command IOCTL even in case of failure Chayan Biswas
2013-03-01 22:05 ` Keith Busch [this message]
2013-05-22 20:23   ` [PATCH 2/2] Return the result from user admin command IOCTL even in case of failureX Matthew Wilcox
2013-05-22 21:12     ` Chayan Biswas

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=alpine.LRH.2.03.1303011459080.456@localhost.localdom \
    --to=keith.busch@intel.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