Patch "block, bfq: fix uaf for bfqq in bfq_exit_icq_bfqq" has been added to the 6.0-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

    block, bfq: fix uaf for bfqq in bfq_exit_icq_bfqq

to the 6.0-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:
     block-bfq-fix-uaf-for-bfqq-in-bfq_exit_icq_bfqq.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 2cdd803b3edd469225937ccc1af1b9e2bc545496
Author: Yu Kuai <yukuai3@xxxxxxxxxx>
Date:   Mon Dec 26 11:06:05 2022 +0800

    block, bfq: fix uaf for bfqq in bfq_exit_icq_bfqq
    
    [ Upstream commit 246cf66e300b76099b5dbd3fdd39e9a5dbc53f02 ]
    
    Commit 64dc8c732f5c ("block, bfq: fix possible uaf for 'bfqq->bic'")
    will access 'bic->bfqq' in bic_set_bfqq(), however, bfq_exit_icq_bfqq()
    can free bfqq first, and then call bic_set_bfqq(), which will cause uaf.
    
    Fix the problem by moving bfq_exit_bfqq() behind bic_set_bfqq().
    
    Fixes: 64dc8c732f5c ("block, bfq: fix possible uaf for 'bfqq->bic'")
    Reported-by: Yi Zhang <yi.zhang@xxxxxxxxxx>
    Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221226030605.1437081-1-yukuai1@xxxxxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 528ca21044a5..7d2ca122362f 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -5385,8 +5385,8 @@ static void bfq_exit_icq_bfqq(struct bfq_io_cq *bic, bool is_sync)
 		unsigned long flags;
 
 		spin_lock_irqsave(&bfqd->lock, flags);
-		bfq_exit_bfqq(bfqd, bfqq);
 		bic_set_bfqq(bic, NULL, is_sync);
+		bfq_exit_bfqq(bfqd, bfqq);
 		spin_unlock_irqrestore(&bfqd->lock, flags);
 	}
 }



[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