Re: [PATCH] SIGSEGV instead of -EFAULT

Albert D. Cahalan (acahalan@cs.uml.edu)
Wed, 26 Aug 1998 17:14:53 -0400 (EDT)


Pavel Machek writes:

> This patch changes kernel's behaviour a bit: you'll now get SIGSEGV on
> read(0,0,1) [even in case of console which is broken and does not
> check for errors].

Great! I'd like to suggest another two lines:

#if LINUX_VERSION_CODE & 0x000100 /* development kernels only */
...
#endif

That keeps the release kernels from killing everything and lets
us find all the buggy software as well.

> --- clean/arch/i386/mm/fault.c Sun Aug 16 22:34:25 1998
> +++ linux/arch/i386/mm/fault.c Tue Aug 25 23:36:55 1998
> @@ -197,6 +203,11 @@
> /* Are we prepared to handle this kernel fault? */
> if ((fixup = search_exception_table(regs->eip)) != 0) {
> regs->eip = fixup;
> +/* For every -EFAULT, you get one SIGSEGV for FREE! */
> + tsk->tss.cr2 = address;
> + tsk->tss.error_code = error_code;
> + tsk->tss.trap_no = 14;
> + force_sig(SIGSEGV, tsk);
> return;
> }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html