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] [day] [month] [year] [list]
Message-ID: <202109161503.07F872F6@keescook>
Date:   Thu, 16 Sep 2021 15:05:20 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Thomas Huth <thuth@...hat.com>
Cc:     linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-nfs@...r.kernel.org,
        "J. Bruce Fields" <bfields@...ldses.org>,
        Chuck Lever <chuck.lever@...cle.com>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Iurii Zaikin <yzaikin@...gle.com>, linux-s390@...r.kernel.org,
        Jia He <hejianet@...il.com>,
        Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] lockd: change the proc_handler for nsm_use_hostnames

On Tue, Aug 03, 2021 at 12:59:37PM +0200, Thomas Huth wrote:
> From: Jia He <hejianet@...il.com>
> 
> nsm_use_hostnames is a module parameter and it will be exported to sysctl
> procfs. This is to let user sometimes change it from userspace. But the
> minimal unit for sysctl procfs read/write it sizeof(int).
> In big endian system, the converting from/to  bool to/from int will cause
> error for proc items.
> 
> This patch use a new proc_handler proc_dobool to fix it.
> 
> Signed-off-by: Jia He <hejianet@...il.com>
> Reviewed-by: Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>
> [thuth: Fix typo in commit message]
> Signed-off-by: Thomas Huth <thuth@...hat.com>
> ---
>  fs/lockd/svc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 2de048f80eb8..0ab9756ed235 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -584,7 +584,7 @@ static struct ctl_table nlm_sysctls[] = {
>  		.data		= &nsm_use_hostnames,
>  		.maxlen		= sizeof(int),

For robustness, maybe this should be:

		.maxlen		= sizeof(nsm_use_hostnames),

>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dobool,
>  	},
>  	{
>  		.procname	= "nsm_local_state",
> -- 
> 2.27.0
> 

Reviewed-by: Kees Cook <keescook@...omium.org>

Also, I wonder what other BE-corrupted bools are out there?

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ