public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* what's the replace for the big kernel lock after kernel version 2.6.39 for system call.
       [not found] <S1752501Ab1KYJXy/20111125092354Z+1871@vger.kernel.org>
@ 2011-11-28  9:03 ` Wen Yan Xin
  2011-11-29 21:41   ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Wen Yan Xin @ 2011-11-28  9:03 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org; +Cc: Zongliang Li, Gang He, Yong Jun Chai

Hi all,

I have a trouble of working on kernel 2.6.39 and later. Originally when our kernel module startups, it hooks some file system call, like sys_open... , and the big kernel lock - lock_kernel() - will be held before creating the hook to prevent user application use system calls, and be released after the hook created.


But after the kernel 2.6.39, the big kernel lock has been removed. I'm thinking there should be one or more lock that should be used. 

So, my question is which lock should be held now, when we hook the system call of file system?

I'd really appreciate your answer in advance.


--

>>>> 	auth ca64a8ac subscribe linux-kernel wenyan_xin@symantec.com
Succeeded.

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

* Re: what's the replace for the big kernel lock after kernel version 2.6.39 for system call.
  2011-11-28  9:03 ` what's the replace for the big kernel lock after kernel version 2.6.39 for system call Wen Yan Xin
@ 2011-11-29 21:41   ` Al Viro
  2011-11-30  9:44     ` Tvrtko Ursulin
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2011-11-29 21:41 UTC (permalink / raw)
  To: Wen Yan Xin
  Cc: linux-kernel@vger.kernel.org, Zongliang Li, Gang He,
	Yong Jun Chai

On Mon, Nov 28, 2011 at 01:03:07AM -0800, Wen Yan Xin wrote:
> Hi all,
> 
> I have a trouble of working on kernel 2.6.39 and later. Originally when our kernel module startups, it hooks some file system call, like sys_open... , and the big kernel lock - lock_kernel() - will be held before creating the hook to prevent user application use system calls, and be released after the hook created.
> 
> 
> But after the kernel 2.6.39, the big kernel lock has been removed. I'm thinking there should be one or more lock that should be used. 
> 
> So, my question is which lock should be held now, when we hook the system call of file system?
> 
> I'd really appreciate your answer in advance.

1) your rootkit has always been racy; taking BKL does *NOT* prevent another
CPU from entering a system call.

2) none; just don't do it.

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

* Re: what's the replace for the big kernel lock after kernel version 2.6.39 for system call.
  2011-11-29 21:41   ` Al Viro
@ 2011-11-30  9:44     ` Tvrtko Ursulin
  2011-11-30 13:56       ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Tvrtko Ursulin @ 2011-11-30  9:44 UTC (permalink / raw)
  To: Al Viro
  Cc: Wen Yan Xin, linux-kernel@vger.kernel.org, Zongliang Li, Gang He,
	Yong Jun Chai

On Tuesday 29 Nov 2011 21:41:36 Al Viro wrote:
> On Mon, Nov 28, 2011 at 01:03:07AM -0800, Wen Yan Xin wrote:
> > Hi all,
> > 
> > I have a trouble of working on kernel 2.6.39 and later. Originally when
> > our kernel module startups, it hooks some file system call, like
> > sys_open... , and the big kernel lock - lock_kernel() - will be held
> > before creating the hook to prevent user application use system calls,
> > and be released after the hook created.
> > 
> > 
> > But after the kernel 2.6.39, the big kernel lock has been removed. I'm
> > thinking there should be one or more lock that should be used.
> > 
> > So, my question is which lock should be held now, when we hook the system
> > call of file system?
> > 
> > I'd really appreciate your answer in advance.
> 
> 1) your rootkit has always been racy; taking BKL does *NOT* prevent another
> CPU from entering a system call.
> 
> 2) none; just don't do it.

Hi Al,

Why not be a nice guy when you already took the effort of replying and mention 
fanotify? Because I am sure you know the history and when you see a security 
vendor asking these things, you never know, maybe it fits their requirements. 
Maybe it is not your favourite thing as well, but not a reason not to mention 
it.

And strictly speaking, rootkits actively try to hide themselves hence whatever 
unsafe, ugly and wrong stuff they might have it is not a rootkit. :)

Regards,

Tvrtko

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

* Re: what's the replace for the big kernel lock after kernel version 2.6.39 for system call.
  2011-11-30  9:44     ` Tvrtko Ursulin
@ 2011-11-30 13:56       ` Al Viro
  2011-11-30 14:12         ` Tvrtko Ursulin
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2011-11-30 13:56 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: linux-kernel

On Wed, Nov 30, 2011 at 09:44:27AM +0000, Tvrtko Ursulin wrote:

> > 1) your rootkit has always been racy; taking BKL does *NOT* prevent another
> > CPU from entering a system call.
> > 
> > 2) none; just don't do it.
> 
> Hi Al,
> 
> Why not be a nice guy when you already took the effort of replying and mention 
> fanotify? Because I am sure you know the history and when you see a security 
> vendor asking these things, you never know, maybe it fits their requirements. 
> Maybe it is not your favourite thing as well, but not a reason not to mention 
> it.

1) I really have not noticed which domain had that come from until after
replying.
2) I have zero sympathy to the author's employer, so even noticing that in
time would not have made the reply any kinder.  Harsher, if nothing else, since
3) said employer was among those who had been told, again and again and again,
that patching syscall table was seriously racy.  Years ago.

> And strictly speaking, rootkits actively try to hide themselves hence whatever 
> unsafe, ugly and wrong stuff they might have it is not a rootkit. :)

Oh?  And how, pray tell, is it _finding_ the syscall table to binary-patch,
if not by rootkit-style methods?  Come to think of that, how does it defeat
the write-protection on said syscall table?

I do stand by my assessment; ignore the domain part of From and Cc and
this question is indistinguishable from "do my homework for me" kind of
question from rootkit-writer.

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

* Re: what's the replace for the big kernel lock after kernel version 2.6.39 for system call.
  2011-11-30 13:56       ` Al Viro
@ 2011-11-30 14:12         ` Tvrtko Ursulin
  0 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2011-11-30 14:12 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel

On Wednesday 30 Nov 2011 13:56:48 Al Viro wrote:
> On Wed, Nov 30, 2011 at 09:44:27AM +0000, Tvrtko Ursulin wrote:
> > > 1) your rootkit has always been racy; taking BKL does *NOT* prevent
> > > another CPU from entering a system call.
> > > 
> > > 2) none; just don't do it.
> > 
> > Hi Al,
> > 
> > Why not be a nice guy when you already took the effort of replying and
> > mention fanotify? Because I am sure you know the history and when you
> > see a security vendor asking these things, you never know, maybe it fits
> > their requirements. Maybe it is not your favourite thing as well, but
> > not a reason not to mention it.
> 
> 1) I really have not noticed which domain had that come from until after
> replying.
> 2) I have zero sympathy to the author's employer, so even noticing that in
> time would not have made the reply any kinder.  Harsher, if nothing else,
> since 3) said employer was among those who had been told, again and again
> and again, that patching syscall table was seriously racy.  Years ago.

I then hope if you had spotted the senders domain you would have mentioned 
fanotify, even after flaming them to your hearts content.

> > And strictly speaking, rootkits actively try to hide themselves hence
> > whatever unsafe, ugly and wrong stuff they might have it is not a
> > rootkit. :)
> 
> Oh?  And how, pray tell, is it _finding_ the syscall table to binary-patch,
> if not by rootkit-style methods?  Come to think of that, how does it defeat
> the write-protection on said syscall table?
> 
> I do stand by my assessment; ignore the domain part of From and Cc and
> this question is indistinguishable from "do my homework for me" kind of
> question from rootkit-writer.

I just said, and that with a casual modifier, that it is not a rootkit _by 
definition_ of a rootkit so please don't read more from it than it was.

Tvrtko

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

end of thread, other threads:[~2011-11-30 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <S1752501Ab1KYJXy/20111125092354Z+1871@vger.kernel.org>
2011-11-28  9:03 ` what's the replace for the big kernel lock after kernel version 2.6.39 for system call Wen Yan Xin
2011-11-29 21:41   ` Al Viro
2011-11-30  9:44     ` Tvrtko Ursulin
2011-11-30 13:56       ` Al Viro
2011-11-30 14:12         ` Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox