Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp71379imm; Thu, 27 Sep 2018 16:13:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV60BBZaVmpc9/6PWjkeorzBl2E0UEs1yyk3W6kamOEY/BsxkHxb0s/Cg84NRm+SeyTlZggCW X-Received: by 2002:a63:1342:: with SMTP id 2-v6mr12347671pgt.19.1538090013900; Thu, 27 Sep 2018 16:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538090013; cv=none; d=google.com; s=arc-20160816; b=zaoYv3Z9H9yrtfQ9vPMheg3Tbh8/G7cMP7Tn14nhyRgorJIYgiUUVzK3dP7g3xsLKv JwOOgvWAvqwLgYB1GVLiJnSfVThAp+hfRUTp8sST4LpjaSH2Yp/M38jSHrzxHEtt3pGt p9Qr/ckM1TtUWXDoq2oLDJJSeE8W8vPTkEa36B2mCyqLdnohC4jopLMHVHRsntAJ1lZ5 fo57jx1HwFAtT8gtU/sI8eJEgnTaOlDS3ssLTrGATW9ORjOSD/eVShALh5Ka7pbh8WUc fIPyU+AvBzZPDOkpanxZNUDhag+LuuCueK/2ENTiYkkMdJp4oqQVzaMJqT9SOyfaGaNH Z9Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qkyLnr+1KPshBxsBP2BHK/UPsCSeUDxVmWoxzdWGkuc=; b=ifkpt0Ef+glVRxO6phzRYizHfACPBNLeZRa+6I5Z+/nxBp/ZG+sG42fvIIlzdB4JQs GP/NJXv8W2Sn7/HbeS9dVbcDzKvnsSYmSNiY139pl8EcCAsb+0Kj04i0HTLWjbbWuCla zLeTNEJld7f48xaQJZ8cUexJuVfIMue8yXIwrE0gR1IKHKNZwe+1ZNXFRphOEegc9moh BKPapU7cFUL/oQGjkr+X+91pBrPh0ng+2gXE3mXIjk++x0bmWVo3I87cjH99uhctNhJo QsoYOGwEFsg4MYBn0TsEUiDpskmJgi53sS1770ubyxdw/BfEBVzulNHKqOyz10wOJxsr BDgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u64-v6si3078846pgu.533.2018.09.27.16.13.17; Thu, 27 Sep 2018 16:13:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbeI1Fdx (ORCPT + 99 others); Fri, 28 Sep 2018 01:33:53 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:15475 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbeI1Fdx (ORCPT ); Fri, 28 Sep 2018 01:33:53 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w8RNCkRw033719; Fri, 28 Sep 2018 08:12:46 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Fri, 28 Sep 2018 08:12:46 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157066051.bbtec.net [60.157.66.51]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w8RNCfYR033700 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Sep 2018 08:12:46 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: Re: Leaking Path in XFS's ioctl interface(missing LSM check) To: Dave Chinner , James Morris Cc: Alan Cox , TongZhang , darrick.wong@oracle.com, linux-xfs@vger.kernel.org, LKML , linux-security-module@vger.kernel.org, Wenbo Shen References: <5EF0D46A-C098-4B51-AD13-225FFCA35D4C@vt.edu> <20180926013329.GD31060@dastard> <20180926192426.472360ea@alans-desktop> <20180927013812.GF31060@dastard> <20180927221948.GH31060@dastard> From: Tetsuo Handa Message-ID: <43032103-99c5-88ae-5aa1-a7906e059a8b@I-love.SAKURA.ne.jp> Date: Fri, 28 Sep 2018 08:12:41 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180927221948.GH31060@dastard> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/09/28 7:19, Dave Chinner wrote:> IOWs, the security_file_ioctl() hook is almost completely useless in > cases like this - you can't isolate the ioctl based on the file > argument, because it can point to any file or directory in the > filesystem. And without actually parsing, decoding and instantiating > the the ioctl arguments, you can't tell the ioctl it can't act on > specific targets. And because filehandle to dentry resolution > results in disconnected dentries, the paths are not complete and > hence path based security checks (e.g. tomoyo) are likely to be > broken and unfixable... Though TOMOYO uses pathname as a mandatory parameter, CaitSith (currently waiting for review) does not. CaitSith can filter filesystem specific ioctl() using fsmagic and cmd parameter like: 10 acl ioctl path.fsmagic=0x9FA0 audit 0 10 deny cmd=@FORBIDDEN_IOCTLS_ON_PROCFS 20 allow CaitSith does ioctl() checks. Missing LSM check is a bug.