lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 47/52] bpf, s390: Fix potential memory leak about jit_data
    Date
    From: Tiezhu Yang <yangtiezhu@loongson.cn>

    [ 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@loongson.cn>
    Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/s390/net/bpf_jit_comp.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    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:
    --
    2.33.0


    \
     
     \ /
      Last update: 2021-10-11 15:51    [W:2.756 / U:0.484 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site