Patch "IB/hfi1: Reject a zero-length user expected buffer" has been added to the 6.1-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

    IB/hfi1: Reject a zero-length user expected buffer

to the 6.1-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:
     ib-hfi1-reject-a-zero-length-user-expected-buffer.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 96521fe6ac5a69f9dfb22cfed7a2b72bab9a4161
Author: Dean Luick <dean.luick@xxxxxxxxxxxxxxxxxxxx>
Date:   Mon Jan 9 12:31:11 2023 -0500

    IB/hfi1: Reject a zero-length user expected buffer
    
    [ Upstream commit 0a0a6e80472c98947d73c3d13bcd7d101895f55d ]
    
    A zero length user buffer makes no sense and the code
    does not handle it correctly.  Instead, reject a
    zero length as invalid.
    
    Fixes: 97736f36dbeb ("IB/hfi1: Validate page aligned for a given virtual addres")
    Signed-off-by: Dean Luick <dean.luick@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/167328547120.1472310.6362802432127399257.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
index 186d30291260..3c609b11e71c 100644
--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
+++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
@@ -256,6 +256,8 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
 
 	if (!PAGE_ALIGNED(tinfo->vaddr))
 		return -EINVAL;
+	if (tinfo->length == 0)
+		return -EINVAL;
 
 	tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL);
 	if (!tidbuf)



[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