Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-13 16:17, Cong Wang wrote: > On Tue, Dec 13, 2016 at 2:52 AM, Richard Guy Briggs wrote: > > It is actually the audit_pid and audit_nlk_portid that I care about > > more. The audit daemon could vanish or close the socket while the > > kernel sock to which it was

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-13 16:17, Cong Wang wrote: > On Tue, Dec 13, 2016 at 2:52 AM, Richard Guy Briggs wrote: > > It is actually the audit_pid and audit_nlk_portid that I care about > > more. The audit daemon could vanish or close the socket while the > > kernel sock to which it was attached is still quite

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Cong Wang
On Tue, Dec 13, 2016 at 2:52 AM, Richard Guy Briggs wrote: > It is actually the audit_pid and audit_nlk_portid that I care about > more. The audit daemon could vanish or close the socket while the > kernel sock to which it was attached is still quite valid. Accessing > the set

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Cong Wang
On Tue, Dec 13, 2016 at 2:52 AM, Richard Guy Briggs wrote: > It is actually the audit_pid and audit_nlk_portid that I care about > more. The audit daemon could vanish or close the socket while the > kernel sock to which it was attached is still quite valid. Accessing > the set of three

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-12 16:10, Cong Wang wrote: > On Mon, Dec 12, 2016 at 2:02 AM, Richard Guy Briggs wrote: > > On 2016-12-09 20:13, Cong Wang wrote: > >> Netlink notifier can safely be converted to blocking one, I will send > >> a patch. > > > > I had a quick look at how that might

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-12 16:10, Cong Wang wrote: > On Mon, Dec 12, 2016 at 2:02 AM, Richard Guy Briggs wrote: > > On 2016-12-09 20:13, Cong Wang wrote: > >> Netlink notifier can safely be converted to blocking one, I will send > >> a patch. > > > > I had a quick look at how that might happen. The netlink

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-13 02:51, Richard Guy Briggs wrote: > On 2016-12-09 23:40, Cong Wang wrote: > > On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > > > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs > > > wrote: > > >> On 2016-12-08 22:57, Cong Wang

Re: netlink: GPF in sock_sndtimeo

2016-12-13 Thread Richard Guy Briggs
On 2016-12-13 02:51, Richard Guy Briggs wrote: > On 2016-12-09 23:40, Cong Wang wrote: > > On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > > > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs > > > wrote: > > >> On 2016-12-08 22:57, Cong Wang wrote: > > >>> On Thu, Dec 8, 2016 at 10:02 PM,

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Richard Guy Briggs
On 2016-12-09 23:40, Cong Wang wrote: > On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > >> On 2016-12-08 22:57, Cong Wang wrote: > >>> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Richard Guy Briggs
On 2016-12-09 23:40, Cong Wang wrote: > On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > >> On 2016-12-08 22:57, Cong Wang wrote: > >>> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs > >>> wrote: > >>> > I also tried to

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Cong Wang
On Mon, Dec 12, 2016 at 2:02 AM, Richard Guy Briggs wrote: > On 2016-12-09 20:13, Cong Wang wrote: >> Netlink notifier can safely be converted to blocking one, I will send >> a patch. > > I had a quick look at how that might happen. The netlink notifier chain > is atomic. Would

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Cong Wang
On Mon, Dec 12, 2016 at 2:02 AM, Richard Guy Briggs wrote: > On 2016-12-09 20:13, Cong Wang wrote: >> Netlink notifier can safely be converted to blocking one, I will send >> a patch. > > I had a quick look at how that might happen. The netlink notifier chain > is atomic. Would the registered

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Dmitry Vyukov
On Sat, Dec 10, 2016 at 8:40 AM, Cong Wang wrote: >>> On 2016-12-08 22:57, Cong Wang wrote: On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > I also tried to extend Cong Wang's idea to attempt to proactively > respond to

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Dmitry Vyukov
On Sat, Dec 10, 2016 at 8:40 AM, Cong Wang wrote: >>> On 2016-12-08 22:57, Cong Wang wrote: On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > I also tried to extend Cong Wang's idea to attempt to proactively > respond to a > NETLINK_URELEASE on the

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Richard Guy Briggs
On 2016-12-09 20:13, Cong Wang wrote: > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > > On 2016-12-08 22:57, Cong Wang wrote: > >> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs > >> wrote: > >> > I also tried to extend Cong Wang's idea to

Re: netlink: GPF in sock_sndtimeo

2016-12-12 Thread Richard Guy Briggs
On 2016-12-09 20:13, Cong Wang wrote: > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > > On 2016-12-08 22:57, Cong Wang wrote: > >> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs > >> wrote: > >> > I also tried to extend Cong Wang's idea to attempt to proactively > >> >

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Cong Wang
On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: >> On 2016-12-08 22:57, Cong Wang wrote: >>> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: >>> > I also tried to

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Cong Wang
On Fri, Dec 9, 2016 at 8:13 PM, Cong Wang wrote: > On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: >> On 2016-12-08 22:57, Cong Wang wrote: >>> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: >>> > I also tried to extend Cong Wang's idea to attempt to proactively respond

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Cong Wang
On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > On 2016-12-08 22:57, Cong Wang wrote: >> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: >> > I also tried to extend Cong Wang's idea to attempt to proactively respond >> > to a >> >

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Cong Wang
On Fri, Dec 9, 2016 at 3:01 AM, Richard Guy Briggs wrote: > On 2016-12-08 22:57, Cong Wang wrote: >> On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: >> > I also tried to extend Cong Wang's idea to attempt to proactively respond >> > to a >> > NETLINK_URELEASE on the audit_sock and

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-09 12:53, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 12:48 PM, Richard Guy Briggs wrote: > > On 2016-12-09 11:49, Dmitry Vyukov wrote: > >> On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > >> > On 2016-11-29 23:52, Richard Guy Briggs

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-09 12:53, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 12:48 PM, Richard Guy Briggs wrote: > > On 2016-12-09 11:49, Dmitry Vyukov wrote: > >> On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > >> > On 2016-11-29 23:52, Richard Guy Briggs wrote: > >> > I tried a quick compile

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Dmitry Vyukov
On Fri, Dec 9, 2016 at 12:48 PM, Richard Guy Briggs wrote: > On 2016-12-09 11:49, Dmitry Vyukov wrote: >> On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: >> > On 2016-11-29 23:52, Richard Guy Briggs wrote: >> > I tried a quick compile attempt on the

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Dmitry Vyukov
On Fri, Dec 9, 2016 at 12:48 PM, Richard Guy Briggs wrote: > On 2016-12-09 11:49, Dmitry Vyukov wrote: >> On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: >> > On 2016-11-29 23:52, Richard Guy Briggs wrote: >> > I tried a quick compile attempt on the test case (I assume it is a >> >

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-09 11:49, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > > On 2016-11-29 23:52, Richard Guy Briggs wrote: > > I tried a quick compile attempt on the test case (I assume it is a > > socket fuzzer) and get the following compile error:

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-09 11:49, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > > On 2016-11-29 23:52, Richard Guy Briggs wrote: > > I tried a quick compile attempt on the test case (I assume it is a > > socket fuzzer) and get the following compile error: > > cc -g -O0

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-08 22:57, Cong Wang wrote: > On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > > I also tried to extend Cong Wang's idea to attempt to proactively respond > > to a > > NETLINK_URELEASE on the audit_sock and reset it, but ran into a locking > > error > >

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Richard Guy Briggs
On 2016-12-08 22:57, Cong Wang wrote: > On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > > I also tried to extend Cong Wang's idea to attempt to proactively respond > > to a > > NETLINK_URELEASE on the audit_sock and reset it, but ran into a locking > > error > > stack dump using

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Dmitry Vyukov
On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > On 2016-11-29 23:52, Richard Guy Briggs wrote: >> On 2016-11-29 15:13, Cong Wang wrote: >> > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs >> > wrote: >> > > On 2016-11-26 17:11, Cong Wang wrote:

Re: netlink: GPF in sock_sndtimeo

2016-12-09 Thread Dmitry Vyukov
On Fri, Dec 9, 2016 at 7:02 AM, Richard Guy Briggs wrote: > On 2016-11-29 23:52, Richard Guy Briggs wrote: >> On 2016-11-29 15:13, Cong Wang wrote: >> > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs >> > wrote: >> > > On 2016-11-26 17:11, Cong Wang wrote: >> > >> It is racy on audit_sock,

Re: netlink: GPF in sock_sndtimeo

2016-12-08 Thread Cong Wang
On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > I also tried to extend Cong Wang's idea to attempt to proactively respond to a > NETLINK_URELEASE on the audit_sock and reset it, but ran into a locking error > stack dump using mutex_lock(_cmd_mutex) in the notifier

Re: netlink: GPF in sock_sndtimeo

2016-12-08 Thread Cong Wang
On Thu, Dec 8, 2016 at 10:02 PM, Richard Guy Briggs wrote: > I also tried to extend Cong Wang's idea to attempt to proactively respond to a > NETLINK_URELEASE on the audit_sock and reset it, but ran into a locking error > stack dump using mutex_lock(_cmd_mutex) in the notifier callback. >

Re: netlink: GPF in sock_sndtimeo

2016-12-08 Thread Richard Guy Briggs
On 2016-11-29 23:52, Richard Guy Briggs wrote: > On 2016-11-29 15:13, Cong Wang wrote: > > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > > > On 2016-11-26 17:11, Cong Wang wrote: > > >> It is racy on audit_sock, especially on the netns exit path. > > > > > > I

Re: netlink: GPF in sock_sndtimeo

2016-12-08 Thread Richard Guy Briggs
On 2016-11-29 23:52, Richard Guy Briggs wrote: > On 2016-11-29 15:13, Cong Wang wrote: > > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > > > On 2016-11-26 17:11, Cong Wang wrote: > > >> It is racy on audit_sock, especially on the netns exit path. > > > > > > I think that is the

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Richard Guy Briggs
On 2016-11-29 15:13, Cong Wang wrote: > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > > On 2016-11-26 17:11, Cong Wang wrote: > >> It is racy on audit_sock, especially on the netns exit path. > > > > I think that is the only place it is racy. The other places

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Richard Guy Briggs
On 2016-11-29 15:13, Cong Wang wrote: > On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > > On 2016-11-26 17:11, Cong Wang wrote: > >> It is racy on audit_sock, especially on the netns exit path. > > > > I think that is the only place it is racy. The other places audit_sock > > is set

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Cong Wang
On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > On 2016-11-26 17:11, Cong Wang wrote: >> It is racy on audit_sock, especially on the netns exit path. > > I think that is the only place it is racy. The other places audit_sock > is set is when the socket failure has

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Cong Wang
On Tue, Nov 29, 2016 at 8:48 AM, Richard Guy Briggs wrote: > On 2016-11-26 17:11, Cong Wang wrote: >> It is racy on audit_sock, especially on the netns exit path. > > I think that is the only place it is racy. The other places audit_sock > is set is when the socket failure has just triggered a

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Richard Guy Briggs
On 2016-11-26 17:11, Cong Wang wrote: > On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > > Hello, Eric, thanks for the heads up on this. (more below...) > > The following program triggers GPF in sock_sndtimeo: > >

Re: netlink: GPF in sock_sndtimeo

2016-11-29 Thread Richard Guy Briggs
On 2016-11-26 17:11, Cong Wang wrote: > On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > > Hello, Eric, thanks for the heads up on this. (more below...) > > The following program triggers GPF in sock_sndtimeo: > >

Re: netlink: GPF in sock_sndtimeo

2016-11-26 Thread Cong Wang
On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > Hello, > > The following program triggers GPF in sock_sndtimeo: > https://gist.githubusercontent.com/dvyukov/c19cadd309791cf5cb9b2bf936d3f48d/raw/1743ba0211079a5465d039512b427bc6b59b1a76/gistfile1.txt > > On commit

Re: netlink: GPF in sock_sndtimeo

2016-11-26 Thread Cong Wang
On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > Hello, > > The following program triggers GPF in sock_sndtimeo: > https://gist.githubusercontent.com/dvyukov/c19cadd309791cf5cb9b2bf936d3f48d/raw/1743ba0211079a5465d039512b427bc6b59b1a76/gistfile1.txt > > On commit

Re: netlink: GPF in sock_sndtimeo

2016-11-26 Thread Eric Dumazet
CC Richard Guy Briggs On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > Hello, > > The following program triggers GPF in sock_sndtimeo: >

Re: netlink: GPF in sock_sndtimeo

2016-11-26 Thread Eric Dumazet
CC Richard Guy Briggs On Sat, Nov 26, 2016 at 7:44 AM, Dmitry Vyukov wrote: > Hello, > > The following program triggers GPF in sock_sndtimeo: > https://gist.githubusercontent.com/dvyukov/c19cadd309791cf5cb9b2bf936d3f48d/raw/1743ba0211079a5465d039512b427bc6b59b1a76/gistfile1.txt > > On commit

netlink: GPF in sock_sndtimeo

2016-11-26 Thread Dmitry Vyukov
Hello, The following program triggers GPF in sock_sndtimeo: https://gist.githubusercontent.com/dvyukov/c19cadd309791cf5cb9b2bf936d3f48d/raw/1743ba0211079a5465d039512b427bc6b59b1a76/gistfile1.txt On commit 16ae16c6e5616c084168740990fc508bda6655d4 (Nov 24). general protection fault: [#1] SMP

netlink: GPF in sock_sndtimeo

2016-11-26 Thread Dmitry Vyukov
Hello, The following program triggers GPF in sock_sndtimeo: https://gist.githubusercontent.com/dvyukov/c19cadd309791cf5cb9b2bf936d3f48d/raw/1743ba0211079a5465d039512b427bc6b59b1a76/gistfile1.txt On commit 16ae16c6e5616c084168740990fc508bda6655d4 (Nov 24). general protection fault: [#1] SMP