All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Christof Schmitt <christof.schmitt@de.ibm.com>
Cc: James Bottomley <James.Bottomley@suse.de>,
	linux-scsi@vger.kernel.org,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	stable@kernel.org
Subject: Re: [patch 1/1] sg: Free data buffers after calling blk_rq_unmap_user
Date: Thu, 17 Sep 2009 10:06:01 +0200	[thread overview]
Message-ID: <4AB1EDE9.8090102@interlog.com> (raw)
In-Reply-To: <20090917071553.766054000@de.ibm.com>

Christof Schmitt wrote:

 > From: Christof Schmitt <christof.schmitt@de.ibm.com>
 >
 > Running sg_luns on s390x with CONFIG_DEBUG_PAGEALLOC enabled fails
 > with EFAULT from the SG_IO ioctl. The EFAULT is the result from
 > copy_to_user failing in this call chain:
 >
 > sg_ioctl
 > sg_new_read
 > sg_finish_rem_req
 > blk_rq_unmap_user
 > __blk_rq_unmap_user
 > bio_uncopy_user
 > __bio_copy_iov
 > copy_to_user
 >
 > The sg driver calls sg_remove_scat to free the memory pages before
 > calling blk_rq_unmap_user that tries to copy the data back to
 > userspace. Change the order to first call blk_rq_unmap_user before
 > freeing the pages in sg_remove_scat.
 >
 > Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
 > Cc: stable@kernel.org
 > Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>

      reply	other threads:[~2009-09-17  8:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17  7:10 [patch 0/1] Fix data buffer handling in sg driver Christof Schmitt
2009-09-17  7:10 ` [patch 1/1] sg: Free data buffers after calling blk_rq_unmap_user Christof Schmitt
2009-09-17  8:06   ` Douglas Gilbert [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=4AB1EDE9.8090102@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=James.Bottomley@suse.de \
    --cc=christof.schmitt@de.ibm.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stable@kernel.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.