Re: do_mmap Function Issue Report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 28, 2018 at 11:19:30PM +0800, Po-Hao Su wrote:
> I am writing in reference to report a bug in *do_mmap(...)* function.
> Recently, I found that there seems a bug after *get_unmapped_area(...)
> *function
> is return.
> *do_mmap(...) *function will check the *addr *parameter is aligned on a
> page boundary or not after *get_unmapped_area(...)* function is return.
> But it will return *addr *parameter, not an error(probably to *-EINVAL*)
> while address not aligned on a page boundary.
> Therefore, I think address not aligned on a page boundary should be an
> error(*-EINVAL*).

Hi Po-Hao,

I'm afraid you've misunderstood the intent of this code.  The 'addr'
returned from get_unmapped_area() may be an errno, in which case we
want to return it.  Successful invocations of get_unmapped_area do,
of course, return an aligned address.  Your patch would make us return
-EINVAL for all errors, covering up the actual cause of the error (eg
-ENOMEM or -ENODEV)




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux