Re: [PATCH v2] net/packet: initialize val in packet_getsockopt()

2017-04-25 Thread Alexander Potapenko
On Tue, Apr 25, 2017 at 6:32 PM, David Miller wrote: > From: Alexander Potapenko > Date: Tue, 25 Apr 2017 18:27:04 +0200 > >> On Tue, Apr 25, 2017 at 5:44 PM, David Miller wrote: >>> From: Alexander Potapenko >>> Date: Mon, 24 Apr 2017 14:59:14 +0200 >>> In the case getsockopt() is called

Re: [PATCH v2] net/packet: initialize val in packet_getsockopt()

2017-04-25 Thread David Miller
From: Alexander Potapenko Date: Tue, 25 Apr 2017 18:27:04 +0200 > On Tue, Apr 25, 2017 at 5:44 PM, David Miller wrote: >> From: Alexander Potapenko >> Date: Mon, 24 Apr 2017 14:59:14 +0200 >> >>> In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4 >>> |val| remains uninitialize

Re: [PATCH v2] net/packet: initialize val in packet_getsockopt()

2017-04-25 Thread Alexander Potapenko
On Tue, Apr 25, 2017 at 5:44 PM, David Miller wrote: > From: Alexander Potapenko > Date: Mon, 24 Apr 2017 14:59:14 +0200 > >> In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4 >> |val| remains uninitialized and the syscall may behave differently >> depending on its value. This

Re: [PATCH v2] net/packet: initialize val in packet_getsockopt()

2017-04-25 Thread David Miller
From: Alexander Potapenko Date: Mon, 24 Apr 2017 14:59:14 +0200 > In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4 > |val| remains uninitialized and the syscall may behave differently > depending on its value. This doesn't have security consequences (as the > uninit bytes aren

[PATCH v2] net/packet: initialize val in packet_getsockopt()

2017-04-24 Thread Alexander Potapenko
In the case getsockopt() is called with PACKET_HDRLEN and optlen < 4 |val| remains uninitialized and the syscall may behave differently depending on its value. This doesn't have security consequences (as the uninit bytes aren't copied back), but it's still cleaner to initialize |val| and ensure opt