← Back to team overview

touch-packages team mailing list archive

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

 

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
Touch seeded packages, 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

Status in Ubuntu:
  New

Bug description:
  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

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


Follow ups

References