Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] mdadm: apply patch to fix UAF and fix time64 patch.
@ 2021-02-23 17:29 ericonr
  2021-02-23 17:51 ` [PR PATCH] [Merged]: " ericonr
  0 siblings, 1 reply; 2+ messages in thread
From: ericonr @ 2021-02-23 17:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

There is a new pull request by ericonr against master on the void-packages repository

https://github.com/ericonr/void-packages mdadm
https://github.com/void-linux/void-packages/pull/29007

mdadm: apply patch to fix UAF and fix time64 patch.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29007.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mdadm-29007.patch --]
[-- Type: text/x-diff, Size: 2810 bytes --]

From 51ae6e99ee5f0f3b4e68632345fa74a8583f2aed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Tue, 23 Feb 2021 14:28:00 -0300
Subject: [PATCH] mdadm: apply patch to fix UAF and fix time64 patch.

---
 srcpkgs/mdadm/patches/time64.patch         | 24 +++++++++-------------
 srcpkgs/mdadm/patches/use-after-free.patch | 17 +++++++++++++++
 srcpkgs/mdadm/template                     |  2 +-
 3 files changed, 28 insertions(+), 15 deletions(-)
 create mode 100644 srcpkgs/mdadm/patches/use-after-free.patch

diff --git a/srcpkgs/mdadm/patches/time64.patch b/srcpkgs/mdadm/patches/time64.patch
index c02ca8f7592..1ee4b23f41a 100644
--- a/srcpkgs/mdadm/patches/time64.patch
+++ b/srcpkgs/mdadm/patches/time64.patch
@@ -1,20 +1,16 @@
---- monitor.c	2018-10-01 18:26:06.000000000 +0000
-+++ monitor.c	2020-01-22 19:51:39.575877908 +0000
-@@ -20,6 +20,7 @@
- 
- #include "mdadm.h"
- #include "mdmon.h"
-+#include <inttypes.h>
- #include <sys/syscall.h>
- #include <sys/select.h>
- #include <signal.h>
-@@ -447,7 +448,7 @@
+diff --git monitor.c monitor.c
+index 81537ed..08027ac 100644
+--- monitor.c
++++ monitor.c
+@@ -447,9 +447,9 @@ static int read_and_act(struct active_array *a, fd_set *fds)
  	}
  
  	gettimeofday(&tv, NULL);
 -	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,
- 		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->prev_state],
+ 		sync_actions[a->curr_action],
diff --git a/srcpkgs/mdadm/patches/use-after-free.patch b/srcpkgs/mdadm/patches/use-after-free.patch
new file mode 100644
index 00000000000..69b6ee4aeae
--- /dev/null
+++ b/srcpkgs/mdadm/patches/use-after-free.patch
@@ -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);
+ 	}
diff --git a/srcpkgs/mdadm/template b/srcpkgs/mdadm/template
index ac1bce5aede..f776b6dc9d3 100644
--- a/srcpkgs/mdadm/template
+++ b/srcpkgs/mdadm/template
@@ -1,7 +1,7 @@
 # Template file for 'mdadm'
 pkgname=mdadm
 version=4.1
-revision=2
+revision=3
 hostmakedepends="pkg-config"
 makedepends="eudev-libudev-devel"
 short_desc="Tool for managing/monitoring Linux md device arrays"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: mdadm: apply patch to fix UAF and fix time64 patch.
  2021-02-23 17:29 [PR PATCH] mdadm: apply patch to fix UAF and fix time64 patch ericonr
@ 2021-02-23 17:51 ` ericonr
  0 siblings, 0 replies; 2+ messages in thread
From: ericonr @ 2021-02-23 17:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]

There's a merged pull request on the void-packages repository

mdadm: apply patch to fix UAF and fix time64 patch.
https://github.com/void-linux/void-packages/pull/29007

Description:
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-23 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 17:29 [PR PATCH] mdadm: apply patch to fix UAF and fix time64 patch ericonr
2021-02-23 17:51 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).