From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751235AbdFBTA3 (ORCPT ); Fri, 2 Jun 2017 15:00:29 -0400 Received: from nm20-vm4.bullet.mail.ne1.yahoo.com ([98.138.91.180]:39958 "EHLO nm20-vm4.bullet.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbdFBTA1 (ORCPT ); Fri, 2 Jun 2017 15:00:27 -0400 X-Yahoo-Newman-Id: 252295.45275.bm@smtp211.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: b11D8rwVM1kuat3Hlf3DgHfLTEcXu7vAySjY8FmO0DYaGoB jBgxUhxjZWHMKxsqNBMlxSFGv2C8IXpLaxZgEyjVidsDidRqLYrsWuyV4awm ml.lwGm8XHRLWRVqQzyF_ibidf30HdDqzf9OeGDBKgSvHfiTzBJL1gVBzKWf 4w6Y_cC432O_DtfPVh01fz5kp0ANlOm33VaSM6NA0snNpkgUtpd2aQyOZ1ms hfDKFK7geIGaOStyMOnPiOzycAPixKxTdq1vQJ.jRtkPrB9InApTmSgsuker EOcZl013Vx9wYh2ioK.vZ7YN4dnNDu6OhJmFcRAcSVhJWUPECX4loVbNfDIl IH1p.LyVY2exSEjWshfLkMu925fUVbsBr93CAjnBiMgeDQj5BrPMWBQmjncA SfWYUjUtv2YpGlMfJNvRbVx.av2Amb6n4Rmb20vrl36kPuN9.myZdSOuaDae qnhbm9JjsD0ZyhrVMilcZGBmvw.kQnNyEMEO67jbe85guELNORveUT5r5ObO 75MZGyU_QZ1LZTbBmS6pfdscaZv2wGOfW4Gp6z7Qh8.00ktlvY9PUu1WUpEG 5Y2Xk X-Yahoo-SMTP: OIJXglSswBDfgLtXluJ6wiAYv6_cnw-- Subject: Re: [RFC 0/3] WhiteEgret LSM module To: Steve Kemp Cc: linux-security-module , linux-kernel References: <20170530111157.5196-1-masanobu2.koike@toshiba.co.jp> <20170530205002.GA9841@srcf.ucam.org> <0e0aa575-263a-893a-7ade-f2dc7ce679c2@schaufler-ca.com> From: Casey Schaufler Message-ID: Date: Fri, 2 Jun 2017 12:00:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/2/2017 10:39 AM, Steve Kemp wrote: >> Create an security module that looks for the attribute > For what it is worth I thought this seemed like an interesting project > for a beginner, so I did just that. I wrote up the experience here: > > https://blog.steve.fi/so_i_accidentally_wrote_a_linux_security_module.html > > In short it was a very simple and clean approach, which I think is > hard to get wrong. The only part I need to work on some more is the > difference between `user` and `security` attributes. A 'user' attribute can be set by the file owner. A 'security' attribute requires privilege. SELinux and Smack use 'security' attributes to prevent users from mucking with them. You need to create module hooks for manipulating them, including inode_init_security inode_setxattr inode_post_setxattr inode_removexattr inode_getsecurity inode_listsecurity inode_setsecurity d_instantiate > > Steve > -- > https://steve.fi/ >