Debian Codegraph @

mitigations/CVE-2026-46331

raw
1 #!/bin/sh
2
3 # Linux Vulnerability Mitigation
4 # Copyright (C) 2026 Daniel Baumann <[email protected]>
5 #
6 # SPDX-License-Identifier: PD
7 #
8 # This program is free software: you have unlimited permission
9 # to copy, distribute and modify it.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15 set -e
16
17 CVE="CVE-2026-46331"
18 DATE="2026-06-29"
19 NAME="PACKET_EDIT_MEME.c"
20 URL="https://github.com/sgkdev/packet_edit_meme"
21
22 case "${1}" in
23 check)
24 if [ -e "/etc/modprobe.d/${CVE}.conf" ]
25 then
26 # installed
27 exit 0
28 else
29 # removed
30 exit 1
31 fi
32 ;;
33
34 status)
35 LINUX_CURRENT="$(uname -r | grep -Eo '^[0-9.]+')"
36 LINUX_FIXED="7.1"
37
38 if [ "$(printf '%s\n%s' "${LINUX_CURRENT}" "${LINUX_FIXED}" | sort -V | head -n1)" = "${LINUX_FIXED}" ]
39 then
40 # fixed
41 exit 0
42 fi
43
44 if lsmod | grep -qs act_pedit
45 then
46 # vulnerable
47 exit 2
48 else
49 # mitigated
50 exit 1
51 fi
52 ;;
53
54 install)
55 mkdir -p /etc/modprobe.d
56
57 cat > "/etc/modprobe.d/${CVE}.conf" << EOF
58 # /etc/modprobe.d/${CVE}.conf
59
60 # Name: ${NAME}
61 # Date: ${DATE}
62 # URL: ${URL}
63
64 blacklist act_pedit
65 install act_pedit /bin/false
66 EOF
67
68 rmmod act_pedit > /dev/null 2>&1 || true
69
70 echo 3 > /proc/sys/vm/drop_caches
71 ;;
72
73 remove)
74 rm -f "/etc/modprobe.d/${CVE}.conf"
75 rmdir /etc/modprobe.d > /dev/null 2>&1 || true
76 ;;
77 esac