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;








1















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









share|improve this question









New contributor



Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    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









    share|improve this question









    New contributor



    Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      1












      1








      1


      2






      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









      share|improve this question









      New contributor



      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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






      share|improve this question









      New contributor



      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 8 hours ago









      Kusalananda

      156k18 gold badges309 silver badges495 bronze badges




      156k18 gold badges309 silver badges495 bronze badges






      New contributor



      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      Coder14Coder14

      92 bronze badges




      92 bronze badges




      New contributor



      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Coder14 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          6














          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.






          share|improve this answer



























            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.









            draft saved

            draft discarded


















            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









            6














            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.






            share|improve this answer





























              6














              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.






              share|improve this answer



























                6












                6








                6







                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.






                share|improve this answer















                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.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                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




















                    Coder14 is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її