From nobody Mon Feb 9 07:19:45 2026 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 23560EAE7 for ; Sat, 20 Dec 2025 13:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766235672; cv=none; b=hE2E1pEUFK4L3lo8SXxw/eNcyCOIin8ttFI57rxv6S5ZXKgQ7wHU9FEJ6wgsKEspJj4nuHGEgZExiYOgtYI0QSS7hCChBfKJePQX06i2eiXMD60ac8oukNtsctQV3A9tVYtSmn155e3uIF6NUh6X4Nms/cmaOhyoAtibQA0NHBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766235672; c=relaxed/simple; bh=X1LSS6XQvB6ed/rTZAvGB6vuBUDnesVpzc9nVDICiyw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K4Eq934RI7znTgATOGM0Hp9GDSoq2qDlHck2E0qiVtE+DoU/Pw4RGcG6nMd8IqyxX1wJpLEv3w3geYaBFRntB+dfFDfi2IXdpqOBhiHwahr3XO0dy9aLDb+Zh1YYVrCE0RDaw6BxDKH9LD90VWzqBLqsF+2IDw2FJKL0jtLAb6w= 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=ZcwljddY; arc=none smtp.client-ip=95.215.58.170 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="ZcwljddY" 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=1766235668; 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=VrD2yMNSN/Ud/Hb5P1kTdDYCqY2hl5flKvocGik0/g4=; b=ZcwljddYDfXahDpnXnfSftBbtCJAikEXJTS87HX9erEhymtuULnlPlJnSWszXRi33OWQv6 YKU51SZ3hCKt5LCBA40XxtHPZ0QoWYW7dWIlzXMbFVRKmjBefTIvk8+151wSB2qhCcKKO4 bdgIMTSG5uQDFxaEp+GmlrfCg2bVHv0= From: Thorsten Blum To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH] devtmpfs: Replace simple_strtoul with kstrtoint in mount_param Date: Sat, 20 Dec 2025 13:59:31 +0100 Message-ID: <20251220125930.76836-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" Replace simple_strtoul() with the recommended kstrtoint() for parsing the 'devtmpfs.mount=3D' boot parameter. Unlike simple_strtoul(), which returns an unsigned long, kstrtoint() converts the string directly to int and avoids implicit casting. Check the return value of kstrtoint() and reject invalid values. This adds error handling while preserving behavior for existing values, and removes use of the deprecated simple_strtoul() helper. The current code silently sets 'mount_dev =3D 0' if parsing fails, instead of leaving the default value (IS_ENABLED(CONFIG_DEVTMPFS_MOUNT)) unchanged. Signed-off-by: Thorsten Blum --- drivers/base/devtmpfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index 194b44075ac7..3f7d724ef242 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c @@ -56,8 +56,7 @@ static struct req { =20 static int __init mount_param(char *str) { - mount_dev =3D simple_strtoul(str, NULL, 0); - return 1; + return kstrtoint(str, 0, &mount_dev) =3D=3D 0; } __setup("devtmpfs.mount=3D", mount_param); =20 --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4