[8/8] e2fsck/jfs_user.h: Fix b_data alignment in struct buffer_head

Submitted by Sami Liedes on Dec. 13, 2012, 10:04 p.m.

Details

Message ID 20121213220433.GP9713@sli.dy.fi
State Accepted, archived
Headers show

Commit Message

Sami Liedes Dec. 13, 2012, 10:04 p.m.
buffer_head.b_data needs to be 8-byte aligned to prevent an unaligned
access via a 64-bit pointer in e.g. scan_revoke_records().

Caught using clang -fsanitize=undefined.

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
---
 e2fsck/jfs_user.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/e2fsck/jfs_user.h b/e2fsck/jfs_user.h
index 3cccd3f..fdaf1b2 100644
--- a/e2fsck/jfs_user.h
+++ b/e2fsck/jfs_user.h
@@ -22,7 +22,7 @@  struct buffer_head {
 	int	 	b_dirty;
 	int	 	b_uptodate;
 	int	 	b_err;
-	char		b_data[1024];
+	char		b_data[1024]  __attribute__ ((aligned (8)));
 };
 
 struct inode {