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]
Date:   Sun, 6 Feb 2022 21:19:27 -0800
From:   Blair Barnett <blairbarnett@...global.net>
To:     linux-kernel@...r.kernel.org
Subject: [PATCH]: fanotify_event_metadata is not sufficiently aligned

While running fanotify LTP tests, we ran into several tests that 
exhibited unaligned access faults (our processor that we are developing 
has strict alignment of 8 bytes and does no hW or SW fix-up for 
unaligned accesses). So here is a patch against the 5.15.13 kernel that 
I want to propose to fix this problem. Testing on other architectures 
(ARM and x86) passes.

I am not subscribed to this email list, so please CC and reply to 
bbarnett@...hyum.com.

Thank you,

Blair

 From d358cbc008ebfe2aed50256074e97209bdf035f8 Mon Sep 17 00:00:00 2001
From: Blair Barnett <bbarnett@...hyum.com>
Date: Sun, 6 Feb 2022 21:03:31 -0800
Subject: [PATCH] Since struct fanotify_event_metadata contains an element
  "mask" that is aligned on __aligned_u64, it's best to align the 
structure on
  this size, rather than the current 4B

This fix resolves an unaligned access fault in many of the
fanotify LTP tests
---
  fs/notify/fanotify/fanotify_user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/notify/fanotify/fanotify_user.c 
b/fs/notify/fanotify/fanotify_user.c
index 6facdf476255..f028332738c5 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -109,7 +109,7 @@ struct kmem_cache *fanotify_fid_event_cachep 
__read_mostly;
  struct kmem_cache *fanotify_path_event_cachep __read_mostly;
  struct kmem_cache *fanotify_perm_event_cachep __read_mostly;

-#define FANOTIFY_EVENT_ALIGN 4
+#define FANOTIFY_EVENT_ALIGN sizeof(__aligned_u64)
  #define FANOTIFY_FID_INFO_HDR_LEN \
         (sizeof(struct fanotify_event_info_fid) + sizeof(struct 
file_handle))
  #define FANOTIFY_PIDFD_INFO_HDR_LEN \
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ