Patch "bpf: Fix propagation of signed bounds from 64-bit min/max into 32-bit." has been added to the 5.14-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: Fix propagation of signed bounds from 64-bit min/max into 32-bit.

to the 5.14-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-fix-propagation-of-signed-bounds-from-64-bit-min.patch
and it can be found in the queue-5.14 subdirectory.

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



commit fccba2d478a1e5f84407131f5d96114d83de3682
Author: Alexei Starovoitov <ast@xxxxxxxxxx>
Date:   Mon Nov 1 15:21:52 2021 -0700

    bpf: Fix propagation of signed bounds from 64-bit min/max into 32-bit.
    
    [ Upstream commit 388e2c0b978339dee9b0a81a2e546f8979e021e2 ]
    
    Similar to unsigned bounds propagation fix signed bounds.
    The 'Fixes' tag is a hint. There is no security bug here.
    The verifier was too conservative.
    
    Fixes: 3f50f132d840 ("bpf: Verifier, do explicit ALU32 bounds tracking")
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
    Acked-by: Yonghong Song <yhs@xxxxxx>
    Link: https://lore.kernel.org/bpf/20211101222153.78759-2-alexei.starovoitov@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index b9fb079559a6d..4dd9cedfc453d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1397,7 +1397,7 @@ static void __reg_combine_32_into_64(struct bpf_reg_state *reg)
 
 static bool __reg64_bound_s32(s64 a)
 {
-	return a > S32_MIN && a < S32_MAX;
+	return a >= S32_MIN && a <= S32_MAX;
 }
 
 static bool __reg64_bound_u32(u64 a)



[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