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>] [day] [month] [year] [list]
Date:   Fri, 23 Aug 2019 11:12:37 +0200
From:   Florian Westphal <fw@...len.de>
To:     Dan Siemon <dan@...erfire.com>
Cc:     netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: Bridge zeros out skb->cb in 5.2 (not in 5.1)

Dan Siemon <dan@...erfire.com> wrote:

[ CCing bpf maling list ]

> Commit f12064d1b402c60c5db9c4b63d5ed6d7facb33f6 zeros out skb->cb in
> br_input.c:
> 
> memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
> 
> https://github.com/torvalds/linux/commit/f12064d1b402c60c5db9c4b63d5ed6d7facb33f6
> 
> Prior to 5.2, it was possible to store information in skb->cb and have it
> pass through the bridge to the output link.

I did not know this was even possible.

Any owner of the skb (bridge, ip stack, etc.) use skb->cb[] as they see fit.

> We leveraged this to have a BPF
> prog that runs on ingress and does custom packet parsing and stores the
> output qdisc:class in skb->cb. This enabled the egress BPF filter to be
> super simple and avoid having to parse the entire packet again.
> 
> Note I haven't built with this patch removed so it's possible this isn't
> the problem but the memset is unconditional...

You're not exactly saying what the problem is, so I have no idea.

> Is this a regression? Is it expected that the bridge would wipe this field
> when just passing frames?

Even if you remove the memset, that commit br_input_skb_cb
has existed, and is used.  Fields were just cleared on-demand rather
than unconditionally at the start.

I think the latter is better practice and also what other owners do.
So please explain what exactly the problem is and/or check that the
cb clearing "is the problem".

If it is, I have no idea how to fix it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ