summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUsama Arif <usama.arif@linux.dev>2026-06-16 07:15:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-04 13:45:03 +0200
commit77bba61a20f1b3d206f4f90e10a7bb3cd90b9619 (patch)
treedbc320948562a1afa8fa9d7a5788d303b4bfb300
parent43e40c7a7b26d89d4bc268346962999d814ed8e3 (diff)
downloadlinux-stable-77bba61a20f1b3d206f4f90e10a7bb3cd90b9619.tar.gz
linux-stable-77bba61a20f1b3d206f4f90e10a7bb3cd90b9619.zip
kernel/fork: clear PF_BLOCK_TS in copy_process()
commit fd38b75c4b43295b10d69772a46d1c74dbd6fc81 upstream. PF_BLOCK_TS is only set in blk_time_get_ns() when current->plug is non-NULL, and blk_finish_plug() clears it via __blk_flush_plug() before NULLing the plug pointer. copy_process() breaks the invariant by inheriting PF_BLOCK_TS from the parent while resetting the child's plug to NULL. Clear PF_BLOCK_TS alongside that assignment so callers can rely on "PF_BLOCK_TS set implies current->plug != NULL" and dereference current->plug unguarded. Fixes: 06b23f92af87 ("block: update cached timestamp post schedule/preemption") Cc: stable@vger.kernel.org Signed-off-by: Usama Arif <usama.arif@linux.dev> Link: https://patch.msgid.link/20260616141604.328820-2-usama.arif@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/fork.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 8ac38beae360..145bcc4c8e12 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2314,6 +2314,7 @@ __latent_entropy struct task_struct *copy_process(
#ifdef CONFIG_BLOCK
p->plug = NULL;
+ p->flags &= ~PF_BLOCK_TS;
#endif
futex_init_task(p);