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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Apr 2019 08:09:38 +0200
From:   Nicholas Mc Guire <hofrat@...dl.org>
To:     Santosh Shilimkar <santosh.shilimkar@...cle.com>
Cc:     "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, rds-devel@....oracle.com,
        linux-kernel@...r.kernel.org, Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH] rds: ib: force endiannes annotation

While the endiannes is being handled correctly as indicated by the comment
above the offending line - sparse was unhappy with the missing annotation
as be64_to_cpu() expects a __be64 argument. To mitigate this annotation
issue forced annotation is introduced. Note that this patch has no impact
on the generated binary.

Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
---

Problem located by an experimental coccinelle script to locate
patters that make sparse unhappy (false positives):
net/rds/ib_recv.c:827:23: warning: cast to restricted __le64

Patch was compile-tested with: x86_64_defconfig + RDS_RDMA=m

Patch was verified not to change the binary by diffing the
generated object code before and after applying the patch.

Patch is against 5.1-rc6 (localversion-next is 20190426)

 net/rds/ib_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 7055985..a070a2d 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -824,7 +824,7 @@ static void rds_ib_cong_recv(struct rds_connection *conn,
 	}
 
 	/* the congestion map is in little endian order */
-	uncongested = le64_to_cpu(uncongested);
+	uncongested = le64_to_cpu((__force __le64)uncongested);
 
 	rds_cong_map_updated(map, uncongested);
 }
-- 
2.1.4

Powered by blists - more mailing lists