[Bug 1452402] [NEW] getrandom() stucks when process has no read permission on /dev/urandom

Mibori Shante miborishante at gmail.com
Wed May 6 17:53:45 UTC 2015


Public bug reported:

ubuntu-core/15.04/edge
armhf

getrandom() stucks when process has no read permission on /dev/urandom.
It should return an error.

Easy example to reproduce in golang:

//--------------------
package main

import (
	"crypto/rand"
	"io"
)

func main() {
	p := make([]byte, 16)
	if _, err := io.ReadFull(rand.Reader, p); err != nil { // <--- stuck!
		println(err)
		return
	}
	println(p)
}
//--------------------

The internal implementation of reading from rand.Reader contains getrandom() syscall:
     https://golang.org/src/crypto/rand/rand_linux.go

** Affects: ubuntu
     Importance: Undecided
         Status: New

** Information type changed from Private Security to Public

** Package changed: libseccomp (Ubuntu) => ubuntu

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libseccomp in Ubuntu.
https://bugs.launchpad.net/bugs/1452402

Title:
  getrandom() stucks when process has no read permission on /dev/urandom

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1452402/+subscriptions



More information about the Ubuntu-server-bugs mailing list