Forum > Unix

compiled linux library (.so) is executable

<< < (2/3) > >>

Чебурашка:

--- Quote from: MarkMLl on May 14, 2023, 10:57:32 am ---So I don't know what's really going on, but I think we need to be prepared for some traditional unix weirdness.

--- End quote ---

I found same on deb 11, also I tried to run it, here's a few nice output lines:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---user@debian-11:~$ /lib/x86_64-linux-gnu/libc-2.31.soGNU C Library (Debian GLIBC 2.31-13+deb11u5) stable release version 2.31.Copyright (C) 2020 Free Software Foundation, Inc.This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR APARTICULAR PURPOSE.Compiled by GNU CC version 10.2.1 20210110.libc ABIs: UNIQUE IFUNC ABSOLUTEFor bug reporting instructions, please see:<http://www.debian.org/Bugs/>. 
While libm is not executable:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---user@debian-11:~$ ls /lib/x86_64-linux-gnu/libm.* -l-rw-r--r-- 1 root root 132 Oct 14  2022 /lib/x86_64-linux-gnu/libm.a-rw-r--r-- 1 root root 140 Oct 14  2022 /lib/x86_64-linux-gnu/libm.solrwxrwxrwx 1 root root  12 Oct 14  2022 /lib/x86_64-linux-gnu/libm.so.6 -> libm-2.31.so user@debian-11:~$ ls /lib/x86_64-linux-gnu/libm-2.31.so -l-rw-r--r-- 1 root root 1321344 Oct 14  2022 /lib/x86_64-linux-gnu/libm-2.31.so 
I would bet there is a logic on this, debian is very careful to these things.

MarkMLl:

--- Quote from: Чебурашка on May 15, 2023, 11:21:22 am ---I would bet there is a logic on this, debian is very careful to these things.

--- End quote ---

I have an /extremely/ vague recollection that libc is executable specifically so that it can report the version of the core system-level libraries.


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---# find /lib /usr/lib -type f -name '*so.*' -ls 2> /dev/null | grep rwx | less 12846584    208 -rwxr-xr-x   1 root     root        210968 Apr 10 09:35 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 12846588   1880 -rwxr-xr-x   1 root     root       1922136 Apr 10 09:35 /usr/lib/x86_64-linux-gnu/libc.so.6 # find /lib /usr/lib -type f -name '*so' -ls 2> /dev/null | grep rwx | less 13388759     40 -rwxr-xr-x   1 root     root        39152 Jan 22 05:37 /usr/lib/grass82/bin/v.net.iso 12848415     76 -rwxr-xr-x   1 root     root        74688 Feb 12 22:57 /usr/lib/klibc-XX6cASCB7KZyJWpIJW79y94XHBY.so 
However when I do a brute-force search over the entire system I find a whole lot of stuff that I've either compiled locally (e.g. Mozilla Kompozer) or installed into a Docker container (various microcontroller and FPGA stuff) which have most if not all of their .so libraries marked executable. That obviously boils down either to multiple projects' build methodology, or to a default option in ld (or possibly install or equivalent which handled the final placement).

MarkMLl

Чебурашка:

--- Quote from: Fred vS on May 11, 2023, 06:12:04 pm ---Hello.

Maybe it is a executable compiled with 'hardening' and became a "executable library":
https://wiki.freepascal.org/hardening

--- End quote ---

These are the options in project (omitting paths to unit+inc)


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/bin/fpc-MObjFPC-Scghi-Cg-g-gl-gh-gt-l-vewnhibq-vm6058,3124,3123[ ... ] 
so seems is not this case.

Fred vS:
May I ask what result you get if you do on console?:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$> file yourbinary

Чебурашка:

--- Quote from: Fred vS on May 15, 2023, 05:17:46 pm ---May I ask what result you get if you do on console?:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$> file yourbinary
--- End quote ---

Sure (just renamed lib to libxyz):


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---[user@deb-9]# file libxyz-i386-linux.solibxyz-i386-linux.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version