@@ -515,12 +515,12 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
#ifndef CONFIG_UACCESS_WITH_MEMCPY
unsigned int __ua_flags = uaccess_save_and_enable();
- check_object_size(to, n, false);
+ check_object_size(from, n, true);
n = arm_copy_to_user(to, from, n);
uaccess_restore(__ua_flags);
return n;
#else
- check_object_size(to, n, false);
+ check_object_size(from, n, true);
return arm_copy_to_user(to, from, n);
#endif
}
@@ -252,6 +252,7 @@ badframe:
static int
setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
{
+ sigset_t setcopy = *set;
struct aux_sigframe __user *aux;
int err = 0;
@@ -278,7 +279,7 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
__put_user_error(current->thread.address, &sf->uc.uc_mcontext.fault_address, err);
__put_user_error(set->sig[0], &sf->uc.uc_mcontext.oldmask, err);
- err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(*set));
+ err |= __copy_to_user(&sf->uc.uc_sigmask, &setcopy, sizeof(*set));
aux = (struct aux_sigframe __user *) sf->uc.uc_regspace;
#ifdef CONFIG_CRUNCH
@@ -125,6 +125,8 @@ SECTIONS
#ifdef CONFIG_DEBUG_ALIGN_RODATA
. = ALIGN(1<<SECTION_SHIFT);
#endif
+ _etext = .; /* End of text section */
+
RO_DATA(PAGE_SIZE)
. = ALIGN(4);
@@ -155,8 +157,6 @@ SECTIONS
NOTES
- _etext = .; /* End of text and rodata section */
-
#ifdef CONFIG_DEBUG_RODATA
. = ALIGN(1<<SECTION_SHIFT);
#else
These will be in the next version; they are the fixes I needed to boot my ARM VM. Signed-off-by: Kees Cook <keescook@chromium.org> ---