From 45ecbb1106e5c132118c9bbed67981e9a77eaf2c Mon Sep 17 00:00:00 2001 From: chaquen Date: Mon, 10 Jan 2022 13:06:25 +1100 Subject: [PATCH] New package: tirdad-0.1.20 --- srcpkgs/tirdad/INSTALL | 20 ++++++++++++++++++++ srcpkgs/tirdad/REMOVE | 2 ++ srcpkgs/tirdad/patches/arch.patch | 19 +++++++++++++++++++ srcpkgs/tirdad/template | 26 ++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 srcpkgs/tirdad/INSTALL create mode 100644 srcpkgs/tirdad/REMOVE create mode 100644 srcpkgs/tirdad/patches/arch.patch create mode 100644 srcpkgs/tirdad/template diff --git a/srcpkgs/tirdad/INSTALL b/srcpkgs/tirdad/INSTALL new file mode 100644 index 000000000000..0a10ea4758f4 --- /dev/null +++ b/srcpkgs/tirdad/INSTALL @@ -0,0 +1,20 @@ +# INSTALL +case "$ACTION" in +pre) + # Actions to execute before the package files are unpacked. + ;; +post) + if [ "$UPDATE" = "yes" ]; then + # actions to execute if package is being updated. + sudo rmmod /etc/tirdad.ko + sudo insmod /etc/tirdad.ko + else + # actions to execute if package is being installed. + sudo insmod /etc/tirdad.ko + if ! grep -q tirdad "/etc/rc.local"; then + sudo echo "# Load tirdad module at boot to generate random TCP Initial Sequence Numbers" >> /etc/rc.local + sudo echo "insmod /etc/tirdad.ko" >> /etc/rc.local + fi + fi + ;; +esac diff --git a/srcpkgs/tirdad/REMOVE b/srcpkgs/tirdad/REMOVE new file mode 100644 index 000000000000..413922087c64 --- /dev/null +++ b/srcpkgs/tirdad/REMOVE @@ -0,0 +1,2 @@ +# REMOVE +sudo sed -i '/tirdad/d' /etc/rc.local diff --git a/srcpkgs/tirdad/patches/arch.patch b/srcpkgs/tirdad/patches/arch.patch new file mode 100644 index 000000000000..13a1dd8c3a0f --- /dev/null +++ b/srcpkgs/tirdad/patches/arch.patch @@ -0,0 +1,19 @@ +--- a/module/tirdad.c ++++ b/module/tirdad.c +@@ -30,7 +30,15 @@ + siphash_key_t last_secret; + + unsigned long tcp_secure_seq_adr; +- ++unsigned long __stack_chk_guard; ++void __stack_chk_guard_setup(void) ++{ ++ __stack_chk_guard = 0xBAAAAAAD;//provide some magic numbers ++} ++void __stack_chk_fail(void) ++{ ++ /* Error message */ ++}// will be called when guard variable is corrupted + #define AGGREGATE_KEY_SIZE 16 + #define FUSION_SIZE 12 + diff --git a/srcpkgs/tirdad/template b/srcpkgs/tirdad/template new file mode 100644 index 000000000000..97adb236f06f --- /dev/null +++ b/srcpkgs/tirdad/template @@ -0,0 +1,26 @@ +# Template file for 'tirdad' +pkgname=tirdad +version=0.1.20 +revision=1 +_realversion="${version}-1" +#archs="i686 x86_64" +wrksrc="${pkgname}-${_realversion}" +#create_wrksrc=yes +build_style=gnu-makefile +#configure_args="" +#make_build_args="" +#make_install_args="" +#conf_files="" +#make_dirs="/var/log/dir 0755 root root" +hostmakedepends="linux-headers gcc" +#makedepends="" +#depends="" +short_desc="Tirdad is a kernel module to generate random TCP Initial Sequence Numbs" +maintainer="Chaquen " +license="GPL-3.0-or-later" +homepage="https://github.com/Whonix/tirdad" +distfiles="https://github.com/Whonix/tirdad/archive/refs/tags/${_realversion}.tar.gz" +checksum=5e75b743cfca980a08a0696cb685c86dd42d6566ff557959292506bceaf1a86d +do_install() { + vconf module/tirdad.ko +}