Patch "um: vector: Use GFP_ATOMIC under spin lock" has been added to the 5.8-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

    um: vector: Use GFP_ATOMIC under spin lock

to the 5.8-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:
     um-vector-use-gfp_atomic-under-spin-lock.patch
and it can be found in the queue-5.8 subdirectory.

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



commit f834070d8f1e9d9a12f2fd2c1ee6fbac50e5bf86
Author: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
Date:   Fri Jun 19 13:20:07 2020 +0800

    um: vector: Use GFP_ATOMIC under spin lock
    
    [ Upstream commit e4e721fe4ccb504a29d1e8d4047667557281d932 ]
    
    Use GFP_ATOMIC instead of GFP_KERNEL under spin lock to fix possible
    sleep-in-atomic-context bugs.
    
    Fixes: 9807019a62dc ("um: Loadable BPF "Firmware" for vector drivers")
    Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
    Acked-By: Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Richard Weinberger <richard@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 8735c468230a5..555203e3e7b45 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1403,7 +1403,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
 		kfree(vp->bpf->filter);
 		vp->bpf->filter = NULL;
 	} else {
-		vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL);
+		vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_ATOMIC);
 		if (vp->bpf == NULL) {
 			netdev_err(dev, "failed to allocate memory for firmware\n");
 			goto flash_fail;
@@ -1415,7 +1415,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev,
 	if (request_firmware(&fw, efl->data, &vdevice->pdev.dev))
 		goto flash_fail;
 
-	vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_KERNEL);
+	vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_ATOMIC);
 	if (!vp->bpf->filter)
 		goto free_buffer;
 



[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