All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] dma-buf: explicitely forbid exposing pages from get_user_pages()
Date: Tue, 30 Jun 2026 08:03:39 +0000	[thread overview]
Message-ID: <20260630080340.099B91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260630080112.1117341-1-christian.koenig@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Misspelling of the word 'explicitly' as 'explicitely' in both the commit message and the newly added source code comments. Additionally, 'import mechanism' is slightly awkward grammatically and would read better as 'import mechanisms'.
--

commit d403e672a4ce196480792c8a6cdd1c4a2ffcf542
Author: Christian König <ckoenig.leichtzumerken@gmail.com>

dma-buf: explicitely forbid exposing pages from get_user_pages()

This commit documents that DMA-buf exporters are forbidden from exposing
pages they do not own, such as those acquired by get_user_pages(). It also
discourages exposing the same backing store through multiple DMA-bufs to
avoid aliasing and cache coherency problems.

> dma-buf: explicitely forbid exposing pages from get_user_pages()

[Severity: Low]
This isn't a bug, but there is a typo (explicitely) in the subject line.

> Explicitely document that this is not something exporters can do.

[Severity: Low]
This isn't a bug, but there is a typo (Explicitely) in the commit message.

> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index d504c636dc294..b2efc3085e6d6 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -685,6 +685,14 @@ static struct file *dma_buf_getfile(size_t size, int flags)
>   *
>   * For the detailed semantics exporters are expected to implement see
>   * &dma_buf_ops.
> + *
> + * It is explicitely forbidden for exporters to expose buffers they don't "own"
> + * as DMA-buf. This includes pages acquired by get_user_pages() or other import
> + * mechanism. Not following this rule can create numerous security problems.

[Severity: Low]
This isn't a bug, but there is a typo (explicitely) in the new comment.
Additionally, would it read better to use the plural "mechanisms" here
instead of "mechanism"?

> + *
> + * It is also strongly discouraged to expose the same backing store through
> + * multiple DMA-bufs at the same time. This eventually creates aliasing and
> + * cache coherency problems which are extremely hard to debug and fix.
>   */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260630080112.1117341-1-christian.koenig@amd.com?part=1

  reply	other threads:[~2026-06-30  8:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  8:01 [PATCH] dma-buf: explicitely forbid exposing pages from get_user_pages() Christian König
2026-06-30  8:03 ` sashiko-bot [this message]
2026-06-30 13:42 ` Mario Limonciello
2026-07-07  9:06 ` Christian König
2026-07-07 15:41 ` Max Zhen
2026-07-07 16:54 ` Lizhi Hou

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=20260630080340.099B91F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.