From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: BlaisorBlade <blaisorblade_spam@yahoo.it>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH/2.4]: do_write_mem() return value check
Date: Thu, 25 Mar 2004 17:52:48 -0300 [thread overview]
Message-ID: <20040325205248.GA18172@logos.cnet> (raw)
In-Reply-To: <200403231707.14088.blaisorblade_work@yahoo.it>
On Wed, Mar 24, 2004 at 07:59:01PM +0100, BlaisorBlade wrote:
> From: Andrew Morton, and me (I did a first fix for 2.6 and sent to him, he
> checked everything and committed it and I changed the trivial bits for 2.4).
>
> - remove unused `file *' arg from do_write_mem()
>
> - Add checking for copy_from_user() failures in do_write_mem()
>
> (Note: /dev/kmem can be written to only by root, so this *cannot* have
> security implications)
>
> - Return correct value from kmem writes() when a fault is encountered. A
> write()-style syscall's return values are:
>
> 0 when nothing was written and there was no error (someone tried to
> write zero bytes)
>
> >0: the number of bytes copied, whether or not there was an error.
> Userspace detects errors by noting that the write() return value is less
> than was requested.
>
> <0: there was an error and no bytes were copied
>
> TODO: Do the same changes for read_mem() and read_kmem(). The code is more
> messy so I must create do_read_mem() to avoid clumsy counting; I will post the
> patch first for 2.6.
Hi Paolo,
This is nice -- although I see it as a 2.6 cleanup only.
Do you actually have any practical problem caused by the current broken
"always return -EFAULT" ?
Otherwise leave it for 2.6.
next parent reply other threads:[~2004-03-26 3:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200403231707.14088.blaisorblade_work@yahoo.it>
2004-03-25 20:52 ` Marcelo Tosatti [this message]
[not found] <20040326033339.GD1997@logos.cnet>
2004-03-26 18:16 ` [PATCH/2.4]: do_write_mem() return value check BlaisorBlade
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=20040325205248.GA18172@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=akpm@osdl.org \
--cc=blaisorblade_spam@yahoo.it \
--cc=linux-kernel@vger.kernel.org \
/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