From: Dan Carpenter <dan.carpenter@linaro.org>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Uros Bizjak <ubizjak@gmail.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@kernel.org>
Subject: Re: sparse: Lots of (erroneous?) "different address space" errrors in new version
Date: Mon, 1 Dec 2025 11:27:51 +0300 [thread overview]
Message-ID: <aS1RhxHtknHzZE3Z@stanley.mountain> (raw)
In-Reply-To: <CANiDSCuizbMt77XfrzGPMa3Biai5TF1vcs+C5qdhYoLrP=9b3g@mail.gmail.com>
On Mon, Nov 24, 2025 at 09:55:18AM +0100, Ricardo Ribalda wrote:
> Hi Dan
>
> Every week we bump the smatch/sparse version used by Linux-media's CI.
>
> We were almost error free, but the last version has introduced a huge
> amount of errors:
> https://linux-media.pages.freedesktop.org/-/users/ci/-/jobs/88441453/artifacts/junit/test-sparse.log.txt
>
> (It is also reproducible with linus/master)
>
>
> I have bisected your tool and it seems like they were introduced by:
> commit e53027a4e816a772403baafa83c09e4a94c1cb8f (HEAD)
> Author: Dan Carpenter <dan.carpenter@linaro.org>
> Date: Sat Oct 18 12:31:01 2025 +0300
>
> symbol: preserver address space qualifiers with typeof()
>
> When we're parsing typeof(var) we should preserve the address space
> qualifiers as well.
>
> Reported-by: Uros Bizjak <ubizjak@gmail.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
>
>
> One example of the new error found is:
>
> make -i W=1 C=1 CHECK="sparse" CF="-D__CHECK_ENDIAN__
> -fmemcpy-max-count=11000000" KCFLAGS="-Wmaybe-uninitialized"
> drivers/media/v4l2-core/v4l2-compat-ioctl32.o
> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:763:13: warning:
> incorrect type in argument 2 (different address spaces)
> 09:08 drivers/media/v4l2-core/v4l2-compat-ioctl32.c:763:13: expected
> void const *from
> 09:08 drivers/media/v4l2-core/v4l2-compat-ioctl32.c:763:13: got
> unsigned int __user *
>
>
> static int put_v4l2_event32_time32(struct v4l2_event *p64,
> struct v4l2_event32_time32 __user *p32)
> {
> if (put_user(p64->type, &p32->type)
>
>
> Seems like if we would like to fix the error, put_user should be modified....
>
> Maybe it would be better to revert `symbol: preserver address space
> qualifiers with typeof()` until the codebase is ready for it?
Huh. Sorry, I don't know how I missed your email last week.
The do_put_user_call() is doing this:
__typeof__(*(ptr)) __x = (x); /* eval x once */
And ptr is the __user pointer so Sparse is doing the correct thing.
We could change the __typeof__ to __typeof_unqual__. It silences the
warning. I'll rebuild the entire kernel to see if it causes any other
issues...
regards,
dan carpenter
next prev parent reply other threads:[~2025-12-01 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 8:55 sparse: Lots of (erroneous?) "different address space" errrors in new version Ricardo Ribalda
2025-12-01 7:31 ` Ricardo Ribalda
2025-12-01 8:27 ` Dan Carpenter [this message]
2025-12-01 14:57 ` Ricardo Ribalda
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=aS1RhxHtknHzZE3Z@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=hverkuil@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=ribalda@chromium.org \
--cc=ubizjak@gmail.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.