From nobody Thu Oct 30 18:35:15 2025 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 B310342AA3 for ; Mon, 13 Oct 2025 11:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760356337; cv=none; b=kzjOZmHIAs8n94pkT6gstZTt6/ncARL9w8wPYOOAKgb4GerEe+xWywx/Ps4bvDGEFRhLowprLqj8ePHduY/PYNh2HI6sm5XQDwXCZqDQGuCyEXRdtstMfHtmty97BK5qD7hUqvsvNFPsOwhahj3H/XRqDiLxsqiurfGGGfKmYwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760356337; c=relaxed/simple; bh=V2qDYbbuoTEkBT2HL0t17NuHFHKoI+ou5Hi6gsPWzL0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H8TqqJ6wYrmMLnwV3HIEff/7r/4bCDP1d2TD5+v3HFVmN9DnKPPlfkazZVvgUFiTgCw8MlBGQ8iPpVrue+ivfMxIGa0ekYPKfRTzsfOXwbhiJ5VrZFSRKq2omwA5Xy9Rn2Lh0KP8cFegyMpkt5uOYlPUjgUEIbHZ/Y6g4bgRb8Y= 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=PSjKTqJP; arc=none smtp.client-ip=95.215.58.187 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="PSjKTqJP" 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=1760356330; 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=/Uibbwg5d/wwFpFMHDXbH4NfA15Tu+IH7YaAVA/rb1c=; b=PSjKTqJP9pqAYoHdIVOFzclMViJVzEjidiANqm0xzTACFLXxwbrBrac1PxqPu8OpRK7v8K f5VNqEXqNzQuzlJ/I9TthmxUsJBt/QWf/pwZLjULfY+HDFyvClU5vNWjzfmBeYxGjQOAd/ UmVyha1g5IPcarqIKYH4G8XdsWvPncU= From: Thorsten Blum To: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jason Andryuk , "Dr. David Alan Gilbert" Cc: linux-hardening@vger.kernel.org, Thorsten Blum , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] drivers/xen/xenbus: Replace deprecated strcpy in xenbus_transaction_end Date: Mon, 13 Oct 2025 13:51:25 +0200 Message-ID: <20251013115129.30304-2-thorsten.blum@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: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" strcpy() is deprecated; inline the read-only string instead. Fix the function comment and use bool instead of int while we're at it. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum Reviewed-by: Juergen Gross --- drivers/xen/xenbus/xenbus_xs.c | 14 ++++---------- include/xen/xenbus.h | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 528682bf0c7f..5d95a5f83119 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -546,18 +546,12 @@ int xenbus_transaction_start(struct xenbus_transactio= n *t) EXPORT_SYMBOL_GPL(xenbus_transaction_start); =20 /* End a transaction. - * If abandon is true, transaction is discarded instead of committed. + * If abort is true, transaction is discarded instead of committed. */ -int xenbus_transaction_end(struct xenbus_transaction t, int abort) +int xenbus_transaction_end(struct xenbus_transaction t, bool abort) { - char abortstr[2]; - - if (abort) - strcpy(abortstr, "F"); - else - strcpy(abortstr, "T"); - - return xs_error(xs_single(t, XS_TRANSACTION_END, abortstr, NULL)); + return xs_error(xs_single(t, XS_TRANSACTION_END, abort ? "F" : "T", + NULL)); } EXPORT_SYMBOL_GPL(xenbus_transaction_end); =20 diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 7dab04cf4a36..c94caf852aea 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -158,7 +158,7 @@ int xenbus_exists(struct xenbus_transaction t, const char *dir, const char *node); int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *no= de); int xenbus_transaction_start(struct xenbus_transaction *t); -int xenbus_transaction_end(struct xenbus_transaction t, int abort); +int xenbus_transaction_end(struct xenbus_transaction t, bool abort); =20 /* Single read and scanf: returns -errno or num scanned if > 0. */ __scanf(4, 5) --=20 2.51.0