Re: [PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-18 Thread Greg KH
On Tue, Jan 15, 2019 at 12:47:34PM -0800, Kees Cook wrote: > On Sat, Jan 12, 2019 at 7:28 AM Willy Tarreau wrote: > > > > From: Silvio Cesare > > > > Change snprintf to scnprintf. There are generally two cases where using > > snprintf causes problems. > > > > 1) Uses of size += snprintf(buf, SIZE

Re: [PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-15 Thread Kees Cook
On Sat, Jan 12, 2019 at 7:28 AM Willy Tarreau wrote: > > From: Silvio Cesare > > Change snprintf to scnprintf. There are generally two cases where using > snprintf causes problems. > > 1) Uses of size += snprintf(buf, SIZE - size, fmt, ...) > In this case, if snprintf would have written more char

Re: [PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-14 Thread Willy Tarreau
Hi Kees, On Mon, Jan 14, 2019 at 05:02:51PM -0800, Kees Cook wrote: > On Sat, Jan 12, 2019 at 7:28 AM Willy Tarreau wrote: > > > > From: Silvio Cesare > > > > Change snprintf to scnprintf. There are generally two cases where using > > snprintf causes problems. > > (I didn't find a 0/8 cover let

Re: [PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-14 Thread Kees Cook
On Mon, Jan 14, 2019 at 5:02 PM Kees Cook wrote: > On Sat, Jan 12, 2019 at 7:28 AM Willy Tarreau wrote: > > From: Silvio Cesare > > Change snprintf to scnprintf. There are generally two cases where using > > snprintf causes problems. > > (I didn't find a 0/8 cover letter, so I'm replying here...

Re: [PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-14 Thread Kees Cook
On Sat, Jan 12, 2019 at 7:28 AM Willy Tarreau wrote: > > From: Silvio Cesare > > Change snprintf to scnprintf. There are generally two cases where using > snprintf causes problems. (I didn't find a 0/8 cover letter, so I'm replying here...) Many of these fixes are just robustness updates (e.g.

[PATCH 1/8] lkdtm: change snprintf to scnprintf for possible overflow

2019-01-12 Thread Willy Tarreau
From: Silvio Cesare Change snprintf to scnprintf. There are generally two cases where using snprintf causes problems. 1) Uses of size += snprintf(buf, SIZE - size, fmt, ...) In this case, if snprintf would have written more characters than what the buffer size (SIZE) is, then size will end up la