From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [PATCH] fix writing into /dev/kmem
Date: Mon, 8 Mar 2004 12:50:11 +0100 [thread overview]
Message-ID: <200403081250.11095.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <200403040202.i2422GWo008953@ccure.user-mode-linux.org>
Alle 03:02, giovedì 4 marzo 2004, Jeff Dike ha scritto:
> blaisorblade_spam@yahoo.it said:
> > Well, on *i386* that is 0xc0000001; since klogd is built with i386
> > kernel headers, it will use those.
>
> This was the stupidity that I was refusing to believe in. This means that
> if you take a normal klogd and move it to a 2G/2G system, where the kernel
> starts at 0x80000000, it won't work.
Well, that can be stupid (and is), but needing to recompile iptables when
upgrading kernel from 2.4.21-Mandrake (i.e. 2.4.21-rc#) to 2.4.21 is even
more stupid, right? However that was real.
> > Anyway, here comes that copy_{to,from}_user are buggy. Since fixing
> > those would have a good performance hit (to test, but that will
> > probably be sensitive
>
> In skas mode, I wasn't expecting any legitimate unfixable kernel mode
> access faults, so I wasn't setting up the fault_catcher. So, what I did
> was add a wrapper around the guts of copy_user which does a setjmp, and
> returns whether it got longjmp-ed back to.
Yes, fault_catcher (i.e. memory exceptions) works for kernel addresses at very
little cost. Not for userspace addresses, sadly.
> Reading /dev/kmem now produces -EFAULT.
Well, if you only changed copy_user, there should be some working addresses to
read there, right? Even if klogd would need recompilation to handle it right.
In the case /dev/kmem does not work at all we could live with it, but it is a
bit unclean.
> Writing to it still causes a hang
> because write_kmem doesn't check the return value of do_write_mem. With
> that fixed, everything produces -EFAULT.
I'm sending the return check fix to LKML+ Andrew Morton, together with some
cleanup for the unused params of do_write_mem.
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&opÌk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2004-03-09 19:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-29 2:36 [uml-devel] [PATCH] fix writing into /dev/kmem Jeff Dike
2004-02-29 12:25 ` BlaisorBlade
2004-03-02 1:31 ` Jeff Dike
2004-03-02 18:41 ` BlaisorBlade
2004-03-04 2:02 ` Jeff Dike
2004-03-08 11:50 ` BlaisorBlade [this message]
2004-02-29 16:20 ` BlaisorBlade
2004-03-02 1:11 ` Jeff Dike
2004-03-02 1:31 ` Jeff Dike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200403081250.11095.blaisorblade_spam@yahoo.it \
--to=blaisorblade_spam@yahoo.it \
--cc=jdike@addtoit.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox