*BSD News Article 39780


Return to BSD News archive

Xref: sserve comp.os.386bsd.bugs:2771 comp.os.386bsd.questions:15339
Newsgroups: comp.os.386bsd.bugs,comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!cs.utexas.edu!howland.reston.ans.net!news.sprintlink.net!EU.net!news.eunet.fi!KremlSun!satisfy.kiae.su!kiae!relcom!elvisti!store!office.elvisti.kiev.ua!stesin
From: stesin@elvisti.kiev.ua (Andrew V. Stesin)
Subject: [?!] So, is this a bug in the kernel execve() code?
X-Newsreader: TIN [version 1.2 PL2]
Sender: usenet@store.elvisti.kiev.ua (USENET subsystem)
Nntp-Posting-Host: office.elvisti.kiev.ua
Organization: Electronni Visti InformAgency (ElVisti)
Message-ID: <D1351I.AM5@store.elvisti.kiev.ua>
Date: Tue, 20 Dec 1994 01:20:06 GMT
Lines: 45

Hi BSDers,

as I wrote a few days ago, there was a strange thing noticed
with FreeBSD-1.1.5R. Here is an (incorrect, I know! ;) program in C:

int 
main (int ac, char **av)
{
	return (execve("/bin/ls", av[1], 0));
}

anyway, given some command line parameters, this reboots the system 
immediately on our machine.
Your mileage may vary -- this is the shortest example from the set.
I can describe this as:

	broken arguments to execve() system call, 
	like nonterminated argv[] array, or random arguments, --

	may _often_ cause the immediate and silent OS reboot on our system.

This effect was discovered by Natalie Vinokurova, nata@bitmcnit.bryansk.su.
We tried to reproduce her example and (after a few attempts with "Bus error"
and segfaults) we found it... for a pity... :(

I tried to dig into that piece of kernel code, but sorry -- I'm not
a wisard, I'm not a kernel hacker, I'm not even on a mailing list.
I personally have no idea about how legal this behavior is and how to
fix it.  I don't even know -- was this reported yet or not?

So, questions.

	1. How valid the described behavior is? If it isn't considered
	   valid, how one can fix it?
	2. Is there a set of "official" patches for 1.1.5? Where?
	   We're running vanilla 1.1.5.0 kernel, I only replaced
	   some user-area utilities. Maybe some bugfix patches are
	   needed?

Thanks for your attention; comments and suggestions are welcome!

--
		With best wishes -- Andrew Stesin, 
					system administrator.