Patch "ARC: bpf: Correct conditional check in 'check_jmp_32'" has been added to the 6.12-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

    ARC: bpf: Correct conditional check in 'check_jmp_32'

to the 6.12-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:
     arc-bpf-correct-conditional-check-in-check_jmp_32.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 6f79a7774bc646e286a2cf1f37669854119f6916
Author: Hardevsinh Palaniya <hardevsinh.palaniya@xxxxxxxxxxxxxxxxx>
Date:   Wed Nov 13 19:11:18 2024 +0530

    ARC: bpf: Correct conditional check in 'check_jmp_32'
    
    [ Upstream commit 7dd9eb6ba88964b091b89855ce7d2a12405013af ]
    
    The original code checks 'if (ARC_CC_AL)', which is always true since
    ARC_CC_AL is a constant. This makes the check redundant and likely
    obscures the intention of verifying whether the jump is conditional.
    
    Updates the code to check cond == ARC_CC_AL instead, reflecting the intent
    to differentiate conditional from unconditional jumps.
    
    Suggested-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>
    Acked-by: Shahab Vahedi <list+bpf@xxxxxxxxxx>
    Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@xxxxxxxxxxxxxxxxx>
    Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arc/net/bpf_jit_arcv2.c b/arch/arc/net/bpf_jit_arcv2.c
index 4458e409ca0a..6d989b6d88c6 100644
--- a/arch/arc/net/bpf_jit_arcv2.c
+++ b/arch/arc/net/bpf_jit_arcv2.c
@@ -2916,7 +2916,7 @@ bool check_jmp_32(u32 curr_off, u32 targ_off, u8 cond)
 	addendum = (cond == ARC_CC_AL) ? 0 : INSN_len_normal;
 	disp = get_displacement(curr_off + addendum, targ_off);
 
-	if (ARC_CC_AL)
+	if (cond == ARC_CC_AL)
 		return is_valid_far_disp(disp);
 	else
 		return is_valid_near_disp(disp);




[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