Re: [PATCH 5/8] scsi: lpfc: change snprintf to scnprintf for possible overflow

2019-03-20 Thread James Smart
On 3/20/2019 10:39 AM, Greg KH wrote: On Tue, Jan 15, 2019 at 02:41:17PM -0800, James Smart wrote: On 1/14/2019 5:15 PM, Kees Cook wrote: On Sat, Jan 12, 2019 at 7:29 AM Willy Tarreau wrote: From: Silvio Cesare Change snprintf to scnprintf. There are generally two cases where using snprintf

Re: [PATCH 5/8] scsi: lpfc: change snprintf to scnprintf for possible overflow

2019-03-20 Thread James Smart
On 3/20/2019 10:39 AM, Greg KH wrote: On Tue, Jan 15, 2019 at 02:41:17PM -0800, James Smart wrote: On 1/14/2019 5:15 PM, Kees Cook wrote: On Sat, Jan 12, 2019 at 7:29 AM Willy Tarreau wrote: From: Silvio Cesare Change snprintf to scnprintf. There are generally two cases where using snprintf

Re: [PATCH 5/8] scsi: lpfc: change snprintf to scnprintf for possible overflow

2019-03-20 Thread Greg KH
On Tue, Jan 15, 2019 at 02:41:17PM -0800, James Smart wrote: > > On 1/14/2019 5:15 PM, Kees Cook wrote: > > On Sat, Jan 12, 2019 at 7:29 AM Willy Tarreau wrote: > > > From: Silvio Cesare > > > > > > Change snprintf to scnprintf. There are generally two cases where using > > > snprintf causes

Re: [PATCH 5/8] scsi: lpfc: change snprintf to scnprintf for possible overflow

2019-01-15 Thread James Smart
On 1/14/2019 5:15 PM, Kees Cook wrote: On Sat, Jan 12, 2019 at 7:29 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

Re: [PATCH 5/8] scsi: lpfc: change snprintf to scnprintf for possible overflow

2019-01-14 Thread Kees Cook
On Sat, Jan 12, 2019 at 7:29 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

[PATCH 5/8] scsi: lpfc: 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