Projects
Factory:RISC-V:Base
util-linux
_service:tar_scm:backport-libblkid-fix-misalign...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-libblkid-fix-misaligned-address-in-probe_exfat.patch of Package util-linux
From 2a71e291d0fe247d7ca62775e47865dda4b2acfd Mon Sep 17 00:00:00 2001 From: Milan Broz <gmazyland@gmail.com> Date: Thu, 24 Nov 2022 10:54:01 +0100 Subject: [PATCH] libblkid: fix misaligned-address in probe_exfat Value checked in le32_to_cpu() needs to be properly aligned. Just copy the value temporarily for conversion. Fix OSS-Fuzz issue 53696 --- libblkid/src/superblocks/exfat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c index 323e375..34b7ef3 100644 --- a/libblkid/src/superblocks/exfat.c +++ b/libblkid/src/superblocks/exfat.c @@ -69,16 +69,17 @@ static uint64_t cluster_to_offset(const struct exfat_super_block *sb, static uint32_t next_cluster(blkid_probe pr, const struct exfat_super_block *sb, uint32_t cluster) { - uint32_t *next; + uint32_t *nextp, next; uint64_t fat_offset; fat_offset = block_to_offset(sb, le32_to_cpu(sb->fat_block_start)) + (uint64_t) cluster * sizeof(cluster); - next = (uint32_t *) blkid_probe_get_buffer(pr, fat_offset, + nextp = (uint32_t *) blkid_probe_get_buffer(pr, fat_offset, sizeof(uint32_t)); - if (!next) + if (!nextp) return 0; - return le32_to_cpu(*next); + memcpy(&next, nextp, sizeof(next)); + return le32_to_cpu(next); } static struct exfat_entry_label *find_label(blkid_probe pr, -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2