lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 23 Mar 2024 09:26:03 +0300
From: Andrey Shumilin <shum.sdl@...ct.ru>
To: Chandan Babu R <chandan.babu@...cle.com>
Cc: Andrey Shumilin <shum.sdl@...ct.ru>,
	"Darrick J. Wong" <djwong@...nel.org>,
	Dave Chinner <dchinner@...hat.com>,
	linux-xfs@...r.kernel.org,
	linux-kernel@...r.kernel.org (open list),
	lvc-project@...uxtesting.org,
	khoroshilov@...ras.ru,
	ykarpov@...ras.ru,
	vmerzlyakov@...ras.ru,
	vefanov@...ras.ru
Subject: [PATCH 2/2] xfs_refcount: Preventing integer overflow

Multiplying variables can overflow the "overhead" variable.
To fix this, the variable type has been increased.
Next, a subtraction operation occurs with it,
but before that it is checked.

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Shumilin <shum.sdl@...ct.ru>
---
 fs/xfs/libxfs/xfs_refcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 511c912d515c..cbf07552eaff 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1070,7 +1070,7 @@ static bool
 xfs_refcount_still_have_space(
 	struct xfs_btree_cur		*cur)
 {
-	unsigned long			overhead;
+	unsigned long long		overhead;
 
 	/*
 	 * Worst case estimate: full splits of the free space and rmap btrees
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ