Is dd if=/dev/urandom of=/dev/mem safe?What do top's %MEM and VSZ mean?how to use dd to fill drive with 1'sWhat does `dd if=/dev/zero of=/dev/sda` doForce program to use /dev/urandomWhat does the letter 'u' mean in /dev/urandom?Is it OK to just copy /dev/random and /dev/urandom?What are the --use-urandom or --use-random options in LUKS used for?dd command writing to /dev/sdc changed size of diskHow to understand PBS output “mem” and “vmem” keep the same when the task is x-fold increased with mpirun -np x taskDifference between CONFIG_RANDOMIZE_BASE and CONFIG_RANDOMIZE_MEMORY in Linux kernel config
How can I stop myself from micromanaging other PCs' actions?
Why did Saturn V not head straight to the moon?
How do I generate distribution of positive numbers only with min, max and mean?
Time travel novel: machine makes clones, clones battle to be the one to get back their life
Does the Intel 8086 CPU have user mode and kernel mode?
3D Statue Park: U shapes
Why no ";" after "do" in sh loops?
Using "Kollege" as "university friend"?
What is the max number of outlets on a GFCI circuit?
What is the meaning of "you has the wind of me"?
Why is my read in of data taking so long?
Can the Artificer's infusions stack? Returning weapon + radiant weapon?
How to judge a Ph.D. applicant that arrives "out of thin air"
powerhouse of ideas
What does "see" in "the Holy See" mean?
Area of parallelogram = Area of square. Shear transform
How to copy a file transactionally?
Does academia have a lazy work culture?
How can I receive packages while in France?
What is the lowest-speed bogey a jet fighter can intercept/escort?
How do we explain the E major chord in this progression?
A planet illuminated by a black hole?
Explanation for a joke about a three-legged dog that walks into a bar
Is it normal practice to screen share with a client?
Is dd if=/dev/urandom of=/dev/mem safe?
What do top's %MEM and VSZ mean?how to use dd to fill drive with 1'sWhat does `dd if=/dev/zero of=/dev/sda` doForce program to use /dev/urandomWhat does the letter 'u' mean in /dev/urandom?Is it OK to just copy /dev/random and /dev/urandom?What are the --use-urandom or --use-random options in LUKS used for?dd command writing to /dev/sdc changed size of diskHow to understand PBS output “mem” and “vmem” keep the same when the task is x-fold increased with mpirun -np x taskDifference between CONFIG_RANDOMIZE_BASE and CONFIG_RANDOMIZE_MEMORY in Linux kernel config
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
What exactly does this do? I don't understand how you could access base memory with this...seems kinda weird. Is it safe?
dd if=/dev/urandom of=/dev/mem
ubuntu memory dd random
New contributor
add a comment |
What exactly does this do? I don't understand how you could access base memory with this...seems kinda weird. Is it safe?
dd if=/dev/urandom of=/dev/mem
ubuntu memory dd random
New contributor
add a comment |
What exactly does this do? I don't understand how you could access base memory with this...seems kinda weird. Is it safe?
dd if=/dev/urandom of=/dev/mem
ubuntu memory dd random
New contributor
What exactly does this do? I don't understand how you could access base memory with this...seems kinda weird. Is it safe?
dd if=/dev/urandom of=/dev/mem
ubuntu memory dd random
ubuntu memory dd random
New contributor
New contributor
edited 8 hours ago
Kusalananda♦
156k18 gold badges309 silver badges495 bronze badges
156k18 gold badges309 silver badges495 bronze badges
New contributor
asked 9 hours ago
Coder14Coder14
92 bronze badges
92 bronze badges
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It is safe, if you have properly configured kernel ( safe because it won't work )
Per manual page mem(4):
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine (and
even patch) the system.
So in theory, dd if=/dev/urandom of=/dev/mem
should overwrite whole address space of the physical memory you have installed, and since kernel and other programs run from memory this should effectively crash the system. In practice, there's limit. From the same man page:
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file.
Trying this on virtual machine Ubuntu 18.04 , it returns an error dd: writing to '/dev/mem': Operation not permitted
even with sudo
and despite permissions for root crw-r-----
. From Ubuntu Wiki:
/dev/mem protection
Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM).
So technically, no it is not safe (since it would crash the system) and if kernel option CONFIG_STRICT_DEVMEM
is disabled that's a security hole, but from what I see so far the command wouldn't run if that option is enabled. According to cross-site duplicate, a reboot will fix any issues with it, but of course data in RAM at that time would be lost and not flushed to disk (if any had to be).
There is a suggested method on the duplicate linked earlier using busybox devmem
so if you're determined to mess around with RAM, there may be a way after all.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Coder14 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532381%2fis-dd-if-dev-urandom-of-dev-mem-safe%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It is safe, if you have properly configured kernel ( safe because it won't work )
Per manual page mem(4):
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine (and
even patch) the system.
So in theory, dd if=/dev/urandom of=/dev/mem
should overwrite whole address space of the physical memory you have installed, and since kernel and other programs run from memory this should effectively crash the system. In practice, there's limit. From the same man page:
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file.
Trying this on virtual machine Ubuntu 18.04 , it returns an error dd: writing to '/dev/mem': Operation not permitted
even with sudo
and despite permissions for root crw-r-----
. From Ubuntu Wiki:
/dev/mem protection
Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM).
So technically, no it is not safe (since it would crash the system) and if kernel option CONFIG_STRICT_DEVMEM
is disabled that's a security hole, but from what I see so far the command wouldn't run if that option is enabled. According to cross-site duplicate, a reboot will fix any issues with it, but of course data in RAM at that time would be lost and not flushed to disk (if any had to be).
There is a suggested method on the duplicate linked earlier using busybox devmem
so if you're determined to mess around with RAM, there may be a way after all.
add a comment |
It is safe, if you have properly configured kernel ( safe because it won't work )
Per manual page mem(4):
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine (and
even patch) the system.
So in theory, dd if=/dev/urandom of=/dev/mem
should overwrite whole address space of the physical memory you have installed, and since kernel and other programs run from memory this should effectively crash the system. In practice, there's limit. From the same man page:
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file.
Trying this on virtual machine Ubuntu 18.04 , it returns an error dd: writing to '/dev/mem': Operation not permitted
even with sudo
and despite permissions for root crw-r-----
. From Ubuntu Wiki:
/dev/mem protection
Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM).
So technically, no it is not safe (since it would crash the system) and if kernel option CONFIG_STRICT_DEVMEM
is disabled that's a security hole, but from what I see so far the command wouldn't run if that option is enabled. According to cross-site duplicate, a reboot will fix any issues with it, but of course data in RAM at that time would be lost and not flushed to disk (if any had to be).
There is a suggested method on the duplicate linked earlier using busybox devmem
so if you're determined to mess around with RAM, there may be a way after all.
add a comment |
It is safe, if you have properly configured kernel ( safe because it won't work )
Per manual page mem(4):
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine (and
even patch) the system.
So in theory, dd if=/dev/urandom of=/dev/mem
should overwrite whole address space of the physical memory you have installed, and since kernel and other programs run from memory this should effectively crash the system. In practice, there's limit. From the same man page:
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file.
Trying this on virtual machine Ubuntu 18.04 , it returns an error dd: writing to '/dev/mem': Operation not permitted
even with sudo
and despite permissions for root crw-r-----
. From Ubuntu Wiki:
/dev/mem protection
Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM).
So technically, no it is not safe (since it would crash the system) and if kernel option CONFIG_STRICT_DEVMEM
is disabled that's a security hole, but from what I see so far the command wouldn't run if that option is enabled. According to cross-site duplicate, a reboot will fix any issues with it, but of course data in RAM at that time would be lost and not flushed to disk (if any had to be).
There is a suggested method on the duplicate linked earlier using busybox devmem
so if you're determined to mess around with RAM, there may be a way after all.
It is safe, if you have properly configured kernel ( safe because it won't work )
Per manual page mem(4):
/dev/mem is a character device file that is an image of the main
memory of the computer. It may be used, for example, to examine (and
even patch) the system.
So in theory, dd if=/dev/urandom of=/dev/mem
should overwrite whole address space of the physical memory you have installed, and since kernel and other programs run from memory this should effectively crash the system. In practice, there's limit. From the same man page:
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file.
Trying this on virtual machine Ubuntu 18.04 , it returns an error dd: writing to '/dev/mem': Operation not permitted
even with sudo
and despite permissions for root crw-r-----
. From Ubuntu Wiki:
/dev/mem protection
Some applications (Xorg) need direct access to the physical memory from user-space. The special file /dev/mem exists to provide this access. In the past, it was possible to view and change kernel memory from this file if an attacker had root access. The CONFIG_STRICT_DEVMEM kernel option was introduced to block non-device memory access (originally named CONFIG_NONPROMISC_DEVMEM).
So technically, no it is not safe (since it would crash the system) and if kernel option CONFIG_STRICT_DEVMEM
is disabled that's a security hole, but from what I see so far the command wouldn't run if that option is enabled. According to cross-site duplicate, a reboot will fix any issues with it, but of course data in RAM at that time would be lost and not flushed to disk (if any had to be).
There is a suggested method on the duplicate linked earlier using busybox devmem
so if you're determined to mess around with RAM, there may be a way after all.
edited 8 hours ago
answered 8 hours ago
Sergiy KolodyazhnyySergiy Kolodyazhnyy
11k4 gold badges27 silver badges67 bronze badges
11k4 gold badges27 silver badges67 bronze badges
add a comment |
add a comment |
Coder14 is a new contributor. Be nice, and check out our Code of Conduct.
Coder14 is a new contributor. Be nice, and check out our Code of Conduct.
Coder14 is a new contributor. Be nice, and check out our Code of Conduct.
Coder14 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f532381%2fis-dd-if-dev-urandom-of-dev-mem-safe%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown