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]
Message-Id: <20250326144848.3219740-1-sj1557.seo@samsung.com>
Date: Wed, 26 Mar 2025 23:48:48 +0900
From: Sungjong Seo <sj1557.seo@...sung.com>
To: linkinjeon@...nel.org, yuezhang.mo@...y.com
Cc: sjdev.seo@...il.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, cpgs@...sung.com, Sungjong Seo
	<sj1557.seo@...sung.com>, stable@...r.kernel.org
Subject: [PATCH] exfat: fix potential wrong error return from get_block

If there is no error, get_block() should return 0. However, when bh_read()
returns 1, get_block() also returns 1 in the same manner.

Let's set err to 0, if there is no error from bh_read()

Fixes: 11a347fb6cef ("exfat: change to get file size from DataLength")
Cc: stable@...r.kernel.org
Signed-off-by: Sungjong Seo <sj1557.seo@...sung.com>
---
 fs/exfat/inode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index f3fdba9f4d21..a23677de4544 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -391,6 +391,8 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,
 			/* Zero unwritten part of a block */
 			memset(bh_result->b_data + size, 0,
 			       bh_result->b_size - size);
+
+			err = 0;
 		} else {
 			/*
 			 * The range has not been written, clear the mapped flag
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ