Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-8774

copy_from_user() should not use MAX_STRING_SIZE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Lustre 2.9.0
    • Fix Version/s: Lustre 2.9.0
    • Labels:
      None
    • 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.

        Attachments

          Activity

            People

            • Assignee:
              yujian Jian Yu
              Reporter:
              yujian Jian Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: