Bug 197096

Summary: panic in arp_ifscrub when deleting entries marked LLE_STATIC
Product: Base System Reporter: Kurt Lidl <lidl>
Component: kernAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Some People CC: ae
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to correct locking in arp_ifscrub none

Description Kurt Lidl freebsd_committer freebsd_triage 2015-01-26 15:15:41 UTC
Created attachment 152183 [details]
patch to correct locking in arp_ifscrub

When renaming interfaces, if you attempt to delete the ARP entries that
are marked LLE_STATIC, the kernel will panic.

This is due to only holding a read lock when a write lock is required.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-03-07 18:33:38 UTC
A commit references this bug:

Author: ae
Date: Sat Mar  7 18:33:09 UTC 2015
New revision: 279730
URL: https://svnweb.freebsd.org/changeset/base/279730

Log:
  lla_lookup() can directly call llentry_free() for static entries
  and the last one requires to hold afdata's wlock.

  PR:		197096
  MFC after:	1 week

Changes:
  head/sys/netinet/if_ether.c
Comment 2 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-03-07 18:48:48 UTC
(In reply to lidl from comment #0)
> Created attachment 152183 [details]
> patch to correct locking in arp_ifscrub
> 
> When renaming interfaces, if you attempt to delete the ARP entries that
> are marked LLE_STATIC, the kernel will panic.
> 
> This is due to only holding a read lock when a write lock is required.

Yes, this was my fault. I merged r260187 from our code base, but the patch became outdated after r249742.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-03-14 14:35:30 UTC
A commit references this bug:

Author: ae
Date: Sat Mar 14 14:35:08 UTC 2015
New revision: 279988
URL: https://svnweb.freebsd.org/changeset/base/279988

Log:
  MFC r279730:
    lla_lookup() can directly call llentry_free() for static entries
    and the last one requires to hold afdata's wlock.

  PR:		197096

Changes:
_U  stable/10/
  stable/10/sys/netinet/if_ether.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-03-14 14:44:34 UTC
A commit references this bug:

Author: ae
Date: Sat Mar 14 14:44:04 UTC 2015
New revision: 279990
URL: https://svnweb.freebsd.org/changeset/base/279990

Log:
  MFC r279730:
    lla_lookup() can directly call llentry_free() for static entries
    and the last one requires to hold afdata's wlock.

  PR:		197096

Changes:
_U  stable/9/sys/
  stable/9/sys/netinet/if_ether.c
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-03-14 14:48:07 UTC
Fixed in head/, stable/10 and stable/9. Thanks!