From patchwork Sun Jan 19 19:21:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13944578 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EA99187872 for ; Sun, 19 Jan 2025 19:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737314516; cv=none; b=JJXIqAkbUNGFdSP4+vubRy9TZPnRBfvYJOgc/33t5HmBHrQ0Rt0KC2X7eKd70n/bXklQXxSLlebhZA6pAOl/sQMbDU77U0d7HdQXrSMlF4P2wMAHdbKArDLS7QyCIJUz9lhesmvwz5jeuOaeTenOZCuvBsuBWEp8gimqtjsZXg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737314516; c=relaxed/simple; bh=QWV/+St8DbiKz06xOkXykorrzRluFIExlc8fzm+mPno=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=HBtg1YRBkNN6mj+fWfYggd246G6KF/Eej0LJ2WljzfYRyQkQ63k5P87xWMadGEdf7AE7wvJ7bgmgE0ruMBYFe6c/LkudHjqPp9qPaTr3G+cNtawayUkZnzZn3CJXIZuO4pPQis5ktcaOqLrPYcWZsQHPTkOitkxdJM/XIAHf7xs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RtF18hBb; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RtF18hBb" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-54024ecc33dso3774778e87.0 for ; Sun, 19 Jan 2025 11:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737314513; x=1737919313; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RW/I1gwVCzkTdEikvtdUVVolbvp1q/1QHsSgKe/FT+Y=; b=RtF18hBbm9KuyGDuJNxMd9PoDo1m//GKLpRrpeDDWyPHN2cED0oE1FKPVyRQH+qL1m 8lkiP/Cix9OmQzzGljzTpA4xHz/aDOxk9JnqGJsauKIJfaYPhxIbpmAGLhBKltN8AhOr u5J5lhNKSgkGFauTHGTzYsdYyXsXYbC9PrangABad04fdaf1YKju4hRrUHSv6Hl2UJ2i lJru+TS3HuvqU4NVAAcaQ8sl79MLQaLi6u1lSfJ1leXOFHsohGqLPFTOlA8lLey1V/KC FRwvaFeOjQ54v08+U1Nq7CHs1Zg7kTjOFfX7QGS/GM25ToK5P8si9KONW7PrNG23AUh2 etQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737314513; x=1737919313; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RW/I1gwVCzkTdEikvtdUVVolbvp1q/1QHsSgKe/FT+Y=; b=xPbtmgvvX46vZji73NmMyZAL9z3cA42um0mBIuZH/LPNVAfSOpkq5r7JH0raio/2Ni fTIuC6cOsGJrzGxWMjXg+beIkZRQUvUGyJXp2was5UVYk/Gbo1PmUaSLQ80LGoqZxz4D BVElBvdj8iKVpZgsAzOxSjXFo3L3c0DwNUorGyirkJP/5vOKAqPG2P/0TBGp/kveASCY VZFeYsB0S/1M4hxKWNid59BtKl2I/DqbkbMIgSQkEBfcDLr72aCo4IA+vLiaScwrTrn6 uShu2fTpJHNedXu+ewhOLE+B/Mzx73z+LY264ahFZUQc4FJmuPK4PCZ1LHAutCO/jCeo +D0Q== X-Gm-Message-State: AOJu0Yx4qoMjPVUO9rRRtUUyp3xdcNeiLc1YYXfY6C3s3j3R6RmM0QH/ Gbs2PrjrkTbPTwU61grHRxE8gN/GNTC503m7Ws7cOHxPMGR3oM2nn2tJISLamLYJuMQDsjWYzDc 1MjQ13EQrxPYi6vXC6VcjUNqTrSo= X-Gm-Gg: ASbGnctsVUrYCUiZ1E9egQC1vLPFoxRNpGYtkdMGiRs5fZx9z99QkWz4ZizDoAzPiAP HP+tz+HY3mR76ozlBaPKudOyPOxuVcQfPXqh5AEY2d8U4LaFMbucpB9JGZvvJoZxowrmT5YbvKC p+stUNnfw= X-Google-Smtp-Source: AGHT+IF8h+1IZEfkGf9XhEbsuoGxJpJGrDpf0Hlnahd4oiwTDv2/pDaLMBlGnMFjJsJcNtZMRKnQlPyUbOb4Jp4aV1Q= X-Received: by 2002:ac2:5230:0:b0:541:1c48:8c0d with SMTP id 2adb3069b0e04-5439c285a31mr3116237e87.49.1737314513013; Sun, 19 Jan 2025 11:21:53 -0800 (PST) Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steve French Date: Sun, 19 Jan 2025 13:21:39 -0600 X-Gm-Features: AbW1kvb4WgC7ALSIIw_h25nPJmcpt344c52JTZS6MXMkgjG5X4L2MSehXgML9Pg Message-ID: Subject: [PATCH] cifs: Fix endian types in struct rfc1002_session_packet To: =?utf-8?q?Pali_Roh=C3=A1r?= Cc: CIFS > All fields in struct rfc1002_session_packet are in big endian. This is > because all NetBIOS packet headers are in big endian as opposite of SMB >structures which are in little endian. > Therefore use __be16 and __be32 types instead of __u16 and __u32 in >struct rfc1002_session_packet. > >Reported-by: kernel test robot Do you have a link to the kernel bot reported by (email?) From bbd8ad0d8994d448aa12e9df5fe23e5847729909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Wed, 25 Dec 2024 15:54:22 +0100 Subject: [PATCH 29/71] cifs: Fix endian types in struct rfc1002_session_packet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All fields in struct rfc1002_session_packet are in big endian. This is because all NetBIOS packet headers are in big endian as opposite of SMB structures which are in little endian. Therefore use __be16 and __be32 types instead of __u16 and __u32 in struct rfc1002_session_packet. Reported-by: kernel test robot Signed-off-by: Pali Rohár --- fs/smb/client/rfc1002pdu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/smb/client/rfc1002pdu.h b/fs/smb/client/rfc1002pdu.h index ae1d025da294..ac82c2f3a4a2 100644 --- a/fs/smb/client/rfc1002pdu.h +++ b/fs/smb/client/rfc1002pdu.h @@ -24,7 +24,7 @@ struct rfc1002_session_packet { __u8 type; __u8 flags; - __u16 length; + __be16 length; union { struct { __u8 called_len; @@ -35,8 +35,8 @@ struct rfc1002_session_packet { __u8 scope2; /* null */ } __attribute__((packed)) session_req; struct { - __u32 retarget_ip_addr; - __u16 port; + __be32 retarget_ip_addr; + __be16 port; } __attribute__((packed)) retarget_resp; __u8 neg_ses_resp_error_code; /* POSITIVE_SESSION_RESPONSE packet does not include trailer. -- 2.43.0