From nobody Thu Apr 2 20:22:18 2026 Received: from forward100b.mail.yandex.net (forward100b.mail.yandex.net [178.154.239.147]) (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 CD1A535B63A; Thu, 12 Feb 2026 12:56:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770901002; cv=none; b=F5P0nQovWcCYkDzwu0udSL4f3TW/u3aUq/AULxON6Y/NuUOR2wOkgN4p9KUD5dNtr7MtKkTdO/bP1eVlgrrqcCcguRBUa1m89VRqkfdx1q7KW2cBgFRnO5mJeUWowsCplOJg8/TxmVUB5S/bXUbFCNMoEgof4a8mI5gTXwKg/pY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770901002; c=relaxed/simple; bh=b25GLa6Nxa0JkVVRcxgvW+qahIyegLcJ0z46wPRIPQ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PHEL1dsTTM9TrVwf3NA5uY2viDKBH7ipLUga5dqLsdDEWu2meS4sVx+cSVZvDY7T2LaBe2Au8Ms8VjxqHdMXTIDOF4fC1MRUoxFhBhpvjgyyrJUZlwQNpmFkjtfWPRI8mB/TMPCH+6AzjGfK7Q9s+5SE7xRAE4u9bDwABvXhkTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru; spf=pass smtp.mailfrom=yandex.ru; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b=eYIxE/+s; arc=none smtp.client-ip=178.154.239.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yandex.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="eYIxE/+s" Received: from mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net [IPv6:2a02:6b8:c11:e97:0:640:f294:0]) by forward100b.mail.yandex.net (Yandex) with ESMTPS id DDF4B8077D; Thu, 12 Feb 2026 15:56:34 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id VuTjuXAGI4Y0-tsl2dBmf; Thu, 12 Feb 2026 15:56:34 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1770900994; bh=xpMpHVbNQyEu3bVeX/qstTUz7i5myZeY5ImYtYMRO48=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=eYIxE/+sOTeagoc6/8ZKuR0TEL1FfbVuznpcy51BBtFN4zb9I1027ofIlozh30GX6 /ozi3TTjeR3lIRbVWwAm/9ulhF8oMfIUapK+FhXMGbf0kES8mymkgpLlnbk/goNbAJ dzkesSdkJyVL9B1EelWMr+lTRANZiAc1xb0FGF4g= Authentication-Results: mail-nwsmtp-smtp-production-main-70.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Andy Shevchenko , Andrew Morton Cc: David Laight , Kees Cook , "Darrick J . Wong" , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Antipov Subject: [PATCH v7 3/5] lib: add more string to 64-bit integer conversion overflow tests Date: Thu, 12 Feb 2026 15:56:26 +0300 Message-ID: <20260212125628.739276-4-dmantipov@yandex.ru> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260212125628.739276-1-dmantipov@yandex.ru> References: <20260212125628.739276-1-dmantipov@yandex.ru> 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 Content-Type: text/plain; charset="utf-8" Add a few more string to 64-bit integer conversion tests to check whether 'kstrtoull()', 'kstrtoll()', 'kstrtou64()' and 'kstrtos64()' can handle overflows reported by '_parse_integer_limit()'. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Dmitry Antipov --- v5 and upwards: bump version to match the series v4: initial version to join the series --- lib/test-kstrtox.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/test-kstrtox.c b/lib/test-kstrtox.c index ee87fef66cb5..811128d0df16 100644 --- a/lib/test-kstrtox.c +++ b/lib/test-kstrtox.c @@ -198,6 +198,7 @@ static void __init test_kstrtoull_fail(void) {"10000000000000000000000000000000000000000000000000000000000000000", 2}, {"2000000000000000000000", 8}, {"18446744073709551616", 10}, + {"569202370375329612767", 10}, {"10000000000000000", 16}, /* negative */ {"-0", 0}, @@ -275,9 +276,11 @@ static void __init test_kstrtoll_fail(void) {"9223372036854775809", 10}, {"18446744073709551614", 10}, {"18446744073709551615", 10}, + {"569202370375329612767", 10}, {"-9223372036854775809", 10}, {"-18446744073709551614", 10}, {"-18446744073709551615", 10}, + {"-569202370375329612767", 10}, /* sign is first character if any */ {"-+1", 0}, {"-+1", 8}, @@ -334,6 +337,7 @@ static void __init test_kstrtou64_fail(void) {"-1", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, + {"569202370375329612767", 10}, }; TEST_FAIL(kstrtou64, u64, "%llu", test_u64_fail); } @@ -386,6 +390,8 @@ static void __init test_kstrtos64_fail(void) {"18446744073709551615", 10}, {"18446744073709551616", 10}, {"18446744073709551617", 10}, + {"569202370375329612767", 10}, + {"-569202370375329612767", 10}, }; TEST_FAIL(kstrtos64, s64, "%lld", test_s64_fail); } --=20 2.53.0