diff --git a/net/distcc/dcc_gcc_rewrite_fqn-avoid-heap-corruption.patch b/net/distcc/dcc_gcc_rewrite_fqn-avoid-heap-corruption.patch new file mode 100644 index 0000000..5d0a86d --- /dev/null +++ b/net/distcc/dcc_gcc_rewrite_fqn-avoid-heap-corruption.patch @@ -0,0 +1,65 @@ +commit 879b71d6e95673e58d33f6c3c341a893ee307161 +Author: Alexey Sheplyakov +Date: Sat Jul 10 22:18:14 2021 +0400 + + dcc_gcc_rewrite_fqn: avoid heap corruption + + On ALT Linux I've run into the following bug: + + distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c + free(): invalid next size (fast) + Aborted (core dumped) + + Apparently dcc_gcc_rewrite writes beyond the allocated memory: + + valgrind --leak-check=full -v ./distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c + + ==11382== ERROR SUMMARY: 53 errors from 5 contexts (suppressed: 0 from 0) + ==11382== + ==11382== 1 errors in context 1 of 5: + ==11382== Invalid write of size 1 + ==11382== at 0x4C349D8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611) + ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) + ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) + ==11382== by 0x10E380: main (distcc.c:352) + ==11382== Address 0x544e828 is 1 bytes after a block of size 23 alloc'd + ==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588) + ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) + ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) + ==11382== by 0x10E380: main (distcc.c:352) + ==11382== + ==11382== + ==11382== 1 errors in context 2 of 5: + ==11382== Invalid write of size 1 + ==11382== at 0x4C349C8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611) + ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) + ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) + ==11382== by 0x10E380: main (distcc.c:352) + ==11382== Address 0x544e827 is 0 bytes after a block of size 23 alloc'd + ==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588) + ==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725) + ==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014) + ==11382== by 0x10E380: main (distcc.c:352) + + and ALT Linux' hardened glibc does not quite like that. + Correctly compute the `newcmd_len` to avoid the problem. + + ALTBUG: #40425 + +diff --git a/src/compile.c b/src/compile.c +index 34964566fdd6..26d7d1821501 100644 +--- a/src/compile.c ++++ b/src/compile.c +@@ -584,7 +584,7 @@ static int dcc_gcc_rewrite_fqn(char **argv) + return -ENOENT; + + +- newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0] + 1); ++ newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0]) + 1; + newcmd = malloc(newcmd_len); + if (!newcmd) + return -ENOMEM; diff --git a/net/distcc/distcc.SMBuild b/net/distcc/distcc.SMBuild index 1828e72..2502a75 100755 --- a/net/distcc/distcc.SMBuild +++ b/net/distcc/distcc.SMBuild @@ -1,8 +1,8 @@ app=distcc -version=3.3.3 +version=3.4 build=1sml homepage="https://distcc.github.io/" -download="https://github.com/distcc/distcc/releases/download/v3.3.3/distcc-3.3.3.tar.gz" +download="https://github.com/distcc/distcc/releases/download/v$version/distcc-$version.tar.gz" desc="Distributed C and C++ compiler daemon for parallel building" requires="popt" @@ -14,16 +14,16 @@ build() { cd $app-$version fixbuilddirpermissions - LDFLAGS="-static" \ + applypatch $srcdir/dcc_gcc_rewrite_fqn-avoid-heap-corruption.patch + ./configure \ --prefix="" \ --sbindir=/bin \ --sysconfdir=/etc \ --without-libiberty \ - --disable-Werror \ --without-avahi - make LDFLAGS="-L/lib -static" + make make install DESTDIR=$pkg cp COPYING $pkgdocs/ @@ -32,5 +32,6 @@ build() { } sha512sums=" -cf3de9634244f8d8ab008d3a8a6d49eccb27923b3cf2e55ec2d72493981cf95e634c1b51d35e85d8ffb489625aca594a5b3e03143cebaa1d87dc238070976dc1 distcc-3.3.3.tar.lz -" +c2d7fd2baacee153f722e780b5dc3780eaf2903ceff22c3eb315905d425b984403e1abab540e8cd49829bc03a86ae984b62d31b9defb493adddac7b24f428b09 distcc-3.4.tar.lz +9bc411107021d5f621304a73b0bfdec387d1b33121a325503cf4c9c4046924338ee1b4ef093b517249c3df31cf69cd9f19377df2edd6e81be1dac50a5bd0f3d5 dcc_gcc_rewrite_fqn-avoid-heap-corruption.patch +" \ No newline at end of file diff --git a/net/vnstat/vnstat.SMBuild b/net/vnstat/vnstat.SMBuild index 33ca592..bf21955 100755 --- a/net/vnstat/vnstat.SMBuild +++ b/net/vnstat/vnstat.SMBuild @@ -1,5 +1,5 @@ app=vnstat -version=2.4 +version=2.10 build=1sml homepage="https://humdi.net/vnstat/" download="https://humdi.net/vnstat/vnstat-$version.tar.gz" @@ -32,5 +32,5 @@ build() { } sha512sums=" -deb877b0eff18ccf33fea5c7389c7ba832d675376651c5d0f6cbfe3c5224afb6b8669aedb45c8e99b638e659cf44198f8714ec50c8a9e62272fb0c4e29c67488 vnstat-2.4.tar.lz -" +73bcd991c8a5dbaf4ac2ae0758230ee14981dea18551cf3632fddd43d59245cf1f82245967ea095f1da803f7022665d96436488fe14a00823fc911ec0380a7a8 vnstat-2.10.tar.lz +" \ No newline at end of file diff --git a/net/vnstat/vnstat.run b/net/vnstat/vnstat.run index 749c521..dec00f6 100644 --- a/net/vnstat/vnstat.run +++ b/net/vnstat/vnstat.run @@ -1,3 +1,3 @@ #!/bin/sh CONFFILE=/etc/vnstat.conf -exec /bin/vnstatd --config $CONFFILE --nodaemon 2>&1 +exec /bin/vnstatd --config $CONFFILE --sync --nodaemon 2>&1 diff --git a/net/weechat/weechat.SMBuild b/net/weechat/weechat.SMBuild index 4618bdc..63cdf22 100755 --- a/net/weechat/weechat.SMBuild +++ b/net/weechat/weechat.SMBuild @@ -1,5 +1,5 @@ app=weechat -version=2.5 +version=3.8 build=1sml homepage="http://www.weechat.org" download="https://weechat.org/files/src/weechat-$version.tar.xz" @@ -14,23 +14,21 @@ build() { cd $app-$version fixbuilddirpermissions - mkdir smbuild && cd smbuild - cmake .. \ - -DCMAKE_INSTALL_PREFIX="" \ - -DENABLE_MAN=ON \ - -DENABLE_TCL=OFF \ - -DENABLE_PYTHON=OFF \ - -DENABLE_PYTHON3=ON \ - -DCMAKE_BUILD_TYPE=Release + ./autogen.sh + + LDFLAGS="-lcurses -lterminfo" \ + ./configure \ + --prefix="" \ + --disable-nls make make install DESTDIR=$pkg - cp ../COPYING $pkgdocs/ + cp COPYING $pkgdocs/ mkfinalpkg } sha512sums=" -803ee697823b415d6af7a452717610648288bfb4c2ffd2b63a21a2d0d0cebf5ed32f98f0ef952402b3fea8c39121c429ae517b3446d26a203f76f09a8aed47af weechat-2.5.tar.lz -" +f2fe125d03e9c8f8b5b03e2cdd340c6cd65c463187bd213c9128a3df19da56ae38f1a6d20a47c09606d1504448e3d554de042e33cc57b73753ce8491595ef516 weechat-3.8.tar.xz +" \ No newline at end of file