Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yuqiang Sun" <izaiahsun@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH 2/3] RDMA/rtrs-srv: Balance the session device reference in sysfs setup
Date: Thu, 29 Oct 2026 04:36:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-188705@kernel.org> (raw)
In-Reply-To: <20261029042719.75868-3-izaiahsun@gmail.com>

> The session device is initialized in get_or_create_srv(), and the
> reference that device_initialize() takes is meant to be dropped last, by
> free_srv().  Each path takes one more reference, which
> rtrs_srv_destroy_once_sysfs_root_folders() drops when the path goes
> away.  On the failure paths of the path sysfs setup this does not add
> up:
> 
> - rtrs_srv_create_once_sysfs_root_folders() calls put_device() when
>   device_add() or the creation of the "paths" kobject fails, then
>   unlocks srv->paths_mutex;
> - rtrs_srv_create_path_files() calls
>   rtrs_srv_destroy_once_sysfs_root_folders() when a later step fails,
>   but the per-path reference is only taken by process_info_req() after
>   rtrs_srv_create_path_files() succeeds.
> 
> [ ... ]
> Fixes: baa5b28b7a47 ("RDMA/rtrs-srv: Replace device_register with device_initialize and device_add")
> Fixes: e2853c49477d ("RDMA/rtrs-srv-sysfs: fix missing put_device")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-5-5 kbound
> Signed-off-by: Yuqiang Sun <izaiahsun@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261029042719.75868-1-izaiahsun@gmail.com?part=2


  reply	other threads:[~2026-10-29  4:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  4:27 [PATCH 0/3] RDMA/rtrs-srv: fix use-after-free on sysfs setup failure Yuqiang Sun
2026-10-29  4:27 ` [PATCH 1/3] RDMA/rtrs-srv: Do not free the path on path file creation failure Yuqiang Sun
2026-10-29  4:35   ` sashiko-bot
2026-10-29  4:27 ` [PATCH 2/3] RDMA/rtrs-srv: Balance the session device reference in sysfs setup Yuqiang Sun
2026-10-29  4:36   ` sashiko-bot [this message]
2026-10-29  4:27 ` [PATCH 3/3] RDMA/rtrs-srv: Reject an empty pathname Yuqiang Sun
2026-10-29  4:40   ` sashiko-bot

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=sashiko-outbox-188705@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=izaiahsun@gmail.com \
    --cc=linux-rdma@vger.kernel.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