{"id":145,"date":"2019-01-11T11:07:20","date_gmt":"2019-01-11T13:07:20","guid":{"rendered":"http:\/\/vargolino.com\/wp\/?p=145"},"modified":"2020-06-29T17:46:23","modified_gmt":"2020-06-29T20:46:23","slug":"bash-segfault-on-chroot","status":"publish","type":"post","link":"https:\/\/vargolino.com\/wp\/?p=145","title":{"rendered":"bash SEGFAULT on chroot"},"content":{"rendered":"<p>After upgrading do the Kernel 4.18, a <code>chroot<\/code> I used somewhat frequently stopped working. Everytime I tried to start it I just got that simple, but horrifying message:<\/p>\n<pre>~# chroot \/path\/to\/jail \/bin\/bash -i -l\nSegmentation Fault\n<\/pre>\n<p>As the project I was working on did not depended on that <code>chroot<\/code> I&#8217;ve set this aside until now.<\/p>\n<p>It turns out that LEGACY_VSYSCALL emulation was disabled by the Debian new Kernels&#8230;<\/p>\n<pre>~# diff \/boot\/config-4.9.0-8-amd64 \/boot\/config-4.18.0-0.bpo.1-amd64 | grep VSYSCALL\n CONFIG_X86_VSYSCALL_EMULATION=y\n-# CONFIG_LEGACY_VSYSCALL_NATIVE is not set\n-CONFIG_LEGACY_VSYSCALL_EMULATE=y\n-# CONFIG_LEGACY_VSYSCALL_NONE is not set\n+# CONFIG_LEGACY_VSYSCALL_EMULATE is not set\n+CONFIG_LEGACY_VSYSCALL_NONE=y\n<\/pre>\n<p>Luckily this can be changed in the kernel command line, so adding <code>vsyscall=emulate<\/code> in the Grub command line configuration made it work.<\/p>\n<p>So to solve the problem I njsut had to change the file <code>\/etc\/default\/grub<\/code> so it contained a line such as:<\/p>\n<pre>...\nGRUB_CMDLINE_LINUX_DEFAULT=\"quiet vsyscall=emulate\"\n...\n<\/pre>\n<p>Call <code>update-grub<\/code> and reboot!<\/p>\n<h1>Why?<\/h1>\n<p>Looks like this changes are related to the ASLR (Address Space Layout Randomization) security feature and enabling this emulation can lead to security vulnerabilities.<\/p>\n<h3>Sources<\/h3>\n<p>* This was the post I found that helped me solve this problem: <a href=\"https:\/\/github.com\/moby\/moby\/issues\/28705\">https:\/\/github.com\/moby\/moby\/issues\/28705<\/a><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading do the Kernel 4.18, a chroot I used somewhat frequently stopped working. Everytime I tried to start it I just got that simple, but horrifying message: ~# chroot \/path\/to\/jail \/bin\/bash -i -l Segmentation Fault As the project I was working on did not depended on that chroot I&#8217;ve set this aside until now. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/vargolino.com\/wp\/?p=145\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;bash SEGFAULT on chroot&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,3],"tags":[],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-linux","category-solution","entry"],"_links":{"self":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=145"}],"version-history":[{"count":2,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":173,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions\/173"}],"wp:attachment":[{"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vargolino.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}