mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Aleksandr Mishin <amishin@t-argos.ru>,
	Daejun Park <daejun7.park@samsung.com>,
	stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Can Guo <cang@codeaurora.org>, Bean Huo <beanhuo@micron.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH 6.1] scsi: ufs: ufshpb: Fix NULL deallocation in ufshpb_pre_req_mempool_destroy()
Date: Wed, 3 Jul 2024 12:11:36 -0700	[thread overview]
Message-ID: <64d7746e-4751-4f46-a603-ce07f586b2d2@acm.org> (raw)
In-Reply-To: <20240703111751.23377-1-amishin@t-argos.ru>

On 7/3/24 4:17 AM, Aleksandr Mishin wrote:
> No upstream commit exists for this commit.
> 
> The issue was introduced with commit 41d8a9333cc9 ("scsi: ufs: ufshpb:
> Add HPB 2.0 support").
> 
> In ufshpb_pre_req_mempool_destroy() __free_page() is called only if pointer
> contains NULL value.
> Fix this bug by modifying check condition.
> 
> Upstream branch code has been significantly refactored and can't be
> backported directly.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 41d8a9333cc9 ("scsi: ufs: ufshpb: Add HPB 2.0 support")
> Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
> ---
>   drivers/ufs/core/ufshpb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/core/ufshpb.c b/drivers/ufs/core/ufshpb.c
> index b7f412d0f301..c649e8a10a23 100644
> --- a/drivers/ufs/core/ufshpb.c
> +++ b/drivers/ufs/core/ufshpb.c
> @@ -2120,7 +2120,7 @@ static void ufshpb_pre_req_mempool_destroy(struct ufshpb_lu *hpb)
>   	for (i = 0; i < hpb->throttle_pre_req; i++) {
>   		pre_req = hpb->pre_req + i;
>   		bio_put(hpb->pre_req[i].bio);
> -		if (!pre_req->wb.m_page)
> +		if (pre_req->wb.m_page)
>   			__free_page(hpb->pre_req[i].wb.m_page);
>   		list_del_init(&pre_req->list_req);
>   	}

Are any users of the 6.1 kernel using UFS HPB support? If not, another
possibility is to backport commit 7e9609d2daea ("scsi: ufs: core: Remove
HPB support").

Thanks,

Bart.

      reply	other threads:[~2024-07-03 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 11:17 Aleksandr Mishin
2024-07-03 19:11 ` Bart Van Assche [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=64d7746e-4751-4f46-a603-ce07f586b2d2@acm.org \
    --to=bvanassche@acm.org \
    --cc=alim.akhtar@samsung.com \
    --cc=amishin@t-argos.ru \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=daejun7.park@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=martin.petersen@oracle.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

all inboxes | Powered by JetHome®