On Tue, Jan 14, 2020 at 9:08 PM Vineet Gupta wrote:
>
> This came up when switching ARC to word-at-a-time interface and using
> generic/optimized strncpy_from_user
>
> It seems the existing code checks for user buffer/string range multiple
> times and one of tem cn be avoided.
>
> There's an open-
On Fri, Mar 9, 2018 at 3:15 PM, Robin Murphy wrote:
> Hi Andrey,
>
> On 09/03/18 14:01, Andrey Konovalov wrote:
>>
>> arm64 has a feature called Top Byte Ignore, which allows to embed pointer
>> tags into the top byte of each pointer. Userspace programs (such as
>>
On Fri, Mar 9, 2018 at 3:16 PM, Robin Murphy wrote:
> On 09/03/18 14:02, Andrey Konovalov wrote:
>>
>> To allow arm64 syscalls accept tagged pointers from userspace, we must
>> untag them when they are passed to the kernel. Since untagging is done in
>> generic parts
m.org/docs/HardwareAssistedAddressSanitizerDesign.html
Andrey Konovalov (6):
arm64: add type casts to untagged_addr macro
arm64: untag user addresses in copy_from_user and others
mm, arm64: untag user addresses in memory syscalls
mm, arm64: untag user addresses in mm/gup.c
lib, arm64: untag addrs passed to strncpy_fro
architectures besides arm64.
Signed-off-by: Andrey Konovalov
---
arch/alpha/include/asm/uaccess.h | 2 ++
arch/arc/include/asm/uaccess.h| 1 +
arch/arm/include/asm/uaccess.h| 2 ++
arch/blackfin/include/asm/uaccess.h | 2 ++
arch/c6x/include/asm/uaccess.h| 2
strncpy_from_user and strnlen_user accept user addresses as arguments, and
do not go through the same path as copy_from_user and others, so here we
need to separately handle the case of tagged user addresses as well.
Untag user pointers passed to these functions.
Signed-off-by: Andrey Konovalov
unmap, remap_file_pages,
mprotect, pkey_mprotect, mremap and msync.
Signed-off-by: Andrey Konovalov
---
mm/madvise.c | 2 ++
mm/mempolicy.c | 6 ++
mm/mincore.c | 2 ++
mm/mlock.c | 5 +
mm/mmap.c | 9 +
mm/mprotect.c | 2 ++
mm/mremap.c| 2 ++
mm/msync.c | 3 +++
8 files ch
This patch makes the untagged_addr macro accept all kinds of address types
(void *, unsigned long, etc.) and allows not to specify type casts in each
place where it is used. This is done by using __typeof__.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 3 ++-
1 file
in access_ok and in __uaccess_mask_ptr.
Signed-off-by: Andrey Konovalov
---
arch/arm64/include/asm/uaccess.h | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 2d6451cbaa86..24a221678fe3 100644
--- a
mm/gup.c provides a kernel interface that accepts user addresses and
manipulates user pages directly (for example get_user_pages, that is used
by the futex syscall). Here we also need to handle the case of tagged user
pointers.
Untag addresses passed to this interface.
Signed-off-by: Andrey
10 matches
Mail list logo