From: Jaegeuk Kim Subject: Re: f2fs xattr and SELinux Date: Wed, 04 Dec 2013 17:02:28 +0900 Message-ID: <1386144148.2417.144.camel@kjgkr> References: <29495453.293471385942943622.JavaMail.weblogic@epv6ml06> <529E0745.70900@codeaurora.org> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "linux-fsdevel@vger.kernel.org" To: Konstantin Dorfman Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:50739 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753484Ab3LDIDd (ORCPT ); Wed, 4 Dec 2013 03:03:33 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MX9002KRVPRRB30@mailout2.samsung.com> for linux-fsdevel@vger.kernel.org; Wed, 04 Dec 2013 17:03:27 +0900 (KST) In-reply-to: <529E0745.70900@codeaurora.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, The following patch is to support security labels. commit 8ae8f1627f39bae505b90cade50cd8a911b8bda6 Author: Jaegeuk Kim Date: Mon Jun 3 19:46:19 2013 +0900 f2fs: support xattr security labels Please use the latest f2fs source codes. Thanks, =20 This patch adds the support of security labels for f2fs, which will be used by Linus Security Models (LSMs). =20 Quote from http://en.wikipedia.org/wiki/Linux_Security_Modules: "Linux Security Modules (LSM) is a framework that allows the Linux kernel to support a variety of computer security models while avoiding favoritism toward any single security implementation. The framework is licensed under the terms of the GNU General Public License and is standard part of the Linux kernel since Linux 2.6. AppArmor, SELinux, Smack and TOMOYO Linux are the currently accepted modules in the official kernel.". =20 Signed-off-by: Jaegeuk Kim 2013-12-03 (=ED=99=94), 18:31 +0200, Konstantin Dorfman: > Hello all, >=20 > As I can see from the code of system/extras/ext4_utils/make_ext4fs.c = (it=20 > is utility to create android ext4 images from Google): > ... > ret =3D inode_set_selinux(entry_inode, dentries[i].secon); > if (ret) > error("failed to set SELinux context on %s\n", dentries[i].path= ); > ... >=20 > This utility creates security context per file on target filesystem,=20 > while running in userspace. > I'm looking for similar process for f2fs filesystem. Probably this=20 > process will create seclabel configuration for F2FS. >=20 > Any ideas? >=20 > Thanks, > Kostya >=20 > On 12/02/2013 02:09 AM, Jaegeuk Kim wrote: > > Hi, > > > > Could you check the config of F2FS? > > There should be a seclabel config. > > Thanks, > > > > > > ------- Original Message ------- > > Sender : Konstantin Dorfman > > Date : 2013-12-02 02:09 (GMT+09:00) > > Title : f2fs xattr and SELinux > > > > Hi all, > > > > I'm trying to use f2fs xattr with SELinux (on android) and getting > > following error: > > > > root# restorecon -Rv /data > > Relabeling /data from u:object_r:unlabeled:s0 to > > u:object_r:system_data_file:s0. > > Could not label /data with u:object_r:system_data_file:s0: Operatio= n not > > supported on transport endpoint > > > > Also, output of `ls -Z` command (all files/dirs are unlabeled): > > > > root# ls -Z /data > > drwxrwx--x system system u:object_r:unlabeled:s0 app > > drwxr-x--x root root u:object_r:unlabeled:s0 app_t= ests > > drwxr-x--x root root u:object_r:unlabeled:s0 audio= -encode > > drwxr-x--x root root u:object_r:unlabeled:s0 busyb= ox > > drwxrwx--x system system u:object_r:unlabeled:s0 conne= ctivity > > drwxr-x--x root root u:object_r:unlabeled:s0 data_= test > > drwxr-x--x root root u:object_r:unlabeled:s0 evt-t= est > > drwxr-x--x root root u:object_r:unlabeled:s0 fstes= t > > drwxr-x--x root root u:object_r:unlabeled:s0 gps-t= est > > drwxr-x--x root root u:object_r:unlabeled:s0 graph= ics_tests > > drwxr-x--x root root u:object_r:unlabeled:s0 > > instrumentation_tests > > drwxr-x--x root root u:object_r:unlabeled:s0 kerne= l-tests > > drwxrwx--- root root u:object_r:unlabeled:s0 lost+= found > > drwxrwx--- media_rw media_rw u:object_r:unlabeled:s0 media > > > > mount output is: > > /dev/block/bootdevice/by-name/userdata /data f2fs > > rw,nosuid,nodev,relatime,background_gc_on,discard,user_xattr,acl,ac= tive_logs=3D6 > > 0 0 > > > > Any comments/ideas about why xattr is not working for me on f2fs? > > > > Thanks, > > Kostya > > >=20 >=20 --=20 Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html