From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07A24606A322 for ; Wed, 2 Dec 2026 22:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Sf6PJ8Kn; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=apQUqeJr DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version:Cc :To:Subject:From:Message-ID:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=aXUc3QrEgrFbO6wWchbSEqP+lx3zrfrfjwxOG7P5aFQ=; b=Sf6PJ8KnROO+2R0eERYxPteIpG 0OIzm9h5BWiJRNNp/swVPjfv5uYBjlbQBL0Tr0d3blf18Lfrha0YHfAIQDqzr6wW6MoNfaI2jsu41 NlIBESTe3+DtYC0TSWphv5NNOZc20Gu8F0K2ASSTbSZIaPWyGPNkCUHYAh2dTw2wMyt5HeMXCd/x+ N4mO1IA+AaILGxqy+xq+qjwNwxMoWX420nKTmtNQcexsK+F9lOA8Ft789AYJg83Dne+d4w50+tgCI tZreSWTd7sGQNe/z23sGECdW4EMLjYk2h2n9DKZF2Y1trqNSCm4uM0PVfTisQgbfcmi7p6ul/8T+t OJgB0bCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYt49-0000000CwcJ-2rtu; Wed, 02 Dec 2026 22:44:45 +0000 Received: from mail-yx2-x0b.google.com ([2607:f8b0:4864:41::b]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYt46-0000000Cwbl-49qA for kexec@lists.infradead.org; Wed, 02 Dec 2026 22:44:44 +0000 Received: by mail-yx2-x0b.google.com with SMTP id 956f58d0204a3-67ec6215f4bso316707d50.0 for ; Wed, 02 Dec 2026 14:44:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1796251481; x=1796856281; darn=lists.infradead.org; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:message-id:date:from:to:cc:subject:date:message-id :reply-to:content-type; bh=aXUc3QrEgrFbO6wWchbSEqP+lx3zrfrfjwxOG7P5aFQ=; b=apQUqeJr6z0ZvDQzr1wu+inEBX6kMLgh+7uC8kQVwiFc/imR1N6i0TXh2L4c874GE5 Qh2q40b55FJvB0gSD3EaVlvuct32ytgP4/CbZs32IUqwi0LYhwyylJRnQMqa6TK+COXC XN6tr2JW75HwhvVe8xhNrvLCNOaPh+/0D6u/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796251481; x=1796856281; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=aXUc3QrEgrFbO6wWchbSEqP+lx3zrfrfjwxOG7P5aFQ=; b=O4phufoLPoZTdZSQqJd98tEtVpB4eQRcA3P1+KYEvVRmwrngewOkJbkjPLMThhJoXy 3y7oHVfpNqxioeiJNbRVoUO3JbIaNMCvBHU+sUSmOQpTZhzVdTz/IQEXShzTxDOIRMR7 Q739/An7E8GpAkspm4Zg4sq5LeRAUvouLbHwbr/tCKAi1KxCX6+1ppshlwkAqsGb/DjW 23kaozVfbTXgYvQ4WsRd4bV7u6+g18uhF65iPlpEaVQMWbc9T3+avREfKK43qlZfbkeM 0hGs8A6RwRFG+Whn9BKRM0903OZheMeL58rqq0HcqvRfongKpPSYhrdCFh3FurkfLzri qpPA== X-Forwarded-Encrypted: i=1; AL+hErFVFy+5DVOgcm2H0zLUUAa64fe+1zwcUbKLeZSg8Chhf1gx6o8spvcwVgDTwBb9Acgh6vGwCA==@lists.infradead.org X-Gm-Message-State: APuU4Z+D19cG8Tfm3ro+WOP+8j9vvtFu5A5B+RL8ZrTl+Y206jpanmAH hRotP17VGfDbWJlor6s1C3P3w1bfOGoDbCwaqxpu4HOtDM/cwnQmq0dnxhDFb06iKfY= X-Gm-Gg: AZFdTZd/SgIWQBFtSAfWss7zT+EgmkZz19rHys9twrYT2yIIxlRL419WQvut9EaOMBU 2P+dIaQVMjRh0T8lBHJLrjMMjwnhwGEiWMa5Aah1DQDaDcjNVzIjALpUeJ3fCIXUP7XoPnH4S+V l9zhId6TMg0FgFWZN6Jwx8xudKpv7bblzAGCbnUio+HDE6NhIthAm2DcJmT5QZY9yyVU1pAXozt O+Fvp2hVeo2X9bZkT4/Wz8yM5k8cARFlJL8edfE7ARn/qPsqZu4GqDrtO5L2FMc2nTzcazGYHzE lTKDRlweRiEr3/P4v6vQkWGM0JB7Cdu+nsCFxBC0Cc9s3AkeO32ijYk6bIEkIeanZ022WchsIJT nasKVQNDSPmsAwDFhdnf0qWzbjCTx24hhmRgDFkhbyQ+UEhdz+BPssvN4hPBlBB21hMXz7IidGu UdlzDi0Q9JTCzPYaVPQCVsCv9+fv7LTe6QmaOizuX3YeukwwcSZAA9PeUTQbjlcNEpDKHR1EZoG yu3D2MabcyY74B88nI10Ac77mN40oi4kCTSDmgimeICSJRPGvDPyKntEHluuNeNfqkbi76caelB WsVEo28etmShLVo4l9OIer/BY3msFWR0vI8VWpikAFfLRACU7cLFAzaoXLTc2YxiiMCYS48INwJ Y6OCnHBUPvvnKk/ZSrWcxNCsR5WHBvUEChp644+CG1A9Tz21D+gdrybwsjws3qYVN2/J9taZpok g7MIlWIH1KRZXkd5DA6Yn2OfFY63IPI6J0Xrmvui9UhgNXmnBndUab/RCQ3yAOUHoWQ0n3NSGqj G/NUtUl8dbm2Xl78n+W2eA= X-Received: by 2002:a53:ead2:0:b0:67b:fe2a:42e with SMTP id 956f58d0204a3-67df44c6987mr12589551d50.154.1796251481473; Wed, 02 Dec 2026 14:44:41 -0800 (PST) Received: from [172.20.0.3] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-67df337bfd7sm19375258d50.15.2026.12.02.14.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 14:44:40 -0800 (PST) Date: Wed, 02 Dec 2026 14:44:38 -0800 Message-ID: From: Chris Down Subject: [PATCH v2 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers To: Pasha Tatashin , Mike Rapoport , Pratyush Yadav Cc: Shuah Khan , Shuah Khan , linux-kselftest@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, sashiko-bot@kernel.org, kernel-team@meta.com X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_144443_082218_D02D5CEC X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 luo_ioctl() and luo_session_ioctl() return -EINVAL for a command number outside their ops table, but ENOTTY for an in-table number whose full command does not match. That contradicts the errno contract in include/uapi/linux/liveupdate.h, and it means a program cannot tell an ioctl the kernel does not have from a known ioctl with a bad argument. It also makes isatty() on a LUO fd fail with EINVAL instead of ENOTTY. Patch 1 returns -ENOIOCTLCMD for out-of-range numbers too. Patch 2 adds a selftest for it. v2: - Name the command numbers the selftest uses, and drop 0x3f on /dev/liveupdate, since it tests the same thing as 0xff there (Pratyush) v1: https://lore.kernel.org/r/cover.1796194107.git.chris@chrisdown.name Chris Down (2): liveupdate: Return -ENOTTY for unknown ioctl numbers selftests/liveupdate: Test ENOTTY for unknown ioctl numbers kernel/liveupdate/luo_core.c | 2 +- kernel/liveupdate/luo_session.c | 2 +- .../testing/selftests/liveupdate/liveupdate.c | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) base-commit: 073b7942a9a5998875c2e65a4c243212206713c2 -- 2.56.1