From nobody Sun Feb 8 18:31:52 2026 Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A79B3B782 for ; Sat, 10 Aug 2024 07:14:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723274087; cv=none; b=bssJDPpvvoUyMsYyDENnX8zWdTH2boO8Fdosq/Zf5vGkK2ifPG0/nP2bYK+eL14D70TG8vfjOjEeDSapcBL9R195bJxCNlv1L/hOx93+9KaNs2LOcu7NugeMsqSFcrVqpY1+J1lypaigwwZdW9YIF3Ldq3rDEKhZ8k+/DNfEgEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723274087; c=relaxed/simple; bh=2tS0eWCBDxDsUSBGp58+pIxhFuhjHlr+aBuREye6C0o=; h=To:Cc:Message-Id:From:Subject:Date; b=ULrnkEz0dQHjj8OSveDu1ru24RIK3BFvsG/4dYR5fl97KIhRpS0x4GAxMKm1+V43EQTPjTqV7sI7arALggtjybSg66Vj7fd5gOrJg+g2rxGg79S9m9iDagI8vfWEKWEmSWEocUBJrTCmgFVb4gvbEcRP7/gTrvKdXt5iVKvzzNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=c868azLX; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="c868azLX" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 379BB1151DE1; Sat, 10 Aug 2024 03:14:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 10 Aug 2024 03:14:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1723274084; x=1723360484; bh=pzWoJ6kpdS8AV 2GwnkxogI+qF4smRK+n1tauPh28B5g=; b=c868azLXhPFjbtTy8JFTz45STXwir 7oWG5Tk8J1gmexFRXp+AFmM3fB/Z13TJHNtqClyMM2oFPZ2yvCUM+xJYN7HJa1rl UlE3A22DmMtvjZYyECtFuAnAFQCPGor12T5neHKT0Am5Zl0oMB1otAk4IdyzFKp7 ksFg0ybwnOhp3mkz8JHcmRP3+g91IXO4asaYMwxEJvdnDbj3sECHIdnqa2PfKnJ5 J63QZZ7z/wSH1G+wlAj/3QbalpZXIO65L+0iH5V1PSGoIrvNynQKzYl+PeZJVOdp x2fqcYGTTihyh9zi3lDZdlPBM8dStUIJDfsLDJC2SB0o1RsfL7TMc8Pcg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrleehgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepvfevkffhufffsedttdertddttddtnecuhfhrohhm pefhihhnnhcuvfhhrghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqe enucggtffrrghtthgvrhhnpeffueeileegffegtdehveefkeffveffiedugeefveeuvdet tdefiefflefgteegueenucffohhmrghinhepuggvsghirghnrdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhthhgrihhnsehlihhn uhigqdhmieekkhdrohhrghdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepghgvvghrtheslhhinhhugidqmheikehkrdhorhhgpdhrtghpthht ohepsghrrghunhgvrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghgvrhhgsehlih hnuhigqdhmieekkhdrohhrghdprhgtphhtthhopehushgvrhhmheejseihrghhohhordgt ohhmpdhrtghpthhtoheplhhinhhugidqmheikehksehlihhsthhsrdhlihhnuhigqdhmie ekkhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghr nhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Aug 2024 03:14:42 -0400 (EDT) To: Geert Uytterhoeven Cc: Christian Brauner , Greg Ungerer , Stan Johnson , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [PATCH] m68k: Fix kernel_clone_args.flags in m68k_clone() Date: Sat, 10 Aug 2024 17:03:16 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Stan Johnson recently reported a failure from the 'dump' command: DUMP: Date of this level 0 dump: Fri Aug 9 23:37:15 2024 DUMP: Dumping /dev/sda (an unlisted file system) to /dev/null DUMP: Label: none DUMP: Writing 10 Kilobyte records DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 3595695 blocks. DUMP: Context save fork fails in parent 671 The dump program uses the clone syscall with the CLONE_IO flag, that is, flags =3D=3D 0x80000000. When that value is cast from long int to u64 by m68k_clone(), it undergoes sign-extension. The new value includes CLONE_INTO_CGROUP so the validation in cgroup_css_set_fork() fails and the syscall returns -EBADFD. Avoid sign-extension by adopting the idiom used in kernel/fork.c when casting clone flags. Cc: Stan Johnson Reported-by: Stan Johnson Closes: https://lists.debian.org/debian-68k/2024/08/msg00000.html Fixes: 6aabc1facdb2 ("m68k: Implement copy_thread_tls()") Signed-off-by: Finn Thain --- arch/m68k/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 2584e94e2134..873dc94fdcd8 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -117,7 +117,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs) { /* regs will be equal to current_pt_regs() */ struct kernel_clone_args args =3D { - .flags =3D regs->d1 & ~CSIGNAL, + .flags =3D (lower_32_bits(regs->d1) & ~CSIGNAL), .pidfd =3D (int __user *)regs->d3, .child_tid =3D (int __user *)regs->d4, .parent_tid =3D (int __user *)regs->d3, --=20 2.39.5