Date: Sat, 12 Jul 2003 23:32:49 +0200 From: Pawel Jakub Dawidek <nick@garage.freebsd.pl> To: "Alan L. Cox" <alc@imimic.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Bug in VM pages protection handling. Message-ID: <20030712213249.GJ4973@garage.freebsd.pl> In-Reply-To: <3F10762E.D17A7307@imimic.com> References: <20030712202216.GG4973@garage.freebsd.pl> <3F10762E.D17A7307@imimic.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--y06s9PvpQ1Ch5mdL Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 12, 2003 at 03:57:18PM -0500, Alan L. Cox wrote: +> > I've just send PR for this: +> >=20 +> > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D54418 +> >=20 +> > I'll be greatful if somebody could review, commit and MFC it +> > as soon as possible. I need to hold CerbNG next release until +> > it will be fixed. +> >=20 +>=20 +> As I've said in private e-mail, this is not a bug. You're really asking +> for a change in "specification". Reductions in max_protection have had +> permanent effect since the late 1980's. You've also asked my in private mail why I need this, I'll answer here. I need this to protect syscall arguments that I'm checking in CerbNG. If I need to check an argument I've to be sure that kernel will check exactly that same argument (here is ugly race). So what I do is memory allocaton in process' vmspace, copy argument there, mark newly allocated pages as read-only and call original syscall with new pointer(s). Those pages are freed after that and everything will be correct, but somebody has reported me about 'bus error'. I've track this problem for two days. It occurs for majordomo, when perl is trying to execute something, nevermind. Pages are marked as read-only for child process, but parent process is killed with SIGBUS signal. I don't mees with this parent process at all, but it looks they're sharing some memory or some pages/map is mirrored (copy-on-write mechanism?) with VM_PROT_READ protection. Of course I could rewrite vm_map_protect() function locally and use my version (I hate such hacks, but if there is no other way...), but for me it is strange. Is there something that depends on this or proposed patch breaks anything? Why specification says that? Ok, I don't want to provoke specification breakage, I was just thinking that this was a bug, so PR could be closed, sorry. PS1. Maybe you (or anyone) have better solution for syscall arguments protecting to avoid this race? PS2. Where could I find FreeBSD's VM specification? Or maybe I should look for posix VM spcification? --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --y06s9PvpQ1Ch5mdL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPxB+gT/PhmMH/Mf1AQFNEgP/fVhNelTLT474259wGgBhL7QaPjGhqQJ2 MasfdiVcZOTH0AUzSe8yEEuEFxQRgTcYxZ7b0Tvnlu2XVXUOHNHDOQ1ct5r8zrLQ ETcTjyGmoThO/USV8UqVjUxtLa/y5afwz1TLPCKTig8D5U//dunqeCSRS8/sAI9K ZtAhYYQlTlk= =g1uZ -----END PGP SIGNATURE----- --y06s9PvpQ1Ch5mdL--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030712213249.GJ4973>