Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-11 Thread Tetsuo Handa
Paul Moore wrote: > > + /* > > +* Nothing more to do if valid length is too short to check > > +* address->sa_family. > > +*/ > > + if (addrlen < offsetofend(struct sockaddr, sa_family)) > > + goto out; > > SELinux already checks the address length

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-11 Thread Paul Moore
On Thu, Apr 11, 2019 at 7:32 AM Tetsuo Handa wrote: > On 2019/04/04 13:49, David Miller wrote: > > From: Tetsuo Handa > > Date: Wed, 3 Apr 2019 06:07:40 +0900 > > > >> On 2019/04/03 5:23, David Miller wrote: > >>> Please fix RDS and other protocols to examine the length properly > >>> instead. >

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-11 Thread Casey Schaufler
On 4/11/2019 4:31 AM, Tetsuo Handa wrote: On 2019/04/04 13:49, David Miller wrote: From: Tetsuo Handa Date: Wed, 3 Apr 2019 06:07:40 +0900 On 2019/04/03 5:23, David Miller wrote: Please fix RDS and other protocols to examine the length properly instead. Do you prefer adding branches only fo

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-11 Thread Tetsuo Handa
On 2019/04/04 13:49, David Miller wrote: > From: Tetsuo Handa > Date: Wed, 3 Apr 2019 06:07:40 +0900 > >> On 2019/04/03 5:23, David Miller wrote: >>> Please fix RDS and other protocols to examine the length properly >>> instead. >> >> Do you prefer adding branches only for allow reading the famil

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-03 Thread David Miller
From: Tetsuo Handa Date: Wed, 3 Apr 2019 06:07:40 +0900 > On 2019/04/03 5:23, David Miller wrote: >> Please fix RDS and other protocols to examine the length properly >> instead. > > Do you prefer adding branches only for allow reading the family of socket > address? If the length is zero, the

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-02 Thread Tetsuo Handa
On 2019/04/03 5:23, David Miller wrote: > From: Tetsuo Handa > Date: Mon, 1 Apr 2019 23:19:22 +0900 > >> syzbot is reporting uninitialized value at rds_connect [1] and >> rds_bind [2]. This is because syzbot is passing ulen == 0 whereas >> these functions expects that it is safe to access sockad

Re: [PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-02 Thread David Miller
From: Tetsuo Handa Date: Mon, 1 Apr 2019 23:19:22 +0900 > syzbot is reporting uninitialized value at rds_connect [1] and > rds_bind [2]. This is because syzbot is passing ulen == 0 whereas > these functions expects that it is safe to access sockaddr->family field > in order to determine minimal

[PATCH] net: socket: Always initialize family field at move_addr_to_kernel().

2019-04-01 Thread Tetsuo Handa
syzbot is reporting uninitialized value at rds_connect [1] and rds_bind [2]. This is because syzbot is passing ulen == 0 whereas these functions expects that it is safe to access sockaddr->family field in order to determine minimal ulen size for validation. I noticed that the same problem also exis