Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12121

Audit logging of unsuccessful namesystem calls should not be done while holding fslock.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.7.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently we are audit logging the unsuccessful namesystem calls while holding fslock.
      Following is just one example.

      FSNamesystem.java
      HdfsFileStatus getFileInfo(final String src, boolean resolveLink)
          throws IOException {
          final String operationName = "getfileinfo";
          checkOperation(OperationCategory.READ);
          HdfsFileStatus stat = null;
          readLock();
          try {
            checkOperation(OperationCategory.READ);
            stat = FSDirStatAndListingOp.getFileInfo(dir, src, resolveLink);
          } catch (AccessControlException e) {
            logAuditEvent(false, operationName, src); //<---- audit logging while holding fs read lock.
            throw e;
          } finally {
            readUnlock(operationName);
          }
          logAuditEvent(true, operationName, src);
          return stat;
        }
      

      We should avoid doing this.

        Attachments

          Activity

            People

            • Assignee:
              shahrs87 Rushabh Shah
              Reporter:
              shahrs87 Rushabh Shah
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: