linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Matthew Wilcox" <willy@infradead.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Huang Ying" <ying.huang@intel.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: Fail when offset == num in first check of vm_map_pages_zero()
Date: Wed, 29 May 2019 12:39:27 +0530	[thread overview]
Message-ID: <CAFqt6zZ0SHXddLoQMoO3LHT=50Br0x4r3Wn4XviypRxRUtn9zQ@mail.gmail.com> (raw)
In-Reply-To: <20190528193004.GA7744@gmail.com>

On Wed, May 29, 2019 at 1:38 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> If the user asks us for offset == num, we should already fail in the
> first check, i.e. the one testing for offsets beyond the object.
>
> At the moment, we are failing on the second test anyway,
> since count cannot be 0. Still, to agree with the comment of the first
> test, we should first there.

I think, we need to cc linux-mm.
>
> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
> ---
>  mm/memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index ddf20bd0c317..74cf8b0ce353 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1547,7 +1547,7 @@ static int __vm_map_pages(struct vm_area_struct *vma, struct page **pages,
>         int ret, i;
>
>         /* Fail if the user requested offset is beyond the end of the object */
> -       if (offset > num)
> +       if (offset >= num)
>                 return -ENXIO;
>
>         /* Fail if the user requested size exceeds available object size */
> --
> 2.17.1
>

  reply	other threads:[~2019-05-29  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 20:05 [PATCH] mm: Fail when offset == num in first check of vm_map_pages_zero() Miguel Ojeda
2019-05-29  7:09 ` Souptick Joarder [this message]
2019-06-01 10:41   ` Miguel Ojeda

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='CAFqt6zZ0SHXddLoQMoO3LHT=50Br0x4r3Wn4XviypRxRUtn9zQ@mail.gmail.com' \
    --to=jrdr.linux@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=peterz@infradead.org \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).