From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 8B5351A6824 for ; Thu, 16 Jul 2026 01:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784165187; cv=none; b=q1VyirDe37YTGVz9elhFC+c0VBBKHtYGAxpql2KUQtg/K1Yv8owtgC+7a59MnQjyZAqEe8faLIath7pYAXC9tObmUKKPS7Mtn3vEGzBsgBn39yIpJjIPA7JminsMU/sx7ywzVcw+mRKaB/l68iBdizfHoMdkR982h31WHmALSCU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784165187; c=relaxed/simple; bh=42VrW29M5m0/2epMEHxKGuL/OFpe7hWq5AOZ0LY+4q8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qC6kdmZWRTvItpR/gortphKrfbH4xQM0ur+p1wBLr9TcfqOf0Gv+aOYpROjFuv/1LukBuiAF+yPYdRfcvbw32dHd7vcXIVjaMCNlcfxjH4ZZGU6/ZzZFJACN2dIWKqeVvdjllnoifAvTmKm425Yi5F4k8cUdGZyIql3ccqK5yf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=iM4rUxqs; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="iM4rUxqs" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784165181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ss7/kTGN3OUIncgAtHrRqAmrW5PswI+hh6Nfe+UCfHo=; b=iM4rUxqszxpLGFjWuNCvDqZ8qdZx6g1UnkOpIq1vi8dkwJtkX/Tt0DQRBYa3veg5nYfAN6 VtLXWaXqfl9DCuKY1fPiM9uFiH69WqJspzGsYbH9THu0isPSCBgFvtW4sKi+drn1nsSnwJ /u2XFBs7D2xyY9/m9/WpQHyb+Dkj1Hg= From: Jackie Liu To: pratyush@kernel.org Cc: pasha.tatashin@soleen.com, rppt@kernel.org, kpm@linux-foundation.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] liveupdate: fix GET_NAME ioctl argument validation Date: Thu, 16 Jul 2026 09:26:06 +0800 Message-ID: <20260716012607.22020-1-liu.yun@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Jackie Liu LIVEUPDATE_SESSION_GET_NAME was developed in the liveupdate/next branch while the session type validation change was carried in liveupdate-fixes. When the conflict between the two branches was resolved, the GET_NAME operation descriptor picked up the structure and last member from RETRIEVE_FD. This makes both its known size and minimum size 16 bytes rather than 72. A zero-initialized request still succeeds because luo_session_get_name() writes the full name before luo_ucmd_respond() copies the full GET_NAME response to userspace. However, copy_struct_from_user() treats the output-only name field as unknown trailing data and rejects the request with -E2BIG if any byte in that field is nonzero. Use the GET_NAME structure and its name field in the descriptor. Link: https://lore.kernel.org/all/ahWlYXNjGUbkKoHy@sirena.org.uk/ Assisted-by: Codex:gpt-5.6-sol Reviewed-by: Pratyush Yadav (Google) Signed-off-by: Jackie Liu --- kernel/liveupdate/luo_session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index b79b2a488974..f38b5b18f3f8 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -378,7 +378,7 @@ static const struct luo_ioctl_op luo_session_ioctl_ops[] = { IOCTL_OP(LIVEUPDATE_SESSION_RETRIEVE_FD, luo_session_retrieve_fd, struct liveupdate_session_retrieve_fd, token, LUO_IOCTL_INCOMING), IOCTL_OP(LIVEUPDATE_SESSION_GET_NAME, luo_session_get_name, - struct liveupdate_session_retrieve_fd, token, LUO_IOCTL_ALL), + struct liveupdate_session_get_name, name, LUO_IOCTL_ALL), }; static bool luo_ioctl_type_valid(struct luo_session *session, -- 2.54.0