Re: /dev/mem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Be it for any reason, it is a security loop whole. Even more dangerous is you have access to device file and its not very hard to erase blocks from disk through device file eg.

dd if=/dev/zero of=/dev/sda1 bs=32k count=32k

it can erase 1G disk space.

As far as I know, Windows OS don't allow you to write to the disk directly from user space.

Thanks
Rajat

On Wed, Oct 27, 2010 at 12:49 PM, Alexandre Courbot <gnurou@xxxxxxxxx> wrote:
> Although, it is *okay* to use /dev/kmem for reading, it is a
> particularly bad idea to use it to write data into the kernel. That is
> because, if you want to change the value of a particular field in a
> kernel data structure for ex., you would find the offset of the object
> based on the kernel image & sometimes if you were  not sure as to
> which particular kernel you booted, your offset will be wrong & you
> would trash a certain kernel data structure possibly bringing down the
> whole system.

Not to mention the locking problem. Many data structures in the kernel
requires a lock to be acquired before being accessed, so this adds to
the challenge of finding the right address of the desired object.

So in short: never do that!

Alex.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux