Page MenuHomeFreeBSD

Take the ifnet's address lock in igmp_v3_cancel_link_timers().
ClosedPublic

Authored by markj on Jan 2 2020, 5:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 8:42 PM
Unknown Object (File)
Dec 20 2023, 1:58 AM
Unknown Object (File)
Sep 6 2023, 2:09 PM
Unknown Object (File)
Sep 6 2023, 2:08 PM
Unknown Object (File)
Sep 6 2023, 2:06 PM
Unknown Object (File)
Sep 1 2023, 12:51 PM
Unknown Object (File)
Aug 16 2023, 10:56 AM
Unknown Object (File)
Jun 27 2023, 11:39 PM
Subscribers

Details

Summary

inm_rele_locked() may remove the multicast address associated with inm.

Reported by: syzbot+871c5d1fd5fac6c28f52@syzkaller.appspotmail.com

Test Plan

I don't have a test for it yet, syzkaller did not generate a reproducer.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: hselasky, network.

Also note that this change is consistent with mld_v2_cancel_link_timers().

Looks good.

And add to the commit message that inm_disconnect() asserts the IF_ADDR_WLOCK() .

You might want to move this assert one level up and into: inm_rele_locked() ....

Then you see there is also a call at line 1891, which needs IF_ADDR_WLOCK() around it.

Might be better to only lock when inm_refcount == 0.

This revision now requires changes to proceed.Jan 2 2020, 5:56 PM

Looks good.

And add to the commit message that inm_disconnect() asserts the IF_ADDR_WLOCK() .

You might want to move this assert one level up and into: inm_rele_locked() ....

That assertion would be wrong for the call in igmp_initial_join(), where the refcount is > 1.

Then you see there is also a call at line 1891, which needs IF_ADDR_WLOCK() around it.

The caller, igmp_fasttimo_vnet(), already takes the addr wlock.

Might be better to only lock when inm_refcount == 0.

This revision is now accepted and ready to land.Jan 2 2020, 6:17 PM