You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "lujie (Jira)" <ji...@apache.org> on 2022/05/14 08:13:00 UTC

[jira] [Updated] (YARN-11151) sensitive infor may leak due to crash

     [ https://issues.apache.org/jira/browse/YARN-11151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

lujie updated YARN-11151:
-------------------------
    Description: 
we init LevelDBCacheTimelineStore and LeveldbTimelineStore like:

 
{code:java}
 try {
      localFS = FileSystem.getLocal(conf);
      if (!localFS.exists(dbPath)) {
        if (!localFS.mkdirs(dbPath)) {
          throw new IOException("Couldn't create directory for leveldb " +
              "timeline store " + dbPath);
        }
        localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
      }
    } finally {
      IOUtils.cleanupWithLogger(LOG, localFS);
    } {code}
 

if node crash before setPermisson, then the permisison will be 755 forever

 

code should be like :
{code:java}
 try {
      localFS = FileSystem.getLocal(conf);
      if (!localFS.exists(dbPath)) {
        if (!localFS.mkdirs(dbPath)) {
          throw new IOException("Couldn't create directory for leveldb " +
              "timeline store " + dbPath);
        }
        
      }
         if(!localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
       localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
 } 
finally {
      IOUtils.cleanupWithLogger(LOG, localFS);
    } {code}
 

  was:
we init LevelDBCacheTimelineStore and LeveldbTimelineStore like:

 
{code:java}
 try {
      localFS = FileSystem.getLocal(conf);
      if (!localFS.exists(dbPath)) {
        if (!localFS.mkdirs(dbPath)) {
          throw new IOException("Couldn't create directory for leveldb " +
              "timeline store " + dbPath);
        }
        localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
      }
    } finally {
      IOUtils.cleanupWithLogger(LOG, localFS);
    } {code}
 

if node crash before setPermisson, then the permisison will be 755 forever

 

code should be like :
{code:java}
 try {
      localFS = FileSystem.getLocal(conf);
      if (!localFS.exists(dbPath)) {
        if (!localFS.mkdirs(dbPath)) {
          throw new IOException("Couldn't create directory for leveldb " +
              "timeline store " + dbPath);
        }
        
      }
         if (localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
       localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);}     } finally {
      IOUtils.cleanupWithLogger(LOG, localFS);
    } {code}
 


> sensitive infor may leak due to crash
> -------------------------------------
>
>                 Key: YARN-11151
>                 URL: https://issues.apache.org/jira/browse/YARN-11151
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: lujie
>            Priority: Major
>
> we init LevelDBCacheTimelineStore and LeveldbTimelineStore like:
>  
> {code:java}
>  try {
>       localFS = FileSystem.getLocal(conf);
>       if (!localFS.exists(dbPath)) {
>         if (!localFS.mkdirs(dbPath)) {
>           throw new IOException("Couldn't create directory for leveldb " +
>               "timeline store " + dbPath);
>         }
>         localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
>       }
>     } finally {
>       IOUtils.cleanupWithLogger(LOG, localFS);
>     } {code}
>  
> if node crash before setPermisson, then the permisison will be 755 forever
>  
> code should be like :
> {code:java}
>  try {
>       localFS = FileSystem.getLocal(conf);
>       if (!localFS.exists(dbPath)) {
>         if (!localFS.mkdirs(dbPath)) {
>           throw new IOException("Couldn't create directory for leveldb " +
>               "timeline store " + dbPath);
>         }
>         
>       }
>          if(!localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
>        localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
>  } 
> finally {
>       IOUtils.cleanupWithLogger(LOG, localFS);
>     } {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org