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

copy_from_user() should not use MAX_STRING_SIZE

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • Lustre 2.9.0
    • None
    • 3
    • 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

          [LU-8774] copy_from_user() should not use MAX_STRING_SIZE
          yujian Jian Yu added a comment -

          Patch landed to master branch for Lustre 2.9.0.

          yujian Jian Yu added a comment - Patch landed to master branch for Lustre 2.9.0.

          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

          gerrit Gerrit Updater added a comment - 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

          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

          gerrit Gerrit Updater added a comment - 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

          People

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

            Dates

              Created:
              Updated:
              Resolved: