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]
Message-ID: <1424324307.18191.5.camel@stgolabs.net>
Date:	Wed, 18 Feb 2015 21:38:27 -0800
From:	Davidlohr Bueso <dave@...olabs.net>
To:	akpm@...ux-foundation.org
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	takedakn@...data.co.jp, penguin-kernel@...ove.SAKURA.ne.jp,
	linux-security-module@...r.kernel.org
Subject: Re: [PATCH 3/3] tomoyo: robustify handling of mm->exe_file

On Wed, 2015-02-18 at 16:10 -0800, Davidlohr Bueso wrote:
> +static const char *tomoyo_get_exe(struct mm_struct *mm)
> +{
> +	struct file *exe_file;
> +	const char *cp = NULL;
> +
> +	if (!mm)
> +		return NULL;
> +	exe_file = get_mm_exe_file(mm);
> +	if (!exe_file)
> +		return NULL;
> +
> +	cp = tomoyo_realpath_from_path(&exe_file->f_path);

tomoyo_realpath_from_path can return NULL here, thus we'd leak the
f_path in the caller... I guess this should be:

> +	path_get(&exe_file->f_path);

	if (cp)
		path_get(&exe_file->f_path);

> +	fput(exe_file);
> +	return cp;
> +}

--
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