NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/46807: mmap(2) can cause files/memory to stay around after program exit

Hi folks,

On Fri, Aug 17, 2012 at 08:00:07AM +0000, Martin Husemann wrote:
>  On Thu, Aug 16, 2012 at 01:55:00PM +0000, wrote:
>  > 1) build a NetBSD/usermode kernel and install+modload its kernel module.
>  My gut feeling (but only that) is telling me that this is a crucial step
>  on the way to reproduce the problem, and it is only possible for root
>  to do the modload, isn't it?

Well, its reproducable with a program that semi-randomly mmaps a file around
in a piece of memory without having root priviledges. So yes, although the
original program that showed it needs a module to load to function, just
starting the kernel without the kernel module is enough to trigger the bug:

diablo# df -h /tmp
Filesystem         Size       Used      Avail %Cap Mounted on
tmpfs               17G        12K        17G   0% /tmp
diablo# ./netbsd
Bad system call (core dumped)
diablo# df -h /tmp
Filesystem         Size       Used      Avail %Cap Mounted on
tmpfs               18G       1.0G        17G   5% /tmp

The kernel module is only needed on the first userland program execution
(init's to get system calls to go to the right kernel.

With regards,

Home | Main Index | Thread Index | Old Index