Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Omar Sandoval <osandov@osandov.com>, <linux-block@vger.kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, <kernel-team@fb.com>
Subject: Re: [PATCH] scsi_transport_sas: fix BSG ioctl memory corruption
Date: Tue, 21 Feb 2017 14:19:15 -0700	[thread overview]
Message-ID: <c100b2a7-4359-b91a-5174-091920cd6fc6@fb.com> (raw)
In-Reply-To: <e33a218846e718a310fd8bd92acbafd0b6252aca.1487700062.git.osandov@fb.com>

On 02/21/2017 11:03 AM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> The end_device and sas_host devices support BSG ioctls, but the
> request_queue allocated for them isn't set up to allocate the struct
> scsi_request payload. This leads to memory corruption in the call to
> scsi_req_init() in bsg_map_hdr(), since it will memset past the end of
> the allocated request. Fix it by setting ->cmd_size on the allocated
> request_queue.

Good catch, thanks Omar. Applied.

-- 
Jens Axboe

      parent reply	other threads:[~2017-02-21 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 18:03 [PATCH] scsi_transport_sas: fix BSG ioctl memory corruption Omar Sandoval
2017-02-21 18:31 ` Christoph Hellwig
2017-02-21 21:19 ` Jens Axboe [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=c100b2a7-4359-b91a-5174-091920cd6fc6@fb.com \
    --to=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.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