While building Proot 5.0.0 and 5.1.0 at Gentoo Linux i have this warning from portage: * QA Notice: The following files contain writable and executable sections * Files with such sections will not work properly (or at all!) on some * architectures/operating systems. A bug should be filed at * http://bugs.gentoo.org/ to make sure the issue is fixed. * For more information, see http://hardened.gentoo.org/gnu-stack.xml * Please include the following list of files in your report: * Note: Bugs should be filed for the respective maintainers * of the package in question and not hardened@g.o. * RWX --- --- usr/bin/proot It seems very likely returning of the bug #493416 in some other form, but i am not really hardened expert, so i can not say for sure...
Hello Sergey, I did some experiments to understand why this happens again. It appears that this comes from the way the loader is embedded into the final executable, that is, using objcopy to transform the loader (a freestanding program) into an object file which is then linked to the proot binary. In this case the GNU linker marks the final executable (ie. proot) as requiring an executable stack, maybe because the linker can't assume anything from this foreign object (not generated by a compiler). I'll do more tests before acknowledging that the current fix (ie. adding "-Wl,-z,noexecstack" to LDFLAGS) is the right one. I'll keep you informed. Thanks for this bug report, Cédric.
Hello Sergey, This has been fixed upstream, but not released yet: https://github.com/cedric-vincent/PRoot/commit/cba29af9c8f361e32858406652438b4b2b60e660 Regards, Cédric.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe0b876d4e8abf8f9c28b365886fbbafdf9be14f commit fe0b876d4e8abf8f9c28b365886fbbafdf9be14f Author: Sergey Popov <pinkbyte@gentoo.org> AuthorDate: 2018-08-01 14:23:02 +0000 Commit: Sergey Popov <pinkbyte@gentoo.org> CommitDate: 2018-08-01 14:26:59 +0000 sys-apps/proot: revision bump Backport patches to make PRoot work under newer kernels and to remove RWX code sections Closes: https://bugs.gentoo.org/536724 Package-Manager: Portage-2.3.40, Repoman-2.3.9 .../proot/files/proot-2.3.1-lib-paths-fix.patch | 4 +- sys-apps/proot/files/proot-5.1.0-loader.patch | 272 +++++++++++++++++++++ sys-apps/proot/files/proot-5.1.0-makefile.patch | 22 ++ sys-apps/proot/proot-5.1.0-r1.ebuild | 73 ++++++ 4 files changed, 369 insertions(+), 2 deletions(-)