Bug 22435

Summary: linprocfs causes system down and reboot
Product: Base System Reporter: iwaki <iwaki>
Component: kernAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description iwaki 2000-10-31 06:20:01 UTC
Using linprocfs on 4.1.1-STABLE system, 

% cat /compat/linux/proc/stat

or

% cat /compat/linux/proc/uptime

cause a panic with the following message

 Fatal trap 18: integer divide fault while in kernel mode
 instruction pointer     = 0x8:0xc0933030
 stack pointer           = 0x10:0xc60dddc8
 frame pointer           = 0x10:0xc60dde20
 code segment            = base rx0, limit 0xfffff, type 0x1b
                         = DPL 0, pres 1, def32 1, gran 1
 processor eflags        = interrupt enabled, resume, IOPL = 0
 current process         = 325 (cat)
 interrupt mask          = none
 trap number             = 18
 panic: integer divide fault

and then the system reboots immediately.  At least, this problem has
exist since 4.1.1-STABLE around 24 Oct., but around 17 Oct..  

This is dangerous because every user can make system down easily.  

I heard that the CURRENT around 28 Oct. works good with the same
operations, so this problem maybe exist only in 4.1.1-STABLE.

Fix: In private communication, assar@freebsd.org proposed the following 
patch, which looks working well.  

In src/sys/i386/linux/linprocfs, 
How-To-Repeat: Use the above commands on 4.1.1-STABLE around 24 Oct.
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-10-31 08:38:03 UTC
Responsible Changed
From-To: freebsd-bugs->des

Over to maintainer.
Comment 2 des 2000-10-31 08:54:14 UTC
iwaki@bc.niigata-u.ac.jp writes:
> Using linprocfs on 4.1.1-STABLE system, 
> 
> % cat /compat/linux/proc/stat
> 
> or
> 
> % cat /compat/linux/proc/uptime
> 
> cause a panic with the following message

This happens when stathz is 0 - I MFCed a fix yesterday, so your PR
came just a few hours too late :)

DES
-- 
Dag-Erling Smorgrav - des@ofug.org
Comment 3 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2000-10-31 08:54:38 UTC
State Changed
From-To: open->closed

Already fixed.
Comment 4 iwaki 2000-10-31 09:25:43 UTC
From: Dag-Erling Smorgrav <des@ofug.org>
Subject: Re: kern/22435: linprocfs causes system down and reboot
Date: 31 Oct 2000 09:54:14 +0100

> This happens when stathz is 0 - I MFCed a fix yesterday, so your PR
> came just a few hours too late :)

Yes, thank you.
---
-----
Mamoru IWAKI   (iwaki@bc.niigata-u.ac.jp)
Graduate School of Science and Technology, Niigata University
Comment 5 iwaki 2000-11-05 04:52:03 UTC
From: Dag-Erling Smorgrav <des@ofug.org>
Subject: Re: kern/22435: linprocfs causes system down and reboot
Date: 31 Oct 2000 09:54:14 +0100

> > % cat /compat/linux/proc/stat

> > cause a panic with the following message
> 
> This happens when stathz is 0 - I MFCed a fix yesterday, so your PR
> came just a few hours too late :)

In my system like 

% uname -a
FreeBSD mi000.merlin.gs.niigata-u.ac.jp 4.2-BETA FreeBSD 4.2-BETA #0: Sat Nov  4 17:46:31 JST 2000     root@mi000.merlin.gs.niigata-u.ac.jp:/usr/obj/amd/mi004/home2/FreeBSD-src/stable4/src/sys/MI  i386

the following command still makes system down immediately: 

% cat /compat/linux/proc/0/stat

even if the user is not a super user.  DANGEROUS!
---
-----
Mamoru IWAKI   (iwaki@bc.niigata-u.ac.jp)
Graduate School of Science and Technology, Niigata University