Merge ~utkarsh/ubuntu/+source/libpam-mount:lp1891552-fix-segfault into ubuntu/+source/libpam-mount:ubuntu/focal-devel

Proposed by Utkarsh Gupta
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 278b819da6363e88663d437bb8ccd6c41dac4ad5
Merged at revision: 278b819da6363e88663d437bb8ccd6c41dac4ad5
Proposed branch: ~utkarsh/ubuntu/+source/libpam-mount:lp1891552-fix-segfault
Merge into: ubuntu/+source/libpam-mount:ubuntu/focal-devel
Diff against target: 118 lines (+28/-10)
4 files modified
debian/changelog (+13/-0)
debian/control (+2/-1)
debian/patches/0016-Port-to-pcre2.patch (+5/-5)
debian/tests/local-luks (+8/-4)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  Approve
Canonical Server Team Pending
Ubuntu Server Dev import team Pending
Review via email: mp+400121@code.launchpad.net

Description of the change

Hello,

This MP intends to fix the segfault, as reported in LP: #1891552.

PPA at https://launchpad.net/~utkarsh/+archive/ubuntu/experimental-dump/

Autopkgtest is passing and happy:
```
autopkgtest [20:28:49]: @@@@@@@@@@@@@@@@@@@@ summary
local-luks PASS
```

Requesting you to please review and sponsor the upload. Let me know if you have any questions. TIA! :)

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Please add https://salsa.debian.org/debian/libpam-mount/-/merge_requests/3 for the test-fixes

IMHO we could do so on any release we SRU-touch, and once Debian merged it we will sync it on 21.10.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - I've mentioned the autopkgtest fixes in the SRU template

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Test fixes match what I have worked on +1 to that

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I know you've taken the patch from Debian as-is but to have some references we could/should link to https://salsa.debian.org/debian/libpam-mount/-/commit/c166793d582048587a4091a6deed9824b535f4c8 ?

review: Needs Fixing
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Other than that I found no issue, well done.

Once that bit is resolved (or you have other opinions about it to discuss) ping and I can sponsor.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hello Christian,

Thanks for the review. I've added the commit reference in the commit message. Hope that works for you?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

In the patch header actually, but no need to ping/pong for that - I've changed it on sponsoring with an added commit by me.

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/libpam-mount
 * [new tag] upload/2.16-10ubuntu0.20.04.1 -> upload/2.16-10ubuntu0.20.04.1

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading libpam-mount_2.16-10ubuntu0.20.04.1.dsc: done.
  Uploading libpam-mount_2.16-10ubuntu0.20.04.1.debian.tar.xz: done.
  Uploading libpam-mount_2.16-10ubuntu0.20.04.1_source.buildinfo: done.
  Uploading libpam-mount_2.16-10ubuntu0.20.04.1_source.changes: done.
Successfully uploaded packages.

review: Approve

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 f207f49..2e70d62 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,16 @@
6+libpam-mount (2.16-10ubuntu0.20.04.1) focal; urgency=medium
7+
8+ [ Utkarsh Gupta ]
9+ * Fix segmentation fault in libpcre2-8-0 when using regex
10+ in (cifs) volume. (LP: #1891552)
11+ - d/p/0016-Port-to-pcre2.patch: Fix pcre2 patch.
12+ Thanks to Jochen Sprickerhof for the patch.
13+
14+ [ Christian Ehrhardt ]
15+ * d/t/local-luks: fix autopkgtests.
16+
17+ -- Utkarsh Gupta <utkarsh.gupta@canonical.com> Fri, 26 Mar 2021 20:02:14 +0530
18+
19 libpam-mount (2.16-10) unstable; urgency=medium
20
21 [ Christian Ehrhardt ]
22diff --git a/debian/control b/debian/control
23index 1ba3c5f..6fbdc4c 100644
24--- a/debian/control
25+++ b/debian/control
26@@ -1,7 +1,8 @@
27 Source: libpam-mount
28 Section: admin
29 Priority: optional
30-Maintainer: Jochen Sprickerhof <jspricke@debian.org>
31+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
32+XSBC-Original-Maintainer: Jochen Sprickerhof <jspricke@debian.org>
33 Build-Depends:
34 debhelper-compat (= 12),
35 libblkid-dev,
36diff --git a/debian/patches/0016-Port-to-pcre2.patch b/debian/patches/0016-Port-to-pcre2.patch
37index a804429..b41a91b 100644
38--- a/debian/patches/0016-Port-to-pcre2.patch
39+++ b/debian/patches/0016-Port-to-pcre2.patch
40@@ -44,7 +44,7 @@ index e86b05d..203e490 100644
41
42 #
43 diff --git a/src/rdconf1.c b/src/rdconf1.c
44-index 6869d25..5b4f4f3 100644
45+index b252aa0..68e4b2d 100644
46 --- a/src/rdconf1.c
47 +++ b/src/rdconf1.c
48 @@ -21,7 +21,8 @@
49@@ -68,7 +68,7 @@ index 6869d25..5b4f4f3 100644
50 - pcre *rd;
51 + unsigned int flags = PCRE2_DOLLAR_ENDONLY | PCRE2_DOTALL |
52 + PCRE2_NO_AUTO_CAPTURE;
53-+ int errcode = NULL, ret;
54++ int errcode = 0, ret;
55 + PCRE2_SIZE erroffset;
56 + pcre2_code_8 *rd;
57 + PCRE2_UCHAR buffer[256];
58@@ -83,7 +83,7 @@ index 6869d25..5b4f4f3 100644
59 - } else if (rd == NULL) {
60 - l0g("pcre_compile failed: %s\n", strerror(errno));
61 + flags |= PCRE2_CASELESS;
62-+ rd = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, flags, &errcode, &erroffset, NULL);
63++ rd = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, flags, &errcode, &erroffset, NULL);
64 + if (rd == NULL) {
65 + l0g("pcre2_compile failed: %s at offset %d\n", buffer, (int)erroffset);
66 return -1;
67@@ -91,8 +91,8 @@ index 6869d25..5b4f4f3 100644
68
69 - ret = pcre_exec(rd, NULL, s, strlen(s), 0, 0, NULL, 0);
70 - if (ret == PCRE_ERROR_NOMATCH) {
71-+ match_data = pcre2_match_data_create_from_pattern(pattern, NULL);
72-+ ret = pcre2_match(rd, s, strlen(s), 0, 0, match_data, 0);
73++ match_data = pcre2_match_data_create_from_pattern(rd, NULL);
74++ ret = pcre2_match(rd, (PCRE2_SPTR)s, strlen(s), 0, 0, match_data, 0);
75 + if (ret == PCRE2_ERROR_NOMATCH) {
76 l0g("pcre_exec: no match\n");
77 ret = false;
78diff --git a/debian/tests/local-luks b/debian/tests/local-luks
79index 7ea2a8e..502c259 100644
80--- a/debian/tests/local-luks
81+++ b/debian/tests/local-luks
82@@ -8,7 +8,7 @@ createluks()
83 type=${2}
84 tdir=$(mktemp --directory)
85
86- fallocate -l 8M "/tmp/disk-l${id}.img"
87+ fallocate -l 32M "/tmp/disk-l${id}.img"
88 cryptsetup luksFormat --batch-mode --verbose --force-password --key-file=/home/alice/alice.key --type "${type}" "/tmp/disk-l${id}.img"
89 cryptsetup open --type "${type}" --batch-mode --verbose --key-file=/home/alice/alice.key "/tmp/disk-l${id}.img" "img-luks${id}"
90 mkfs.ext4 -L "IMG-LUKS${id}" "/dev/mapper/img-luks${id}"
91@@ -31,20 +31,24 @@ checkluks()
92 # smoke tests the mount and if not working print debug from journal
93 # shellcheck disable=SC2029
94 ssh -o "StrictHostKeyChecking=no" -i test.key alice@localhost "ls -laF ~/img-luks${id}/testfile" || journalctl -xe -u ssh --no-pager
95+ sleep 5s
96
97 # make sure we are using an actual mount
98 ssh -o "StrictHostKeyChecking=no" -i test.key alice@localhost "mount" | grep "img-luks${id}"
99+ sleep 5s
100
101 # compare data on encrypted disk via local login shell
102 # ensure su from root (needs no PW) does not re-ask for a pass (gets it from ~alice/alice.key anyway)
103- sed -i -e 's/pam_mount.so$/pam_mount.so disable_interactive/' /etc/pam.d/common-auth
104- sed -i -e 's/pam_mount.so$/pam_mount.so disable_interactive/' /etc/pam.d/common-session
105+ sed -i -e 's/pam_mount.so\s*$/pam_mount.so disable_interactive/' /etc/pam.d/common-auth
106+ sed -i -e 's/pam_mount.so\s*$/pam_mount.so disable_interactive/' /etc/pam.d/common-session
107 su --login --command "cat ~/img-luks${id}/testfile" alice > "luks${id}"
108+ sleep 5s
109 cmp expected "luks${id}"
110
111- # compare data on encrypted disk via ssh bsed login
112+ # compare data on encrypted disk via ssh based login
113 # shellcheck disable=SC2029
114 ssh -o "StrictHostKeyChecking=no" -i test.key alice@localhost "cat ~/img-luks${id}/testfile" > "luks${id}"
115+ sleep 5s
116 cmp expected "luks${id}"
117
118 # restore configuration

Subscribers

People subscribed via source and target branches