All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: syzbot <syzbot+cb76c2983557a07cdb14@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [hardening?] [mm?] BUG: bad usercopy in fpa_set
Date: Tue, 5 Mar 2024 19:55:45 +0900	[thread overview]
Message-ID: <aeb26d27-cd0f-4992-b303-f21abeacab21@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <1fec6a8b-7083-4b08-858a-0793f996ed52@I-love.SAKURA.ne.jp>

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index c421a899fc84..b47e56a87dfa 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -573,8 +573,10 @@ static int fpa_get(struct task_struct *target,
 		   const struct user_regset *regset,
 		   struct membuf to)
 {
-	return membuf_write(&to, &task_thread_info(target)->fpstate,
-				 sizeof(struct user_fp));
+	struct thread_info *thread = task_thread_info(target);
+
+	return membuf_write(&to, &thread->fpstate,
+				 sizeof(thread->fpstate));
 }
 
 static int fpa_set(struct task_struct *target,
@@ -586,7 +588,7 @@ static int fpa_set(struct task_struct *target,
 
 	return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 		&thread->fpstate,
-		0, sizeof(struct user_fp));
+		0, sizeof(thread->fpstate));
 }
 
 #ifdef CONFIG_VFP
@@ -690,7 +692,7 @@ static const struct user_regset arm_regsets[] = {
 		 * of sizes, so pretend that the registers are word-sized:
 		 */
 		.core_note_type = NT_PRFPREG,
-		.n = sizeof(struct user_fp) / sizeof(u32),
+		.n = sizeof(union fp_state) / sizeof(u32),
 		.size = sizeof(u32),
 		.align = sizeof(u32),
 		.regset_get = fpa_get,



  parent reply	other threads:[~2024-03-05 10:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 12:53 [syzbot] [hardening?] [mm?] BUG: bad usercopy in fpa_set syzbot
2023-05-07 11:03 ` syzbot
2024-03-05 10:17 ` Tetsuo Handa
2024-03-05 10:27   ` syzbot
2024-03-05 10:55   ` Tetsuo Handa [this message]
2024-03-05 11:04     ` syzbot
2024-04-05 11:42     ` Tetsuo Handa
2024-04-05 11:44       ` [syzbot] [arm] " syzbot
2024-04-05 14:02       ` [syzbot] [hardening?] [mm?] " Tetsuo Handa
2024-04-05 14:25         ` [syzbot] [arm] " syzbot
2024-03-05 11:27 ` [syzbot] [hardening?] [mm?] " Tetsuo Handa
2024-03-05 11:27   ` Tetsuo Handa
2024-04-03 16:12   ` Russell King (Oracle)
2024-04-03 16:12     ` Russell King (Oracle)
2024-04-05 14:28     ` Tetsuo Handa
2024-04-05 14:28       ` Tetsuo Handa
2024-04-15  9:02     ` Mark Rutland
2024-04-15  9:02       ` Mark Rutland
2024-04-15  9:38       ` Tetsuo Handa
2024-04-15  9:38         ` Tetsuo Handa
2024-04-15  9:44         ` Russell King (Oracle)
2024-04-15  9:44           ` Russell King (Oracle)
2024-04-15  9:58           ` Tetsuo Handa
2024-04-15  9:58             ` Tetsuo Handa
2024-04-15 10:27             ` Russell King (Oracle)
2024-04-15 10:27               ` Russell King (Oracle)
2024-04-15 11:43               ` Mark Rutland
2024-04-15 11:43                 ` Mark Rutland
2024-04-15 17:02                 ` Kees Cook
2024-04-15 17:02                   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aeb26d27-cd0f-4992-b303-f21abeacab21@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+cb76c2983557a07cdb14@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.