| 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-46300" |
| 18 |
DATE="2026-05-13" |
| 19 |
NAME="Fragnesia" |
| 20 |
URL="https://github.com/v12-security/pocs/tree/main/fragnesia" |
| 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.0.7" |
| 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 rxrpc |
| 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 rxrpc |
| 65 |
install rxrpc /bin/false |
| 66 |
EOF |
| 67 |
|
| 68 |
rmmod rxrpc > /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 |