From: Helge Deller <deller@gmx.de>
To: linux-parisc@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] parisc: Fix commit 63379c1 parisc: implement full version of access_ok()
Date: Sun, 17 Nov 2013 21:56:38 +0100 [thread overview]
Message-ID: <20131117205638.GA2852@p100.box> (raw)
Commit 63379c1 parisc: implement full version of access_ok() was incomplete and
broke userspace. Fix it by checking if we really write to userspace.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 63f4dd0..228fecb 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -45,7 +45,11 @@ static inline int __range_not_ok(unsigned long addr, unsigned long size,
unsigned long limit)
{
unsigned long __newaddr = addr + size;
- return (__newaddr < addr || __newaddr > limit || size > limit);
+
+ if (segment_eq(get_fs(), KERNEL_DS))
+ return 0;
+
+ return (addr < PAGE_SIZE || __newaddr > limit || size > limit);
}
/**
reply other threads:[~2013-11-17 20:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20131117205638.GA2852@p100.box \
--to=deller@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-parisc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.