linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* why is the sys_close symbol exported ?
@ 2016-11-18  8:56 jmfriedt
  2016-11-18 13:49 ` One Thousand Gnomes
  0 siblings, 1 reply; 2+ messages in thread
From: jmfriedt @ 2016-11-18  8:56 UTC (permalink / raw)
  To: linux-kernel

Following the various rootkit and system call redirection developments, the current
way of identifying the location of the system call table seems to be brute force scanning 
the memory for the location of one of the system calls. This is only possible from a module
if the symbol is exported: I see that only one system call symbol is still exported, that
is sys_close. Removing this symbol export would hinder one of the ways of finding the 
systam call table: I have not been able to find the reason for exporting this particular
symbol (while sys_open for example is not exported). Can anyone justify why that is ?

Thank you, Jean-Michel

-- 
JM Friedt, FEMTO-ST Time & Frequency/SENSeOR, 26 rue de l'Epitaphe, 25000 Besancon, France

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: why is the sys_close symbol exported ?
  2016-11-18  8:56 why is the sys_close symbol exported ? jmfriedt
@ 2016-11-18 13:49 ` One Thousand Gnomes
  0 siblings, 0 replies; 2+ messages in thread
From: One Thousand Gnomes @ 2016-11-18 13:49 UTC (permalink / raw)
  To: jmfriedt; +Cc: linux-kernel

On Fri, 18 Nov 2016 09:56:52 +0100
jmfriedt <jmfriedt@femto-st.fr> wrote:

> Following the various rootkit and system call redirection developments, the current
> way of identifying the location of the system call table seems to be brute force scanning 
> the memory for the location of one of the system calls. This is only possible from a module
> if the symbol is exported: I see that only one system call symbol is still exported, that
> is sys_close. Removing this symbol export would hinder one of the ways of finding the 
> systam call table: I have not been able to find the reason for exporting this particular
> symbol (while sys_open for example is not exported). Can anyone justify why that is ?
> 
> Thank you, Jean-Michel
> 

find . -name "*.[ch]" -exec grep -H sys_close {} \;

So currently it is needed by autofs4, binfmt_misc, net/kcm/kcmsock and
those look like legitimate use cases.

It might be worth changing sys_close to just wrap a call to
do_sys_close() which is the existing code. That would make it slightly
harder.

That said anyone doing syscall table scanning that would can do it at
least two other pretty reliable ways by working form the system call
entry point, which is trivially discoverable.

It's one reason I'd really like to see kvm/qemu provide 'read only until
the virtual machine exits' memory range so that you can irrevocably
protect page ranges (like the syscalls and much of the kernel code)
within a VM.

Alan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-18 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18  8:56 why is the sys_close symbol exported ? jmfriedt
2016-11-18 13:49 ` One Thousand Gnomes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).