Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2007 11:06:58 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/ufs/ffs ffs_alloc.c
Message-ID:  <20071001110057.V85753@maildrop.int.zabbadoz.net>
In-Reply-To: <20071001201359.M2557@besplex.bde.org>
References:  <200709241339.l8ODd6k6059694@repoman.freebsd.org> <47002674.8050707@tomjudge.com> <47002E2F.3030306@tomjudge.com> <20071001090547.H85753@maildrop.int.zabbadoz.net> <20071001201359.M2557@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Oct 2007, Bruce Evans wrote:

> On Mon, 1 Oct 2007, Bjoern A. Zeeb wrote:
>
>> On Mon, 1 Oct 2007, Tom Judge wrote:
>> 
>>> Tom Judge wrote:
>>>> Bjoern A. Zeeb wrote:
>>>>> bz          2007-09-24 13:39:06 UTC
>>>>>
>>>>>   FreeBSD src repository
>>>>>
>>>>>   Modified files:        (Branch: RELENG_6)
>>>>>     sys/ufs/ffs          ffs_alloc.c   Log:
>>>>>   MFC rev. 1.147
>>>>>     Fix a DIV0 in case a large value for fs_avgfilesize or fs_avgfpdir
>>>>>     is given (with newfs or tunefs) and dirsize overflows.
>>>>>       In case dirsize is <= 0 because of an overflow set maxcontigdirs
>>>>>     to 0 so it will be 1 later. This is what would happen for large
>>>>>     fs_avgfilesize. [1]
>>>>>       Submitted by:                   pjd [1]
>>>>>     Revision   Changes    Path
>>>>>   1.132.2.7  +4 -1      src/sys/ufs/ffs/ffs_alloc.c
>>>> 
>>>> 
>>>> Does this by any chance fis this PR: kern/111352?
>>> 
>>> s/fis/fix/
>> 
>> yes it should. I closed the PR, See the comment there.
>
> s/fix/work around/
>
> The bug is in newfs and tunefs permitting garbage parameters, so it cannot
> be fixed in ffs_alloc.c.

No matter what iput the kernel gets and from where, it MUST NOT (or at
least SHOULD not;) panic unless explicitly request by KASSERT/panic/..

So this commit fixes a DIV0 bug in the kernel.


Of course you are right, that the values should be checked by the tools
that we have in the tree so that this problem would not occur.
We could even check if the values given make sense at all, but that still
is a different story to a kernel panic.

-- 
Bjoern A. Zeeb                                 bzeeb at Zabbadoz dot NeT
Software is harder than hardware  so better get it right the first time.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071001110057.V85753>