Bug 189117 - [panic] There is a very big chance crash the system in my computer when I use "netstat -si".
Summary: [panic] There is a very big chance crash the system in my computer when I use...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 18:00 UTC by Kevin
Modified: 2014-09-06 04:41 UTC (History)
4 users (show)

See Also:


Attachments
core.txt (146.35 KB, text/plain)
2014-08-21 03:06 UTC, Danilo Egea Gondolfo
no flags Details
proposed patch (5.56 KB, patch)
2014-08-22 00:35 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin 2014-04-29 18:00:00 UTC
When I type "netstat -si" in xterm on my physical machine, system crash.
The user is not root, but in group "wheel".

After restart the system, I see the line:
"savecore: reboot after panic: page fault"

And then I try it again in a idle system, and crash again.

It is correct in VirtualBox in which FreeBSD 10.0-RELEASE-p1 runs.

How-To-Repeat: I start the system, and launch xterm, 
and then type "netstat -si" in it,
and type enter,
and the system freeze.(maybe it is dumping the kernel)
After 5-10 seconds, system restart automatically.
Comment 1 Victor Yagofarov 2014-08-20 14:47:50 UTC
I have the same problem: I rebooted three machines by this command and stopped.
One is FreeBSD 11.0-CURRENT r262846
And two of them are FreeBSD 10.0-RELEASE-p1
Comment 2 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2014-08-20 15:35:47 UTC
Same problem here: 10.0-STABLE r270206M
Comment 3 Adam McDougall 2014-08-20 16:35:26 UTC
Confirmed running as 'nobody' or 'root' on 10-STABLE r268824 but unable to reproduce on 9-STABLE r268824.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2014-08-20 19:17:21 UTC
Could someone who's seeing this problem please provide a backtrace from the crash, or even better, a copy of core.txt?
Comment 5 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2014-08-21 03:06:57 UTC
Created attachment 146101 [details]
core.txt
Comment 6 Danilo Egea Gondolfo freebsd_committer freebsd_triage 2014-08-21 03:21:45 UTC
If necessary I can upload my vmcore + /boot/kernel/kernel
Comment 7 Mark Johnston freebsd_committer freebsd_triage 2014-08-21 03:33:06 UTC
(In reply to Danilo Egea Gondolfo from comment #6)
> If necessary I can upload my vmcore + /boot/kernel/kernel

That would be useful, thanks. I assumed it was crashing while handling SIOCGIFSTAT_*, but I'm not sure why in6_control() doesn't appear in the trace.
Comment 9 Mark Johnston freebsd_committer freebsd_triage 2014-08-21 14:59:41 UTC
(In reply to Danilo Egea Gondolfo from comment #8)
> vmcore: https://people.freebsd.org/~danilo/tmp/vmcore.6.xz
> kernel: https://people.freebsd.org/~danilo/tmp/kernel.tar.xz

Thanks. Looks like the problem is caused by executing the SIOCGIFSTAT_IN6 ioctl on pflog0. So kldloading pflog.ko and running netstat -si allows me to reproduce the problem.
Comment 10 Mark Johnston freebsd_committer freebsd_triage 2014-08-22 00:35:46 UTC
Created attachment 146138 [details]
proposed patch

Here's a proposed fix for the crash, which is the result of a missed check in r253841.
Comment 11 commit-hook freebsd_committer freebsd_triage 2014-08-22 19:22:02 UTC
A commit references this bug:

Author: markj
Date: Fri Aug 22 19:21:09 UTC 2014
New revision: 270348
URL: http://svnweb.freebsd.org/changeset/base/270348

Log:
  Add some missing checks for unsupported interfaces (e.g. pflog(4)) when
  handling ioctls. While here, remove duplicated checks for a NULL ifp in
  in6_control(): this check is already done near the beginning of the
  function.

  PR:		189117
  Reviewed by:	hrs
  MFC after:	2 weeks

Changes:
  head/sys/netinet6/in6.c
  head/sys/netinet6/scope6.c
  head/sys/netinet6/scope6_var.h
Comment 12 commit-hook freebsd_committer freebsd_triage 2014-09-06 04:34:12 UTC
A commit references this bug:

Author: markj
Date: Sat Sep  6 04:33:38 UTC 2014
New revision: 271184
URL: http://svnweb.freebsd.org/changeset/base/271184

Log:
  MFC r270348:
  Add some missing checks for unsupported interfaces (e.g. pflog(4)) when
  handling ioctls. While here, remove duplicated checks for a NULL ifp in
  in6_control(): this check is already done near the beginning of the
  function.

  MFC r270349:
  Suppress warnings when retrieving protocol stats from interfaces that
  don't support IPv6 (e.g. pflog(4)).

  PR:	189117

Changes:
_U  stable/9/sys/
  stable/9/sys/netinet6/in6.c
  stable/9/sys/netinet6/scope6.c
  stable/9/sys/netinet6/scope6_var.h
_U  stable/9/usr.bin/netstat/
  stable/9/usr.bin/netstat/inet6.c
Comment 13 commit-hook freebsd_committer freebsd_triage 2014-09-06 04:40:15 UTC
A commit references this bug:

Author: markj
Date: Sat Sep  6 04:39:27 UTC 2014
New revision: 271185
URL: http://svnweb.freebsd.org/changeset/base/271185

Log:
  MFC r270348:
  Add some missing checks for unsupported interfaces (e.g. pflog(4)) when
  handling ioctls. While here, remove duplicated checks for a NULL ifp in
  in6_control(): this check is already done near the beginning of the
  function.

  MFC r270349:
  Suppress warnings when retrieving protocol stats from interfaces that
  don't support IPv6 (e.g. pflog(4)).

  PR:		189117
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/sys/netinet6/in6.c
  stable/10/sys/netinet6/scope6.c
  stable/10/sys/netinet6/scope6_var.h
  stable/10/usr.bin/netstat/inet6.c
Comment 14 Mark Johnston freebsd_committer freebsd_triage 2014-09-06 04:41:21 UTC
Fixed in stable/10 and stable/9.