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>] [day] [month] [year] [list]
Message-ID: <20181230040244.GD5082@tigerII.localdomain>
Date:   Sun, 30 Dec 2018 13:02:44 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     akpm@...ux-foundation.org
Cc:     bp@...e.de, keescook@...omium.org, mm-commits@...r.kernel.org,
        pmladek@...e.com, rostedt@...dmis.org,
        sergey.senozhatsky.work@...il.com, yuehaibing@...wei.com,
        linux-kernel@...r.kernel.org
Subject: Re: + taint-fix-debugfs_simple_attrcocci-warnings.patch added to -mm
 tree

On (12/28/18 13:54), akpm@...ux-foundation.org wrote:
>
> Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
> for debugfs files.
>
> Semantic patch information:
> Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
> imposes some significant overhead as compared to
> DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Looks OK to me.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>

>  static __init int register_warn_debugfs(void)
>  {
>  	/* Don't care about failure */
> -	debugfs_create_file("clear_warn_once", 0200, NULL,
> -			    NULL, &clear_warn_once_fops);
> +	debugfs_create_file_unsafe("clear_warn_once", 0200, NULL, NULL,
> +				   &clear_warn_once_fops);
>  	return 0;
>  }

The commit message probably can be better.

The _unsafe() part suggests that some of them "safeness responsibilities"
are now panic.c responsibilities. The patch is OK since panic's
clear_warn_once_fops struct file_operations is safe against removal, so we
don't have to use otherwise necessary debugfs_file_get()/debugfs_file_put().

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ