First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 138344
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo/BSD Team <bsd@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Alex Unleashed <unledev+b.g.o@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
openssl-0.9.7j-fix-sandbox-bsd.patch Patch to fix addpredict in OpenSSL ebuilds patch Alex Unleashed 2006-06-28 05:26 0000 680 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 138344 depends on: Show dependency tree
Bug 138344 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-06-28 05:25 0000
OpenSSL accesses /dev/crypto on BSDs, which is incorrectly marked as predicted
access in src_test (and it contains a typo) in all versions on portage tree.
Testing FreeBSD patch for sandbox revealed this inconsistency, causing access
denied violations.

Steps to reproduce:

1. Apply FreeBSD experimental patches to sandbox
(http://unleashed.amule.org/soc)
2. Enable FEATURES="sandbox"
3. emerge openssl

Actual results:

Sandbox denies accesses to /dev/crypto and errors out preventing OpenSSL from
emerging.

Expected results:

Sandbox denies accesses to /dev/crypto _but_ as they're predicted all goes fine
and OpenSSL gets emerged.

Proposed patch to follow.

------- Comment #1 From Alex Unleashed 2006-06-28 05:26:55 0000 -------
Created an attachment (id=90353) [details]
Patch to fix addpredict in OpenSSL ebuilds

This patch should apply to all versions and fixes the problem for 0.9.7j
specifically.

------- Comment #2 From Diego E. 'Flameeyes' Pettenò 2006-06-28 05:33:13 0000 -------
Last time we decided it was up to sandbox allow access to /dev/crypto, it's
just a conditional to add to the code.

------- Comment #3 From Alex Unleashed 2006-06-28 06:07:05 0000 -------
Woops, okay, didn't have info on that topic. I'll patch sandbox to always
autopredict access to /dev/crypto and include it on my tree. Thanks.

Now change the request to kill that add_predict line which is wrong anyways.

------- Comment #4 From Martin Schlemmer (RETIRED) 2006-07-08 02:33:41 0000 -------
As its only a FreeBSD issue, it really should only add the predict for FreeBSD,
and I do not want to hardcode any more path's.  For the access that stuff
builing or using OpenSSL during build need, it should add a /etc/sandbox.d/
file that allows/predict's this.  I know its not yet in an unmasked or stable
release of sandbox, but then aparently all versions sandbox still have issues
on BSD.

------- Comment #5 From Martin Schlemmer (RETIRED) 2006-07-08 02:34:23 0000 -------
(In reply to comment #4)
> For the access that stuff
> builing or using OpenSSL during build need, it should add a /etc/sandbox.d/
> file that allows/predict's this.

PS, only installed on FreeBSD as well ...

------- Comment #6 From SpanKY 2006-07-08 07:55:39 0000 -------
yeah i dont think this is something to add to sandbox

last i heard this was only an issue in src_test

------- Comment #7 From Alex Unleashed 2006-07-08 12:24:36 0000 -------
Looks like this only applies to OpenSSL on BSD and I haven't found any other
ebuild requiring /dev/crypto to be predicted. If that is the case, why not
apply the proposed patch and be done with it (which, btw, doesn't predict
/dev/crypto under src_test)?

If not, I guess I should patch sandbox to install a file under /etc/sandbox.d
when built for G/FBSD (which looks to me as too much for just one ebuild ATM).
Would that be okay?

------- Comment #8 From Martin Schlemmer (RETIRED) 2006-07-08 14:41:43 0000 -------
(In reply to comment #7)
> Looks like this only applies to OpenSSL on BSD and I haven't found any other
> ebuild requiring /dev/crypto to be predicted. If that is the case, why not
> apply the proposed patch and be done with it (which, btw, doesn't predict
> /dev/crypto under src_test)?
> 

Agreed, if its only needed for OpenSSL to build, there is no reason for it to
be in /etc/sandbox.d/.  Just fix the ebuild.

------- Comment #9 From SpanKY 2006-07-14 22:34:53 0000 -------
i'm not inclined to apply patches that look broken to me

/dev/crypto is used only at runtime, not at compile time ... so why is
addpredict needed anywhere but src_test ?

------- Comment #10 From Alex Unleashed 2006-07-15 22:39:46 0000 -------
(In reply to comment #9)
> i'm not inclined to apply patches that look broken to me
> 
> /dev/crypto is used only at runtime, not at compile time ... so why is
> addpredict needed anywhere but src_test ?

Because actual sandbox violations happen in src_compile and src_install but not
in src_test. Fact is those two stages enter a "Doing certs" phase in which they
try to write to /dev/crypto. If this is expected behaviour or not, I don't
know. Maintainers may have something to say about this.

------- Comment #11 From Diego E. 'Flameeyes' Pettenò 2006-10-22 04:37:03 0000 -------
Okay, so since freebsd-lib-6.2_beta2 I'm now installing a sandbox configuration
file, that allows access to /dev/crypto, which means this bug can be closed.

First Last Prev Next    No search results available      Search page      Enter new bug