/dev/mem: Operation not permitted

Bug #1213922 reported by David Henningsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
laptop-detect (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When running this tool under saucy, on my laptop:

$ laptop-detect
/dev/mem: Operation not permitted
$ echo $?
1

On 12.04, the "/dev/mem: Operation not permitted" error does not appear.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: laptop-detect 0.13.7ubuntu2
ProcVersionSignature: Ubuntu 3.11.0-1.4-generic 3.11.0-rc4
Uname: Linux 3.11.0-1-generic x86_64
ApportVersion: 2.12-0ubuntu3
Architecture: amd64
Date: Mon Aug 19 15:13:55 2013
Dependencies:
 dmidecode 2.12-1
 gcc-4.8-base 4.8.1-9ubuntu1
 libc6 2.17-91ubuntu1
 libgcc1 1:4.8.1-9ubuntu1
 multiarch-support 2.17-91ubuntu1
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-05-08 (102 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130508)
MarkForUpload: True
SourcePackage: laptop-detect
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
David Henningsson (diwic) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

That's laptop-detect's way of saying "I need to run as root". Presumably the permissions on /dev/mem got tightened after precise.

As you want to use that in a pm-utils script, the root privilege requirement shouldn't be an issue?

Changed in laptop-detect (Ubuntu):
status: New → Invalid
Revision history for this message
David Henningsson (diwic) wrote :

This is from "strace laptop-test" under precise:

faccessat(AT_FDCWD, "/dev/mem", R_OK) = -1 EACCES (Permission denied)

Revision history for this message
David Henningsson (diwic) wrote :

This is from "strace laptop-test" under saucy:

faccessat(AT_FDCWD, "/dev/mem", R_OK) = 0
geteuid() = 1000
faccessat(AT_FDCWD, "/usr/sbin/dmidecode", X_OK) = 0
pipe([3, 4]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f03235fea10) = 20344
close(4) = 0
read(3, /dev/mem: Operation not permitted
"", 128)

Revision history for this message
David Henningsson (diwic) wrote :

Sure, on root this is not an issue.

It's actually the other way around for /dev/mem, on precise it's crw-r------ and on saucy it's crw-rw----+ .

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.