Eli Britstein via dev <[email protected]> writes: > The ipf module calculates fragment bounds with uint16_t, that can be > wrapped around, causing access to invalid memory. Fix it. > Other commits are supporting this fix. > > v3-v2: > - Added ipf: Drop overlap fragments. > - Added ofproto-dpif: Use strip_recirc in reassembly dump-flows checks. > - Zero-payload commit now focuses only on adding an additional byte to > the test, as the new bounds commit would reject it otherwise. > - Wrapping bounds - separated checks for rest_len <= 0. > > v4-v3: > - Added 2 more commits. > - Wrapping bounds - added a TOO_LARGE counter. > > v5-v4: > - Added a test coverage for drop overlap fragments. > - Fixed a wrongly counted IPv6 too-large counter. > - Added BEYOND_LAST counter. > > v6-v5: > - Overlap now drops the whole datagram. Exact duplicates are dropped alone. > - Added RFC references in the code comments. > > v7-v6: > - Added a DISCARDED counter. > - A last-fragment duplicate now completes the datagram. > - Reordered "Distinguish" before "Drop overlapping" to keep commits > bisectable. > - Folded the zero-payload test commit into the wrapping-bounds and > "Distinguish" commits. > - Added beyond-last tests (last seen second, IPv6). > > v8-v7: > - Fixed the last-fragment duplicate handling. > - Added tests and clarified comments.
After taking a deeper look, there's one bit of difference that we need to address before going forward - the reasoning *why* it should be okay to drop the packets rather than forwarding on with CT_INVALID. For example, when we drop in this DP the SDN controller can no longer take the opportunity to check the invalid packet and make decisions. We move the policy decision outside the openflow pipeline and move it into the fragmentation layer directly. Generally, I think OVS takes the stance that the controller should have the opportunity to make some informed decision with the packet, where this series drops. That includes writing pipelines that replicate kernel datapath semantics. Please make sure to mark 4/5 as for sure needing a backport in your cover letter with the reasoning. IF you feel that 5/5's correctness issue should also have a backport (after addressing comments), flag that as well (and we can see about what the dependency scope is). It would be good for the cover letter to spell out that the earlier parts of the series are kernel / userspace alignments rather than bugfixes. All 5 patches contain Fixes: tags, and without saying so, they would be considered for stable backports - but given the amount of behavior change that isn't something we would normally do without strong reasoning. > Eli Britstein (5): > ofproto-dpif: Use strip_recirc in reassembly dump-flows checks. > ipf: Distinguish duplicate and overlapping fragments. > ipf: Drop overlapping fragments and their datagram. > ipf: Reject IPv4/v6 fragments with wrapping bounds. > ipf: Reject fragments beyond the last fragment. > > lib/dpctl.c | 16 + > lib/dpif-provider.h | 4 + > lib/ipf.c | 239 +++++++++++-- > lib/ipf.h | 4 + > tests/ofproto-dpif.at | 573 +++++++++++++++++++++++++++++-- > tests/system-userspace-macros.at | 32 ++ > 6 files changed, 814 insertions(+), 54 deletions(-) _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
