Patch "IB/hfi1: Use kzalloc() for mmu_rb_handler allocation" has been added to the 5.10-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: Use kzalloc() for mmu_rb_handler allocation

to the 5.10-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-use-kzalloc-for-mmu_rb_handler-allocation.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 0d887aa9b2d6d86b1b1ead76bc7a3150803a8baa
Author: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxxxxxxxxxxxxx>
Date:   Mon Mar 29 09:54:14 2021 -0400

    IB/hfi1: Use kzalloc() for mmu_rb_handler allocation
    
    [ Upstream commit ca5f72568e034e1295a7ae350b1f786fcbfb2848 ]
    
    The code currently assumes that the mmu_notifier struct
    embedded in mmu_rb_handler only contains two fields.
    
    There are now extra fields:
    
    struct mmu_notifier {
            struct hlist_node hlist;
            const struct mmu_notifier_ops *ops;
            struct mm_struct *mm;
            struct rcu_head rcu;
            unsigned int users;
    };
    
    Given that there in no init for the mmu_notifier, a kzalloc() should
    be used to insure that any newly added fields are given a predictable
    initial value of zero.
    
    Fixes: 06e0ffa69312 ("IB/hfi1: Re-factor MMU notification code")
    Link: https://lore.kernel.org/r/1617026056-50483-9-git-send-email-dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx
    Reviewed-by: Adam Goldman <adam.goldman@xxxxxxxxx>
    Signed-off-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index f3fb28e3d5d7..d213f65d4cdd 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -89,7 +89,7 @@ int hfi1_mmu_rb_register(void *ops_arg,
 	struct mmu_rb_handler *h;
 	int ret;
 
-	h = kmalloc(sizeof(*h), GFP_KERNEL);
+	h = kzalloc(sizeof(*h), GFP_KERNEL);
 	if (!h)
 		return -ENOMEM;
 



[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