Patch "bpf: Add a check for struct bpf_fib_lookup size" has been added to the 5.10-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: Add a check for struct bpf_fib_lookup size

to the 5.10-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-add-a-check-for-struct-bpf_fib_lookup-size.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 65bdbe217623857089728a30bd50c2706d95e444
Author: Anton Protopopov <aspsk@xxxxxxxxxxxxx>
Date:   Tue Mar 26 10:17:42 2024 +0000

    bpf: Add a check for struct bpf_fib_lookup size
    
    [ Upstream commit 59b418c7063d30e0a3e1f592d47df096db83185c ]
    
    The struct bpf_fib_lookup should not grow outside of its 64 bytes.
    Add a static assert to validate this.
    
    Suggested-by: David Ahern <dsahern@xxxxxxxxxx>
    Signed-off-by: Anton Protopopov <aspsk@xxxxxxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/20240326101742.17421-4-aspsk@xxxxxxxxxxxxx
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/filter.c b/net/core/filter.c
index 49e4d1535cc82..a3101cdfd47b9 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -78,6 +78,9 @@
 #include <linux/btf_ids.h>
 #include <net/tls.h>
 
+/* Keep the struct bpf_fib_lookup small so that it fits into a cacheline */
+static_assert(sizeof(struct bpf_fib_lookup) == 64, "struct bpf_fib_lookup size check");
+
 static const struct bpf_func_proto *
 bpf_sk_base_func_proto(enum bpf_func_id func_id);
 




[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