hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Brennan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-8207) Docker container launch use popen have risk of shell expansion
Date Tue, 01 May 2018 20:52:00 GMT

    [ https://issues.apache.org/jira/browse/YARN-8207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16460139#comment-16460139

Jim Brennan commented on YARN-8207:

[~eyang], I spent a little time looking at this one today. Didn't get too far, but here are
few comments.

 * (nit) add_to_buffer() funxction name doesn't seem to fit anymore, maybe add_to_arglist()? 
 * free_buffer() - should set argv->out[i] = NULL after freeing.
 * (nit) struct argv is a confusing name because of the standard main() char **argv param
- maybe struct arglist, or something like that?
 * get_docker_volume_command()
 ** looks like 'docker' is never freed.
 ** (nit) make_string() is a nice abstraction, but all those little alloc/frees seems expensive.
 ** (nit) add_mounts() - you can put the free(mount_src) at the end inside an if !NULL instead
of calling it in every condition.
 ** reset() is a very generic name for a global function - also if this is limited to DOCKER_ARG_MAX
entries, why isn't it just a fixed array of char*?  If you are going to malloc it, why not
support auto-resizing of it?

> Docker container launch use popen have risk of shell expansion
> --------------------------------------------------------------
>                 Key: YARN-8207
>                 URL: https://issues.apache.org/jira/browse/YARN-8207
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: yarn-native-services
>            Reporter: Eric Yang
>            Assignee: Eric Yang
>            Priority: Major
>         Attachments: YARN-8207.001.patch, YARN-8207.002.patch, YARN-8207.003.patch
> Container-executor code utilize a string buffer to construct docker run command, and
pass the string buffer to popen for execution.  Popen spawn a shell to run the command.  Some
arguments for docker run are still vulnerable to shell expansion.  The possible solution is
to convert from char * buffer to string array for execv to avoid shell expansion.

This message was sent by Atlassian JIRA

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

View raw message