Re: [patch 2/2] lib/string.c: strlcpy() might read too far

2014-04-15 Thread Dan Carpenter
On Mon, Apr 14, 2014 at 02:46:15PM -0700, Andrew Morton wrote: > On Wed, 2 Apr 2014 11:47:31 +0300 Dan Carpenter > wrote: > > > Imagine you have a user controlled variable at the end of a struct which > > is allocated at the end of a page. The strlen() could read beyond the > > mapped memory an

Re: [patch 2/2] lib/string.c: strlcpy() might read too far

2014-04-14 Thread Dave Jones
On Wed, Apr 02, 2014 at 11:47:31AM +0300, Dan Carpenter wrote: > Imagine you have a user controlled variable at the end of a struct which > is allocated at the end of a page. The strlen() could read beyond the > mapped memory and cause an oops. > > Probably there are two reasons why we have

Re: [patch 2/2] lib/string.c: strlcpy() might read too far

2014-04-14 Thread Andrew Morton
On Wed, 2 Apr 2014 11:47:31 +0300 Dan Carpenter wrote: > Imagine you have a user controlled variable at the end of a struct which > is allocated at the end of a page. The strlen() could read beyond the > mapped memory and cause an oops. Well, it's hard to conceive of a situation where anything