]> git.proxmox.com Git - lxc.git/blob - debian/patches/extra/0002-Fix-off-by-one-error-constructing-mount-options.patch
pull in more fixes from master
[lxc.git] / debian / patches / extra / 0002-Fix-off-by-one-error-constructing-mount-options.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: srd424 <srd424@users.noreply.github.com>
3 Date: Sun, 3 Jul 2022 10:21:30 +0100
4 Subject: [PATCH] Fix off-by-one error constructing mount options
5
6 This fixes a really subtle off-by-one error constructing overlay mount options if rootfs options are provided and modern overlayfs (i.e. requiring a workdir) is used. We need to allow for the extra "," required to separate the extra options when computing the length!
7
8 Signed-off-by: srd424 <srd424@users.noreply.github.com>
9 ---
10 src/lxc/storage/overlay.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13 diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c
14 index f8094fada..0c3fa1220 100644
15 --- a/src/lxc/storage/overlay.c
16 +++ b/src/lxc/storage/overlay.c
17 @@ -445,7 +445,7 @@ int ovl_mount(struct lxc_storage *bdev)
18 upper, lower, mntdata);
19
20 len2 = strlen(lower) + strlen(upper) + strlen(work) +
21 - strlen("upperdir=,lowerdir=,workdir=") +
22 + strlen("upperdir=,lowerdir=,workdir=,") +
23 strlen(mntdata) + 1;
24 options_work = must_realloc(NULL, len2);
25 ret2 = snprintf(options, len2,