mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org,
	Gaston Gonzalez <gascoar@gmail.com>,
	Ojaswin Mujoo <ojaswin98@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>, Phil Elwell <phil@raspberrypi.com>,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v3] staging: vc04_services: Fix RCU dereference check
Date: Sun, 23 Jan 2022 18:32:15 +0100	[thread overview]
Message-ID: <7b0ce9d5-a278-3892-8d4a-905ca15e1edf@i2se.com> (raw)
In-Reply-To: <20211231195406.5479-1-treasure4paddy@gmail.com>

Am 31.12.21 um 20:54 schrieb Padmanabha Srinivasaiah:
> In service_callback path RCU dereferenced pointer struct vchiq_service
> need to be accessed inside rcu read-critical section.
>
> Also userdata/user_service part of vchiq_service is accessed around
> different synchronization mechanism, getting an extra reference to a
> pointer keeps sematics simpler and avoids prolonged graceperiod.
>
> Accessing vchiq_service with rcu_read_[lock/unlock] fixes below issue.
>
> [   32.201659] =============================
> [   32.201664] WARNING: suspicious RCU usage
> [   32.201670] 5.15.11-rt24-v8+ #3 Not tainted
> [   32.201680] -----------------------------
> [   32.201685] drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h:529 suspicious rcu_dereference_check() usage!
> [   32.201695]
> [   32.201695] other info that might help us debug this:
> [   32.201695]
> [   32.201700]
> [   32.201700] rcu_scheduler_active = 2, debug_locks = 1
> [   32.201708] no locks held by vchiq-slot/0/98.
> [   32.201715]
> [   32.201715] stack backtrace:
> [   32.201723] CPU: 1 PID: 98 Comm: vchiq-slot/0 Not tainted 5.15.11-rt24-v8+ #3
> [   32.201733] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT)
> [   32.201739] Call trace:
> [   32.201742]  dump_backtrace+0x0/0x1b8
> [   32.201772]  show_stack+0x20/0x30
> [   32.201784]  dump_stack_lvl+0x8c/0xb8
> [   32.201799]  dump_stack+0x18/0x34
> [   32.201808]  lockdep_rcu_suspicious+0xe4/0xf8
> [   32.201817]  service_callback+0x124/0x400
> [   32.201830]  slot_handler_func+0xf60/0x1e20
> [   32.201839]  kthread+0x19c/0x1a8
> [   32.201849]  ret_from_fork+0x10/0x20
>
> Signed-off-by: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

Thanks


      reply	other threads:[~2022-01-23 17:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29 15:32 [PATCH] " Padmanabha Srinivasaiah
2021-12-29 19:13 ` Stefan Wahren
2021-12-30 13:34   ` Padmanabha Srinivasaiah
2021-12-30 14:54     ` [PATCH v2] " Padmanabha Srinivasaiah
2021-12-30 21:39       ` Stefan Wahren
2021-12-31 18:56         ` Padmanabha Srinivasaiah
2021-12-31 19:54           ` [PATCH v3] " Padmanabha Srinivasaiah
2022-01-23 17:32             ` Stefan Wahren [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=7b0ce9d5-a278-3892-8d4a-905ca15e1edf@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gascoar@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nsaenz@kernel.org \
    --cc=ojaswin98@gmail.com \
    --cc=phil@raspberrypi.com \
    --cc=treasure4paddy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®