[LU-8774] copy_from_user() should not use MAX_STRING_SIZE Created: 28/Oct/16  Updated: 11/May/17  Resolved: 22/Nov/16

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

Type: Bug Priority: Minor
Reporter: Jian Yu Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The following codes are incorrect:

$ git grep "MAX_STRING_SIZE" | grep copy_from_user
lustre/ldlm/ldlm_resource.c:	if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
lustre/obdclass/lprocfs_status.c:	if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))

We should only copy enough bytes to cover count passed in.



 Comments   
Comment by Gerrit Updater [ 28/Oct/16 ]

Jian Yu (jian.yu@intel.com) uploaded a new patch: http://review.whamcloud.com/23462
Subject: LU-8774 lprocfs: not use MAX_STRING_SIZE in copy_from_user
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f5c8d723829ca7289c15d9820f730213e2b7c4f4

Comment by Gerrit Updater [ 19/Nov/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23462/
Subject: LU-8774 lprocfs: not use MAX_STRING_SIZE in copy_from_user
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a9ae88bbaca0770f28f3c88a4afed6b99403aec6

Comment by Jian Yu [ 22/Nov/16 ]

Patch landed to master branch for Lustre 2.9.0.

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