mdadm: apply patch to fix UAF and fix time64 patch.

This commit is contained in:
Érico Rolim 2021-02-23 14:28:00 -03:00 committed by Érico Nogueira Rolim
parent 59aa7c46d5
commit c8450b12a9
3 changed files with 28 additions and 15 deletions

View file

@ -1,20 +1,16 @@
--- monitor.c 2018-10-01 18:26:06.000000000 +0000 diff --git monitor.c monitor.c
+++ monitor.c 2020-01-22 19:51:39.575877908 +0000 index 81537ed..08027ac 100644
@@ -20,6 +20,7 @@ --- monitor.c
+++ monitor.c
#include "mdadm.h" @@ -447,9 +447,9 @@ static int read_and_act(struct active_array *a, fd_set *fds)
#include "mdmon.h"
+#include <inttypes.h>
#include <sys/syscall.h>
#include <sys/select.h>
#include <signal.h>
@@ -447,7 +448,7 @@
} }
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
- dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", - dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+ dprintf("(%d): %"PRId64".%06"PRId64" state:%s prev:%s action:%s prev: %s start:%llu\n", + dprintf("(%d): %lld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
a->info.container_member, a->info.container_member,
tv.tv_sec, tv.tv_usec, - tv.tv_sec, tv.tv_usec,
+ (long long)tv.tv_sec, (long)tv.tv_usec,
array_states[a->curr_state], array_states[a->curr_state],
array_states[a->prev_state],
sync_actions[a->curr_action],

View file

@ -0,0 +1,17 @@
From Rich Felker, over IRC
diff --git a/policy.c b/policy.c
index c0d18a7e..78ad34cd 100644
--- policy.c
+++ policy.c
@@ -214,8 +214,9 @@ static char *disk_path(struct mdinfo *disk)
continue;
if (stb.st_rdev != makedev(disk->disk.major, disk->disk.minor))
continue;
+ char *result = xstrdup(ent->d_name);
closedir(by_path);
- return xstrdup(ent->d_name);
+ return result;
}
closedir(by_path);
}

View file

@ -1,7 +1,7 @@
# Template file for 'mdadm' # Template file for 'mdadm'
pkgname=mdadm pkgname=mdadm
version=4.1 version=4.1
revision=2 revision=3
hostmakedepends="pkg-config" hostmakedepends="pkg-config"
makedepends="eudev-libudev-devel" makedepends="eudev-libudev-devel"
short_desc="Tool for managing/monitoring Linux md device arrays" short_desc="Tool for managing/monitoring Linux md device arrays"