From: sashiko-bot@kernel.org
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] dma-buf: enable sg_table wrapping on CONFIG_DEBUG
Date: Tue, 09 Jun 2026 14:10:13 +0000 [thread overview]
Message-ID: <20260609141014.222A41F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609135939.2606-1-christian.koenig@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `dma_buf_wrap_sg_table()` and `dma_buf_unwrap_sg_table()` functions incorrectly check for `CONFIG_DEBUG`, which is not a valid or defined Kconfig option, unconditionally disabling the feature.
--
commit b10cbc45f527d11143178ac04d087f2e2061de9c
Author: Christian König <ckoenig.leichtzumerken@gmail.com>
dma-buf: enable sg_table wrapping on CONFIG_DEBUG
This commit changes the conditional for wrapping sg_tables from
CONFIG_DMABUF_DEBUG to CONFIG_DEBUG. The intent is to catch bad
importers doing nasty things by broadening when this feature is enabled.
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index d504c636dc294..9caef606fba14 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -861,7 +861,7 @@ static int dma_buf_wrap_sg_table(struct sg_table **sg_table)
> struct dma_buf_sg_table_wrapper *to;
> int i, ret;
>
> - if (!IS_ENABLED(CONFIG_DMABUF_DEBUG))
> + if (!IS_ENABLED(CONFIG_DEBUG))
[Severity: Medium]
Is CONFIG_DEBUG a defined Kconfig option in the kernel? I could not find it.
Since it doesn't exist (unlike CONFIG_DEBUG_KERNEL or CONFIG_DEBUG_FS),
this will unconditionally evaluate to false and completely disable the
wrapping feature. Was a different debug config intended here?
> return 0;
>
> /*
[ ... ]
> @@ -900,7 +900,7 @@ static void dma_buf_unwrap_sg_table(struct sg_table **sg_table)
> {
> struct dma_buf_sg_table_wrapper *copy;
>
> - if (!IS_ENABLED(CONFIG_DMABUF_DEBUG))
> + if (!IS_ENABLED(CONFIG_DEBUG))
[Severity: Medium]
Will unwrapping also become permanently disabled here due to the undefined
Kconfig option?
> return;
>
> copy = container_of(*sg_table, typeof(*copy), wrapper);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609135939.2606-1-christian.koenig@amd.com?part=1
prev parent reply other threads:[~2026-06-09 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 13:59 [PATCH] dma-buf: enable sg_table wrapping on CONFIG_DEBUG Christian König
2026-06-09 14:10 ` sashiko-bot [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=20260609141014.222A41F00893@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox