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

fld_proc_hash_seq_write accesses userspace pointer directly

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.8.0
    • Lustre 2.7.0, Lustre 2.5.3, Lustre 2.8.0
    • 3
    • 9223372036854775807

    Description

      In lustre/fld/lproc_fld.c we have this gem:

      static ssize_t
      fld_proc_hash_seq_write(struct file *file, const char __user *buffer,
                              size_t count, loff_t *off)
      {
      ...
                      if (!strncmp(fld_hash[i].fh_name, buffer, count)) {
                              hash = &fld_hash[i];
                              break;
                      }
      ...
      

      This is a bug and we cannot really access user pointers directly. The value first must be copied to a kernel buffer.

      This was introduced in 2006 by Yury, part of cmd3 bringup.

      Attachments

        Issue Links

          Activity

            [LU-7624] fld_proc_hash_seq_write accesses userspace pointer directly
            pjones Peter Jones made changes -
            Comment [ No problem Henri. I'll delete the comments to prevent future confusion ]
            pjones Peter Jones made changes -
            Comment [ The patch above was pushed with an incorrect LU reference and is absolutely not related to this ticket.
            Sorry for that, please ignore. ]
            pjones Peter Jones made changes -
            Comment [ Henri Doreau (henri.doreau@cea.fr) uploaded a new patch: http://review.whamcloud.com/22697
            Subject: LU-7624 mdd: refactor changelog handling for XATTR ops
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: d2db6deaa60335bee663e0a76b02f691f56d1a4b ]
            pjones Peter Jones made changes -
            Link Original: This issue is related to LDEV-142 [ LDEV-142 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to LDEV-367 [ LDEV-367 ]

            Oh I have been given power. How scary!!

            simmonsja James A Simmons added a comment - Oh I have been given power. How scary!!
            pjones Peter Jones made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Do you realize that you have permissions to mark tickets as resolved James?

            pjones Peter Jones added a comment - Do you realize that you have permissions to mark tickets as resolved James?

            Patch has landed. This ticket can be closed.

            simmonsja James A Simmons added a comment - Patch has landed. This ticket can be closed.

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17797/
            Subject: LU-7624 fld: copy userspace buffer
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: ab38c3afa2747c99b766b9bbdd825ef7593bc532

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17797/ Subject: LU-7624 fld: copy userspace buffer Project: fs/lustre-release Branch: master Current Patch Set: Commit: ab38c3afa2747c99b766b9bbdd825ef7593bc532

            People

              bogl Bob Glossman (Inactive)
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: