TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

In-Memory-Only ELF Execution Without Tmpfs

63 pointsby woobyover 5 years ago

5 comments

dimkr1over 5 years ago
There are other ways to do this that don&#x27;t involve tmpfs or write() - see <a href="https:&#x2F;&#x2F;github.com&#x2F;dimkr&#x2F;papaw" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dimkr&#x2F;papaw</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;dimkr&#x2F;Mirai-Source-Code" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dimkr&#x2F;Mirai-Source-Code</a>
评论 #21148881 未加载
评论 #21149275 未加载
derefrover 5 years ago
Given that Linux now has both file descriptors, and process memory-page ranges, pointing to anonymous allocated memory regions, are they interchangeable?<p>What I mean is:<p>- to go from a memfd to anonymous memory, you can call mmap(2) on the fd<p>- to go from anonymous memory to a memfd, you...?
评论 #21149992 未加载
ldngover 5 years ago
And when would you want to do that ? Really curious as I fail to see a usecase where the same goal could not be achieve otherwise. But there must be some otherwise the API would not have been introduced i guess.
评论 #21148001 未加载
评论 #21147873 未加载
评论 #21147719 未加载
评论 #21149164 未加载
pwdisswordfish2over 5 years ago
Oh yeah, I&#x27;ve once discovered this method myself. With execveat() one can even avoid going through procfs.<p>It doesn&#x27;t work worth shbang-based scripts, though; that just returns ENOENT. Makes sense, I suppose.
评论 #21148403 未加载
评论 #21148142 未加载
joostersover 5 years ago
A bit off-topic, but their perl code is buggy. fork() returns <i>undef</i> on error, not -1.<p>And you can use &#x27;$FH-&gt;autoflush(1)&#x27; instead of the eye-watering &#x27;select((select($FH), $|=1)[0])&#x27;
评论 #21152251 未加载