From: Qing Wang <wangqing7171@gmail.com>
To: syzbot+e0378d4f4fe57aa2bdd0@syzkaller.appspotmail.com
Cc: acme@kernel.org, adrian.hunter@intel.com,
alexander.shishkin@linux.intel.com, irogers@google.com,
jolsa@kernel.org, kan.liang@linux.intel.com,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
mark.rutland@arm.com, mingo@redhat.com, namhyung@kernel.org,
netdev@vger.kernel.org, peterz@infradead.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [perf?] KASAN: slab-use-after-free Read in __task_pid_nr_ns
Date: Mon, 5 Jan 2026 10:38:42 +0800 [thread overview]
Message-ID: <20260105023842.1739283-1-wangqing7171@gmail.com> (raw)
In-Reply-To: <6891c7b8.050a0220.7f033.001f.GAE@google.com>
#syz test
diff --git a/kernel/fork.c b/kernel/fork.c
index b1f3915d5f8e..72b9b37a96c8 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1975,6 +1975,7 @@ __latent_entropy struct task_struct *copy_process(
struct file *pidfile = NULL;
const u64 clone_flags = args->flags;
struct nsproxy *nsp = current->nsproxy;
+ struct signal_struct *free_sig = NULL;
/*
* Don't allow sharing the root directory with processes in a different
@@ -2501,8 +2502,11 @@ __latent_entropy struct task_struct *copy_process(
mmput(p->mm);
}
bad_fork_cleanup_signal:
- if (!(clone_flags & CLONE_THREAD))
- free_signal_struct(p->signal);
+ if (!(clone_flags & CLONE_THREAD)) {
+ free_sig = p->signal;
+ p->signal = NULL;
+ free_signal_struct(free_sig);
+ }
bad_fork_cleanup_sighand:
__cleanup_sighand(p->sighand);
bad_fork_cleanup_fs:
diff --git a/kernel/pid.c b/kernel/pid.c
index a31771bc89c1..1a012e033552 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -329,9 +329,9 @@ EXPORT_SYMBOL_GPL(find_vpid);
static struct pid **task_pid_ptr(struct task_struct *task, enum pid_type type)
{
- return (type == PIDTYPE_PID) ?
- &task->thread_pid :
- &task->signal->pids[type];
+ if (type == PIDTYPE_PID)
+ return &task->thread_pid;
+ return task->signal ? &task->signal->pids[type] : NULL;
}
/*
--
2.34.1
next prev parent reply other threads:[~2026-01-05 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 8:58 [syzbot] [perf?] KASAN: slab-use-after-free Read in __task_pid_nr_ns syzbot
2026-01-05 2:38 ` Qing Wang [this message]
2026-01-05 2:38 ` syzbot
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=20260105023842.1739283-1-wangqing7171@gmail.com \
--to=wangqing7171@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=syzbot+e0378d4f4fe57aa2bdd0@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox