Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24F4B18D38 for ; Fri, 4 Mar 2016 11:59:46 +0000 (UTC) Received: (qmail 47583 invoked by uid 500); 4 Mar 2016 11:59:40 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 47530 invoked by uid 500); 4 Mar 2016 11:59:40 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 47508 invoked by uid 99); 4 Mar 2016 11:59:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 11:59:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BC6392C1F58 for ; Fri, 4 Mar 2016 11:59:40 +0000 (UTC) Date: Fri, 4 Mar 2016 11:59:40 +0000 (UTC) From: "Costin Leau (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-9875) HDFS client requires compromising permission when running under JVM security manager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15179789#comment-15179789 ] Costin Leau commented on HDFS-9875: ----------------------------------- Sure. I've forked the 2.8 branch on github; change is available as a [PR|https://github.com/costin/hadoop/pull/1], [diff|https://patch-diff.githubusercontent.com/raw/costin/hadoop/pull/1.diff] and [patch|https://patch-diff.githubusercontent.com/raw/costin/hadoop/pull/1.patch]. Thanks, > HDFS client requires compromising permission when running under JVM security manager > ------------------------------------------------------------------------------------ > > Key: HDFS-9875 > URL: https://issues.apache.org/jira/browse/HDFS-9875 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client, security > Affects Versions: 2.7.2 > Environment: Linux > Reporter: Costin Leau > > HDFS _client_ requires dangerous permission, in particular _execute_ on _all files_ despite only trying to connect to an HDFS cluster. > A full list (for both Hadoop 1 and 2) is available here along with the place in code where they occur. > While it is understandable for some permissions to be used, requiring {{FilePermission <> execute}} to simply initialize a class field [Shell|https://github.com/apache/hadoop/blob/0fa54d45b1cf8a29f089f64d24f35bd221b4803f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java#L728] which in the end is not used (since it's just a client) simply *compromises* the entire security system. > To make matters worse, the code is executed to initialize a field so in case the permissions is not granted, the VM fails with {{InitializationError}} which is unrecoverable. > Ironically enough, on Windows this problem does not appear since the code simply bypasses it and initializes the field with a fall back value ({{false}}). > A quick fix would be to simply take into account that the JVM {{SecurityManager}} might be active and the permission not granted or that the external process fails and use a fall back value. > A proper and long-term fix would be to minimize the use of permissions for hdfs client since it is simply not required. A client should be as light as possible and not have the server requirements leaked onto. -- This message was sent by Atlassian JIRA (v6.3.4#6332)