lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ