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>] [day] [month] [year] [list]
Message-Id: <1433510925-11438-1-git-send-email-alnovak@suse.cz>
Date:	Fri,  5 Jun 2015 15:28:45 +0200
From:	Ales Novak <alnovak@...e.cz>
To:	Dave Chinner <david@...morbit.com>
Cc:	xfs@....sgi.com, linux-kernel@...r.kernel.org,
	Ales Novak <alnovak@...e.cz>
Subject: [PATCH] xfs: fix in the setting of logbsize

Logbsize should be integer multiple of log stripe unit size. If it's
not, various operations will lead to crashes, due to invalid buffer
sizes, i.e. we've seen crashes in the callpath xlog_sync->xlog_pack_data.

However, this rule is only mentioned in the documentation, while it
could be checked during the mount.

Signed-off-by: Ales Novak <alnovak@...e.cz>
---
 fs/xfs/xfs_super.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 8fcc4cc..1a3766d 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1352,6 +1352,11 @@ xfs_finish_flags(
 			xfs_warn(mp,
 		"logbuf size must be greater than or equal to log stripe size");
 			return -EINVAL;
+		} else if (mp->m_logbsize > 0 && mp->m_sb.sb_logsunit > 0 &&
+			   mp->m_logbsize % mp->m_sb.sb_logsunit) {
+			xfs_warn(mp,
+		"logbuf size must be integer multiple of log stripe size");
+			return -EINVAL;
 		}
 	} else {
 		/* Fail a mount if the logbuf is larger than 32K */
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ