Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Dan Horák
9644b501e7 - Fix segfault due memory corruption when reading topology info (#958953) 2013-11-19 11:06:09 +01:00
Peter Lemenkov
90e7c5467c Add neccessary BuildRequires for SCTP
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

Conflicts:
	erlang.spec
2013-03-02 10:14:45 +04:00
Peter Lemenkov
a59dbf4322 Fix erts deps
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

Conflicts:
	erlang.spec
2013-03-02 10:13:12 +04:00
Fedora Build
3b4490ada0 Kill defattr directive (no longer required since EL5/FC6)
Signed-off-by: Fedora Build <lemenkov@gmail.com>

Conflicts:
	erlang.spec
2013-03-02 10:10:37 +04:00
2 changed files with 68 additions and 66 deletions

View file

@ -0,0 +1,48 @@
From 8c34a2dc70070cca8d97ad3c0f2dfbec1a0d82d8 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Thu, 15 Mar 2012 16:42:40 +0100
Subject: [PATCH] erts: Fix memory corruption when reading topology info
If the number of processors actually found while reading sysfs
is lower than the configured value, we realloc() the cpuinfo array
to the smaller size, but we then iterate it using the original
configured size, thus corrupting memory beyond the allocated
block.
---
erts/lib_src/common/erl_misc_utils.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index 4806311..162c908 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -727,7 +727,7 @@ struct erts_cpu_info_t_ {
prev = NULL;
this = &cpuinfo->topology[0];
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
if (processor == this->processor) {
if (node != this->node)
@@ -939,7 +939,7 @@ struct erts_cpu_info_t_ {
if (res > 1) {
prev = this++;
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
this->thread = ((this->node == prev->node
@@ -1094,7 +1094,7 @@ struct erts_cpu_info_t_ {
if (res > 1) {
prev = this++;
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
this->thread = ((this->node == prev->node
--
1.8.4

View file

@ -25,7 +25,7 @@
Name: erlang
Version: %{upstream_ver}
Release: %{upstream_rel_for_rpm}.1%{?dist}
Release: %{upstream_rel_for_rpm}.3%{?dist}
Summary: General-purpose programming language and runtime environment
Group: Development/Languages
@ -86,9 +86,14 @@ Patch9: otp-0009-Ugly-workaround-for-java-1.5.0-gcj-which-doesn-t-sup.patch
Patch10: otp-0010-Remove-rpath-from-esock_ssl.patch
# end of autogenerated patch tag list
# additional patches
# https://github.com/erlang/otp/commit/8c34a2dc70070cca8d97ad3c0f2dfbec1a0d82d8.patch
Patch100: erlang-14B04-Fix_memory_corruption_when_reading_topology_info.patch
# BuildRoot not strictly needed since F10, but keep it for spec file robustness
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: lksctp-tools-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel
@ -449,6 +454,8 @@ Summary: Functionality necessary to run the Erlang System itself
Group: Development/Languages
Requires: %{name}-kernel%{?_isa} = %{version}-%{release}
Requires: %{name}-stdlib%{?_isa} = %{version}-%{release}
Provides: erlang(erl_drv_version) = 1.5
Provides: erlang(erl_nif_version) = 2.2
Obsoletes: %{name} < R13B-04.5
%description erts
@ -1005,6 +1012,9 @@ Erlang mode for XEmacs (source lisp files).
%patch10 -p1 -b .Remove_rpath_from_esock_ssl
# end of autogenerated prep patch list
# additional patches
%patch100 -p1 -b .Fix_memory_corruption_when_reading_topology_info
# remove shipped zlib sources
rm -f erts/emulator/zlib/*.[ch]
@ -1021,9 +1031,9 @@ rm -f lib/ssl/examples/certs/etc/erlangCA/index.txt.old
%build
%ifarch sparcv9 sparc64
CFLAGS="$RPM_OPT_FLAGS -mcpu=ultrasparc -fno-strict-aliasing" %configure --enable-shared-zlib
CFLAGS="$RPM_OPT_FLAGS -mcpu=ultrasparc -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp
%else
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --enable-shared-zlib
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --enable-shared-zlib --enable-sctp
%endif
# remove pre-built stuff
@ -1194,7 +1204,6 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%if %{with doc}
%dir %{_docdir}/%{n_uvr}/
%doc %{_docdir}/%{n_uvr}/AUTHORS
@ -1206,14 +1215,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files appmon
%defattr(-,root,root)
%{_libdir}/erlang/lib/appmon-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/appmon.*
%endif
%files asn1
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/asn1-*/
%{_libdir}/erlang/lib/asn1-*/ebin
%{_libdir}/erlang/lib/asn1-*/priv
@ -1224,7 +1231,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files common_test
%defattr(-,root,root)
%{_libdir}/erlang/lib/common_test-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/ct.*
@ -1242,14 +1248,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files compiler
%defattr(-,root,root)
%{_libdir}/erlang/lib/compiler-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/compile.*
%endif
%files cosEvent
%defattr(-,root,root)
%{_libdir}/erlang/lib/cosEvent-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/cosEventApp.*
@ -1264,7 +1268,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosEventDomain
%defattr(-,root,root)
%{_libdir}/erlang/lib/cosEventDomain-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/CosEventDomainAdmin.*
@ -1274,7 +1277,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosFileTransfer
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/cosFileTransfer-*/
%{_libdir}/erlang/lib/cosFileTransfer-*/ebin
%{_libdir}/erlang/lib/cosFileTransfer-*/include
@ -1289,7 +1291,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosNotification
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/cosNotification-*/
%{_libdir}/erlang/lib/cosNotification-*/ebin
%{_libdir}/erlang/lib/cosNotification-*/include
@ -1326,7 +1327,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosProperty
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/cosProperty-*/
%{_libdir}/erlang/lib/cosProperty-*/ebin
%{_libdir}/erlang/lib/cosProperty-*/include
@ -1342,7 +1342,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosTime
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/cosTime-*/
%{_libdir}/erlang/lib/cosTime-*/ebin
%{_libdir}/erlang/lib/cosTime-*/include
@ -1357,7 +1356,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files cosTransactions
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/cosTransactions-*/
%{_libdir}/erlang/lib/cosTransactions-*/ebin
%{_libdir}/erlang/lib/cosTransactions-*/include
@ -1374,7 +1372,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files crypto
%defattr(-,root,root)
%{_libdir}/erlang/lib/crypto-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/crypto.*
@ -1382,7 +1379,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files debugger
%defattr(-,root,root)
%{_libdir}/erlang/lib/debugger-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/debugger.*
@ -1391,7 +1387,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files dialyzer
%defattr(-,root,root)
%{_bindir}/dialyzer
%{_libdir}/erlang/bin/dialyzer
%{_libdir}/erlang/erts-*/bin/dialyzer
@ -1401,7 +1396,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files diameter
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/diameter-*/
%{_libdir}/erlang/lib/diameter-*/bin
%{_libdir}/erlang/lib/diameter-*/ebin
@ -1419,7 +1413,6 @@ rm -rf $RPM_BUILD_ROOT
%files doc
%defattr(-,root,root)
%if %{with doc}
%doc %{_docdir}/%{n_uvr}/doc
%doc %{_docdir}/%{n_uvr}/erts-*/
@ -1438,7 +1431,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files edoc
%defattr(-,root,root)
%{_libdir}/erlang/lib/edoc-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/edoc.*
@ -1450,11 +1442,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files erl_docgen
%defattr(-,root,root)
%{_libdir}/erlang/lib/erl_docgen-*/
%files erl_interface
%defattr(-,root,root)
%{_libdir}/erlang/lib/erl_interface-*/
%if %{with doc}
%{_libdir}/erlang/man/man1/erl_call.*
@ -1471,8 +1461,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files erts
%defattr(-,root,root)
# TODO these directories should be packaged separately
%dir %{_libdir}/erlang/
%dir %{_libdir}/erlang/bin/
@ -1553,7 +1541,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/erlang/usr/
%files et
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/et-*/
%{_libdir}/erlang/lib/et-*/ebin
%{_libdir}/erlang/lib/et-*/include
@ -1566,7 +1553,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files eunit
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/eunit-*/
%{_libdir}/erlang/lib/eunit-*/ebin
%{_libdir}/erlang/lib/eunit-*/include
@ -1576,7 +1562,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files examples
%defattr(-,root,root)
%{_libdir}/erlang/lib/asn1-*/examples
#%{_libdir}/erlang/lib/cosFileTransfer-*/examples
#%{_libdir}/erlang/lib/cosNotification-*/examples
@ -1605,7 +1590,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/erlang/lib/wx-*/examples
%files gs
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/gs-*/
%{_libdir}/erlang/lib/gs-*/contribs
%{_libdir}/erlang/lib/gs-*/ebin
@ -1616,11 +1600,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files hipe
%defattr(-,root,root)
%{_libdir}/erlang/lib/hipe-*/
%files ic
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/ic-*/
%{_libdir}/erlang/lib/ic-*/ebin
%{_libdir}/erlang/lib/ic-*/include
@ -1634,7 +1616,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files inets
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/inets-*/
%{_libdir}/erlang/lib/inets-*/ebin
%{_libdir}/erlang/lib/inets-*/include
@ -1656,7 +1637,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files inviso
%defattr(-,root,root)
%{_libdir}/erlang/lib/inviso-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/inviso.*
@ -1668,12 +1648,10 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files jinterface
%defattr(-,root,root)
%{_libdir}/erlang/lib/jinterface-*/
%{_javadir}/%{name}/OtpErlang.jar
%files kernel
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/kernel-*/
%{_libdir}/erlang/lib/kernel-*/ebin
%{_libdir}/erlang/lib/kernel-*/include
@ -1715,7 +1693,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files megaco
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/megaco-*/
%{_libdir}/erlang/lib/megaco-*/ebin
%{_libdir}/erlang/lib/megaco-*/include
@ -1737,7 +1714,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files mnesia
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/mnesia-*/
%{_libdir}/erlang/lib/mnesia-*/ebin
%{_libdir}/erlang/lib/mnesia-*/include
@ -1749,7 +1725,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files observer
%defattr(-,root,root)
%{_libdir}/erlang/lib/observer-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/crashdump.*
@ -1758,14 +1733,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files odbc
%defattr(-,root,root)
%{_libdir}/erlang/lib/odbc-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/odbc.*
%endif
%files orber
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/orber-*/
%{_libdir}/erlang/lib/orber-*/COSS
%{_libdir}/erlang/lib/orber-*/ebin
@ -1795,7 +1768,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files os_mon
%defattr(-,root,root)
%{_libdir}/erlang/lib/os_mon-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/cpu_sup.*
@ -1807,14 +1779,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files otp_mibs
%defattr(-,root,root)
%{_libdir}/erlang/lib/otp_mibs-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/otp_mib.*
%endif
%files parsetools
%defattr(-,root,root)
%{_libdir}/erlang/lib/parsetools-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/leex.*
@ -1822,7 +1792,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files percept
%defattr(-,root,root)
%{_libdir}/erlang/lib/percept-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/egd.*
@ -1831,21 +1800,18 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files pman
%defattr(-,root,root)
%{_libdir}/erlang/lib/pman-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/pman.*
%endif
%files public_key
%defattr(-,root,root)
%{_libdir}/erlang/lib/public_key-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/public_key.*
%endif
%files reltool
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/reltool-*/
%{_libdir}/erlang/lib/reltool-*/ebin
%{_libdir}/erlang/lib/reltool-*/src
@ -1854,7 +1820,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files runtime_tools
%defattr(-,root,root)
%{_libdir}/erlang/lib/runtime_tools-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/dbg.*
@ -1863,7 +1828,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files sasl
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/sasl-*/
%{_libdir}/erlang/lib/sasl-*/ebin
%{_libdir}/erlang/lib/sasl-*/src
@ -1881,7 +1845,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files snmp
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/snmp-*/
%{_libdir}/erlang/lib/snmp-*/bin
%{_libdir}/erlang/lib/snmp-*/ebin
@ -1942,7 +1905,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files ssh
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/ssh-*/
%{_libdir}/erlang/lib/ssh-*/ebin
%{_libdir}/erlang/lib/ssh-*/include
@ -1956,7 +1918,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files ssl
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/ssl-*/
%{_libdir}/erlang/lib/ssl-*/ebin
%{_libdir}/erlang/lib/ssl-*/priv
@ -1969,7 +1930,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files stdlib
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/stdlib-*/
%{_libdir}/erlang/lib/stdlib-*/ebin
%{_libdir}/erlang/lib/stdlib-*/include
@ -2038,7 +1998,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files syntax_tools
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/syntax_tools-*/
%{_libdir}/erlang/lib/syntax_tools-*/ebin
%if %{with doc}
@ -2054,7 +2013,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files test_server
%defattr(-,root,root)
%{_libdir}/erlang/lib/test_server-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/test_server.*
@ -2063,14 +2021,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files toolbar
%defattr(-,root,root)
%{_libdir}/erlang/lib/toolbar-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/toolbar.*
%endif
%files tools
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/tools-*/
%{_libdir}/erlang/lib/tools-*/bin
%{_libdir}/erlang/lib/tools-*/ebin
@ -2091,21 +2047,18 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files tv
%defattr(-,root,root)
%{_libdir}/erlang/lib/tv-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/tv.*
%endif
%files typer
%defattr(-,root,root)
%{_bindir}/typer
%{_libdir}/erlang/bin/typer
%{_libdir}/erlang/erts-*/bin/typer
%{_libdir}/erlang/lib/typer-*/
%files webtool
%defattr(-,root,root)
%{_libdir}/erlang/lib/webtool-*/
%if %{with doc}
%{_libdir}/erlang/man/man1/start_webtool.*
@ -2113,7 +2066,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files wx
%defattr(-,root,root)
%dir %{_libdir}/erlang/lib/wx-*/
%{_libdir}/erlang/lib/wx-*/ebin
%{_libdir}/erlang/lib/wx-*/include
@ -2340,7 +2292,6 @@ rm -rf $RPM_BUILD_ROOT
%endif
%files xmerl
%defattr(-,root,root)
%{_libdir}/erlang/lib/xmerl-*/
%if %{with doc}
%{_libdir}/erlang/man/man3/xmerl.*
@ -2354,30 +2305,33 @@ rm -rf $RPM_BUILD_ROOT
%if 0%{?el6}%{?fedora}
%files -n emacs-erlang
%defattr(-,root,root,-)
%dir %{_emacs_sitelispdir}/erlang
%doc %{_emacs_sitelispdir}/erlang/README
%{_emacs_sitelispdir}/erlang/*.elc
%{_emacs_sitestartdir}/erlang-init.el
%files -n emacs-erlang-el
%defattr(-,root,root,-)
%{_emacs_sitelispdir}/erlang/*.el
%files -n xemacs-erlang
%defattr(-,root,root,-)
%dir %{_xemacs_sitelispdir}/erlang
%doc %{_xemacs_sitelispdir}/erlang/README
%{_xemacs_sitelispdir}/erlang/*.elc
%{_xemacs_sitestartdir}/erlang-init.el
%files -n xemacs-erlang-el
%defattr(-,root,root,-)
%{_xemacs_sitelispdir}/erlang/*.el
%endif
%changelog
* Tue Nov 19 2013 Dan Horák <dan[at]danny.cz> - R14B-04.3
- Fix segfault due memory corruption when reading topology info (#958953)
* Sat Mar 02 2013 Peter Lemenkov <lemenkov@gmail.com> - R14B-04.2
- Add neccessary BuildRequires for SCTP (see rhbz #908530)
- Fixed erts provides
* Sun Aug 07 2011 Peter Lemenkov <lemenkov@gmail.com> - R14B-04.1
- Ver. R14B04