Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2897246imm; Sun, 30 Sep 2018 07:18:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV636cVl51e1Gcb82dS0RP5oB4bIR3LTydP2/dZdC0hjMgGxDQRqlAkDYafzJHLdt9LqTsSH6 X-Received: by 2002:a17:902:6b83:: with SMTP id p3-v6mr7580914plk.133.1538317110721; Sun, 30 Sep 2018 07:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538317110; cv=none; d=google.com; s=arc-20160816; b=DuTRggYfPRzeRSaqAFEtinzbmvMMvc0VbkFN2WmyVtOE2bkxI1jP/pXjCwsB34OECn 8m1VQ4AXtELzYl+bwy4y/u+rfH/xBG97c52N104LEgMMqKYugFsL8YALTp8lsOtM8ZxZ 10FPdCBcBz7upavweoAX/fnAhb+aQvHxj3kyK2/rsPUxAoEIHEnYBLAfDpoqLBi6wJ+a etD70dDkaZWv8MLhMoomTKeRGrIFgEA1uTv7apYw5m2TSixDnDULUtGDVGIPu51bPuWw 7RTYHc5LfpQRBOVcGhkWYmtdNM85ZprRzi5iCpQZwL+B9DCpIiJf/xxehox/MkU0eXiI adhQ== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=CuolveQEs/HweGOhEPPxad2iqRwoQSIcujyOpKIzczs=; b=mu9p7SW1+OZ5+Nr6APUPg45utckrTRln19CNKg9DvnjtUduD62s8ImI6qNDYUDFdFm NABZqPxGyZO2PqHeWuu8E10U6oMyZD782SVnS9my/qmm+2aQxdQf7K577Ikm1vsfZ0Dw uYeEGj9gbsNHjbh3niI0XPKZvbKZTXzs5KDRHkU+6QVZUAFoLMifZuKoOsJUekOIbM8F Lr3yihQcgXkB/AKnPCbf/CzAwulEBKo+wJfvL1K5O3KDF0pJI6Yq/dEUMD6e+DsLnlN+ qnAHfsik4SAw+FjbOeTG3blEH0CT1OPAn+6lIYuweft9tfH01b5NbxOS9XuSJA16TzCR gyYQ== 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 p62-v6si10653085pfj.30.2018.09.30.07.18.16; Sun, 30 Sep 2018 07:18:30 -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 S1728600AbeI3UuP (ORCPT + 99 others); Sun, 30 Sep 2018 16:50:15 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:40482 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727630AbeI3UuP (ORCPT ); Sun, 30 Sep 2018 16:50:15 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id w8UEGrRI013399; Sun, 30 Sep 2018 15:16:53 +0100 Date: Sun, 30 Sep 2018 15:16:52 +0100 From: Alan Cox To: Dave Chinner Cc: TongZhang , darrick.wong@oracle.com, linux-xfs@vger.kernel.org, LKML , linux-security-module@vger.kernel.org, Wenbo Shen Subject: Re: Leaking Path in XFS's ioctl interface(missing LSM check) Message-ID: <20180930151652.6975610c@alans-desktop> In-Reply-To: <20180927013812.GF31060@dastard> References: <5EF0D46A-C098-4B51-AD13-225FFCA35D4C@vt.edu> <20180926013329.GD31060@dastard> <20180926192426.472360ea@alans-desktop> <20180927013812.GF31060@dastard> Organization: Intel Corporation X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > CAP_SYS_ADMIN is also a bit weird because low level access usually > > implies you can bypass access controls so you should also check > > CAP_SYS_DAC ? > > Do you mean CAP_DAC_READ_SEARCH as per the newer handle syscalls? > But that only allows bypassing directory search operations, so maybe > you mean CAP_DAC_OVERRIDE? It depends what the ioctl allows you to do. If it allows me to bypass DAC and manipulate the file system to move objects around then it's a serious issue. The underlying problem is if CAP_SYS_ADMIN is able to move objects around then I can move modules around. We already have a problem with CAP_DAC_OVERRIDE giving you CAP_SYS_RAWIO (ie totally owning the machine) unless the modules are signed, if xfs allows ADMIN as well then CAP_SYS_ADMIN is much easier to obtain and you'd get total system ownership from it. Not good. > Regardless, this horse bolted long before those syscalls were > introduced. The time to address this issue was when XFS was merged > into linux all those years ago, back when the apps that run in > highly secure restricted environments that use these interfaces were > being ported to linux. We can't change this now without breaking > userspace.... That's what people said about setuid shell scripts. I'd like to understand better what can be done. We can argue afterwards about what if anything to do about it and if it is possible to abuse it. Alan