From: "Theodore Ts'o" <tytso@mit.edu>
To: Qasim Ijaz <qasdev00@gmail.com>
Cc: adilger.kernel@dilger.ca, shikemeng@huaweicloud.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH RESEND] ext4: Fix potential NULL pointer dereferences in test_mb_mark_used() and test_mb_free_blocks()
Date: Fri, 21 Mar 2025 01:03:52 -0400 [thread overview]
Message-ID: <20250321050352.GB1161423@mit.edu> (raw)
In-Reply-To: <20250313000021.18170-1-qasdev00@gmail.com>
On Thu, Mar 13, 2025 at 12:00:21AM +0000, Qasim Ijaz wrote:
> test_mb_mark_used() and test_mb_free_blocks() call kunit_kzalloc() to
> allocate memory, however both fail to ensure that the allocations
> succeeded. If kunit_kzalloc() returns NULL, then dereferencing the
> corresponding pointer without checking for NULL will lead to
> a NULL pointer dereference.
>
> To fix this call KUNIT_ASSERT_NOT_ERR_OR_NULL() to ensure
> the allocation succeeded.
Thanks; other folks have sent this fix.
- Ted
prev parent reply other threads:[~2025-03-21 5:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 0:00 [PATCH RESEND] ext4: Fix potential NULL pointer dereferences in test_mb_mark_used() and test_mb_free_blocks() Qasim Ijaz
2025-03-17 19:05 ` Tim Chen
2025-03-18 1:30 ` Kemeng Shi
2025-03-21 5:03 ` Theodore Ts'o [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=20250321050352.GB1161423@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qasdev00@gmail.com \
--cc=shikemeng@huaweicloud.com \
--cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox