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

llapi_obd_statfs() tests errno in non error cases, may leak file descriptors

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • Lustre 2.9.0
    • 3
    • 9223372036854775807

    Description

      In llapi_obd_statfs() we have:

              fd = open(path, O_RDONLY);
              if (errno == EISDIR)
                      fd = open(path, O_DIRECTORY | O_RDONLY);
      

      Second, if open() succeeds then the value of errno is arbitrary and the file descriptor may be leaked if errno was previously set to EISDIR.

      Also note that open() will never set errno to EISDIR when write access is not requested.

      Attachments

        Activity

          [LU-8723] llapi_obd_statfs() tests errno in non error cases, may leak file descriptors
          pjones Peter Jones added a comment -

          Landed for 2.9

          pjones Peter Jones added a comment - Landed for 2.9

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23285/
          Subject: LU-8723 llapi: correct open() handling in llapi_obd_statfs()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: c791db551d022cd804e9dcc751cd7e33102a741a

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23285/ Subject: LU-8723 llapi: correct open() handling in llapi_obd_statfs() Project: fs/lustre-release Branch: master Current Patch Set: Commit: c791db551d022cd804e9dcc751cd7e33102a741a

          John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23285
          Subject: LU-8723 llapi: correct open() handling in llapi_obd_statfs()
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: bde378b948a515b53f22feb5f32fecd628b2bbd0

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23285 Subject: LU-8723 llapi: correct open() handling in llapi_obd_statfs() Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: bde378b948a515b53f22feb5f32fecd628b2bbd0

          People

            wc-triage WC Triage
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: