From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388379; b=oXJldw+6wzeH5ZnPWNjGea61S8mITt9lnlbDd14TIKI4wCK1zrBa2z9UnszoZxi4h+tu 5EDmUicpbIbL8XDi2koGvIjXvRnoQDkJy7u6XSRc0D9ct+eC75hdBds3B6uT/4qOxj/vi GFzLLFuUxsyrUvyEIW59b5F9j+jHrkw0Fc8tdDuBtTeYUXL6IkeCJ/IJUBzNNOdnc8IKR NGk9LEi17aG6Url/8Nyr9cnkyhzHMGhanNbjVel0DiKJkE6wOVO8tA9Sbxeg08t2PYWQM Mzbn+E7hbNImBooDzxWIodM04jx1ANuYT4O3ht8bVgOpnpG788gn+1fUNaMQaNxwvpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388379; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=mvbyBCjlAW0PiRGwHz3QhAIIEmCP3bAXsHMmDUeTh2Q=; b=09D2i6pOy1nX54iznwQyHjnF7wFpOwcqaZBYW+pDKHbc/cHQ5cLd6FoUdl6Ba4O33iPP +1KQsaeLwOPVBe9FV1UZL2giEoJkKdB4NLD4o8WctcKGzIgLVfLa9Mgmt4KI00iFNQQji q1o1pRZBylcGeZvUfJUzq4gzc9hbl2wIA4kccrTCEGC3WdEGNwrFVEYcFVmCPLCZ07pcM S+3tssAlr0bzAPFWdODclbB2TcyG0reWtZdADxkI3bjDCVMm2LAQ4DhE6YTZflm9IJPfT Kbms1yz3xzfWLjxldqly2GX0m1ARdz6VqqLpNEV8RRVpliDbFk7wBKTgZBl5YHXVWDg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=EJMPdlCk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9205A606A32D; Fri, 4 Dec 2026 12:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=EJMPdlCk Received: by smtp.kernel.org (Postfix) with ESMTPSA id D59621F00939; Fri, 4 Dec 2026 12:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388379; bh=mvbyBCjlAW0PiRGwHz3QhAIIEmCP3bAXsHMmDUeTh2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EJMPdlCkdFzmIzwf9JtwjMnvMsZbI9PxkJ1THy21I/KhVMR2lQ2Pn9kZ6q8VzzNgZ plDSkIJKKRDpPWSva64Ze0ZJ3PZvhWDfNzhgI9EA1HTlItIqpEHqCF+wEay2MvmG+d hePwyi5iFoCNAQxRMPprCA5MkUE0L7t04R/nL/t8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Jiri Slaby (SUSE)" Subject: [PATCH 6.1 0591/1059] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Date: Fri, 4 Dec 2026 19:02:02 +0900 Message-ID: <20261204100659.454208775@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Slaby (SUSE) commit 895dc0eaa2779ff46a0b2a20b5ce9eb0b1125cb2 upstream. Since commit f0193d3ea73b below, `cmd` was converted with compat_ptr(), while `arg` was passed to ld->ops->ioctl() unmodified. Fix it so `cmd` stays `cmd` and `arg` gets converted through compat_ptr() as intended. Notes: 2) compat_ptr() did nothing to `cmd`, provided it is uint, 1) compat_ptr() is no-op everywhere (was different on s390 before 8e0b986c59c6 ("s390: Remove compat support")), 3) `arg` might not have been chopped correctly until 8e0b986c59c6. But I am not sure why noone noticed all those (7) years (from f0193d3ea73b to 8e0b986c59c6)? Fixes: f0193d3ea73b ("change semantics of ldisc ->compat_ioctl()") Signed-off-by: Jiri Slaby (SUSE) Cc: stable@vger.kernel.org # applicable from 4.20 to 6.18 incl Assisted-by: LLM Link: https://patch.msgid.link/63e9d84a1e8e23852423206cf3f8907aafc88f17.1793704520.git.jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2980,8 +2980,7 @@ static long tty_compat_ioctl(struct file if (ld->ops->compat_ioctl) retval = ld->ops->compat_ioctl(tty, cmd, arg); if (retval == -ENOIOCTLCMD && ld->ops->ioctl) - retval = ld->ops->ioctl(tty, (unsigned long)compat_ptr(cmd), - arg); + retval = ld->ops->ioctl(tty, cmd, (unsigned long)compat_ptr(arg)); tty_ldisc_deref(ld); return retval;