Page MenuHomeFreeBSD

iflib: netmap: fix rsync index overrun
ClosedPublic

Authored by vmaffione on Jun 13 2020, 7:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 8, 9:17 PM
Unknown Object (File)
Sat, Jun 8, 9:16 PM
Unknown Object (File)
Sat, Jun 8, 9:12 PM
Unknown Object (File)
Fri, Jun 7, 10:47 PM
Unknown Object (File)
Wed, May 29, 12:53 PM
Unknown Object (File)
Tue, May 21, 12:26 PM
Unknown Object (File)
Fri, May 17, 2:40 PM
Unknown Object (File)
May 6 2024, 6:20 PM

Details

Summary

In the current iflib_netmap_rxsync, there is nothing that prevents kring->nr_hwtail to overrun kring->nr_hwcur during the descriptor import phase. This may cause errors in netmap applications, such as:

em1 RX0: fail 'head < kring->nr_hwcur || head > kring->nr_hwtail' h 795 c 795 t 282 rh 795 rc 795 rt 282 hc 282 ht 282
Test Plan

Tested on an em device in a VM. After the patch, the problem disappears.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 31675

Event Timeline

I guess no objections here? This is an easy change, that fixes a bug that is very easy to reproduce, and that prevents netmap applications from working for real on iflib.

This revision is now accepted and ready to land.Jun 23 2020, 3:00 PM
This revision was automatically updated to reflect the committed changes.