Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-06 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 11:15:29PM +0300, Dan Carpenter wrote: > > > diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h > > > index e863dd5..5e0fc2b 100644 > > > --- a/include/acpi/platform/acenv.h > > > +++ b/include/acpi/platform/acenv.h > > > > This is an ACPICA header

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-06 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 11:15:29PM +0300, Dan Carpenter wrote: diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index e863dd5..5e0fc2b 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h This is an ACPICA header and changes to

RE: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-04 Thread Zheng, Lv
Hi, > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Thursday, May 01, 2014 4:15 AM > > On Wed, Apr 30, 2014 at 09:49:23PM +0200, Rafael J. Wysocki wrote: > > On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: > > > There are sometimes where we know that we are doing an

RE: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-04 Thread Zheng, Lv
Hi, From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Thursday, May 01, 2014 4:15 AM On Wed, Apr 30, 2014 at 09:49:23PM +0200, Rafael J. Wysocki wrote: On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: There are sometimes where we know that we are doing an strcpy()

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-01 Thread Dan Carpenter
Ah. Fantastic. That's all great stuff. I'm on holiday today but I'll send a new later in the week. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-05-01 Thread Dan Carpenter
Ah. Fantastic. That's all great stuff. I'm on holiday today but I'll send a new later in the week. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Solar Designer
On Wed, Apr 30, 2014 at 06:08:44PM +0300, Dan Carpenter wrote: > There are sometimes where we know that we are doing an strcpy() into a > fixed length buffer. In those cases, we could verify that the strcpy() > doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS > if you want

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 09:49:23PM +0200, Rafael J. Wysocki wrote: > On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: > > There are sometimes where we know that we are doing an strcpy() into a > > fixed length buffer. In those cases, we could verify that the strcpy() > > doesn't

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Rafael J. Wysocki
On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: > There are sometimes where we know that we are doing an strcpy() into a > fixed length buffer. In those cases, we could verify that the strcpy() > doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS > if you want

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Kees Cook
On Wed, Apr 30, 2014 at 9:19 AM, Dan Carpenter wrote: > On Wed, Apr 30, 2014 at 08:33:21AM -0700, Kees Cook wrote: >> On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter >> wrote: >> > +#if CONFIG_DEBUG_STRICT_SLOW_STRCPY_CHECKS >> > +#define strcpy(dest, src) do {

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 08:33:21AM -0700, Kees Cook wrote: > On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter > wrote: > > +#if CONFIG_DEBUG_STRICT_SLOW_STRCPY_CHECKS > > +#define strcpy(dest, src) do { \ > > + int len = __compiletime_size(dest);

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Kees Cook
On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter wrote: > There are sometimes where we know that we are doing an strcpy() into a > fixed length buffer. In those cases, we could verify that the strcpy() > doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS > if you want to

[patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS if you want to check for that. The downside is that it makes strcpy slower. I

[patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS if you want to check for that. The downside is that it makes strcpy slower. I

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Kees Cook
On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter dan.carpen...@oracle.com wrote: There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 08:33:21AM -0700, Kees Cook wrote: On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter dan.carpen...@oracle.com wrote: +#if CONFIG_DEBUG_STRICT_SLOW_STRCPY_CHECKS +#define strcpy(dest, src) do { \ + int len =

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Kees Cook
On Wed, Apr 30, 2014 at 9:19 AM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Apr 30, 2014 at 08:33:21AM -0700, Kees Cook wrote: On Wed, Apr 30, 2014 at 8:08 AM, Dan Carpenter dan.carpen...@oracle.com wrote: +#if CONFIG_DEBUG_STRICT_SLOW_STRCPY_CHECKS +#define strcpy(dest, src) do

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Rafael J. Wysocki
On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS if you want to

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2014 at 09:49:23PM +0200, Rafael J. Wysocki wrote: On Wednesday, April 30, 2014 06:08:44 PM Dan Carpenter wrote: There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow.

Re: [patch] lib: check for strcpy() overflows to fixed length buffers

2014-04-30 Thread Solar Designer
On Wed, Apr 30, 2014 at 06:08:44PM +0300, Dan Carpenter wrote: There are sometimes where we know that we are doing an strcpy() into a fixed length buffer. In those cases, we could verify that the strcpy() doesn't overflow. This patch introduces DEBUG_STRICT_SLOW_STRCPY_CHECKS if you want to