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: <d03c64d2-46c0-42d8-8f88-28669e921c95@wanadoo.fr>
Date: Sun, 12 Oct 2025 17:21:08 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: chenxiaosong@...nxiaosong.com, stfrench@...rosoft.com, metze@...ba.org,
 pali@...nel.org, linkinjeon@...nel.org, smfrench@...il.com,
 sfrench@...ba.org, senozhatsky@...omium.org, tom@...pey.com,
 pc@...guebit.org, ronniesahlberg@...il.com, sprasad@...rosoft.com,
 bharathsm@...rosoft.com, zhangguodong@...inos.cn
Cc: linux-cifs@...r.kernel.org, linux-kernel@...r.kernel.org,
 ChenXiaoSong <chenxiaosong@...inos.cn>
Subject: Re: [PATCH 06/22] smb: move SMB1_PROTO_NUMBER to common/cifsglob.h

Le 12/10/2025 à 17:08, chenxiaosong@...nxiaosong.com a écrit :
> From: ZhangGuoDong <zhangguodong@...inos.cn>
> 
> Replace the constant of client with SMB1_PROTO_NUMBER, then move the
> macro definition from server/smb_common.h to common/cifsglob.h, maybe
> the server will use this macro definition in the future.
> 
> Co-developed-by: ChenXiaoSong <chenxiaosong@...inos.cn>
> Signed-off-by: ChenXiaoSong <chenxiaosong@...inos.cn>
> Signed-off-by: ZhangGuoDong <zhangguodong@...inos.cn>
> ---
>   fs/smb/client/misc.c       | 2 +-
>   fs/smb/common/cifsglob.h   | 2 ++
>   fs/smb/server/smb_common.h | 1 -
>   3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c
> index dda6dece802a..15be9d8738ab 100644
> --- a/fs/smb/client/misc.c
> +++ b/fs/smb/client/misc.c
> @@ -318,7 +318,7 @@ static int
>   check_smb_hdr(struct smb_hdr *smb)
>   {
>   	/* does it have the right SMB "signature" ? */
> -	if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) {
> +	if (*(__le32 *) smb->Protocol != cpu_to_le32(SMB1_PROTO_NUMBER)) {

Should this be SMB1_PROTO_NUMBER?
(without cpu_to_le32())

CJ

>   		cifs_dbg(VFS, "Bad protocol string signature header 0x%x\n",
>   			 *(unsigned int *)smb->Protocol);
>   		return 1;
> diff --git a/fs/smb/common/cifsglob.h b/fs/smb/common/cifsglob.h
> index 371160fec1cd..5928d35c7f30 100644
> --- a/fs/smb/common/cifsglob.h
> +++ b/fs/smb/common/cifsglob.h
> @@ -9,6 +9,8 @@
>   #ifndef _COMMON_CIFS_GLOB_H
>   #define _COMMON_CIFS_GLOB_H
>   
> +#define SMB1_PROTO_NUMBER		cpu_to_le32(0x424d53ff)
> +
>   struct smb_version_values {
>   	char		*version_string;
>   	__u16		protocol_id;
> diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h
> index 9c0db206624b..6d427dbed5fd 100644
> --- a/fs/smb/server/smb_common.h
> +++ b/fs/smb/server/smb_common.h
> @@ -151,7 +151,6 @@
>   		FILE_EXECUTE | FILE_DELETE_CHILD | \
>   		FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES)
>   
> -#define SMB1_PROTO_NUMBER		cpu_to_le32(0x424d53ff)
>   #define SMB_COM_NEGOTIATE		0x72
>   #define SMB1_CLIENT_GUID_SIZE		(16)
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ