All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Jan Kara <jack@suse.cz>, linux-media@vger.kernel.org
Cc: Pawel Osciak <pawel@osciak.com>
Subject: Re: Handling of user address in vb2_dc_get_userptr()
Date: Mon, 21 Oct 2013 09:22:32 +0200	[thread overview]
Message-ID: <5264D638.5010302@samsung.com> (raw)
In-Reply-To: <20131017212331.GA14677@quack.suse.cz>

Hello,

On 2013-10-17 23:23, Jan Kara wrote:
>    I'm auditing get_user_pages() users and when looking into
> vb2_dc_get_userptr() I was wondering about the following: The address this
> function works with is an arbitrary user-provided address. However the
> function vb2_dc_get_user_pages() uses pfn_to_page() on the pfn obtained
> from VM_IO | VM_PFNMAP vma. That isn't really safe for arbitrary vma of
> this type (such vmas don't have to have struct page associated at all). I
> expect this works because userspace always passes a pointer to either a
> regular vma or VM_FIXMAP vma where struct page is associated with pfn. Am
> I right? Or for on which vmas this code is supposed to work? Thanks in
> advance for clarification.

This is known issue. It has been at least partially addresses by the 
following patch:
https://patchwork.linuxtv.org/patch/18978/

I hope that one day it can be addressed fully by changing the 
dma-mapping API in a way it will let drivers to map particular pfn into 
dma address space.

Best regards
-- 
Marek Szyprowski
Samsung R&D Institute Poland


      reply	other threads:[~2013-10-21  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 21:23 Handling of user address in vb2_dc_get_userptr() Jan Kara
2013-10-21  7:22 ` Marek Szyprowski [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=5264D638.5010302@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=jack@suse.cz \
    --cc=linux-media@vger.kernel.org \
    --cc=pawel@osciak.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 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.