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: <20140328101315.GB21330@arm.com>
Date:	Fri, 28 Mar 2014 10:13:15 +0000
From:	Catalin Marinas <catalin.marinas@....com>
To:	Li Zefan <lizefan@...wei.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH v3 2/4] kmemleak: allow freeing internal objects after
 kmemleak was disabled

More nitpicks ;)

On Fri, Mar 28, 2014 at 08:53:18AM +0000, Li Zefan wrote:
> diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
> index 6dc8013..a7e6a06 100644
> --- a/Documentation/kmemleak.txt
> +++ b/Documentation/kmemleak.txt
> @@ -51,7 +51,8 @@ Memory scanning parameters can be modified at run-time by writing to the
>  		  (default 600, 0 to stop the automatic scanning)
>    scan		- trigger a memory scan
>    clear		- clear list of current memory leak suspects, done by
> -		  marking all current reported unreferenced objects grey
> +		  marking all current reported unreferenced objects grey.
> +		  Or free all kmemleak objects if kmemleak has been disabled.

Comma after "unreferenced objects grey" and lower-case "or free ..."

> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index be7ecc0..6631df8 100644
[...]
> @@ -1690,17 +1711,16 @@ static const struct file_operations kmemleak_fops = {
>   */
>  static void kmemleak_do_cleanup(struct work_struct *work)
>  {
> -	struct kmemleak_object *object;
> -
>  	mutex_lock(&scan_mutex);
>  	stop_scan_thread();
>  
> -	if (!kmemleak_has_leaks) {
> -		rcu_read_lock();
> -		list_for_each_entry_rcu(object, &object_list, object_list)
> -			delete_object_full(object->pointer);
> -		rcu_read_unlock();
> -	}
> +	if (!kmemleak_has_leaks)
> +		__kmemleak_do_cleanup();
> +	else
> +		pr_info("Disable kmemleak without freeing internal objects, "
> +			"so you may still check information on memory leaks. "
> +			"You may reclaim memory by writing \"clear\" to "
> +			"/sys/kernel/debug/kmemleak\n");

Alternative text:

		pr_info("Kmemleak disabled without freeing internal data. "
			"Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\"\n");

(I'm wouldn't bother with long lines in printk strings)

Otherwise:

Acked-by: Catalin Marinas <catalin.marinas@....com>

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