Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
mdadm.1500
0001-super1-Fix-bblog_size-accesses-on-big-endi...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-super1-Fix-bblog_size-accesses-on-big-ending-machine.patch of Package mdadm.1500
From 27c7c87a6877a576cce02a667745ed4c12a60e22 Mon Sep 17 00:00:00 2001 From: NeilBrown <neilb@suse.com> Date: Fri, 29 Jan 2016 12:35:33 +1100 Subject: [PATCH] super1: Fix bblog_size accesses on big-ending machines. bblog_size is 16bit so using le32_to_cpu on it is not wise and leads to errors on big-endian machines. Change all such calls to use le16. Bug was introduced in mdadm-3.3 Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> --- super1.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/super1.c +++ b/super1.c @@ -699,12 +699,12 @@ static int copy_metadata1(struct superty } if (super.bblog_size != 0 && - __le32_to_cpu(super.bblog_size) <= 100 && + __le16_to_cpu(super.bblog_size) <= 100 && super.bblog_offset != 0 && (super.feature_map & __le32_to_cpu(MD_FEATURE_BAD_BLOCKS))) { /* There is a bad block log */ unsigned long long bb_offset = sb_offset; - int bytes = __le32_to_cpu(super.bblog_size) * 512; + int bytes = __le16_to_cpu(super.bblog_size) * 512; int written = 0; struct align_fd afrom, ato; @@ -798,7 +798,7 @@ static int examine_badblocks_super1(stru __u64 *bbl, *bbp; int i; - if (!sb->bblog_size || __le32_to_cpu(sb->bblog_size) > 100 + if (!sb->bblog_size || __le16_to_cpu(sb->bblog_size) > 100 || !sb->bblog_offset){ printf("No bad-blocks list configured on %s\n", devname); return 0; @@ -809,7 +809,7 @@ static int examine_badblocks_super1(stru return 0; } - size = __le32_to_cpu(sb->bblog_size)* 512; + size = __le16_to_cpu(sb->bblog_size)* 512; if (posix_memalign((void**)&bbl, 4096, size) != 0) { pr_err("%s could not allocate badblocks list\n", __func__); return 0; @@ -950,7 +950,7 @@ static void getinfo_super1(struct supert if (sb->bblog_offset && sb->bblog_size) { unsigned long long bbend = super_offset; bbend += (int32_t)__le32_to_cpu(sb->bblog_offset); - bbend += __le32_to_cpu(sb->bblog_size); + bbend += __le16_to_cpu(sb->bblog_size); if (bbend > earliest) earliest = bbend; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor