[LU-8260] osd_ldiskfs fiemap code wrong address space usage Created: 12/Jun/16  Updated: 21/Mar/19  Resolved: 21/Mar/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.13.0

Type: Bug Priority: Major
Reporter: Oleg Drokin Assignee: Arshad Hussain
Resolution: Fixed Votes: 0
Labels: easy

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

osd_io code seems to be using struct fiemap_extent's fi_extents_start field directly even though it has __user qualifier.
We then pass this buffer straight into inode's fiemap method that does assume the pointer is userspace which is boind to break on some conigurations.

We need to at least set ds to kernel_ds to have it working,
or find some other wayst to call into fiemap code with kernelspace buffers.

Offending functions are osd_fiemap_get() and osd_is_mapped()



 Comments   
Comment by Gerrit Updater [ 15/Dec/18 ]

Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: https://review.whamcloud.com/33878
Subject: LU-8260 osd-ldiskfs: osd_fiemap_get() fix address space mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ae220772026c20835bd79f01a419406f30042899

Comment by Gerrit Updater [ 21/Mar/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33878/
Subject: LU-8260 osd-ldiskfs: osd_fiemap_get() fix address space mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: dcafe7cb48f5e4582a4711652b38629c46675232

Comment by Peter Jones [ 21/Mar/19 ]

Landed for 2.13

Generated at Sat Feb 10 02:16:00 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.