Commit 41b7602e authored by Michal Simek's avatar Michal Simek

microblaze: Fix access_ok macro

There is the problem with bit OR (|) because for
some combination is addr | size | addr+size equal
to seq.

For standard kernel setting (kernel starts at 0xC0000000)
is seq for user space 0xBFFFFFFF and everything below
this limit is fine.

But even address 0xBFFFFFFF is fine because it
is below kernel space.
Signed-off-by: default avatarAndrew Fedonczuk <andrew.fedonczuk@ericsson.com>
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent ebe21125
...@@ -95,7 +95,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size) ...@@ -95,7 +95,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
* - "addr", "addr + size" and "size" are all below the limit * - "addr", "addr + size" and "size" are all below the limit
*/ */
#define access_ok(type, addr, size) \ #define access_ok(type, addr, size) \
(get_fs().seg > (((unsigned long)(addr)) | \ (get_fs().seg >= (((unsigned long)(addr)) | \
(size) | ((unsigned long)(addr) + (size)))) (size) | ((unsigned long)(addr) + (size))))
/* || printk("access_ok failed for %s at 0x%08lx (size %d), seg 0x%08x\n", /* || printk("access_ok failed for %s at 0x%08lx (size %d), seg 0x%08x\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment