All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Joshua Brindle <method@manicmethod.com>,
	SELinux <selinux@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>
Subject: Re: Fixfiles using new setfiles/restorecon simplification
Date: Fri, 26 Feb 2010 15:52:36 -0500	[thread overview]
Message-ID: <4B883494.2070400@redhat.com> (raw)
In-Reply-To: <1267217234.9997.85.camel@moss-pluto.epoch.ncsc.mil>

On 02/26/2010 03:47 PM, Stephen Smalley wrote:
> On Fri, 2010-02-26 at 15:25 -0500, Daniel J Walsh wrote:
>    
>> On 02/26/2010 03:16 PM, Stephen Smalley wrote:
>>      
>>> On Fri, 2010-02-26 at 13:12 -0500, Daniel J Walsh wrote:
>>>
>>>        
>>>> On 02/26/2010 09:36 AM, Stephen Smalley wrote:
>>>>
>>>>          
>>>>> On Fri, 2010-02-26 at 09:23 -0500, Daniel J Walsh wrote:
>>>>>
>>>>>
>>>>>            
>>>>>> On 02/26/2010 09:10 AM, Stephen Smalley wrote:
>>>>>>
>>>>>>
>>>>>>              
>>>>>>> On Fri, 2010-02-26 at 08:41 -0500, Daniel J Walsh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>>>> On 02/25/2010 08:41 PM, Joshua Brindle wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                  
>>>>>>>>> What version of the kernel was this added in? I don't want to
>>>>>>>>> completely break old kernels using new toolchains (CLIP backports
>>>>>>>>> toolchains to RHEL 4 and 5). It would be better to use seclabel if it
>>>>>>>>> is there, otherwise fall back to the old list.
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>>> This message was distributed to subscribers of the selinux mailing list.
>>>>>>>>> If you no longer wish to subscribe, send mail to
>>>>>>>>> majordomo@tycho.nsa.gov with
>>>>>>>>> the words "unsubscribe selinux" without quotes as the message.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                    
>>>>>>>> The problem with this is we end up with a lot of cruft in the toolchain,
>>>>>>>> that is continually out of data, and makes it hard to figure out what
>>>>>>>> the script is doing.  We have older versions of the tool chain for those
>>>>>>>> platforms, shouldn't we have sort of the latest toolchain.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                  
>>>>>>> If we do that, we ought to make a major bump in the version numbers,
>>>>>>> e.g. finally go to 2.1 or 3.0 or something, and make sure the release
>>>>>>> announcement clearly marks it as not backward compatible.
>>>>>>>
>>>>>>> With regard to fixfiles simplification though, can't we eliminate the
>>>>>>> need to define or use FILESYSTEMS* altogether in the script by switching
>>>>>>> all uses of setfiles to restorecon -R /, since that will automatically
>>>>>>> skip non-labeled filesystems on kernels>= 2.6.30?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>> It will still walk on read/only file systems.
>>>>>>
>>>>>>
>>>>>>              
>>>>> That should be fairly easy to fix in setfiles given that we are already
>>>>> reading /proc/mounts - we can just add exclude on any ro mounts.
>>>>>
>>>>>
>>>>>
>>>>>            
>>>> How about this patch to remove ro mount points from setfiles/restorecon
>>>>
>>>>          
>>> Your logic depends on the option order - if "seclabel" appears first,
>>> then you'll break out of the loop and never see the "ro".  If we are ok
>>> with that assumption (which happens to be true at present,
>>> but /proc/mounts format is not guaranteed to remain stable), then it is
>>> ok but then there is no reason to set found to 0 (already initialized to
>>> 0).  If we want to be robust against ordering changes, we'd need to drop
>>> the break; from the seclabel case and keep scanning to check for any
>>> subsequent "ro" options.  Or you could just use strstr() on the entire
>>> mount_info[3] and not worry about splitting it into tokens.
>>>
>>>
>>>        
>> No I removed the break after finding seclabel, and set found to 0 if ro
>> is found.
>>
>> So it will either search the entire structure for seclabel or break out
>> with ro.
>>
>>
>> +            if (strcmp(item, "ro") == 0) {
>> +                found = 0;
>> +                break;
>> +            }
>>                if (strcmp(item, "seclabel") == 0) {
>>                    found = 1;
>> -                break;
>>                }
>>
>>      
> Actually, given your other comment, I guess we can't do it this way, as
> if they have e.g. read-only root with writable mounts underneath, we'll
> never reach them.
>
>    
We have that problem with or without this patch.  Since no seclabel is 
the same problem.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2010-02-26 20:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 20:46 Fixfiles using new setfiles/restorecon simplification Daniel J Walsh
2010-02-26  1:41 ` Joshua Brindle
2010-02-26 12:56   ` Stephen Smalley
2010-02-26 13:41   ` Daniel J Walsh
2010-02-26 14:10     ` Stephen Smalley
2010-02-26 14:23       ` Daniel J Walsh
2010-02-26 14:36         ` Stephen Smalley
2010-02-26 18:12           ` Daniel J Walsh
2010-02-26 20:16             ` Stephen Smalley
2010-02-26 20:25               ` Daniel J Walsh
2010-02-26 20:33                 ` Stephen Smalley
2010-02-26 20:47                 ` Stephen Smalley
2010-02-26 20:52                   ` Daniel J Walsh [this message]
2010-02-26 20:57                     ` Stephen Smalley
2010-02-26 21:04                       ` Daniel J Walsh
2010-02-26 17:56 ` Stephen Smalley
2010-02-26 18:36   ` Daniel J Walsh
2010-02-26 18:59   ` Daniel J Walsh
2010-02-26 20:49     ` Stephen Smalley
2010-02-26 21:14       ` Daniel J Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B883494.2070400@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=method@manicmethod.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.