Re: general protection fault in security_inode_getattr

2020-10-30 Thread Miklos Szeredi
On Fri, Oct 30, 2020 at 7:42 PM Dmitry Vyukov wrote: > > On Fri, Oct 30, 2020 at 2:02 PM Miklos Szeredi wrote: > > > > On Mon, Aug 24, 2020 at 11:00 PM Ondrej Mosnacek > > wrote: > > > > > > On Mon, Aug 24, 2020 at 9:37 PM syzbot > > > w

Re: general protection fault in security_inode_getattr

2020-10-30 Thread Miklos Szeredi
On Mon, Aug 24, 2020 at 11:00 PM Ondrej Mosnacek wrote: > > On Mon, Aug 24, 2020 at 9:37 PM syzbot > wrote: > > syzbot has found a reproducer for the following issue on: > > Looping in fsdevel and OverlayFS maintainers, as this seems to be > FS/OverlayFS related... Hmm, the oopsing code is alway

Re: [PATCH] af_unix: fix garbage collect vs. MSG_PEEK

2016-12-19 Thread Miklos Szeredi
On Tue, Oct 4, 2016 at 3:51 AM, David Miller wrote: > From: Miklos Szeredi > Date: Thu, 29 Sep 2016 14:09:14 +0200 > >> @@ -1550,6 +1550,17 @@ static int unix_attach_fds(struct scm_cookie *scm, >> struct sk_buff *skb) >> return max_level; >> } >&g

[PATCH] af_unix: fix garbage collect vs. MSG_PEEK

2016-09-29 Thread Miklos Szeredi
escriptors. This prevents problems from a pure in-flight socket having its buffers modified while the garbage collect is taking place. Signed-off-by: Miklos Szeredi Cc: --- include/net/af_unix.h | 1 + net/unix/af_unix.c| 15 +-- net/unix/garbage.c| 5 + 3 files changed, 19

Re: kernel BUG at net/unix/garbage.c:149!"

2016-08-30 Thread Miklos Szeredi
On Tue, Aug 30, 2016 at 11:31 AM, Nikolay Borisov wrote: > > > On 08/30/2016 12:18 PM, Miklos Szeredi wrote: >> On Tue, Aug 30, 2016 at 12:37 AM, Miklos Szeredi wrote: >>> On Sat, Aug 27, 2016 at 11:55 AM, Miklos Szeredi >>> wrote: >> >>> c

Re: kernel BUG at net/unix/garbage.c:149!"

2016-08-30 Thread Miklos Szeredi
On Tue, Aug 30, 2016 at 12:37 AM, Miklos Szeredi wrote: > On Sat, Aug 27, 2016 at 11:55 AM, Miklos Szeredi wrote: > crash> list -H gc_inflight_list unix_sock.link -s unix_sock.inflight | > grep counter | cut -d= -f2 | awk '{s+=$1} END {print s}' > 130 >

Re: kernel BUG at net/unix/garbage.c:149!"

2016-08-29 Thread Miklos Szeredi
On Sat, Aug 27, 2016 at 11:55 AM, Miklos Szeredi wrote: > > On Wed, Aug 24, 2016 at 11:40 PM, Hannes Frederic Sowa > wrote: > > On 24.08.2016 16:24, Nikolay Borisov wrote: > >> Hello, > >> > >> I hit the following BUG: > &g

Re: kernel BUG at net/unix/garbage.c:149!"

2016-08-27 Thread Miklos Szeredi
On Wed, Aug 24, 2016 at 11:40 PM, Hannes Frederic Sowa wrote: > On 24.08.2016 16:24, Nikolay Borisov wrote: >> Hello, >> >> I hit the following BUG: >> >> [1851513.239831] [ cut here ] >> [1851513.240079] kernel BUG at net/unix/garbage.c:149! >> [1851513.240313] invalid opc

Re: [PATCH 00/28] Swap over NFS -v16

2008-02-26 Thread Miklos Szeredi
> > > > mm-page_file_methods.patch > > > > > > > > This makes page_offset and others more expensive by adding a > > > > conditional jump to a function call that is not usually made. > > > > > > > > Why do swap pages have a different index to everyone else? > > > > > > Because the pag

Re: [PATCH 00/28] Swap over NFS -v16

2008-02-26 Thread Miklos Szeredi
> > mm-page_file_methods.patch > > > > This makes page_offset and others more expensive by adding a > > conditional jump to a function call that is not usually made. > > > > Why do swap pages have a different index to everyone else? > > Because the page->index of an anonymous page is

Re: [PATCH 22/28] mm: add support for non block device backed swap files

2008-02-26 Thread Miklos Szeredi
is not really needed. Just require ->set_page_dirty() be filled in by filesystems which want swapfiles (and others too, in the longer term, the fallback is just historical crud). Here's an incremental patch addressing these issues and beautifying t

Re: [PATCH resend] rewrite AF_UNIX garbage collector, fixes race

2007-07-12 Thread Miklos Szeredi
> This looks good, patch applied and I'll get this into the > 2.6.23 merge window. > > Once this sits around for a while and we feel super-confident > with it we can consider a backport into -stable. OK. Thanks for the review. Miklos - To unsubscribe from this list: send the line "unsubscribe n

Re: [PATCH resend] rewrite AF_UNIX garbage collector, fixes race

2007-07-11 Thread Miklos Szeredi
> > Dave, I really appreciate the work you do. Please forgive my > > impatience. > > No problem. > > Your patch is first in line for me to review tomorrow ok? Great, thanks. Miklos - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED]

Re: [PATCH resend] rewrite AF_UNIX garbage collector, fixes race

2007-07-11 Thread Miklos Szeredi
> > This may seem low priority and irrelevant, but it _is_ a bug, and it's > > affecting a real world application. So please take that into > > consideration. > > I'm not the only person who hasn't reviewed your latest patch yet. > > You may want to consider that this might have something to do

Re: [PATCH resend] rewrite AF_UNIX garbage collector, fixes race

2007-07-10 Thread Miklos Szeredi
> > But myself, nor any other developers, are going to review your work > > any faster if you do things like try to slip things in behind the > > maintainer's back as you attempted to do yesterday by asking Andrew to > > put your AF_UNIX garbage collector rewrite directly into his -mm tree. > > mm

Re: [PATCH re-resend] fix race in AF_UNIX garbage collector

2007-07-10 Thread Miklos Szeredi
> > On Tue, 10 Jul 2007 11:50:30 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > > > Can you please add this to -mm. Sometimes that has wonderful effect > > > on the willingness of people to look at a patch. > > > > sure ;) > > Andrew

[PATCH re-resend] fix race in AF_UNIX garbage collector

2007-07-10 Thread Miklos Szeredi
least. Thanks, Miklos From: Miklos Szeredi <[EMAIL PROTECTED]> Throw out the old mark & sweep garbage collector and put in a refcounting cycle detecting one. The old one had a race with recvmsg, that resulted in false positives and hence data loss. The old algorithm operated on all

[PATCH resend] rewrite AF_UNIX garbage collector, fixes race

2007-07-04 Thread Miklos Szeredi
From: Miklos Szeredi <[EMAIL PROTECTED]> Throw out the old mark & sweep garbage collector and put in a refcounting cycle detecting one. The old one had a race with recvmsg, that resulted in false positives and hence data loss. The old algorithm operated on all unix sockets in the syst

[PATCH] rewrite AF_UNIX garbage collector

2007-06-27 Thread Miklos Szeredi
Please review. Apologies if the patch itself is not too readable due to lots of code being replaced, but the end result is quite clear I think. From: Miklos Szeredi <[EMAIL PROTECTED]> Throw out the old mark & sweep garbage collector and put in a refcounting cycle detecting one

Re: [PATCH] fix race in AF_UNIX

2007-06-26 Thread Miklos Szeredi
> > Right. But the devil is in the details, and (as you correctly point > > out later) to implement this, the whole locking scheme needs to be > > overhauled. Problems: > > > > - Using the queue lock to make the dequeue and the fd detach atomic > >wrt the GC is difficult, if not impossible:

Re: [PATCH] fix race in AF_UNIX

2007-06-23 Thread Miklos Szeredi
t or > >> > vice versa during garbage collection. Since gc is done with a > >> > spinlock held, this only shows up on SMP. > >> > > >> > Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> > >> > >> I'm going to hold of

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > No, correctness always trumps performance. Lost packets on an AF_UNIX > > socket are _unexceptable_, and this is definitely not a theoretical > > problem. > > If its so unacceptable why has nobody noticed until now - its a bug > clearly, it needs fixing clearly, but unless you can produce som

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > > I'm all for fixing this gc mess that we have now. But please don't > > > expect me to be the one who's doing it. > > > > Don't worry, I only expect you to make the situation worse :-) > > In any event, I'll try to find some time to look more at your patch. > > But just like you don't want

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > I'm all for fixing this gc mess that we have now. But please don't > > expect me to be the one who's doing it. > > Don't worry, I only expect you to make the situation worse :-) That's real nice. Looks like finding and fixing bugs in not appreciated in the networking subsystem :-/ Miklos -

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > but it's not as if it's really going to affect performance > > in real cases. > > Since these circumstances are creatable by any user, we have > to consider the cases caused by malicious entities. OK. But then the whole gc thing is already broken, since a user can DoS socket creation/destruc

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> * Thomas Graf <[EMAIL PROTECTED]> 2007-06-18 12:32 > > * Miklos Szeredi <[EMAIL PROTECTED]> 2007-06-18 11:44 > > > Garbage collection only ever happens, if the app is sending AF_UNIX > > > sockets over AF_UNIX sockets. Which is a rather rare case. And whi

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> * Miklos Szeredi <[EMAIL PROTECTED]> 2007-06-18 11:44 > > Garbage collection only ever happens, if the app is sending AF_UNIX > > sockets over AF_UNIX sockets. Which is a rather rare case. And which > > is basically why this bug went unnoticed for so long. >

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > > Secondarily, this bug has been around for years and nobody noticed. > > > The world will not explode if this bug takes a few more days or > > > even a week to work out. Let's do it right instead of ramming > > > arbitrary turds into the kernel. > > > > Fine, but just wishing a bug to get fi

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > > > And is anyone working on a better patch? > > > > > > I have no idea. > > > > > > > Those patches aren't "bad" in the correctness sense. So IMO any one > > > > of them is better, than having that bug in there. > > > > > > You're adding a very serious performance regression, which is > >

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> > And is anyone working on a better patch? > > I have no idea. > > > Those patches aren't "bad" in the correctness sense. So IMO any one > > of them is better, than having that bug in there. > > You're adding a very serious performance regression, which is > about as bad as the bug itself. N

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
> From: Miklos Szeredi <[EMAIL PROTECTED]> > Date: Mon, 18 Jun 2007 09:49:32 +0200 > > > Ping Dave, > > > > Since there doesn't seem to be any new ideas forthcoming, can we > > please decide on either one of my two sumbitted patches? > > Yo

Re: [PATCH] fix race in AF_UNIX

2007-06-18 Thread Miklos Szeredi
away > > > perfectly good packets with AF_UNIX sockets in them. > > > > > > The problems arise when a socket goes from installed to in-flight or > > > vice versa during garbage collection. Since gc is done with a > > > spinlock held, this only shows u

Re: [PATCH] fix race in AF_UNIX

2007-06-11 Thread Miklos Szeredi
ice versa during garbage collection. Since gc is done with a > > spinlock held, this only shows up on SMP. > > > > Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> > > I'm going to hold off on this one for now. > > Holding all of the read locks kind of

Re: [PATCH] fix race in AF_UNIX

2007-06-06 Thread Miklos Szeredi
r a short duration, and unix_gc() should only rarely be called. So > > I don't think there's any performance problem here. > > It pulls a non-local cacheline into the local thread, that's extremely > expensive on SMP. OK, here's an updated patch, that uses -&

Re: [PATCH] fix race in AF_UNIX

2007-06-05 Thread Miklos Szeredi
> > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Date: Mon, 04 Jun 2007 11:45:32 +0200 > > > > > > A recv() on an AF_UNIX, SOCK_STREAM socket can race with a > > > > send()+close() on the peer, causing recv() to return zero, even

Re: [PATCH] fix race in AF_UNIX

2007-06-05 Thread Miklos Szeredi
> > I just want to win the "who's laziest?" league. It would take me > > about 5 minutes to get the netdev tree and test compile the change. > > Of which 5 seconds would be actually updating the patch. I was > > thought it was OK to pass that 5 seconds worth of hard work to you in > > order to sa

Re: [PATCH] fix race in AF_UNIX

2007-06-05 Thread Miklos Szeredi
lector, that can throw away perfectly good > > packets with AF_UNIX sockets in them. > > > > The problems arise when a socket goes from installed to in-flight or > > vica versa during garbage collection. Since gc is done with a > > spinlock held, this only shows up

Re: [PATCH] fix race in AF_UNIX

2007-06-04 Thread Miklos Szeredi
s arise when a socket goes from installed to in-flight or vica versa during garbage collection. Since gc is done with a spinlock held, this only shows up on SMP. The following patch fixes it for me, but it's possibly the wrong approach. Signed-off-by: Miklos Szeredi <[EMAIL PROT

Re: [PATCH] fix race in AF_UNIX

2007-06-04 Thread Miklos Szeredi
-flight or vica versa during garbage collection. Since gc is done with a spinlock held, this only shows up on SMP. The following patch fixes it for me, but it's possibly the wrong approach. Signed-off-by: Miklos Szeredi <[EMAIL PROT

[PATCH] fix race in AF_UNIX

2007-06-02 Thread Miklos Szeredi
From: Miklos Szeredi <[EMAIL PROTECTED]> A recv() on an AF_UNIX, SOCK_STREAM socket can race with a send()+close() on the peer, causing recv() to return zero, even though the sent data should be received. This happens if the send() and the close() is performed between skb_dequeue() and ch

[PATCH] file descriptor loss while receiving SCM_RIGHTS

2006-10-08 Thread Miklos Szeredi
patch makes sure, that at least the already installed fds are sent to userspace. It doesn't solve the issue of losing file descriptors in case of an EFAULT on the userspace buffer. Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> --- Index: linux/net