From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: Karl MacMillan <kmacmillan@mentalrootkit.com>
Cc: Joshua Brindle <jbrindle@tresys.com>,
Mark Goldman <mgoldman@tresys.com>,
SE Linux <selinux@tycho.nsa.gov>,
Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: [patch 1/3] libsemanage: genhomedircon replacement
Date: Thu, 21 Jun 2007 16:54:54 -0400 [thread overview]
Message-ID: <467AE59E.2050501@tycho.nsa.gov> (raw)
In-Reply-To: <1182450900.11527.88.camel@localhost.localdomain>
Karl MacMillan wrote:
> On Thu, 2007-06-21 at 14:25 -0400, Joshua Brindle wrote:
>> Karl MacMillan wrote:
>>> On Thu, 2007-06-21 at 14:09 -0400, Joshua Brindle wrote:
>>>> Karl MacMillan wrote:
>>>>> On Thu, 2007-06-21 at 12:49 -0400, Joshua Brindle wrote:
>>>>>> Karl MacMillan wrote:
>>>>>>> On Tue, 2007-06-19 at 11:09 -0400, Joshua Brindle wrote:
>>>>>>>> Karl MacMillan wrote:
>>>>>>>>> On Fri, 2007-05-25 at 13:06 -0400, Joshua Brindle wrote:
>>>>>>>>>> Karl MacMillan wrote:
>>>>>>>>>>>> If you would like to move the list types out of policyrep and
>>>>>>>>>>>> into trunk, I'll be happy to use it. Otherwise it is out of
>>>>>>>>>>>> the scope of this patch.
>>>>>>>>>>>>
>>>>>>>>>>> Please rebase against the policyrep branch - we can then
>>>>>>>>>>> consider merging the list types and this patch to trunk if
>>>>>>>>>>> desired. I will NACK this patch if it contains the
>>>>> additional list types.
>>>>>>>>>> There aren't additional list types because there aren't any in
>>>>>>>>>> trunk. This has nothing to do with policyrep and doesn't break
>>>>>>>>>> ABI compatibility and should be in trunk. I hate this idea of
>>>>>>>>>> pushing everything into policyrep because its going to make it
>>>>>>>>>> that much harder to get good testing done and the source of
>>>>>>>>>> bugs will be harder to track down.
>>>>>>>>>>
>>>>>>>>> Ok.
>>>>>>>>>
>>>>>>>>>> If you are so insistent on using the list types in policyrep
>>>>>>>>>> why not port them to trunk so we can use them?
>>>>>>>>> That option is fine with me (and was one of my suggestions),
>>>>>>>>> though I don't have time to do the port right now. Can you or
>>>>>>>>> Mark send a patch pulling over the iterators and list?
>>>>>>>> I'm going to bring this back up because I think this patch is
>>>>>>>> important to get into upstream as a first step toward generic
>>>>>>>> label generation.
>>>>>>>>
>>>>>>> Can you tell me a little more about what you are thinking with
>>>>>>> this?
>>>>>>>
>>>>> ??
>>>>>
>>>> We need labels for various object managers (like policy server)
>>>> generated per user. For example, if you look back at the PoC apache
>>>> metapolicy you'll see some hardcoded labels like user_apache_types_t
>>>> and so on, these need to be generated for each user.
>>>>
>>>>
>>>>>>>> Since we aren't using the policyrep branch anymore and
>>>>>>>> libpolicyrep is going to be in c++ do you still have
>>>>>>>> reservations against this patch?
>>>>>>>>
>>>>>>> I'm still convinced about the maintenance long term and potential
>>>>>>> for errors. Have all of the implementation issues that James
>>>>>>> brought up been resolved? Remind me why this is better in C than
>>>>>>> in an external Python helper.
>>>>>>>
>>>>>> Its very hacky, we have to close the current transaction (from
>>>>>> within the library) so that genhomedircon can connect and get a
>>>>>> read lock on the newly created active store and then it modifies
>>>>>> the files outside of the module store, non-ideal in almost every
>>>>>> way.
>>>>>>
>>>>> Why does it need to get the read lock - why can't it be changed to
>>>>> take the sandbox location and work on that directly? Fixing that
>>>>> might be better long term as it seems advantageous to allow helper
>>>>> programs in general (for separation and least-privilege).
>>>>>
>>>> Work directly on the module store? The module store is a private
>>>> resource of libsemanage, applications should not modify it directly
>>>> outside of libsemanage.
>>> genhomedircon is part of libsemanage - it just runs in a
>>> separate process. IOW it is just an implementation detail.
>>>
>> Not to mention running a python interpreter from a library is pretty
>> lame.
>
> Why? It's less lame than doing this string manipulation in C if you ask
> me. Not to mention safer - the kind of string manipulation done for this
> is perhaps the biggest source of exploitable flaws in software.
I'm going to do the unthinkable and agree with Josh, I think the
solution to this is to write correct code, not to give up and use a
scripting language. I'm not a fan of the Python dependencies.
>
> [...]
>
>>> Think about a process to verify untrusted data (like modules)
>>> - it would be helpful to allow a separate process to examine
>>> that data. Yes things like semodule will have full access but
>>> allowing a lower-privileged process to handle some parts is desirable
>>> in my opinion.
>> We already have a facility to run external apps that can do that. In
>> semanage.conf just do:
>>
>> [verify module]
>> path=/some/path/to/checker
>> [end]
>>
>> Which has nothing to do with genhomedircon, genhomedircon is mutating
>> the store, we should not be providing a facility to let random programs
>> mutate the store arbitrarilly.
>
> My point (that seems to be getting lost) is that genhomedircon is not an
> arbitrary program. It's just part of libsemanage. Why shouldn't we allow
> separate processes to mutate the store if they are built-in to
> libsemanage?
Running helpers from a library is IMO a bad idea, because it's not easy
to completely insulate helper processes from the caller. Caller could
get unexpected results from an ill-timed wait(2) call for example, or
not be expecting strange things in its process tree.
--
Eamon Walsh <ewalsh@tycho.nsa.gov>
National Security Agency
--
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.
next prev parent reply other threads:[~2007-06-21 20:54 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 9:54 [patch 0/3] genhomedircon replacement in libsemanage jbrindle
2007-05-21 9:54 ` [patch 1/3] libsemanage: genhomedircon replacement jbrindle
2007-05-22 21:08 ` Karl MacMillan
2007-05-24 14:04 ` Mark Goldman
2007-05-24 14:45 ` Karl MacMillan
2007-05-24 15:44 ` Daniel J Walsh
2007-05-24 19:20 ` Mark Goldman
2007-05-25 15:52 ` Karl MacMillan
2007-05-25 17:06 ` Joshua Brindle
2007-05-26 0:02 ` Karl MacMillan
2007-05-29 20:25 ` audit2allow module generation Anand Patel
2007-05-29 21:11 ` Karl MacMillan
2007-05-30 14:44 ` Anand Patel
2007-05-31 16:05 ` Karl MacMillan
2007-06-08 15:36 ` Karl MacMillan
2007-06-11 13:47 ` Anand Patel
2007-08-30 13:43 ` Anand Patel
2007-09-03 16:13 ` Karl MacMillan
2007-09-10 14:10 ` Anand Patel
2007-09-10 16:01 ` Karl MacMillan
2007-06-19 15:09 ` [patch 1/3] libsemanage: genhomedircon replacement Joshua Brindle
2007-06-21 16:29 ` Karl MacMillan
2007-06-21 16:49 ` Joshua Brindle
2007-06-21 18:04 ` Karl MacMillan
2007-06-21 18:09 ` Joshua Brindle
2007-06-21 18:18 ` Karl MacMillan
2007-06-21 18:25 ` Joshua Brindle
2007-06-21 18:35 ` Karl MacMillan
2007-06-21 20:54 ` Eamon Walsh [this message]
2007-06-22 11:50 ` Daniel J Walsh
2007-06-22 15:22 ` Karl MacMillan
2007-06-22 15:31 ` Joshua Brindle
2007-06-22 16:04 ` Karl MacMillan
2007-06-22 16:58 ` Eamon Walsh
2007-06-22 19:30 ` Karl MacMillan
2007-06-22 20:55 ` Eamon Walsh
2007-07-02 14:00 ` Joshua Brindle
2007-07-02 14:23 ` Karl MacMillan
2007-07-02 15:54 ` Joshua Brindle
2007-07-02 21:26 ` Joshua Brindle
2007-07-03 1:12 ` James Antill
2007-07-03 11:15 ` Can someone please assist me with selinux issue David Cottle
[not found] ` <1183464455.12218.243.camel@moss-spartans.epoch.ncs! c.mil>
2007-07-03 12:07 ` Stephen Smalley
2007-07-04 23:30 ` David Cottle
2007-07-05 12:33 ` Stephen Smalley
2007-07-12 19:03 ` Libsemanage dependency on version of Linux Hasan Rezaul-CHR010
2007-07-12 19:39 ` Stephen Smalley
2007-07-12 19:48 ` Hasan Rezaul-CHR010
2007-07-12 19:57 ` Stephen Smalley
2007-07-12 19:49 ` Stephen Smalley
2007-07-02 14:54 ` [patch 1/3] libsemanage: genhomedircon replacement James Antill
2007-06-22 20:00 ` James Antill
2007-05-24 15:05 ` Steve G
2007-05-24 15:27 ` Karl MacMillan
2007-05-24 16:00 ` James Antill
2007-05-25 14:22 ` Mark Goldman
2007-05-21 9:54 ` [patch 2/3] libsemanage: test functions jbrindle
2007-05-21 9:54 ` [patch 3/3] Remove legacy genhomedircon python script jbrindle
2007-05-22 17:23 ` [patch 0/3] genhomedircon replacement in libsemanage Daniel J Walsh
2007-05-22 17:35 ` Joshua Brindle
2007-05-22 21:10 ` Karl MacMillan
2007-05-22 21:11 ` Karl MacMillan
-- strict thread matches above, loose matches on Subject: below --
2007-08-08 20:22 [patch 0/3] libsemanage: genhomedircon replacement tmiller
2007-08-08 20:22 ` [patch 1/3] " tmiller
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=467AE59E.2050501@tycho.nsa.gov \
--to=ewalsh@tycho.nsa.gov \
--cc=dwalsh@redhat.com \
--cc=jbrindle@tresys.com \
--cc=kmacmillan@mentalrootkit.com \
--cc=mgoldman@tresys.com \
--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.