User: Password:
Subscribe / Log in / New account

Who needs /dev/kmem?

Who needs /dev/kmem?

Posted Apr 25, 2010 14:08 UTC (Sun) by mobiphil (guest, #65620)
Parent article: Who needs /dev/kmem?

yes.. russian rulette (see prev comment) should be possible everywhere.
ummmwhat: you can still use /dev/mem, or you can play a bit longer but more fun with /dev/sdaX :) I know... would be fun to go through the full /dev/*

Most over-paranoid people are becoming even more over-paranoid as they do not understand clearly the risks. In their paranoia agony, their mind becomes gray and they step deeper in the devil's circle. If you would let rootkit-in-kmem-context-paranoia people arguing the topic more than 10 minutes, they would tell you that computers are dangerous, even more... life is dangerous, even more atoms are dangerous... so lets annihilate everything... That is life, some people are struggling to invent and to build and others are coming to destroy with possible most idiotic arguments... And you have to see their names every day...

And, one of the most idiotic arguments you hear... It is not used... How the hell can somebody talk in the name of bilions of linux users over the world????????

(Log in to post comments)

Who needs /dev/kmem?

Posted Apr 25, 2010 15:30 UTC (Sun) by nix (subscriber, #2304) [Link]

Well, it's been five years since this article was posted, and in all that time I have not heard a single person express the least desire to use /dev/kmem or express the least twinge of sorrow over its absence.

On Unix systems with free kernels, there is pretty much no safe way to use /dev/kmem in any case: too many details of kernel memory layout can and do change too often. Revving all the tools whenever you hack the memory manager would be appalling.

/dev/kmem was useful with proprietary Unixes before /proc and friends were thought of. These days, it is only of use to script kiddies: if anyone is still legitimately using it, it behooves us to take it away to encourage the poor self-harming sod to pick some better method, *any* better method of doing what he wants. Farewell, foul hack, you are not missed.

Who needs /dev/kmem?

Posted Jun 23, 2010 5:03 UTC (Wed) by azhrei_fje (guest, #26148) [Link]

I have a use for it. A legitimate one, in fact. :)

I'm teaching a Linux device driver development course this week. One of my favorite tools to show the students is KME - the Kernel Memory Editor (last version is from 2006 via KME has some problems (not being 64-bit compatible is the biggest).

Essentially it's a spreadsheet that reads /dev/kmem and displays the results of address expressions (and their contents) with realtime updates (think "top" for kernel memory).

KME can modify kernel memory as well, which is obviously dangerous, but quite acceptable for my purposes.

I've been Google'ing for the last couple of hours looking for some discussion of what I should replace /dev/kmem with but it's not obvious. Since kmem provides virtual addresses it's perfect for KME, but the kernel function read_kmem() returns EPERM in all cases and mmap_kmem() doesn't work as corbet points out above.

A hex dump of /proc/kcore shows that it's discontiguous but docs for it seem to be quite sparse (or my Google-fu is weak right now) so I have little chance of updating KME in the very near-term (such as before this class is over on Friday!!).

(PS: I'm glad I'm not the one to resurrect this thread! :))

Who needs /dev/kmem?

Posted Nov 8, 2010 10:49 UTC (Mon) by jum (guest, #71087) [Link]

I've made use of /dev/kmem on UNIX systems in test programs to access external device address regions on boards developed by our hardware department. Thus I don't have to rely on same basic capacities of the board the device driver has to check.

I wanted to use that feature on Linux for some self made evaluation boards with PCIe connection before I start writing a device driver. However it seems that I cannot access device address regions that way with /dev/kmem.

In brief: I've never used /dev/kmem to r/w main memory on any OS.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds