Reading /dev/mem on linux, capabilities issue?

jhu

Lifer
Oct 10, 1999
11,918
9
81
I'm running Debian 5.0 and want to dump system memory into a file. I tried "dd in=/dev/mem of=mem.bin " as root. It doesn't work and I keep getting stuff like "Program dd tried to access /dev/mem between xxxxx -> xxxxxx" in the logs. I have a feeling this might have something to do with capabilities, but I having trouble finding how to set them.
 

Colt45

Lifer
Apr 18, 2001
19,720
1
0
You need a new kernel with /dev/mem set to promiscuous or something like that, IIRC.

It's been neutered for security, it can't read all the memory.

+config NONPROMISC_DEVMEM
+ bool "Disable promiscuous /dev/mem"
+ default y
+ help
+ The /dev/mem file by default only allows userspace access to PCI
+ space and the BIOS code and data regions. This is sufficient for
+ dosemu and X and all common users of /dev/mem. With this config
+ option, you allow userspace access to all of memory, including
+ kernel and userspace memory. Accidental access to this is
+ obviously disasterous, but specific access can be used by people
+ debugging the kernel.