lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66a1bbe7f05a0_85410294c6@willemb.c.googlers.com.notmuch>
Date: Wed, 24 Jul 2024 22:43:51 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jeongjun Park <aha310510@...il.com>, 
 willemdebruijn.kernel@...il.com, 
 jasowang@...hat.com
Cc: syzbot+44623300f057a28baf1e@...kaller.appspotmail.com, 
 davem@...emloft.net, 
 edumazet@...gle.com, 
 pabeni@...hat.com, 
 kuba@...nel.org, 
 jiri@...nulli.us, 
 bigeasy@...utronix.de, 
 linux-kernel@...r.kernel.org, 
 netdev@...r.kernel.org, 
 bpf@...r.kernel.org, 
 syzkaller-bugs@...glegroups.com, 
 Jeongjun Park <aha310510@...il.com>
Subject: Re: [PATCH net] tun: Remove nested call to bpf_net_ctx_set() in
 do_xdp_generic()

Jeongjun Park wrote:
> In the previous commit, bpf_net_context handling was added to 
> tun_sendmsg() and do_xdp_generic(), but if you write code like this,
> bpf_net_context overlaps in the call trace below, causing various
> memory corruptions.

I'm no expert on this code, but commit 401cb7dae813 that introduced
bpf_net_ctx_set explicitly states that nested calls are allowed.

And the function does imply that:

static inline struct bpf_net_context *bpf_net_ctx_set(struct bpf_net_context *bpf_net_ctx)
{
        struct task_struct *tsk = current;

        if (tsk->bpf_net_context != NULL)
                return NULL;
        bpf_net_ctx->ri.kern_flags = 0;

        tsk->bpf_net_context = bpf_net_ctx;
        return bpf_net_ctx;
}


 
> <Call trace>
> ...
> tun_sendmsg() // bpf_net_ctx_set()
>   tun_xdp_one()
>     do_xdp_generic() // bpf_net_ctx_set() <-- nested
> ...
> 
> This patch removes the bpf_net_context handling that exists in 
> do_xdp_generic() and modifies it to handle it in the parent function.

Is tun_xdp_one missing? That also calls do_xdp_generic.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ