The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrei Warkentin <awarkentin@vmware.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] /dev/mem: Fix wrong error on accessing beyond valid memory addresses.
Date: Mon, 14 Nov 2011 14:33:08 -0800 (PST)	[thread overview]
Message-ID: <379707293.52012.1321309988256.JavaMail.root@zimbra-prod-mbox-2.vmware.com> (raw)
In-Reply-To: <4EC19253.6080201@zytor.com>

Hi,

----- Original Message -----
> From: "H. Peter Anvin" <hpa@zytor.com>
> To: "Andrei Warkentin" <awarkentin@vmware.com>
> Cc: linux-kernel@vger.kernel.org
> Sent: Monday, November 14, 2011 5:12:35 PM
> Subject: Re: [PATCH] /dev/mem: Fix wrong error on accessing beyond valid memory addresses.
> 
> On 11/14/2011 02:11 PM, Andrei Warkentin wrote:
> >>
> >> EOF seems wrong to me (not as bad as EFAULT, but still wrong).
> >
> > Although that was what we had discussed, I do not return -EOF in
> > the patch. As you
> > mention - that would be wrong. I played around with other devices
> > (block, actually),
> > and if you attempt to read(2) beyond the end, read(2) simply
> > returns 0, as in
> > zero bytes read out. Of course, lseek(2) beyond the end should
> > return -EINVAL, as
> > well, so that is what that patch I CCd you on accomplishes.
> >
> 
> 0 is EOF.
> 

Ah, whoops, silly me.

> This is not a block device -- comparing to block devices is
> pointless.
> There is no "end" to /dev/mem, so this is a totally meaningless
> comparison.

Oh ok, I looked at other arches, like IA64, and now see why
using valid_phys_addr_range as an "end" test is meaningless.

Thanks,
A

      reply	other threads:[~2011-11-14 22:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 23:31 [PATCH] /dev/mem: Fix wrong error on accessing beyond valid memory addresses Andrei Warkentin
2011-11-14 21:21 ` Andrei Warkentin
2011-11-14 21:59   ` H. Peter Anvin
2011-11-14 22:11     ` Andrei Warkentin
2011-11-14 22:12       ` H. Peter Anvin
2011-11-14 22:33         ` Andrei Warkentin [this message]

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=379707293.52012.1321309988256.JavaMail.root@zimbra-prod-mbox-2.vmware.com \
    --to=awarkentin@vmware.com \
    --cc=hpa@zytor.com \
    --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