Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754598AbbEZQmq (ORCPT ); Tue, 26 May 2015 12:42:46 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:45423 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbbEZQmk (ORCPT ); Tue, 26 May 2015 12:42:40 -0400 X-AuditID: cbfec7f5-f794b6d000001495-ac-5564a27cd261 Message-id: <1432658555.1974.26.camel@samsung.com> Subject: Re: [PATCH v2 0/7] Smack namespace From: Lukasz Pawelczyk To: Stephen Smalley Cc: "David S. Miller" , "Eric W. Biederman" , "Kirill A. Shutemov" , "Serge E. Hallyn" , Al Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Casey Schaufler , David Howells , Fabian Frederick , Greg KH , James Morris , Jeff Layton , Jingoo Han , Joe Perches , John Johansen , Jonathan Corbet , Kees Cook , Mauro Carvalho Chehab , Miklos Szeredi , Oleg Nesterov , Paul Moore , Tetsuo Handa , Zefan Li , Rafal Krypa , linux-doc@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, containers@lists.linux-foundation.org, Lukasz Pawelczyk Date: Tue, 26 May 2015 18:42:35 +0200 In-reply-to: <5564A088.4040507@tycho.nsa.gov> References: <1432209222-8479-1-git-send-email-l.pawelczyk@samsung.com> <1432557162-19123-1-git-send-email-l.pawelczyk@samsung.com> <556484BD.2060004@tycho.nsa.gov> <1432657655.1974.21.camel@samsung.com> <5564A088.4040507@tycho.nsa.gov> Content-type: text/plain; charset=UTF-8 X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) MIME-version: 1.0 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUzMcRzHfe/3cL+7ufk5yVdtrNuaDZHmjw+ZNZv1y/NMs/zD6X6uuLty V3oY26GjXXpw/YHrkopwXUJqSOUKNaHSlkKd9IxK9KQkd8XWf6/P3q/3Pp8/PgwhTaM8mHBN FK/VyFUyWkzW/qlu8jmZowj2TW0EuHR6G1gKbTS0lUzQYMvro6Hz6XkElroEEgbOTJIwXZIg BOPkLxrO5hbSMP11NaR07IXG7LcU2MYdCDIcHSTUDBtoeJWkBtvFbAKKxhJpyD53nYTGxxYa vl/4TIMpMVkI+QV6CvK7Y6G79B4BxRUGBB9Ml0jISBigoN90i4Cq0lwC6urfCKFuqpoK8OIc 36ZIzqxPprkMfQPJPbjdIuAemVuFXFNpCJfwrJ/iHhVYBVzN5UmSq8i0Cbn05puIy01Jp7ih rvfOQqrTLSjrRdywtYnY43lAvEnBq8JP8Nq1mw+Jw9rvGFBkxfzYsw21SI/6RUYkYjC7Hn/p sQtn2R3XtxXSRiRmpOwNhO8YRv4NPxEe7TMSLkvC+uHBJ0MCFy9iV+HmqjLKxTTri8fqy2Yc N3YFzuu5jFxlgnWIcGeKeSYgWW+c9PIHcrGI9cHlA70zLGWHEDZ8PeJiwlk2Xc1x+ozzpNW4 pUUxu3chHk9vI2eV5bjI1k+kIdY8p2Geo5nnaNcQYUWL+ejQSN1hpdpvjU6u1kVrlGtCI9T3 0eyfjDxEN15srEQsg2TzJVAVGiyl5Cd0cepKhBlC5iY5lakIlkoU8rh4XhtxUBut4nWVyJMh ZUskVx4P7pOySnkUf4znI3nt/1TAiDz0SPN7IsqiKf9YE3x8h927fftO/3f7vz2v2GWytmYt XLfgblByc2B8UBYybJl3wC8kYHdPWles+0P/mOKMlk+j1M+jG5b57ao1dvDIP9mXjukAijyW W5nlaNhvVfq83lqsmhqj00WBfV5x7vp8u33pdq2HfWWiIGprIBqn3zRIDspIXZh83UpCq5P/ BaYa4rkjAwAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1806 Lines: 43 On wto, 2015-05-26 at 12:34 -0400, Stephen Smalley wrote: > > On wto, 2015-05-26 at 10:35 -0400, Stephen Smalley wrote: > >> On 05/25/2015 08:32 AM, Lukasz Pawelczyk wrote: > > > > I call the inode operation by hand in the post_setxattr. > > > > The label will effectively be set twice, which is not ideal, but there > > is no other option right now without reworking the hooks as you said. > > > > This shouldn't really be a problem because the Smack operations will not > > use the filesystem label (even when it's set incorrectly for a moment) > > but an already initialized smack_known structure for this inode that has > > all the values filled in properly. > > > > The only attack vector I can think of is hard rebooting the machine in a > > way that mapped label is really saved in the filesystem before the > > unmapped will have a chance. Should I be worried about that? This sounds > > a little unreal. > > If it were my security module, I would be worried about it. Even aside > from maliciously induced failure, you are leaving yourself open to > inconsistencies arising upon crashes. I would suggest modifying the > setxattr hook so that the security module can override the original > value/size pair with its own definition before it is passed to the inode > operation. There is already precedent in that security modules are > allowed to override the value/size returned by getxattr for security.*, > so this just makes them fully parallel. Will do. Thank you. -- Lukasz Pawelczyk Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/