aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcthulhu <cthulhu@ydb.tech>2023-02-17 16:57:18 +0300
committercthulhu <cthulhu@ydb.tech>2023-02-17 16:57:18 +0300
commit26644e909724c96a87dae4b71d335c2b96bb253b (patch)
treeed73ff85534243f8c35064f0302d9992c2fe8a08
parent750a5c2f50390814aa092a0af80f86325d782c4b (diff)
downloadydb-26644e909724c96a87dae4b71d335c2b96bb253b.tar.gz
Fix unaligned access UB in blob storage,
Fix unaligned access UB in blob storage,
-rw-r--r--ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h3
-rw-r--r--ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogformat.h2
-rw-r--r--ydb/core/erasure/erasure.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h b/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h
index 078a4e14ac..c63991a858 100644
--- a/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h
+++ b/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h
@@ -103,7 +103,8 @@ namespace NKikimr {
static bool Parse(TKeyBarrier &out, const TString &buf, TString &errorExplanation);
auto ConvertToTuple() const {
- return std::make_tuple(TabletId, Channel, Hard, Gen, GenCounter);
+ ui64 alignedTabletId = ReadUnaligned<ui64>(&TabletId);
+ return std::make_tuple(alignedTabletId, Channel, Hard, Gen, GenCounter);
}
};
#pragma pack(pop)
diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogformat.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogformat.h
index 396c4e7a39..a4079f905b 100644
--- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogformat.h
+++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogformat.h
@@ -15,7 +15,7 @@ namespace NKikimr {
////////////////////////////////////////////////////////////////////////////
// SYNC LOG FORMAT
////////////////////////////////////////////////////////////////////////////
-#pragma pack(push, 4)
+#pragma pack(push, 1)
struct TLogoBlobRec {
ui64 Raw[3]; // TLogoBlobID
TIngress Ingress;
diff --git a/ydb/core/erasure/erasure.cpp b/ydb/core/erasure/erasure.cpp
index 2505c7713b..fe2df1eaf3 100644
--- a/ydb/core/erasure/erasure.cpp
+++ b/ydb/core/erasure/erasure.cpp
@@ -2750,7 +2750,7 @@ void TErasureType::SplitDiffs(ECrcMode crcMode, ui32 dataSize, const TVector<TDi
template <typename Bucket>
void XorCpy(Bucket *dest, const Bucket *orig, const Bucket *diff, ui32 count) {
for (ui32 idx = 0; idx < count; ++idx) {
- dest[idx] = orig[idx] ^ diff[idx];
+ dest[idx] = ReadUnaligned<Bucket>(&orig[idx]) ^ ReadUnaligned<Bucket>(&diff[idx]);
}
}