LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-19-2012, 07:14 AM   #1
alpha645
LQ Newbie
 
Registered: Jul 2006
Posts: 25

Rep: Reputation: 0
Strongswan fails while accessing /dev/urandom


I made a bug that is relevant to this post here. However, I'm turning to the community now, as I cannot believe that no one else has stumbled on this issue. I'm not using any wild configuration settings, it's just a regular roadwarrior setting using ikev2, tunnel (+ipcomp transport) and authentication using RSA signatures (PKI infra).

This is on an updated Ubuntu 12.04 barebones installation.

However, on the cliënt, when I want to start the connection, I get this:
Quote:
root@Delta:~# ipsec up remote
initiating IKE_SA remote[1] to 82.169.126.54
opening "/dev/urandom" failed: Permission denied
error generating nonce
tried to check-in and delete nonexisting IKE_SA
And this is where things get really weird:

Quote:
root@Delta:~# ls -la /dev/urandom
crw-rw-rw- 1 root root 1, 9 jun 17 17:54 /dev/urandom
root@Delta:~# lsattr /dev/urandom
lsattr: Bewerking wordt niet ondersteund Tijdens lezen van vlaggen op /dev/urandom (-> says it is not supported)
But we are root right... ? Yes we are:

Quote:
root@Delta:~# ps -p 21021,22515,21020,22514 -o args,group,pgid,ppid,rgroup,ruser,tty,user,gid,rgid,ruid,uid
COMMAND GROUP PGID PPID RGROUP RUSER TT USER GID RGID RUID UID
/usr/lib/ipsec/starter root 21020 1 root root ? root 0 0 0 0
/usr/lib/ipsec/charon --use root 21021 21020 root root ? root 0 0 0 0
/usr/lib/ipsec/starter root 22514 1 root root ? root 0 0 0 0
/usr/lib/ipsec/charon --use root 22515 22514 root root ? root 0 0 0 0
More relevant info can be found in the bugreport. We haven't tried much so far, only the suggestion made by this link. No dice though.

And it is no way my intention to start a flamewar, troll or something... But these settings work on a Gentoo cliënt. I'm one of the few lucky one's who managed to 'convert' my parents to use Linux and Ubuntu was the logical choice (introducing my parents to Gentoo's emerge, USE-flags, CFLAGS, compilation failures, ABI/API compatibility might happen in another 100 years ). It's a really simple setup. Basically it's and alternative installation CD. I simply only installed base and the user-session starts with startx. It has no networkmanager, no display manager and uses XFCE components to work. At boot it uses 93 out of 512 MB of RAM (so that is not an issue I suppose). PAM authentication works, I had to do some fiddling to authenticate the regular user with consolekit but this works now. Power events (shutdown, restart, hibernate) and USB devices (camera's, USB, mounting, umounting) all work flawlessly.

Thanks in advance for *any* suggestions
 
Old 06-19-2012, 07:08 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Run the command under strace, maybe there's something strange in the actual open() call
 
1 members found this post helpful.
Old 06-19-2012, 11:57 PM   #3
alpha645
LQ Newbie
 
Registered: Jul 2006
Posts: 25

Original Poster
Rep: Reputation: 0
Yes, I did that and indeed something is strange:

[pid 22519] open("/dev/urandom", O_RDONLY) = -1 EACCES (Permission denied)

Which crazy since:

root@Delta:~# ps -p 21021,22515,21020,22514 -o args,group,pgid,ppid,rgroup,ruser,tty,user,gid,rgid,ruid,uid
COMMAND GROUP PGID PPID RGROUP RUSER TT USER GID RGID RUID UID
/usr/lib/ipsec/starter root 21020 1 root root ? root 0 0 0 0
/usr/lib/ipsec/charon --use root 21021 21020 root root ? root 0 0 0 0
/usr/lib/ipsec/starter root 22514 1 root root ? root 0 0 0 0
/usr/lib/ipsec/charon --use root 22515 22514 root root ? root 0 0 0 0

I have a full strace attached in the bug, but I will also attach it here.
Attached Files
File Type: txt starter_strace.txt (78.7 KB, 11 views)
 
Old 06-20-2012, 09:43 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Can't see anything obvious in the trace, do you have selinux installed/enabled?
 
1 members found this post helpful.
Old 06-20-2012, 10:19 AM   #5
alpha645
LQ Newbie
 
Registered: Jul 2006
Posts: 25

Original Poster
Rep: Reputation: 0
Nope, no nothing. Just Unix Discretionary Access Controls (DAC). No Apparmor, no grsecurity, no pax or anything else LSM related. I disabled this in the kernel, so it is not even possible to be 'accidentally' enabled.

I compiled a custom 4.6.4 version from the strongswan.org website. It fails the same way. I'm currently building with libcap disabled, as that is the only possibility left that I can think of.

If that doesn't work, I'll resort to disabling the 'random' plugin (if that makes Strongswan still function though).

Thanks for your time and dedication . Aside from launchpad, you are the only one responding. Ubuntuforums and linuxforums.org yields NULL responses so far.
 
Old 06-20-2012, 10:50 AM   #6
alpha645
LQ Newbie
 
Registered: Jul 2006
Posts: 25

Original Poster
Rep: Reputation: 0
Lightbulb

Yup, disabling libcap functionality fixes the issue. Strongswan has a 'native' alternative, but I haven't tried that one yet.

Disabling it is not *such* a big deal as this Strongswan installation is a client. Thanks anyway!

Further findings will be placed in bug 1014361.

Last edited by alpha645; 06-20-2012 at 10:52 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd if=/dev/urandom of=/dev/hda2 bs=1M doesn't work Melsync Linux - General 16 05-19-2014 06:36 PM
[SOLVED] Stupidly ran "cat /dev/urandom > /dev/mem", worried I broke firmware crosstalk Linux - Hardware 2 10-25-2010 05:27 PM
[SOLVED] wiping HDD using /dev/urandom versus /dev/zero, a theoretical question H_TeXMeX_H Linux - General 6 06-29-2009 06:55 AM
/dev/random and /dev/urandom pool(s)? kpeirce Linux - Software 2 01-31-2006 06:54 AM
/dev/urandom Moszer Slackware 3 09-09-2003 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration