[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120918174729.GA27841@redhat.com>
Date: Tue, 18 Sep 2012 19:47:29 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Roland McGrath <roland@...k.frob.com>
Cc: Denys Vlasenko <vda.linux@...glemail.com>,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Amerigo Wang <amwang@...hat.com>,
"Jonathan M. Foote" <jmfoote@...t.org>,
Pedro Alves <palves@...hat.com>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists