From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 2/2] file: add security patches cherry-picked from upstream
Date: Wed, 12 Mar 2014 10:29:29 +0100 [thread overview]
Message-ID: <1394616569-9024-2-git-send-email-post@lespocky.de> (raw)
In-Reply-To: <1394616569-9024-1-git-send-email-post@lespocky.de>
Signed-off-by: Alexander Dahl <post@lespocky.de>
---
.../0001-Fix-memory-leak-Anatol-Belski.patch | 34 ++++++++++++++++++++
...-in-out-of-bounds-calculations-Jan-Kaluza.patch | 23 +++++++++++++
patches/file-5.17/series | 5 +++
3 files changed, 62 insertions(+)
create mode 100644 patches/file-5.17/0001-Fix-memory-leak-Anatol-Belski.patch
create mode 100644 patches/file-5.17/0002-off-by-one-in-out-of-bounds-calculations-Jan-Kaluza.patch
create mode 100644 patches/file-5.17/series
diff --git a/patches/file-5.17/0001-Fix-memory-leak-Anatol-Belski.patch b/patches/file-5.17/0001-Fix-memory-leak-Anatol-Belski.patch
new file mode 100644
index 0000000..206e7eb
--- /dev/null
+++ b/patches/file-5.17/0001-Fix-memory-leak-Anatol-Belski.patch
@@ -0,0 +1,34 @@
+From: Christos Zoulas <christos@zoulas.com>
+Date: Fri, 21 Feb 2014 14:32:48 +0000
+Subject: [PATCH] Fix memory leak (Anatol Belski)
+
+Conflicts:
+ src/softmagic.c
+---
+ src/softmagic.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/softmagic.c b/src/softmagic.c
+index 5ed347e..7ee3f6f 100644
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -1755,12 +1755,16 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
+ ms->offset = soffset;
+ if (rv == 1) {
+ if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
+- file_printf(ms, F(m->desc, "%u"), offset) == -1)
++ file_printf(ms, F(m->desc, "%u"), offset) == -1) {
++ free(rbuf);
+ return -1;
+- if (file_printf(ms, "%s", rbuf) == -1)
++ }
++ if (file_printf(ms, "%s", rbuf) == -1) {
++ free(rbuf);
+ return -1;
+- free(rbuf);
++ }
+ }
++ free(rbuf);
+ return rv;
+
+ case FILE_USE:
diff --git a/patches/file-5.17/0002-off-by-one-in-out-of-bounds-calculations-Jan-Kaluza.patch b/patches/file-5.17/0002-off-by-one-in-out-of-bounds-calculations-Jan-Kaluza.patch
new file mode 100644
index 0000000..e4c61ca
--- /dev/null
+++ b/patches/file-5.17/0002-off-by-one-in-out-of-bounds-calculations-Jan-Kaluza.patch
@@ -0,0 +1,23 @@
+From: Christos Zoulas <christos@zoulas.com>
+Date: Tue, 4 Mar 2014 17:42:19 +0000
+Subject: [PATCH] off by one in out of bounds calculations (Jan Kaluza)
+
+Conflicts:
+ src/softmagic.c
+---
+ src/softmagic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/softmagic.c b/src/softmagic.c
+index 7ee3f6f..3919fa7 100644
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -71,7 +71,7 @@ private void cvt_16(union VALUETYPE *, const struct magic *);
+ private void cvt_32(union VALUETYPE *, const struct magic *);
+ private void cvt_64(union VALUETYPE *, const struct magic *);
+
+-#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o)))
++#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
+ /*
+ * softmagic - lookup one file in parsed, in-memory copy of database
+ * Passed the name and FILE * of one file to be typed.
diff --git a/patches/file-5.17/series b/patches/file-5.17/series
new file mode 100644
index 0000000..6b27f34
--- /dev/null
+++ b/patches/file-5.17/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Fix-memory-leak-Anatol-Belski.patch
+0002-off-by-one-in-out-of-bounds-calculations-Jan-Kaluza.patch
+# 4440242115f6c92b22376f9aa65eca96 - git-ptx-patches magic
--
1.7.10.4
--
ptxdist mailing list
ptxdist@pengutronix.de
prev parent reply other threads:[~2014-03-12 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 8:09 [ptxdist] [PATCH] file: upgrade to 5.17 Alexander Dahl
2014-03-12 7:22 ` Alexander Dahl
2014-03-12 8:29 ` Alexander Dahl
2014-03-12 9:29 ` [ptxdist] [PATCH 1/2] " Alexander Dahl
2014-03-12 9:29 ` Alexander Dahl [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394616569-9024-2-git-send-email-post@lespocky.de \
--to=post@lespocky.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox