Merge ~ahasenack/ubuntu/+source/nfs-utils:kinetic-blkmapd-invalid-free into ubuntu/+source/nfs-utils:ubuntu/kinetic-devel

Proposed by Andreas Hasenack
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 7954eacfc92db1dc3d48a5f2f31a4661dfe1e20d
Proposed branch: ~ahasenack/ubuntu/+source/nfs-utils:kinetic-blkmapd-invalid-free
Merge into: ubuntu/+source/nfs-utils:ubuntu/kinetic-devel
Diff against target: 69 lines (+47/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/blkmapd-fix-invalid-free.patch (+39/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Bryce Harrington (community) Approve
Canonical Server Reporter Pending
Review via email: mp+431926@code.launchpad.net

Description of the change

Fix for a core dump in blkmapd. The linked SRU bug has testing instructions.

I haven't heard back from upstream yet, maybe the final commit will be different. I'll evaluate if/when that happens, and submit to debian.

Once LL is open, I'll propose the fix there too, and then proceed with the SRU.

PPA: https://launchpad.net/~ahasenack/+archive/ubuntu/blkmapd-invalid-free

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

See the jammy MP for review comments.

+1 to plan on waiting to LL opening, given that SRU processing is slow right now.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: ahasenack, bryce
Uploaders: ahasenack, bryce
MP auto-approved

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

lunar isn't open yet, but it exists, and can be uploaded to (unapproved, though), which I did. I'll now proceed with this SRU.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded:

Uploading nfs-utils_2.6.1-2ubuntu4.1.dsc
Uploading nfs-utils_2.6.1-2ubuntu4.1.debian.tar.xz
Uploading nfs-utils_2.6.1-2ubuntu4.1_source.buildinfo
Uploading nfs-utils_2.6.1-2ubuntu4.1_source.changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 68e44d7..60bc1df 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+nfs-utils (1:2.6.1-2ubuntu4.1) kinetic; urgency=medium
7+
8+ * d/p/blkmapd-fix-invalid-free.patch: fix blkmapd crash due to invalid
9+ free() (LP: #1979885)
10+
11+ -- Andreas Hasenack <andreas@canonical.com> Thu, 20 Oct 2022 11:45:11 -0300
12+
13 nfs-utils (1:2.6.1-2ubuntu4) kinetic; urgency=medium
14
15 * No-change rebuild against libevent-core-2.1-7a
16diff --git a/debian/patches/blkmapd-fix-invalid-free.patch b/debian/patches/blkmapd-fix-invalid-free.patch
17new file mode 100644
18index 0000000..bdcdc19
19--- /dev/null
20+++ b/debian/patches/blkmapd-fix-invalid-free.patch
21@@ -0,0 +1,39 @@
22+Description: remove invalid free() call
23+ The data pointer is not allocated separatedly, it's the struct that needs to
24+ be free()ed.
25+ Originally reported by lixiaokeng via
26+ https://www.spinics.net/lists/linux-nfs/msg87598.html with a slightly different
27+ fix proposal.
28+Author: Andreas Hasenack <andreas@canonical.com>
29+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022185
30+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1979885
31+Forwarded: https://lore.kernel.org/linux-nfs/CANYNYEG=utJ2pe+FtMWh8O+dz63R2wbzOC7ZVrvoqD=U04WL5g@mail.gmail.com/T/#u
32+Last-Update: 2022-10-20
33+diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
34+index 2736ac89..b3786a1f 100644
35+--- a/utils/blkmapd/device-discovery.c
36++++ b/utils/blkmapd/device-discovery.c
37+@@ -188,7 +188,6 @@ static void bl_add_disk(char *filepath)
38+
39+ if (disk && diskpath) {
40+ if (serial) {
41+- free(serial->data);
42+ free(serial);
43+ }
44+ return;
45+@@ -229,7 +228,6 @@ static void bl_add_disk(char *filepath)
46+ disk->valid_path = path;
47+ }
48+ if (serial) {
49+- free(serial->data);
50+ free(serial);
51+ }
52+ }
53+@@ -242,7 +240,6 @@ static void bl_add_disk(char *filepath)
54+ free(path);
55+ }
56+ if (serial) {
57+- free(serial->data);
58+ free(serial);
59+ }
60+ return;
61diff --git a/debian/patches/series b/debian/patches/series
62index 34ce413..ea6946e 100644
63--- a/debian/patches/series
64+++ b/debian/patches/series
65@@ -11,3 +11,4 @@ svcgssd-document-missing-options.patch
66 nfs-conf-manpage-missing-svcgssd-options.patch
67 always-run-generator.patch
68 fix-format-overflow-warning.patch
69+blkmapd-fix-invalid-free.patch

Subscribers

People subscribed via source and target branches