raspberrypi / raspberrypi/linux

VC04: Address space mismatch - bulk_userdata

Open
#5,698 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Description

Describe the bug

Hello,

I am wondering if anyone here as visibility on [1]

It would help squashing the VC04 Sparse warnings for upsteram VC04 de-stage.

[1] : https://github.com/raspberrypi/linux/blob/rpi-6.6.y/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c#L543

Steps to reproduce the behaviour

Running Sparse on the mainline linux-staging branch, I get:

/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:335:26: warning: incorrect type in assignment (different address spaces)
/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:335:26:    expected void *[assigned] userdata
/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:335:26:    got void [noderef] __user *userdata
/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:553:47: warning: incorrect type in assignment (different address spaces)
/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:553:47:    expected void [noderef] __user *[addressable] [assigned] bulk_userdata
/home/uajain/src/kernel/mainline/media_tree/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c:553:47:    got void *bulk_userdata

On one of the location, there is clear FIXME about figuring out the correct address spaces.

Device (s)

Raspberry Pi 3 Mod. B+

System

Compile / static analysis on upstream branch:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/log/?h=staging-testing

Logs

No response

Additional context

VC04 mainline de-staging

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c, especially the assignments at lines 335 and 553 and the referenced line 543. Review the existing FIXME about address spaces and reproduce the Sparse warnings on the staging-testing branch. Done means the bulk_userdata and userdata address-space warnings are resolved without introducing new Sparse warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.