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

Unsafe userspace address access from proc handler in nodemap code

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.9.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Patch http://review.whamcloud.com/18783 added this bit of code:

      nodemap_fileset_seq_write(struct file *file,
                                            const char __user *buffer,
                                            size_t count, loff_t *off)
      {
              struct seq_file *m = file->private_data;
              int rc = 0;
      
              if (count > 0)
                      rc = nodemap_set_fileset(m->private, buffer);
      
              if (rc != 0)
                      return -EINVAL;
      
              return count;
      }
      

      Now the problem is - buffer is in userspace, so we cannot just pass it like this to nodemap_set_fileset where it would get dereferenced.
      We need to properly copy it to kernelspace first.

      Attachments

        Activity

          [LU-8258] Unsafe userspace address access from proc handler in nodemap code

          Landed to master for 2.9.0

          jgmitter Joseph Gmitter (Inactive) added a comment - Landed to master for 2.9.0

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/21857/
          Subject: LU-8258 nodemap: fix userspace address access in proc code
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 288e55b8a38222af843a71a89df90234a72d8e0d

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/21857/ Subject: LU-8258 nodemap: fix userspace address access in proc code Project: fs/lustre-release Branch: master Current Patch Set: Commit: 288e55b8a38222af843a71a89df90234a72d8e0d

          Kit Westneat (kit.westneat@gmail.com) uploaded a new patch: http://review.whamcloud.com/21857
          Subject: LU-8258 nodemap: fix userspace address access in proc code
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 001098168e33dbd856537725fc2dca1b3135cab7

          gerrit Gerrit Updater added a comment - Kit Westneat (kit.westneat@gmail.com) uploaded a new patch: http://review.whamcloud.com/21857 Subject: LU-8258 nodemap: fix userspace address access in proc code Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 001098168e33dbd856537725fc2dca1b3135cab7
          pjones Peter Jones added a comment -

          Kit

          Are you able to help with this one?

          Peter

          pjones Peter Jones added a comment - Kit Are you able to help with this one? Peter

          People

            kit.westneat Kit Westneat (Inactive)
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: