patrickpeng2091 / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

[PATCH] lsyncd has executable stack #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build lsyncd
2. execstack -q lsyncd

What version of the product are you using? On what operating system?

lsyncd 2.0.4 on Fedora 14 (Linux/i386).

Please provide any additional information below.

The fix is attached.

Original issue reported on code.google.com by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 10:20

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 10:22

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you, applying the patch as soon as possible.

Original comment by axk...@gmail.com on 29 Apr 2011 at 10:32

GoogleCodeExporter commented 9 years ago
If you haven't applied the patch, you may consider using another one instead: 
older objcopy (at lease in Enterprise Linux 5 and 6) apparently doesn't cope 
well with /dev/null being a special file:

objcopy --input-target=binary \
               --output-target=`cat objtarget` \
               --binary-architecture=`cat objarch` \
               --add-section .note.GNU-stack=/dev/null luac.out luac.o
objcopy: Warning: '/dev/null' is not an ordinary file
make[1]: *** [luac.o] Error 1

Original comment by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 10:58

Attachments:

GoogleCodeExporter commented 9 years ago
Honestly, I'm reconsidering to drop object-copy and write a small tool that 
will simply create proper c code with a static constant unsigned character 
array.

Once I thought using object-copy was oh-so-smart, to capture the script into 
the executable, but it bails on other operating systems like OS-X anyway, and 
you've shown me it has subtle issues as well :-)

Original comment by axk...@gmail.com on 29 Apr 2011 at 11:07

GoogleCodeExporter commented 9 years ago
Please disregard the above comment. objcopy in el5/el6 is completely broken 
when adding empty sections and fails, even without an error message.

Original comment by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 11:17

GoogleCodeExporter commented 9 years ago
Please disregard the above comment. objcopy in el5/el6 is completely broken 
when adding empty sections and fails, even without an error message.

Original comment by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 11:17

GoogleCodeExporter commented 9 years ago
"The above comment" referred to Comment 3. (no idea why the comment got posted 
redundantly, I did not even refresh...). The idea with C array makes much more 
sense portability-wise. For now, I'm just going to use execstack tool to add 
the resulting binary for those distros.

Original comment by lubo.rin...@gtempaccount.com on 29 Apr 2011 at 11:20

GoogleCodeExporter commented 9 years ago
Ok, changed SVN to use a C array to integrate the lua script. Should be more 
portable and have less subtle issues.

Only slight disadvantage, build now needs lua interpreter (so far it only 
needed the compiler) but shouldnt be a problem sind 99.99% cases the compiler 
comes with the interpreter and vice versa.

Original comment by axk...@gmail.com on 4 May 2011 at 1:20

GoogleCodeExporter commented 9 years ago
2.0.5 will have script embedding via char-array in c-code

Original comment by axk...@gmail.com on 11 Jun 2011 at 2:21