mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0
@ 2019-07-15 10:57 Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 2/5] sqlite: fix typo in option SQLITE_LOAD_EXTENTION Roland Hieber
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Roland Hieber @ 2019-07-15 10:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber, Roland Hieber

Clean up and pin down the config options. The removed defines in
CPPFLAGS are already set by the configure script when we supply the
right configure options; and this way ./scripts/configure_helper.py is
also happy. Add a patch so that building without pthreads does not fail
with linker errors (could already be broken in previous versions, but I
didn't test).

Even if "public_domain" is not a valid SPDX license identifier (see this
discussion [1] for background), it describes the license situation best.
Pin down the license MD5 mentioning that it is public domain.

[1]: https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files

Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 ...nfigure-make-disable-threadsafe-work.patch | 29 +++++++++++++++++++
 patches/sqlite-autoconf-3280000/autogen.sh    |  1 +
 patches/sqlite-autoconf-3280000/series        |  4 +++
 rules/sqlite.make                             | 19 ++++++++----
 4 files changed, 47 insertions(+), 6 deletions(-)
 create mode 100644 patches/sqlite-autoconf-3280000/0001-configure-make-disable-threadsafe-work.patch
 create mode 120000 patches/sqlite-autoconf-3280000/autogen.sh
 create mode 100644 patches/sqlite-autoconf-3280000/series

diff --git a/patches/sqlite-autoconf-3280000/0001-configure-make-disable-threadsafe-work.patch b/patches/sqlite-autoconf-3280000/0001-configure-make-disable-threadsafe-work.patch
new file mode 100644
index 000000000000..1e3a641a72b6
--- /dev/null
+++ b/patches/sqlite-autoconf-3280000/0001-configure-make-disable-threadsafe-work.patch
@@ -0,0 +1,29 @@
+From: Roland Hieber <rhi@pengutronix.de>
+Date: Tue, 9 Jul 2019 12:18:52 +0200
+Subject: [PATCH] configure: make --disable-threadsafe work
+
+SQLITE_THREADSAFE can be 0, 1 or 2, and if it is not defined, it
+is defined to 1 by default in sqlite3.c.
+
+_REENTRANT only needs to be defined or undefined according to
+https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html#Feature-Test-Macros
+
+Forwarded: https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg115812.html
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index f0b70b96428c..3044077e93f6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -91,6 +91,8 @@ if test x"$enable_threadsafe" != "xno"; then
+   BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
+   AC_SEARCH_LIBS(pthread_create, pthread)
+   AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
++else
++  BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0"
+ fi
+ #-----------------------------------------------------------------------
+ 
diff --git a/patches/sqlite-autoconf-3280000/autogen.sh b/patches/sqlite-autoconf-3280000/autogen.sh
new file mode 120000
index 000000000000..9f8a4cb7ddcb
--- /dev/null
+++ b/patches/sqlite-autoconf-3280000/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/sqlite-autoconf-3280000/series b/patches/sqlite-autoconf-3280000/series
new file mode 100644
index 000000000000..516ce59bdbad
--- /dev/null
+++ b/patches/sqlite-autoconf-3280000/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-configure-make-disable-threadsafe-work.patch
+# 7c01923b9908ba74dacfdb9f965dc010  - git-ptx-patches magic
diff --git a/rules/sqlite.make b/rules/sqlite.make
index 83cf28469de1..f93d9c2f3fe7 100644
--- a/rules/sqlite.make
+++ b/rules/sqlite.make
@@ -19,27 +19,30 @@ PACKAGES-$(PTXCONF_SQLITE) += sqlite
 #
 # Paths and names
 #
-SQLITE_VERSION	:= 3190200
-SQLITE_MD5	:= 9f006b16de2cd81f6bae9b40e91daabf
+SQLITE_VERSION	:= 3280000
+SQLITE_MD5	:= 3c68eb400f8354605736cd55400e1572
 SQLITE		:= sqlite-autoconf-$(SQLITE_VERSION)
 SQLITE_SUFFIX	:= tar.gz
-SQLITE_URL	:= https://www.sqlite.org/2017/$(SQLITE).$(SQLITE_SUFFIX)
+SQLITE_URL	:= https://www.sqlite.org/2019/$(SQLITE).$(SQLITE_SUFFIX)
 SQLITE_SOURCE	:= $(SRCDIR)/$(SQLITE).$(SQLITE_SUFFIX)
 SQLITE_DIR	:= $(BUILDDIR)/$(SQLITE)
 SQLITE_LICENSE	:= public_domain
+SQLITE_LICENSE_FILES	:= file://sqlite3.c;startline=29;endline=30;md5sum=43af35cab122fd0eed4d5469d0507788
 
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
+# sqlite has an unusual config system where some defines are set by the
+# configure script, but others can still be defined on the compiler command
+# line. Pin down all configure options so that configure_helper.py is pleased,
+# but apart from that, set only the defines that we really want (or otherwise
+# our CPPFLAGS would explode).
 SQLITE_CONF_ENV := \
 	$(CROSS_ENV) \
 	CPPFLAGS=" \
 	-DSQLITE_ENABLE_COLUMN_METADATA=1 \
 	-DSQLITE_ENABLE_FTS3_PARENTHESIS=1 \
-	-DSQLITE_ENABLE_FTS4=1 \
-	-DSQLITE_ENABLE_JSON1=1 \
-	-DSQLITE_ENABLE_RTREE=1 \
 	-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
 	-DSQLITE_SOUNDEX=1 \
 	"
@@ -53,9 +56,13 @@ SQLITE_CONF_OPT		:= \
 	--$(call ptx/endis,PTXCONF_SQLITE_READLINE)-readline \
 	--$(call ptx/endis,PTXCONF_SQLITE_THREADSAFE)-threadsafe \
 	--$(call ptx/endis,PTXCONF_SQLITE_LOAD_EXTENTION)-dynamic-extensions \
+	--enable-fts4 \
+	--enable-fts3 \
 	--disable-fts5 \
 	--enable-json1 \
+	--enable-rtree \
 	--disable-session \
+	--disable-debug \
 	--disable-static-shell
 
 # ----------------------------------------------------------------------------
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 2/5] sqlite: fix typo in option SQLITE_LOAD_EXTENTION
  2019-07-15 10:57 [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0 Roland Hieber
@ 2019-07-15 10:57 ` Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 3/5] migrate_ptx: fix typos in reason comments Roland Hieber
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Roland Hieber @ 2019-07-15 10:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 rules/sqlite.in             |  2 +-
 rules/sqlite.make           |  2 +-
 scripts/migrate/migrate_ptx | 10 +++++++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/rules/sqlite.in b/rules/sqlite.in
index 1bc0694b01d4..7b60edf3e772 100644
--- a/rules/sqlite.in
+++ b/rules/sqlite.in
@@ -18,7 +18,7 @@ config SQLITE_THREADSAFE
 	bool
 	prompt "Safe for use within a multi-threaded program"
 
-config SQLITE_LOAD_EXTENTION
+config SQLITE_LOAD_EXTENSION
 	bool
 	prompt "external extensions"
 	help
diff --git a/rules/sqlite.make b/rules/sqlite.make
index f93d9c2f3fe7..4be3e35fe674 100644
--- a/rules/sqlite.make
+++ b/rules/sqlite.make
@@ -55,7 +55,7 @@ SQLITE_CONF_OPT		:= \
 	--disable-editline \
 	--$(call ptx/endis,PTXCONF_SQLITE_READLINE)-readline \
 	--$(call ptx/endis,PTXCONF_SQLITE_THREADSAFE)-threadsafe \
-	--$(call ptx/endis,PTXCONF_SQLITE_LOAD_EXTENTION)-dynamic-extensions \
+	--$(call ptx/endis,PTXCONF_SQLITE_LOAD_EXTENSION)-dynamic-extensions \
 	--enable-fts4 \
 	--enable-fts3 \
 	--disable-fts5 \
diff --git a/scripts/migrate/migrate_ptx b/scripts/migrate/migrate_ptx
index 9d19bf6754bf..d7f8b04795bb 100755
--- a/scripts/migrate/migrate_ptx
+++ b/scripts/migrate/migrate_ptx
@@ -391,6 +391,14 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)X\>/\1XIMAGESRC/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_BAD1_STEREO -> GST_PLUGINS_GOOD1_AUDIOFX
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_\)BAD1_STEREO\>/\1GOOD1_AUDIOFX/
+
+#
+# from   : ptxdist-2019.07.0
+# to     : ptxdist-2019.08.0
+# symbol : SQLITE_LOAD_EXTENTION -> SQLITE_LOAD_EXTENSION
+# reason : option was renamed
+#
+s/^\(\(# \)\?PTXCONF_SQLITE_LOAD_\)EXTENTION/\1EXTENSION/
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 3/5] migrate_ptx: fix typos in reason comments
  2019-07-15 10:57 [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0 Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 2/5] sqlite: fix typo in option SQLITE_LOAD_EXTENTION Roland Hieber
@ 2019-07-15 10:57 ` Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 4/5] fastcgi: re-export patch series with git-ptx-patches Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 5/5] fastcgi: apply fix for CVE-2012-6687 Roland Hieber
  3 siblings, 0 replies; 5+ messages in thread
From: Roland Hieber @ 2019-07-15 10:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 scripts/migrate/migrate_ptx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/migrate/migrate_ptx b/scripts/migrate/migrate_ptx
index d7f8b04795bb..34c9a5ccedf8 100755
--- a/scripts/migrate/migrate_ptx
+++ b/scripts/migrate/migrate_ptx
@@ -335,7 +335,7 @@ s/^\(\(# \)\?PTXCONF_\)MESALIB_DRI_IMX\>/\1MESALIB_DRI_KMSRO/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_BASE1_IVORBIS -> GST_PLUGINS_BASE1_TREMOR
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_BASE1_\)IVORBIS\>/\1TREMOR/
 
@@ -351,7 +351,7 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_\)BAD1_COMPOSITOR\>/\1BASE1_COMPOSITOR/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_GOOD1_QTDEMUX -> GST_PLUGINS_GOOD1_ISOMP4
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)QTDEMUX\>/\1ISOMP4/
 
@@ -359,7 +359,7 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)QTDEMUX\>/\1ISOMP4/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_GOOD1_LIBPNG -> GST_PLUGINS_GOOD1_PNG
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)LIBPNG\>/\1PNG/
 
@@ -367,7 +367,7 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)LIBPNG\>/\1PNG/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_GOOD1_QT -> GST_PLUGINS_GOOD1_QT5
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)QT\>/\1QT5/
 
@@ -375,7 +375,7 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)QT\>/\1QT5/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_GOOD1_GST_V4L2 -> GST_PLUGINS_GOOD1_V4L2
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)GST_V4L2\(_LIBV4L2\)\?\>/\1V4L2\3/
 
@@ -383,7 +383,7 @@ s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)GST_V4L2\(_LIBV4L2\)\?\>/\1V4L2\3/
 # from   : ptxdist-2019.04.0
 # to     : ptxdist-2019.05.0
 # symbol : GST_PLUGINS_GOOD1_X -> GST_PLUGINS_GOOD1_XIMAGESRC
-# reason : option was rename
+# reason : option was renamed
 #
 s/^\(\(# \)\?PTXCONF_GST_PLUGINS_GOOD1_\)X\>/\1XIMAGESRC/
 
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 4/5] fastcgi: re-export patch series with git-ptx-patches
  2019-07-15 10:57 [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0 Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 2/5] sqlite: fix typo in option SQLITE_LOAD_EXTENTION Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 3/5] migrate_ptx: fix typos in reason comments Roland Hieber
@ 2019-07-15 10:57 ` Roland Hieber
  2019-07-15 10:57 ` [ptxdist] [PATCH 5/5] fastcgi: apply fix for CVE-2012-6687 Roland Hieber
  3 siblings, 0 replies; 5+ messages in thread
From: Roland Hieber @ 2019-07-15 10:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

No functional changes until the next patch.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 patches/fcgi-2.4.0/0001-fix-buildsystem.patch     | 15 ++++++---------
 .../0002-prepare-for-new-autotools.patch          |  9 +++------
 patches/fcgi-2.4.0/0003-include-stdio.h.patch     |  9 +++------
 patches/fcgi-2.4.0/series                         |  3 ++-
 4 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/patches/fcgi-2.4.0/0001-fix-buildsystem.patch b/patches/fcgi-2.4.0/0001-fix-buildsystem.patch
index 4880823f79d8..a15794d4cb9c 100644
--- a/patches/fcgi-2.4.0/0001-fix-buildsystem.patch
+++ b/patches/fcgi-2.4.0/0001-fix-buildsystem.patch
@@ -8,13 +8,13 @@ Subject: [PATCH] fix buildsystem
 
 Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
 ---
- cgi-fcgi/Makefile.am |    2 +-
- examples/Makefile.am |    4 ++--
- libfcgi/Makefile.am  |    5 +++--
+ cgi-fcgi/Makefile.am | 2 +-
+ examples/Makefile.am | 4 ++--
+ libfcgi/Makefile.am  | 5 +++--
  3 files changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/cgi-fcgi/Makefile.am b/cgi-fcgi/Makefile.am
-index 4a5c685..04b4483 100644
+index 4a5c685bce01..04b4483bd307 100644
 --- a/cgi-fcgi/Makefile.am
 +++ b/cgi-fcgi/Makefile.am
 @@ -2,7 +2,7 @@
@@ -27,7 +27,7 @@ index 4a5c685..04b4483 100644
  INCLUDE_FILES   = $(INCLUDEDIR)/fastcgi.h  \
  		  $(INCLUDEDIR)/fcgiapp.h  \
 diff --git a/examples/Makefile.am b/examples/Makefile.am
-index 484d3e8..930f203 100644
+index 484d3e897437..930f2030e830 100644
 --- a/examples/Makefile.am
 +++ b/examples/Makefile.am
 @@ -11,7 +11,7 @@ noinst_PROGRAMS     = authorizer        \
@@ -47,7 +47,7 @@ index 484d3e8..930f203 100644
 +echo_cpp_LDADD   = $(LIBDIR)/libfcgi++.la $(LIBDIR)/libfcgi.la
  
 diff --git a/libfcgi/Makefile.am b/libfcgi/Makefile.am
-index 0f14615..d7346f5 100644
+index 0f1461566a35..d7346f5eb26c 100644
 --- a/libfcgi/Makefile.am
 +++ b/libfcgi/Makefile.am
 @@ -1,7 +1,7 @@
@@ -67,6 +67,3 @@ index 0f14615..d7346f5 100644
 +libfcgi___la_LDFLAGS = -rpath @libdir@
 +libfcgi___la_LIBADD = libfcgi.la
  
--- 
-1.7.2.3
-
diff --git a/patches/fcgi-2.4.0/0002-prepare-for-new-autotools.patch b/patches/fcgi-2.4.0/0002-prepare-for-new-autotools.patch
index fbc6d3131b44..b7d442057bbf 100644
--- a/patches/fcgi-2.4.0/0002-prepare-for-new-autotools.patch
+++ b/patches/fcgi-2.4.0/0002-prepare-for-new-autotools.patch
@@ -6,11 +6,11 @@ we need AM_INIT_AUTOMAKE([foreign]) or automake fails with missing files
 
 Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
 ---
- configure.in |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/configure.in b/configure.in
-index e1941d0..1f94dde 100755
+index e1941d008704..1f94ddeea03b 100755
 --- a/configure.in
 +++ b/configure.in
 @@ -4,8 +4,8 @@ dnl     This file is an input file used by the GNU "autoconf" program to
@@ -24,6 +24,3 @@ index e1941d0..1f94dde 100755
  
  AM_CONFIG_HEADER(fcgi_config.h)
  
--- 
-1.7.2.3
-
diff --git a/patches/fcgi-2.4.0/0003-include-stdio.h.patch b/patches/fcgi-2.4.0/0003-include-stdio.h.patch
index a78131d0845a..e10d9c7621de 100644
--- a/patches/fcgi-2.4.0/0003-include-stdio.h.patch
+++ b/patches/fcgi-2.4.0/0003-include-stdio.h.patch
@@ -6,11 +6,11 @@ fcgi failed to compile. EOF wasn't defined because stdio.h wasn't included.
 
 Signed-off-by: George McCollister <george.mccollister@gmail.com>
 ---
- include/fcgiapp.h |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ include/fcgiapp.h | 2 ++
+ 1 file changed, 2 insertions(+)
 
 diff --git a/include/fcgiapp.h b/include/fcgiapp.h
-index d7236f6..c39a671 100644
+index d7236f6f3f2a..c39a6715021c 100644
 --- a/include/fcgiapp.h
 +++ b/include/fcgiapp.h
 @@ -34,6 +34,8 @@
@@ -22,6 +22,3 @@ index d7236f6..c39a671 100644
  /*
   * Error codes.  Assigned to avoid conflict with EOF and errno(2).
   */
--- 
-1.7.2.3
-
diff --git a/patches/fcgi-2.4.0/series b/patches/fcgi-2.4.0/series
index 444776df4941..cf1dab231793 100644
--- a/patches/fcgi-2.4.0/series
+++ b/patches/fcgi-2.4.0/series
@@ -1,5 +1,6 @@
 # generated by git-ptx-patches
+#tag:base --start-number 1
 0001-fix-buildsystem.patch
 0002-prepare-for-new-autotools.patch
 0003-include-stdio.h.patch
-# 36557fb0b64a93d0502c776d964302aa  - git-ptx-patches magic
+# 95fd96128b53d07d1cad2014dcacc9e0  - git-ptx-patches magic
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 5/5] fastcgi: apply fix for CVE-2012-6687
  2019-07-15 10:57 [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0 Roland Hieber
                   ` (2 preceding siblings ...)
  2019-07-15 10:57 ` [ptxdist] [PATCH 4/5] fastcgi: re-export patch series with git-ptx-patches Roland Hieber
@ 2019-07-15 10:57 ` Roland Hieber
  3 siblings, 0 replies; 5+ messages in thread
From: Roland Hieber @ 2019-07-15 10:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 ...e-poll-in-os_unix.c-instead-of-selec.patch | 96 +++++++++++++++++++
 patches/fcgi-2.4.0/series                     |  3 +-
 2 files changed, 98 insertions(+), 1 deletion(-)
 create mode 100644 patches/fcgi-2.4.0/0004-CVE-2012-6687-use-poll-in-os_unix.c-instead-of-selec.patch

diff --git a/patches/fcgi-2.4.0/0004-CVE-2012-6687-use-poll-in-os_unix.c-instead-of-selec.patch b/patches/fcgi-2.4.0/0004-CVE-2012-6687-use-poll-in-os_unix.c-instead-of-selec.patch
new file mode 100644
index 000000000000..2973172ad614
--- /dev/null
+++ b/patches/fcgi-2.4.0/0004-CVE-2012-6687-use-poll-in-os_unix.c-instead-of-selec.patch
@@ -0,0 +1,96 @@
+From: Anton Kortunov <toshic.toshic@gmail.com>
+Date: Tue, 9 Jul 2019 16:24:02 +0200
+Subject: [PATCH] CVE-2012-6687: use poll in os_unix.c instead of select to
+ avoid problem with > 1024 connections
+
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/933417
+Forwarded: yes, fastcgi-developers@mailman.fastcgi.com
+Origin: https://github.com/tehnick/libfcgi-debian/blob/master/debian/patches/use-poll.patch,
+  https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/933417/+attachment/2745025/+files/poll.patch,
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681591
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+---
+ libfcgi/os_unix.c | 35 ++++++++++++++++++++++-------------
+ 1 file changed, 22 insertions(+), 13 deletions(-)
+
+diff --git a/libfcgi/os_unix.c b/libfcgi/os_unix.c
+index 73e6a7f51522..af35aeed471b 100755
+--- a/libfcgi/os_unix.c
++++ b/libfcgi/os_unix.c
+@@ -42,6 +42,7 @@ static const char rcsid[] = "$Id: os_unix.c,v 1.37 2002/03/05 19:14:49 robs Exp
+ #include <sys/time.h>
+ #include <sys/un.h>
+ #include <signal.h>
++#include <poll.h>
+ 
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+@@ -103,6 +104,9 @@ static int volatile maxFd = -1;
+ static int shutdownPending = FALSE;
+ static int shutdownNow = FALSE;
+ 
++static int libfcgiOsClosePollTimeout = 2000;
++static int libfcgiIsAfUnixKeeperPollTimeout = 2000;
++
+ void OS_ShutdownPending()
+ {
+     shutdownPending = TRUE;
+@@ -168,6 +172,16 @@ int OS_LibInit(int stdioFds[3])
+     if(libInitialized)
+         return 0;
+ 
++    char *libfcgiOsClosePollTimeoutStr = getenv( "LIBFCGI_OS_CLOSE_POLL_TIMEOUT" );
++    if(libfcgiOsClosePollTimeoutStr) {
++        libfcgiOsClosePollTimeout = atoi(libfcgiOsClosePollTimeoutStr);
++    }
++
++    char *libfcgiIsAfUnixKeeperPollTimeoutStr = getenv( "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT" );
++    if(libfcgiIsAfUnixKeeperPollTimeoutStr) {
++        libfcgiIsAfUnixKeeperPollTimeout = atoi(libfcgiIsAfUnixKeeperPollTimeoutStr);
++    }
++
+     asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo));
+     if(asyncIoTable == NULL) {
+         errno = ENOMEM;
+@@ -755,19 +769,16 @@ int OS_Close(int fd)
+ 
+     if (shutdown(fd, 1) == 0)
+     {
+-        struct timeval tv;
+-        fd_set rfds;
++        struct pollfd pfd;
+         int rv;
+         char trash[1024];
+ 
+-        FD_ZERO(&rfds);
++        pfd.fd = fd;
++        pfd.events = POLLIN;
+ 
+         do 
+         {
+-            FD_SET(fd, &rfds);
+-            tv.tv_sec = 2;
+-            tv.tv_usec = 0;
+-            rv = select(fd + 1, &rfds, NULL, NULL, &tv);
++            rv = poll(&pfd, 1, libfcgiOsClosePollTimeout);
+         }
+         while (rv > 0 && read(fd, trash, sizeof(trash)) > 0);
+     }
+@@ -1116,13 +1127,11 @@ static int is_reasonable_accept_errno (const int error)
+  */
+ static int is_af_unix_keeper(const int fd)
+ {
+-    struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL };
+-    fd_set read_fds;
+-
+-    FD_ZERO(&read_fds);
+-    FD_SET(fd, &read_fds);
++    struct pollfd pfd;
++    pfd.fd = fd;
++    pfd.events = POLLIN;
+ 
+-    return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds);
++    return poll(&pfd, 1, libfcgiIsAfUnixKeeperPollTimeout) >= 0 && (pfd.revents & POLLIN);
+ }
+ 
+ /*
diff --git a/patches/fcgi-2.4.0/series b/patches/fcgi-2.4.0/series
index cf1dab231793..0a44f7fd19ca 100644
--- a/patches/fcgi-2.4.0/series
+++ b/patches/fcgi-2.4.0/series
@@ -3,4 +3,5 @@
 0001-fix-buildsystem.patch
 0002-prepare-for-new-autotools.patch
 0003-include-stdio.h.patch
-# 95fd96128b53d07d1cad2014dcacc9e0  - git-ptx-patches magic
+0004-CVE-2012-6687-use-poll-in-os_unix.c-instead-of-selec.patch
+# b3af8b9128742fb7ab04b50022c278f5  - git-ptx-patches magic
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-15 10:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 10:57 [ptxdist] [PATCH 1/5] sqlite: version bump 3.19.2 -> 3.28.0 Roland Hieber
2019-07-15 10:57 ` [ptxdist] [PATCH 2/5] sqlite: fix typo in option SQLITE_LOAD_EXTENTION Roland Hieber
2019-07-15 10:57 ` [ptxdist] [PATCH 3/5] migrate_ptx: fix typos in reason comments Roland Hieber
2019-07-15 10:57 ` [ptxdist] [PATCH 4/5] fastcgi: re-export patch series with git-ptx-patches Roland Hieber
2019-07-15 10:57 ` [ptxdist] [PATCH 5/5] fastcgi: apply fix for CVE-2012-6687 Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox