Page MenuHomeFreeBSD

bridgestp: validate timer values in config BPDU
ClosedPublic

Authored by kp on Apr 15 2021, 5:35 PM.

Details

Summary

IEEE Std 802.1D-2004 Section 17.14 defines permitted ranges for timers.
Incoming BPDU messages should be checked against the permitted ranges.
The rest of 17.14 appears to be enforced already.

PR: 254924

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kp requested review of this revision.Apr 15 2021, 5:35 PM
donner added a subscriber: donner.
donner added inline comments.
sys/net/bridgestp.c
603–604

Should this be "<=" and ">="?

607–608

Dito

612

Dito and may you have a space left?

This revision is now accepted and ready to land.Apr 15 2021, 8:08 PM
kp marked 2 inline comments as done.Apr 15 2021, 9:00 PM
kp added inline comments.
sys/net/bridgestp.c
603–604

No, BSTP_MIN_MAX_AGE is still acceptable. The cu_max_age value should only be rejected if it's strictly less than that value. (Or more than the maximum value).

See also bstp_set_maxage() for example.

612

Yes. I checked the couch and found a loose space, so I don't have to run to the store to buy more.

sys/net/bridgestp.c
612

May you insert the space into the code like this?

cu->cu_hello_time > BSTP_MAX_HELLO_TIME
kp marked an inline comment as done.Apr 16 2021, 8:28 AM
kp added inline comments.
sys/net/bridgestp.c
612

Yes, I've applied that change in my local version of this commit and it'll be included when I push this later today.

This revision now requires review to proceed.Apr 16 2021, 8:29 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 19 2021, 12:11 PM
This revision was automatically updated to reflect the committed changes.