[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user
From: |
Richard Henderson |
Subject: |
Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user |
Date: |
Mon, 8 Feb 2021 09:32:30 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 2/8/21 5:57 AM, Peter Maydell wrote:
>> void unlock_user(void *host_ptr, abi_ulong guest_addr, size_t len);
....
>> - if (len > 0) {
>> - memcpy(g2h_untagged(guest_addr), host_ptr, len);
>> + if (len != 0) {
>> + memcpy(host_ptr_conv, host_ptr, len);
>> }
>
> Why the change from checking >0 to checking !=0 ? I'd rather not
> have to go through and audit all the callsites to confirm none
> of them pass a "length-or-negative-errno" value here...
The comparison change should have happened with the type change to unsigned in
the previous patch.
r~
- [PATCH v5 03/31] exec: Use uintptr_t for guest_base, (continued)
- [PATCH v5 12/31] exec: Use cpu_untagged_addr in g2h; split out g2h_untagged, Richard Henderson, 2021/02/03
- [PATCH v5 11/31] exec: Introduce cpu_untagged_addr, Richard Henderson, 2021/02/03
- [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user, Richard Henderson, 2021/02/03
- [PATCH v5 23/31] linux-user/aarch64: Implement PR_MTE_TCF and PR_MTE_TAG, Richard Henderson, 2021/02/03
- [PATCH v5 04/31] exec: Use uintptr_t in cpu_ldst.h, Richard Henderson, 2021/02/03
- [PATCH v5 09/31] linux-user: Do not use guest_addr_valid for h2g_valid, Richard Henderson, 2021/02/03
- [PATCH v5 14/31] linux-user: Use guest_range_valid in access_ok, Richard Henderson, 2021/02/03
- [PATCH v5 16/31] linux-user: Use cpu_untagged_addr in access_ok; split out *_untagged, Richard Henderson, 2021/02/03
- [PATCH v5 15/31] exec: Rename guest_{addr,range}_valid to *_untagged, Richard Henderson, 2021/02/03
- [PATCH v5 18/31] linux-user: Fix types in uaccess.c, Richard Henderson, 2021/02/03