View Issue Details

IDProjectCategoryView StatusLast Update
0007623GNUnetset servicepublic2024-02-29 22:46
Reporterulfvonbelow Assigned ToFlorian Dold  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.19.4Fixed in Version0.19.4 
Summary0007623: Misaligned access to set_size field of StrataEstimatorMessage
DescriptionWe can only actually count on these messages being 4-byte-aligned at most. MST takes care to do 8-byte alignment if it matters to the host system, but StrataEstimatorMessages aren't delivered by MST, they're delivered by CADET which then passes them to MQ. Even if what CADET receives is 8-byte aligned, the StrataEstimatorMessage begins after its 4-byte header, at which point it is only 4-byte aligned.
Steps To Reproduce./configure --enable-sanitizer
make
make install
make check
Additional InformationEither CADET / MQ need to ensure the message is aligned before passing it through, or StrataEstimatorMessage needs to accommodate unaligned access. The attached patch does the latter by adding GNUNET_PACKED.
Tagspatch
Attached Files
0001-SETU-prevent-misaligned-access-to-StrataEstimatorMes.patch (930 bytes)   
From 09facbb09d5cf4131e8cf991931c9354937cda13 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 05:33:40 -0600
Subject: [PATCH] SETU: prevent misaligned access to
 StrataEstimatorMessage.set_size.

Gnunet's messages aren't guaranteed to be 8-byte-aligned. The ones delivered
via MST are (at least, whenever it matters), but not the ones delivered by
GNUNET_MQ_inject_message, such as is done by CADET.
---
 src/setu/gnunet-service-setu_protocol.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/setu/gnunet-service-setu_protocol.h b/src/setu/gnunet-service-setu_protocol.h
index c2a166e60..c896166ce 100644
--- a/src/setu/gnunet-service-setu_protocol.h
+++ b/src/setu/gnunet-service-setu_protocol.h
@@ -218,7 +218,7 @@ struct StrataEstimatorMessage
   /**
    * Size of the local set
    */
-  uint64_t set_size;
+  uint64_t set_size GNUNET_PACKED;
 };
 
 
-- 
2.38.1

Activities

schanzen

2023-06-01 20:26

administrator   ~0020240

released some time ago

Issue History

Date Modified Username Field Change
2023-01-29 21:17 ulfvonbelow New Issue
2023-01-29 21:17 ulfvonbelow Status new => assigned
2023-01-29 21:17 ulfvonbelow Assigned To => Florian Dold
2023-01-29 21:17 ulfvonbelow Tag Attached: bug
2023-01-29 21:17 ulfvonbelow Tag Attached: patch
2023-01-29 21:17 ulfvonbelow File Added: 0001-SETU-prevent-misaligned-access-to-StrataEstimatorMes.patch
2023-02-06 06:17 schanzen Status assigned => resolved
2023-02-06 06:17 schanzen Resolution open => fixed
2023-02-06 06:17 schanzen Fixed in Version => 0.19.4
2023-02-06 06:19 schanzen Target Version => 0.19.4
2023-06-01 20:26 schanzen Note Added: 0020240
2023-06-01 20:26 schanzen Status resolved => closed
2024-02-29 22:46 Christian Grothoff Tag Detached: bug