Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread Hannes Frederic Sowa
On Di, 2014-09-30 at 11:18 +, David Laight wrote: > From: Hannes Frederic > > On Di, 2014-09-30 at 08:20 +, David Laight wrote: > > > From: Hannes Frederic > > > > On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: > > > > > On Mon, Sep 29, 2014 at 4:04 AM, David Laight > > > > > wrote:

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread Michael S. Tsirkin
On Mon, Sep 29, 2014 at 12:48:47PM -0700, Kees Cook wrote: > On Mon, Sep 29, 2014 at 4:48 AM, Michael S. Tsirkin wrote: > > On Sun, Sep 28, 2014 at 04:27:53PM -0700, Kees Cook wrote: > >> This makes the size argument a const, since it is always populated by > >> the caller. Additionally double-che

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread David Laight
From: Hannes Frederic > On Di, 2014-09-30 at 08:20 +, David Laight wrote: > > From: Hannes Frederic > > > On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: > > > > On Mon, Sep 29, 2014 at 4:04 AM, David Laight > > > > wrote: > > > > > From: Kees Cook > > > > >> This makes the size argument

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread Hannes Frederic Sowa
On Di, 2014-09-30 at 08:20 +, David Laight wrote: > From: Hannes Frederic > > On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: > > > On Mon, Sep 29, 2014 at 4:04 AM, David Laight > > > wrote: > > > > From: Kees Cook > > > >> This makes the size argument a const, since it is always populated

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread David Laight
From: Hannes Frederic > On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: > > On Mon, Sep 29, 2014 at 4:04 AM, David Laight > > wrote: > > > From: Kees Cook > > >> This makes the size argument a const, since it is always populated by > > >> the caller. > > > > > > There is almost no point making

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread Hannes Frederic Sowa
On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: > On Mon, Sep 29, 2014 at 4:04 AM, David Laight wrote: > > From: Kees Cook > >> This makes the size argument a const, since it is always populated by > >> the caller. > > > > There is almost no point making parameters 'const. > > ('const foo *' ma

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread Kees Cook
On Mon, Sep 29, 2014 at 4:48 AM, Michael S. Tsirkin wrote: > On Sun, Sep 28, 2014 at 04:27:53PM -0700, Kees Cook wrote: >> This makes the size argument a const, since it is always populated by >> the caller. Additionally double-checks to make sure the copy_from_user >> can never overflow, keeping

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread Kees Cook
On Mon, Sep 29, 2014 at 4:04 AM, David Laight wrote: > From: Kees Cook >> This makes the size argument a const, since it is always populated by >> the caller. > > There is almost no point making parameters 'const. > ('const foo *' makes sense). > >> Additionally double-checks to make sure the copy

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread Michael S. Tsirkin
On Mon, Sep 29, 2014 at 02:48:49PM +0300, Michael S. Tsirkin wrote: > On Sun, Sep 28, 2014 at 04:27:53PM -0700, Kees Cook wrote: > > This makes the size argument a const, since it is always populated by > > the caller. Additionally double-checks to make sure the copy_from_user > > can never overflo

Re: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread Michael S. Tsirkin
On Sun, Sep 28, 2014 at 04:27:53PM -0700, Kees Cook wrote: > This makes the size argument a const, since it is always populated by > the caller. Additionally double-checks to make sure the copy_from_user > can never overflow, keeping CONFIG_DEBUG_STRICT_USER_COPY_CHECKS happy: > >In function '

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread David Laight
From: Kees Cook > This makes the size argument a const, since it is always populated by > the caller. There is almost no point making parameters 'const. ('const foo *' makes sense). > Additionally double-checks to make sure the copy_from_user > can never overflow, keeping CONFIG_DEBUG_STRICT_USER

[PATCH] tun: make sure interface usage can not overflow

2014-09-28 Thread Kees Cook
This makes the size argument a const, since it is always populated by the caller. Additionally double-checks to make sure the copy_from_user can never overflow, keeping CONFIG_DEBUG_STRICT_USER_COPY_CHECKS happy: In function 'copy_from_user', inlined from '__tun_chr_ioctl' at drivers/net