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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240209105251.GE1516992@kernel.org>
Date: Fri, 9 Feb 2024 10:52:51 +0000
From: Simon Horman <horms@...nel.org>
To: David Howells <dhowells@...hat.com>
Cc: Steve French <smfrench@...il.com>, Jeff Layton <jlayton@...nel.org>,
	Matthew Wilcox <willy@...radead.org>,
	Paulo Alcantara <pc@...guebit.com>,
	Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>,
	Christian Brauner <christian@...uner.io>, netfs@...ts.linux.dev,
	linux-cifs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-mm@...ck.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, Steve French <sfrench@...ba.org>,
	Shyam Prasad N <nspmangalore@...il.com>,
	Rohith Surabattula <rohiths.msft@...il.com>
Subject: Re: [PATCH v5 09/12] cifs: Cut over to using netfslib

On Mon, Feb 05, 2024 at 10:57:21PM +0000, David Howells wrote:

...

> diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
> index 84e3675eb41e..b58fdee40755 100644
> --- a/fs/smb/client/smb2pdu.c
> +++ b/fs/smb/client/smb2pdu.c
> @@ -4386,10 +4386,12 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
>  	req->Length = cpu_to_le32(io_parms->length);
>  	req->Offset = cpu_to_le64(io_parms->offset);
>  
> -	trace_smb3_read_enter(0 /* xid */,
> -			io_parms->persistent_fid,
> -			io_parms->tcon->tid, io_parms->tcon->ses->Suid,
> -			io_parms->offset, io_parms->length);
> +	trace_smb3_read_enter(rdata ? rdata->rreq->debug_id : 0,
> +			      rdata ? rdata->subreq.debug_index : 0,
> +			      rdata ? rdata->xid : 0,
> +			      io_parms->persistent_fid,
> +			      io_parms->tcon->tid, io_parms->tcon->ses->Suid,
> +			      io_parms->offset, io_parms->length);
>  #ifdef CONFIG_CIFS_SMB_DIRECT

Hi David,

above some care is taken to handle the case where rdata might be NULL.

However, the code below this hunk, other than being guarded by
smb3_use_rdma_offload(io_parms), uses rdata unconditionally.

Perhaps the guard makes this ok. But Smatch flags this inconsistency.
And I thought I should bring it to your attention.

For reference the code I am referring to looks like this:

#ifdef CONFIG_CIFS_SMB_DIRECT
	/*
	 * If we want to do a RDMA write, fill in and append
	 * smbd_buffer_descriptor_v1 to the end of read request
	 */
	if (smb3_use_rdma_offload(io_parms)) {
		struct smbd_buffer_descriptor_v1 *v1;
		bool need_invalidate = server->dialect == SMB30_PROT_ID;

		rdata->mr = smbd_register_mr(server->smbd_conn, &rdata->subreq.io_iter,
					     true, need_invalidate);
		if (!rdata->mr)
			return -EAGAIN;


...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ