summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch')
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch
new file mode 100644
index 000000000..2452f7e08
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-lib-ext2fs-unix_io.c-revert-parts-of-libext2fs-fix-p.patch
@@ -0,0 +1,48 @@
+From 3593063f735f453d43f461292e26913436c11ca3 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Sat, 1 May 2021 13:06:12 +0200
+Subject: [PATCH] lib/ext2fs/unix_io.c: revert parts of "libext2fs: fix
+ potential races in unix_io"
+
+Upstream-Status: Submitted [https://github.com/tytso/e2fsprogs/pull/68]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/ext2fs/unix_io.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
+index 528c2fbc..f4916b21 100644
+--- a/lib/ext2fs/unix_io.c
++++ b/lib/ext2fs/unix_io.c
+@@ -311,10 +311,10 @@ bounce_read:
+ size += really_read;
+ goto short_read;
+ }
+- actual = size;
+- if (actual > align_size)
+- actual = align_size;
+- actual -= offset;
++ if ((actual + offset) > align_size)
++ actual = align_size - offset;
++ if (actual > size)
++ actual = size;
+ memcpy(buf, data->bounce + offset, actual);
+
+ really_read += actual;
+@@ -455,9 +455,10 @@ bounce_write:
+ }
+ }
+ actual = size;
+- if (actual > align_size)
+- actual = align_size;
+- actual -= offset;
++ if ((actual + offset) > align_size)
++ actual = align_size - offset;
++ if (actual > size)
++ actual = size;
+ memcpy(((char *)data->bounce) + offset, buf, actual);
+ if (ext2fs_llseek(data->dev, aligned_blk * align_size, SEEK_SET) < 0) {
+ retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
+--
+2.24.0
+