Skip to contentSkip to conversation

SELinux context not working

DISCUSSION Brian Chadwick 3 participants 7 messages Jun 19, 2014 – Jun 22, 2014 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems

#1 lore raw

Hi,

Quoted 12 lines · Brian Chadwick

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

Quoted 8 lines

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

IMO, you missed -o seclabel.

Thanks,

Quoted 15 lines

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Signature · 12 lines
Jaegeuk Kim

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi,

Quoted 7 lines · Brian Chadwick

Hi again

I tried mounting with seclabel specifically stated, i.e.:

mount -t f2fs -o rw,relatime,background_gc=on,seclabel,user_xattr,acl,active_logs=6

Quoted 7 lines

The drive mounts successfully but seclabel is not listed as a mount option when I use the mount command to list mounted devices and once again file contexts don't work.

I am using the latest util-linux .. ie 2.24.2

Any clues?

If so, I suspect your sepolicy.
Could you give me the following results?

# dmesg | grep SELinux

Thanks,

Quoted 47 lines

Thanks

Brian

Quoted 41 lines · Jaegeuk Kim

Hi,

Quoted 12 lines · Brian Chadwick

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

Quoted 8 lines

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

IMO, you missed -o seclabel.

Thanks,

Quoted 14 lines

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Signature · 12 lines
Jaegeuk Kim

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#4 lore raw
Quoted 4 lines · Jaegeuk Kim
Quoted 1 line

Any clues?

If so, I suspect your sepolicy.
Could you give me the following results?

I was stuck until:
https://android-review.googlesource.com/#/c/96593/

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Hi,

Quoted 23 lines · Brian Chadwick
Quoted 22 lines · Jaegeuk Kim

Hi,

Quoted 7 lines · Brian Chadwick

Hi again

I tried mounting with seclabel specifically stated, i.e.:

mount -t f2fs -o rw,relatime,background_gc=on,seclabel,user_xattr,acl,active_logs=6

Quoted 7 lines

The drive mounts successfully but seclabel is not listed as a mount option when I use the mount command to list mounted devices and once again file contexts don't work.

I am using the latest util-linux .. ie 2.24.2

Any clues?

If so, I suspect your sepolicy.
Could you give me the following results?

# dmesg | grep SELinux
Quoted 8 lines
Quoted 1 line

Thanks,

the pertinent result is:

[12192.972271] SELinux: initialized (dev sda6, type f2fs), not

configured for labeling

What do I need to add to SELinux?

Just for sure, you need to check the JP's reference.

Thanks,

Quoted 48 lines
Quoted 48 lines
Quoted 48 lines

Thanks

Brian

Quoted 41 lines · Jaegeuk Kim

Hi,

Quoted 12 lines · Brian Chadwick

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

Quoted 8 lines

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

IMO, you missed -o seclabel.

Thanks,

Quoted 14 lines

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Signature · 12 lines
Jaegeuk Kim

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 33 lines · Brian Chadwick
Quoted 32 lines · Jaegeuk Kim

Hi,

Quoted 29 lines · Brian Chadwick
Quoted 16 lines · Jaegeuk Kim

Hi,

Quoted 13 lines · Brian Chadwick

Hi again

I tried mounting with seclabel specifically stated, i.e.:

mount -t f2fs -o rw,relatime,background_gc=on,seclabel,user_xattr,acl,active_logs=6

The drive mounts successfully but seclabel is not listed as a mount option when I use the mount command to list mounted devices and once again file contexts don't work.

I am using the latest util-linux .. ie 2.24.2

Quoted 7 lines
Quoted 1 line

Any clues?

If so, I suspect your sepolicy.
Could you give me the following results?

# dmesg | grep SELinux

Thanks,

the pertinent result is:

[12192.972271] SELinux: initialized (dev sda6, type f2fs), not

configured for labeling

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What do I need to add to SELinux?

Just for sure, you need to check the JP's reference.

Thanks,

What is the JP's reference?

As JP replied to you, the link was

https://android-review.googlesource.com/#/c/96593/

Thanks,

Quoted 51 lines

Thanks

Quoted 48 lines
Quoted 48 lines
Quoted 48 lines
Quoted 48 lines

Thanks

Brian

Quoted 41 lines · Jaegeuk Kim

Hi,

Quoted 12 lines · Brian Chadwick

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

Quoted 8 lines

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

IMO, you missed -o seclabel.

Thanks,

Quoted 14 lines

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Signature · 12 lines
Jaegeuk Kim

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Hi,

Quoted 38 lines · Brian Chadwick
Quoted 37 lines · Jaegeuk Kim
Quoted 36 lines · Brian Chadwick
Quoted 35 lines · Jaegeuk Kim

Hi,

Quoted 23 lines · Brian Chadwick
Quoted 22 lines · Jaegeuk Kim

Hi,

Quoted 7 lines · Brian Chadwick

Hi again

I tried mounting with seclabel specifically stated, i.e.:

mount -t f2fs -o rw,relatime,background_gc=on,seclabel,user_xattr,acl,active_logs=6

Quoted 7 lines

The drive mounts successfully but seclabel is not listed as a mount option when I use the mount command to list mounted devices and once again file contexts don't work.

I am using the latest util-linux .. ie 2.24.2

Any clues?

If so, I suspect your sepolicy.
Could you give me the following results?

# dmesg | grep SELinux
Quoted 7 lines
Quoted 1 line

Thanks,

the pertinent result is:

[12192.972271] SELinux: initialized (dev sda6, type f2fs), not

configured for labeling

What do I need to add to SELinux?

Just for sure, you need to check the JP's reference.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

Thanks,

What is the JP's reference?

As JP replied to you, the link was

https://android-review.googlesource.com/#/c/96593/

that link mentions "ocontext" ... i have no idea what that is .. i have googled to no avail

You need to use a mount option for selinx context. e.g., -o context=system_u:object_r:var_log_t

This is because the default sepolicy doesn't include f2fs as their fscontext.

Ref: http://www.redhat.com/f/pdf/whitepapers/Filesystem_Labeling_SELinux.pdf

Thanks,

Quoted 55 lines

thanks

Quoted 51 lines

Thanks,

Quoted 48 lines

Thanks

Quoted 46 lines
Quoted 46 lines
Quoted 46 lines
Quoted 46 lines

Thanks

Brian

Quoted 41 lines · Jaegeuk Kim

Hi,

Quoted 12 lines · Brian Chadwick

Hi

I cant get file contexts to work with F2FS. I have tried a variety of kernels up to the latest 3.16rc1 with the Security Labels option selected in the config. I am using the latest git of f2fs-tools.

But when I try to set a security context I get the following:

chcon: failed to change context of ‘/mnt/f2fs/sig’ to ‘system_u:--reference=/home/brian/sig:unlabeled_t:s0’: Operation not supported

Quoted 8 lines

cp -a also seems unable to set the correct context.

Is there a bug or am I missing something?

mount details are:

/dev/sda6 on /mnt/f2fs type f2fs (rw,relatime,background_gc=on,user_xattr,acl,active_logs=6)

IMO, you missed -o seclabel.

Thanks,

Quoted 14 lines

Kind regards

Brian Chadwick

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Signature · 12 lines
Jaegeuk Kim

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel