The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ocfs2: add checks in ocfs2_xattr_find_entry() to avoid potential out-of-bound access.
@ 2024-05-17  9:41 Ferry Meng
  2024-05-17  9:41 ` [PATCH v2 1/2] ocfs2: add bounds checking to ocfs2_xattr_find_entry() Ferry Meng
  2024-05-17  9:41 ` [PATCH v2 2/2] ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() Ferry Meng
  0 siblings, 2 replies; 6+ messages in thread
From: Ferry Meng @ 2024-05-17  9:41 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, ocfs2-devel; +Cc: linux-kernel, Ferry Meng

Hi, all:

This patch series attempts to address a scenario where accessing user-defined
xattrs in a carefully crafted image can lead to out-of-bound access.(To speak
truthfully, I do not think this vehavior would occur under proper usage.)

In my testing environment, I constructed an OCFS2 image, created a file with
several user-defined xattrs(long name attributes, this will cause a "Non-INLINE"
xattr, which requires additional space for storage), and then forcibly modified
the xe_name_offset using a binary editing tool (e.g "hexedit"). Upon remounting
the image and running 'getfattr -d /path/to/file', this patchset was able to 
detect "partial" malicious modification.

In v2, I make these changes:
- (1/2) use xs->end directly, no need to parse a parameter.
- (2/2) define a local var 'name_offset'.

Ferry Meng (2):
  ocfs2: add bounds checking to ocfs2_xattr_find_entry()
  ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()

 fs/ocfs2/xattr.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

-- 
2.32.0.3.g01195cf9f


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-28 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17  9:41 [PATCH v2 0/2] ocfs2: add checks in ocfs2_xattr_find_entry() to avoid potential out-of-bound access Ferry Meng
2024-05-17  9:41 ` [PATCH v2 1/2] ocfs2: add bounds checking to ocfs2_xattr_find_entry() Ferry Meng
2024-05-17 10:52   ` Joseph Qi
2024-05-17  9:41 ` [PATCH v2 2/2] ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() Ferry Meng
2024-05-17 10:53   ` Joseph Qi
2024-05-28 11:30     ` lei lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox