Patch "bpf, s390: Fix potential memory leak about jit_data" has been added to the 5.4-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

    bpf, s390: Fix potential memory leak about jit_data

to the 5.4-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:
     bpf-s390-fix-potential-memory-leak-about-jit_data.patch
and it can be found in the queue-5.4 subdirectory.

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



commit fc0dc3cff1cd5134210f80f5f722d0ad1b9712aa
Author: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
Date:   Mon Sep 27 15:06:14 2021 +0800

    bpf, s390: Fix potential memory leak about jit_data
    
    [ Upstream commit 686cb8b9f6b46787f035afe8fbd132a74e6b1bdd ]
    
    Make sure to free jit_data through kfree() in the error path.
    
    Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs")
    Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
    Acked-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
    Reviewed-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
    Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
    Signed-off-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 2d2996627629..f63e4cb6c9b3 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -1385,7 +1385,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL);
 	if (jit.addrs == NULL) {
 		fp = orig_fp;
-		goto out;
+		goto free_addrs;
 	}
 	/*
 	 * Three initial passes:



[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