From: sashiko-bot@kernel.org
To: "Mikulas Patocka" <mpatocka@redhat.com>,
"Alasdair Kergon" <agk@redhat.com>,
"Mike Snitzer" <snitzer@kernel.org>,
"Benjamin Marzinski" <bmarzins@redhat.com>
Cc: dm-devel@lists.linux.dev
Subject: Re: [PATCH] dm-cache: fix NULL pointer dereference on open failure
Date: Fri, 06 Nov 2026 18:48:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-202101@kernel.org> (raw)
In-Reply-To: <05b79ec2-42f7-ffe3-20e6-1dc499e60cf5@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-cache: Fixes trailer cites c6b4fcbad044 instead of
9b1cc9f251af
--
commit 9e9ca29bfbdfdcf14064f5312fa72be5b8ba53a8
Author: Mikulas Patocka <mpatocka@redhat.com>
> dm-cache: fix NULL pointer dereference on open failure
>
> When __begin_transaction_flags in metadata_open fails,
> dm_cache_metadata_close is called. dm_cache_metadata_close attempts to
> execute list_del(&cmd->list);, but the "cmd" object is not on any list
> yet, thus it crashes with NULL pointer dereference.
>
> Fix this by initializing cmd->list after cmd is allocated.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Assisted-by: Claude:claude-opus-5
> Cc: stable@vger.kernel.org
> Fixes: c6b4fcbad044 ("dm: add cache target")
[Severity: Low]
Should the Fixes: tag reference 9b1cc9f251af ("dm cache: share
cache-metadata object across inactive and active DM tables") instead?
In c6b4fcbad044 ("dm: add cache target"), struct dm_cache_metadata did not
have a list member and dm_cache_metadata_close() did not call list_del().
Commit 9b1cc9f251af ("dm cache: share cache-metadata object across
inactive and active DM tables") added cmd->list, deferred list_add() to
lookup_or_open() after metadata_open() succeeds, and added
list_del(&cmd->list) to dm_cache_metadata_close().
--
Sashiko AI review · https://sashiko.dev/#/patchset/05b79ec2-42f7-ffe3-20e6-1dc499e60cf5@redhat.com?part=1
next prev parent reply other threads:[~2026-11-06 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 18:38 [PATCH] dm-cache: fix NULL pointer dereference on open failure Mikulas Patocka
2026-11-06 18:48 ` sashiko-bot [this message]
2026-11-11 18:19 ` Ming Hung Tsai
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-202101@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agk@redhat.com \
--cc=bmarzins@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=mpatocka@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=snitzer@kernel.org \
/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.