From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 1D6BE220687 for ; Thu, 16 Jul 2026 01:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784165188; cv=none; b=mcsjgsRNxSyJ8L1woDPb7wcYdJoh0EvD/CY/1azTDe468dZwaOkwociP6R9B2Phh5tKczOEcHBv6SUbSVLceP5IgIN9zbHe0NQ0O50JNG/WmqGlLoCYbfa5JQRgigGsx0cwKN4XJUOgBIE//biK6e5XR4Sv3YrEeFIpvtb9Crbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784165188; c=relaxed/simple; bh=jC/kM0PEIXaVF6M1qP0E98LwlU78iPOF0F6v2o9HPI4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hutlnlpee01iFkkdnWQlkyYDSf/NGxxRE8YnozcHeV2pgcESmy4IL8borjqp476C93NrtqTwT+sBZUZThONlfpgWcwUiHxGv2DiCMpanNyCkKdFvqzpx4ZKIt71ca1/gICC+s87zEb5xxLb2rwq9tQx3LnjiXKBVglrhB49ttZc= 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=bpDhLyHK; arc=none smtp.client-ip=91.218.175.188 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="bpDhLyHK" 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=1784165185; 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: in-reply-to:in-reply-to:references:references; bh=yzHyAL7pNceL2yaXNIkqBqDFMTl7ASDtb7hMv9AVCYQ=; b=bpDhLyHK1bdALzPdXyBKZzCwXL1qxjw3hodGbug4JRD8sCcWH76NsjpcowVR6fohPeYQCf /zFCfmx82TavJKKm7BAvtUhbKlVrtgxAkaom2sehGLbgUtnpOnjf4Kocnl9+Twe79tDxdW VZ1OqGvyERbPYHjOOM9IdJj9WrP/Rek= 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 2/2] liveupdate: reject nonzero reserved value for SESSION_FINISH Date: Thu, 16 Jul 2026 09:26:07 +0800 Message-ID: <20260716012607.22020-2-liu.yun@linux.dev> In-Reply-To: <20260716012607.22020-1-liu.yun@linux.dev> References: <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 The UAPI documents liveupdate_session_finish::reserved as requiring zero, but luo_session_finish() currently ignores it and finishes the session. Accepting nonzero values prevents the field from being safely repurposed by a future extension. Reject nonzero reserved values before changing session state, matching LIVEUPDATE_SESSION_GET_NAME. Fixes: 16cec0d26521 ("liveupdate: luo_session: add ioctls for file preservation") Assisted-by: Codex:gpt-5.6-sol Reviewed-by: Pratyush Yadav (Google) Signed-off-by: Jackie Liu --- kernel/liveupdate/luo_session.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index f38b5b18f3f8..15342c0783b5 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -316,7 +316,12 @@ static int luo_session_finish(struct luo_session *session, struct luo_ucmd *ucmd) { struct liveupdate_session_finish *argp = ucmd->cmd; - int err = luo_session_finish_one(session); + int err; + + if (argp->reserved) + return -EINVAL; + + err = luo_session_finish_one(session); if (err) return err; -- 2.54.0