Skip to content

Commit 51df97f

Browse files
committed
Merge tag 's390-6.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Alexander Gordeev: - Fix incorrectly dropped dereferencing of the stack nth entry introduced with a previous KASAN false positive fix - Use a proper memdup_array_user() helper to prevent overflow in a protected key size calculation * tag 's390-6.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/ptrace: Fix pointer dereferencing in regs_get_kernel_stack_nth() s390/pkey: Prevent overflow in size calculation for memdup_user()
2 parents 9c2f970 + 7f8073c commit 51df97f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/s390/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static __always_inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *r
265265
addr = kernel_stack_pointer(regs) + n * sizeof(long);
266266
if (!regs_within_kernel_stack(regs, addr))
267267
return 0;
268-
return READ_ONCE_NOCHECK(addr);
268+
return READ_ONCE_NOCHECK(*(unsigned long *)addr);
269269
}
270270

271271
/**

drivers/s390/crypto/pkey_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void *_copy_apqns_from_user(void __user *uapqns, size_t nr_apqns)
8686
if (!uapqns || nr_apqns == 0)
8787
return NULL;
8888

89-
return memdup_user(uapqns, nr_apqns * sizeof(struct pkey_apqn));
89+
return memdup_array_user(uapqns, nr_apqns, sizeof(struct pkey_apqn));
9090
}
9191

9292
static int pkey_ioctl_genseck(struct pkey_genseck __user *ugs)

0 commit comments

Comments
 (0)