From nobody Wed Aug 10 00:44:14 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M2WR32dqYz4Y9p0; Wed, 10 Aug 2022 00:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M2WR31sZJz3tyj; Wed, 10 Aug 2022 00:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660092255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HypFr8slZsYJNvmnw0MiVuA8+3DbiVHJxW4FicHQfok=; b=b2D6DHHqaMDNADzj4nGpL6Q2lWH4svuiu5MtgbrSyhQ4uFjOEmTsdziC32nSiTBYy2HHYz KY5TU8gWn3VEPR/P3ruYtwKzAukg9wZR3uEY7J4TH0fFZQJW7Xn9L3cv0uIpvt9vA1xCzC TVUbovE897w/TGLGhepR/f95KSaW+gWq05rpFewY7xDrEVjTF6znmSneXMtveAEvUiDVap f9+xOg+483P9MuBSYRWRn1u++eUCMaKjeRJdrVChfcr10+9ERgsdlgKbnQqf7iWYp2APFx ckWLvhNyNTs7MqcMUuUxDISpHMBZ2AL8lx+Y4an/y2UwakGmlnSos5+kZMYVBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M2WR30hspzrx9; Wed, 10 Aug 2022 00:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27A0iFR2017432; Wed, 10 Aug 2022 00:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27A0iEXe017431; Wed, 10 Aug 2022 00:44:14 GMT (envelope-from git) Date: Wed, 10 Aug 2022 00:44:14 GMT Message-Id: <202208100044.27A0iEXe017431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fedb2ee64c0d - stable/13 - thread_create(): call cpu_copy_thread() after td_pflags is zeroed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fedb2ee64c0d2d853131df994729d2e4f522c1b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660092255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HypFr8slZsYJNvmnw0MiVuA8+3DbiVHJxW4FicHQfok=; b=UXu9g4ZAX6TW8lnBAlhXPwzyTrfshW2zLlaEMC+FvWN62unetxJbX/bZufsMqrPNlxWLm0 Z1TqkkKvnuCE/Kar2j7Vc136hVj9aEWDqSGA9l0JNKxG+jr59HQPQRA36w2AffW1yCRe/u //aSAoz4fCVYHHKAzdhYDeC/4iewzonoMqFHRQTPB92puhN7lK3+1oUuBJabt6L/OpySvo KDhpdtqgcF2CXl3Kslqn2YeNHLF97qMxl81bsp9YHlVQ78Go6fgEGoKsLUZfuBxvf3UV4H WLoh8Z/FutiCnxlj97e5NBr+9gf85Mle33MNhoiAxoH+q1+gwNmW3B6vo3PNqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660092255; a=rsa-sha256; cv=none; b=xZD1wc+6+zZotYFQOX/DUEOE/9yzzdcFUMqhhakKTGg3NQ11mUYwLe2s/+5Orm3UP0wiRf vy1sataOUquTDGWyw4mUUoLwya7dU5RYuEYs/FtL0iLNzQ8OvHiutkyuuPswyksbVi+3rd dazJ64AtKQbWwoaz0gS9FZ2275VBaKRlOH2fveVWtD5+OWRHosbOWhbq/yLaqd3MbE46JB ix97x5ACvA6i9+NRwWkRaV7c1s1aUzcWRa00vONDSElabNSvp2g6Bncd+GMOJWtv9AOY3t QYRfWBkJ3E+e2GVOtkCRgKhKVQdD4f3RjB0mPftf1ZHg9l90HDZqHq5l3ypscw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fedb2ee64c0d2d853131df994729d2e4f522c1b3 commit fedb2ee64c0d2d853131df994729d2e4f522c1b3 Author: Konstantin Belousov AuthorDate: 2022-08-07 17:00:02 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-10 00:44:03 +0000 thread_create(): call cpu_copy_thread() after td_pflags is zeroed (cherry picked from commit 1b0a4974c5004216daf4a2ac4375074ce56bc55b) --- sys/compat/linux/linux_fork.c | 4 ++-- sys/kern/kern_thr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index bcd5ffe3c589..2839e865e95f 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -280,8 +280,6 @@ linux_clone_thread(struct thread *td, struct l_clone_args *args) if (error) goto fail; - cpu_copy_thread(newtd, td); - bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&td->td_startcopy, &newtd->td_startcopy, @@ -290,6 +288,8 @@ linux_clone_thread(struct thread *td, struct l_clone_args *args) newtd->td_proc = p; thread_cow_get(newtd, td); + cpu_copy_thread(newtd, td); + /* create the emuldata */ linux_proc_init(td, newtd, true); diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 18722cc6a73d..5da2735facb4 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -231,8 +231,6 @@ thread_create(struct thread *td, struct rtprio *rtp, if (error) goto fail; - cpu_copy_thread(newtd, td); - bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&td->td_startcopy, &newtd->td_startcopy, @@ -241,6 +239,8 @@ thread_create(struct thread *td, struct rtprio *rtp, newtd->td_rb_list = newtd->td_rbp_list = newtd->td_rb_inact = 0; thread_cow_get(newtd, td); + cpu_copy_thread(newtd, td); + error = initialize_thread(newtd, thunk); if (error != 0) { thread_cow_free(newtd);