lkml.org 
[lkml]   [2012]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm v2] coredump: extend core dump note section to contain file names of mapped files
On 09/18, Oleg Nesterov wrote:
>
> Or perhaps 'filename = ""' case can handle this case itself. In this
> case we do not even need strlen(), remaining = name - filename.

IOW. Denys, this is up to you and _iirc_ this was already discussed
(just I don't remember the result), but perhaps

if (IS_ERR(filename)) {
if (-ENAMETOOLONG) {
...
goto retry;
}
remaining--;
*name++ = 0;
} else {
remaining = name - filename;
strcpy(name, filename);
}

Hmm. And I just noticed that 'filename = ""' case does not verify
there is a room to write a single '\0' :/

So, afaics you also need

- if (-ENAMETOOLONG)
+ if (-ENAMETOOLONG || !remaining)

or I missed something.

Oleg.



\
 
 \ /
  Last update: 2012-09-18 20:21    [W:0.094 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site