public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Suraj Sonawane <surajsonawane0215@gmail.com>, dgilbert@interlog.com
Cc: James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot+7efb5850a17ba6ce098b@syzkaller.appspotmail.com
Subject: Re: [PATCH] scsi: sg: fix slab-use-after-free Read in sg_release
Date: Thu, 21 Nov 2024 12:24:02 -0800	[thread overview]
Message-ID: <3fe2a0cf-e652-4e4e-b74f-659eb5ab89e3@acm.org> (raw)
In-Reply-To: <20241120125944.88095-1-surajsonawane0215@gmail.com>

On 11/20/24 4:59 AM, Suraj Sonawane wrote:
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index f86be197f..457d54171 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -393,7 +393,6 @@ sg_release(struct inode *inode, struct file *filp)
>   
>   	mutex_lock(&sdp->open_rel_lock);
>   	scsi_autopm_put_device(sdp->device);
> -	kref_put(&sfp->f_ref, sg_remove_sfp);
>   	sdp->open_cnt--;
>   
>   	/* possibly many open()s waiting on exlude clearing, start many;
> @@ -405,6 +404,7 @@ sg_release(struct inode *inode, struct file *filp)
>   		wake_up_interruptible(&sdp->open_wait);
>   	}
>   	mutex_unlock(&sdp->open_rel_lock);
> +	kref_put(&sfp->f_ref, sg_remove_sfp);
>   	return 0;
>   }

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2024-11-21 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 12:59 [PATCH] scsi: sg: fix slab-use-after-free Read in sg_release Suraj Sonawane
2024-11-21 20:24 ` Bart Van Assche [this message]
2024-11-25 14:30 ` Suraj Sonawane
2024-11-25 17:03   ` Bart Van Assche
2024-11-26  5:19     ` Suraj Sonawane
2024-12-05  2:17 ` Martin K. Petersen
2024-12-06  6:52   ` Suraj Sonawane

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=3fe2a0cf-e652-4e4e-b74f-659eb5ab89e3@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=surajsonawane0215@gmail.com \
    --cc=syzbot+7efb5850a17ba6ce098b@syzkaller.appspotmail.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