Patch "scsi: st: Don't modify unknown block number in MTIOCGET" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: st: Don't modify unknown block number in MTIOCGET

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-st-don-t-modify-unknown-block-number-in-mtiocge.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0c5946f3cb4eb1c463d67c05fa295a0fe86f209b
Author: Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx>
Date:   Wed Nov 6 11:57:21 2024 +0200

    scsi: st: Don't modify unknown block number in MTIOCGET
    
    [ Upstream commit 5bb2d6179d1a8039236237e1e94cfbda3be1ed9e ]
    
    Struct mtget field mt_blkno -1 means it is unknown. Don't add anything to
    it.
    
    Signed-off-by: Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx>
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=219419#c14
    Link: https://lore.kernel.org/r/20241106095723.63254-2-Kai.Makisara@xxxxxxxxxxx
    Reviewed-by: John Meneghini <jmeneghi@xxxxxxxxxx>
    Tested-by: John Meneghini <jmeneghi@xxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 9933722acfd96..861038a1cbd48 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3751,7 +3751,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
 		    ((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
 		mt_status.mt_blkno = STps->drv_block;
 		mt_status.mt_fileno = STps->drv_file;
-		if (STp->block_size != 0) {
+		if (STp->block_size != 0 && mt_status.mt_blkno >= 0) {
 			if (STps->rw == ST_WRITING)
 				mt_status.mt_blkno +=
 				    (STp->buffer)->buffer_bytes / STp->block_size;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux