From patchwork Mon Nov 30 06:42:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Murray X-Patchwork-Id: 106355 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.27383.1796021018927770234 for ; Sun, 29 Nov 2026 22:43:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=fHdnQeED; spf=pass (domain: konsulko.com, ip: 209.85.221.49, mailfrom: scott.murray@konsulko.com) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-4ad6219f7d8so9136001f8f.0 for ; Sun, 29 Nov 2026 22:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1796021017; x=1796625817; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=BjY3UGxZPt5kwuy0h3YzEBQethiTaa85k7MoEXiANYk=; b=fHdnQeEDnBGEkc7D7kUpbwCSkGwGCeBwbmp5AhrkTD5Xnyiu3GyT1/a5b4c+uru/mp KogI0d0xCrGTkTMoyVmshm0UZAUoaKksJ9YDb+QlEt64aRfFjg1TcQW2SN9luyhciydw HkzMmenBCKJLzE+y0cKAeo38ZDCwXpOIR0Zrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796021017; x=1796625817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=BjY3UGxZPt5kwuy0h3YzEBQethiTaa85k7MoEXiANYk=; b=03QaE4RzpVK84XE42FLjPbdfQ9Ib6SCPf/OL8DHeMaE6/Vc7U0iKlt3VnhsxqAr63r 4yALvYeXWftIC945/t528D7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V9N imJA+5QddMVNOkcwRAzj8YvfzK2+erA== X-Received: by 2002:a05:6000:4a1b:b0:48d:f996:1814 with SMTP id ffacd0b85a97d-4abba0cd3c7mr59291527f8f.57.1796021017091; Sun, 29 Nov 2026 22:43:37 -0800 (PST) Return-Path: Received: from tone.k.g (lan.nucleusys.com. [92.247.61.126]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab65cb41f4sm60434756f8f.7.2026.11.29.22.43.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 22:43:36 -0800 (PST) From: Scott Murray To: yocto-patches@lists.yoctoproject.org Subject: [meta-security][scarthgap][PATCH 10/27] suricata: add PACKAGECONFIG[seccomp] - MemoryDenyWriteExecute Date: Mon, 30 Nov 2026 08:42:55 +0200 Message-ID: <27f1264b32e1191874187c378b608be744ae539c.1796019369.git.scott.murray@konsulko.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 06:43:39 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5610 From: Clayton Casciato Add option to prevent memory mappings that are both writable and executable. https://www.freedesktop.org/software/systemd/man/255/systemd.exec.html#MemoryDenyWriteExecute= Core Suricata developer: https://github.com/jasonish/suricata-rpms/blob/a606a810325dd0a4f3ee45b2756b96bda28e590b/7.0/suricata-4.1.1-service.patch#L23 Fedora: https://src.fedoraproject.org/rpms/suricata/c/cfb3b996f54d28018cd01f9c6b9ecb77e59f344d Resolve SELinux AVC denial: type=PROCTITLE proctitle=/usr/bin/suricata -c /etc/suricata/suricata.yaml -i eth0 type=SYSCALL arch=aarch64 syscall=mprotect success=no exit=EACCES(Permission denied) a0=0x7fffa7d04000 a1=0x4000 a2=PROT_READ|PROT_WRITE|PROT_EXEC a3=0x21 items=0 ppid=1 pid=283 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=Suricata-Main exe=/usr/bin/suricata subj=system_u:system_r:initrc_t:s0 key=(null) type=AVC avc: denied { execmem } for pid=283 comm=Suricata-Main scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=process Signed-off-by: Clayton Casciato Signed-off-by: Scott Murray --- recipes-ids/suricata/files/suricata.service | 1 + recipes-ids/suricata/suricata_7.0.13.bb | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/recipes-ids/suricata/files/suricata.service b/recipes-ids/suricata/files/suricata.service index bd7010d..4b774f4 100644 --- a/recipes-ids/suricata/files/suricata.service +++ b/recipes-ids/suricata/files/suricata.service @@ -14,6 +14,7 @@ ExecReload=/bin/kill -HUP $MAINPID PrivateTmp=yes ProtectHome=yes ProtectSystem=yes +MemoryDenyWriteExecute=no [Install] WantedBy=multi-user.target diff --git a/recipes-ids/suricata/suricata_7.0.13.bb b/recipes-ids/suricata/suricata_7.0.13.bb index adee0c7..cbcd88b 100644 --- a/recipes-ids/suricata/suricata_7.0.13.bb +++ b/recipes-ids/suricata/suricata_7.0.13.bb @@ -38,7 +38,15 @@ CARGO_BUILD_FLAGS:append = " --offline" B = "${S}" # nfnetlink has a dependancy to meta-networking -PACKAGECONFIG ??= "file pcre2 yaml python pcap cap-ng net" +PACKAGECONFIG ??= "file \ + pcre2 \ + yaml \ + python \ + pcap \ + cap-ng \ + net \ + ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)} \ + " PACKAGECONFIG:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'unittests', '', d)}" PACKAGECONFIG[pcre2] = "--with-libpcre2-includes=${STAGING_INCDIR} --with-libpcre2-libraries=${STAGING_LIBDIR}, ,libpcre2 ," @@ -51,6 +59,7 @@ PACKAGECONFIG[nfq] = "--enable-nfqueue, --disable-nfqueue,libnetfilter-queue," PACKAGECONFIG[file] = ",,file, file" PACKAGECONFIG[python] = "--enable-python, --disable-python, python3, python3-core" +PACKAGECONFIG[seccomp] = "" PACKAGECONFIG[unittests] = "--enable-unittests, --disable-unittests," export logdir = "${localstatedir}/log" @@ -115,6 +124,10 @@ do_install () { -e s:/bin/kill:${base_bindir}/kill:g \ -e s:/usr/lib:${libdir}:g \ ${WORKDIR}/suricata.service > ${D}${systemd_unitdir}/system/suricata.service + + if ${@bb.utils.contains('PACKAGECONFIG', 'seccomp', 'true', 'false', d)}; then + sed -i -e 's/^MemoryDenyWriteExecute=no$/MemoryDenyWriteExecute=yes/' ${D}${systemd_unitdir}/system/suricata.service + fi fi # Remove /var/run as it is created on startup