lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 12 Oct 2020 12:24:32 +0000
From:   Volodymyr Babchuk <Volodymyr_Babchuk@...m.com>
To:     Jens Wiklander <jens.wiklander@...aro.org>
CC:     "tee-dev@...ts.linaro.org" <tee-dev@...ts.linaro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] optee: remove address tag in check_mem_type()


Hello Jens,

Jens Wiklander writes:

> On Mon, Oct 12, 2020 at 11:26 AM Volodymyr Babchuk
> <Volodymyr_Babchuk@...m.com> wrote:
>>
>> Before passing 'start' to find_vma() we need to remove
>> tags from it to get sane results.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@...m.com>
>> ---
>>  drivers/tee/optee/call.c | 2 ++
>>  1 file changed, 2 insertions(+)
>
> Would you mind giving a bit more background to this? For example in
> which contexts this function does or doesn't work as expected? Do you
> have any special use cases that don't work, etc? This is not a new
> regression, it's rather a problem we've always had, right?

Yes, sorry. I had to clarify in the commit description. Issue was found
on Android. Android uses pointer tagging [1], so MSB of user pointers
contain tags. As a result, passing raw user address to find_vma() leads
to NULL result, as it only traverses RB tree and does not alter passed
address in any way.

Code in mm/gup.c already strips tags and maybe, it is better to call
untagged_addr() inside of find_vma(). I'm not sure. Probably, we need
some help from MM maintainers.

Anyways, this patched fixed issue with register_shm failing in our use
case.

[1] https://source.android.com/devices/tech/debug/tagged-pointers


-- 
Volodymyr Babchuk at EPAM

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ