Patch "netdevsim: Don't accept device bound programs" has been added to the 6.6-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

    netdevsim: Don't accept device bound programs

to the 6.6-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:
     netdevsim-don-t-accept-device-bound-programs.patch
and it can be found in the queue-6.6 subdirectory.

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



commit f5db45b80d5dd82a21d88afa3bf8c8b74665641b
Author: Stanislav Fomichev <sdf@xxxxxxxxxx>
Date:   Mon Nov 13 20:54:52 2023 -0800

    netdevsim: Don't accept device bound programs
    
    [ Upstream commit c0c6bde586c7dce82719b4ff32a2db6af9ee3d65 ]
    
    Commit 2b3486bc2d23 ("bpf: Introduce device-bound XDP programs") introduced
    device-bound programs by largely reusing existing offloading infrastructure.
    This changed the semantics of 'prog->aux->offload' a bit. Now, it's non-NULL
    for both offloaded and device-bound programs.
    
    Instead of looking at 'prog->aux->offload' let's call bpf_prog_is_offloaded
    which should be true iff the program is offloaded and not merely device-bound.
    
    Fixes: 2b3486bc2d23 ("bpf: Introduce device-bound XDP programs")
    Reported-by: syzbot+44c2416196b7c607f226@xxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Reviewed-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Cc: Dipendra Khadka <kdipendra88@xxxxxxxxx>
    Link: https://lore.kernel.org/bpf/20231114045453.1816995-2-sdf@xxxxxxxxxx
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c
index f60eb97e3a627..608953d4f98da 100644
--- a/drivers/net/netdevsim/bpf.c
+++ b/drivers/net/netdevsim/bpf.c
@@ -93,7 +93,7 @@ static void nsim_prog_set_loaded(struct bpf_prog *prog, bool loaded)
 {
 	struct nsim_bpf_bound_prog *state;
 
-	if (!prog || !prog->aux->offload)
+	if (!prog || !bpf_prog_is_offloaded(prog->aux))
 		return;
 
 	state = prog->aux->offload->dev_priv;
@@ -311,7 +311,7 @@ nsim_setup_prog_hw_checks(struct netdevsim *ns, struct netdev_bpf *bpf)
 	if (!bpf->prog)
 		return 0;
 
-	if (!bpf->prog->aux->offload) {
+	if (!bpf_prog_is_offloaded(bpf->prog->aux)) {
 		NSIM_EA(bpf->extack, "xdpoffload of non-bound program");
 		return -EINVAL;
 	}



[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