惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家
V
V2EX
Jina AI
Jina AI
V
Visual Studio Blog
有赞技术团队
有赞技术团队
博客园 - 司徒正美
博客园 - 叶小钗
The Cloudflare Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
Google Online Security Blog
Google Online Security Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News and Events Feed by Topic
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
SecWiki News
SecWiki News
博客园_首页
罗磊的独立博客
量子位
Latest news
Latest news
I
Intezer
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Last Week in AI
Last Week in AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
SegmentFault 最新的问题
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News | PayPal Newsroom

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Swap Fire on My VPS: A Nightmare That Started with a Kernel CVE Patch
Mustafa ERBA · 2026-05-14 · via DEV Community

Mustafa ERBAY

Sudden Increase in Swap Usage: Symptoms and Initial Findings

This morning, when I connected to my server, I wanted to check the system health before starting my workflow as usual. However, the scene I encountered was far from what I was accustomed to. The htop output showed the mysqld process consuming an abnormally high amount of CPU and RAM, but what really caught my attention was the swap usage reaching almost full capacity. When I checked with the free -h command, I saw that almost the entire system was using swap space. This situation had drastically reduced the server's performance, causing many services to become unresponsive. Normally, swap usage on this server remains at a minimum because I have sufficient RAM, and processes are usually kept in memory. I needed to conduct an in-depth investigation to find the source of this sudden increase.

My first reaction was to check if I had made any recent updates. I reviewed the apt history log records for the past week. The most significant change I noticed was a Linux kernel update that was automatically applied a few days ago: linux-image-6.5.0-27-generic. It was critical to understand how this update affected the system's swap behavior. Kernel updates are usually made to improve performance or close security vulnerabilities, but they can sometimes lead to unexpected side effects. Situations like this on my own VPS constantly remind me how careful I need to be at every layer of the system architecture.

ℹ️ Why Does Swap Usage Increase?

Swap space is a disk area used by the operating system when physical memory (RAM) is insufficient. If your system's RAM becomes full, the operating system temporarily moves less frequently used memory pages to the swap area. While this frees up space for new processes, it reduces system performance because disk access is much slower than RAM access. Sudden and continuous high swap usage is usually a sign of either a memory leak or an application struggling to cope with insufficient RAM.

Kernel Update and CVE Impact

To find the root cause of this problem, I continued to examine the dmesg outputs and system logs. The journalctl -xe command showed detailed error messages from the last 24 hours. The error messages I saw were specifically related to memory management and suggested that the kernel was having trouble allocating memory under certain conditions. The first thing that came to mind was that the latest kernel update might have brought security patches with it. I researched if there were any memory management vulnerabilities associated with any CVE (Common Vulnerabilities and Exposures) numbers.

While examining the latest updates for the Linux kernel's 6.5.x series, a vulnerability named CVE-2026-31431 caught my eye. This vulnerability was specifically related to swap management and could, under certain conditions, cause the kernel to perform erroneous memory reads or writes. This situation could disrupt the system's memory management, leading to an unexpected increase in swap usage and even making the system unstable. It perfectly matched the scenario I was experiencing. The update was intended to fix this vulnerability, but it seemed the patch interacted with a specific configuration or usage pattern on my system, causing a reverse effect.

Situations like this point to an approach called "fix on break." A change made to close a security vulnerability can sometimes lead to unforeseen new problems. Especially in complex systems, it is quite difficult to test all possible scenarios for every patch. Therefore, every update deployed to a production environment needs to be carefully monitored, and one must be prepared for potential issues. Encountering such a problem on my own VPS once again painfully reminded me of this principle.

Debugging: The Process of Debugging What Triggered Swap

After generally identifying the source of the problem, I began a more detailed debugging process. My goal was to concretely determine which process or system behavior was triggering such high swap usage. The strace command is a powerful tool for monitoring the system calls and signals a process makes. Examining calls like malloc and mmap can be useful, especially for understanding memory allocation issues. However, since the problem was increasing swap usage across the entire system, I turned to broader tools.

The perf tool is an excellent option for performance analysis on Linux systems. With the perf top command, you can see the processes and functions consuming the most CPU time in real-time. However, my problem was not CPU-bound but rather memory and swap usage. Therefore, I recorded page faults and memory accesses on the system using commands like perf record -g -e page-faults,cycles,instructions,major-faults,minor-faults -- sleep 60. I then analyzed this data with perf report. The records showed intensive calls to the mysqld process and the kernel's __handle_mm_fault function. This indicated that the system was constantly moving memory pages from disk to swap space and reading them back.

# Monitor swap usage in real-time

<figure>
  <Image src={cover} alt="A graph showing swap usage peaking on a VPS terminal screen." />
</figure>

watch -n 1 free -h

# Search system logs for memory management related errors
sudo journalctl -xe | grep -i "memory\|swap\|oom\|fault"

# Monitor system calls for a specific process (e.g., mysqld)
sudo strace -p $(pgrep mysqld) -s 256 -e trace=memory

Enter fullscreen mode Exit fullscreen mode

Based on these analyses, I became even closer to the conclusion that the problem was not directly with the mysqld process itself, but rather a bug in the kernel related to swap management was being triggered. Specifically, the installation of the linux-image-6.5.0-27-generic package after the automatic apt upgrade operation that occurred during the night hours pointed to the start of the problem.

Solution: Rolling Back the Patch and Configuration Adjustments

After identifying the source of the problem, my first step was to temporarily roll back the kernel version that was causing the issue. This was critical to ensure the system ran stably and to gather more data. I listed the installed kernel images with the dpkg --list | grep linux-image command and used sudo apt remove linux-image-6.5.0-27-generic followed by sudo apt autoremove to revert to a previous stable version. Then, I installed a previous, trusted kernel version (e.g., linux-image-6.5.0-26-generic) with sudo apt install linux-image-6.5.0-26-generic.

After restarting the system and booting with the old kernel version, I ran the free -h command again. I observed that swap usage had returned to normal, and the mysqld process was no longer exhibiting abnormal memory usage. This definitively confirmed that a bug in the new kernel version was causing the problem. However, simply rolling back the patch was not a permanent solution. Security vulnerabilities still existed and would need to be addressed at some point.

Therefore, my next step was to research ways to temporarily disable or mitigate the impact of the relevant CVE in the new kernel version. It is possible to manage swap behavior by adjusting kernel parameters or changing sysctl settings. Specifically, the vm.swappiness value determines how aggressively the system uses swap. An setting like sysctl vm.swappiness=10 reduces the system's inclination to use swap. However, this alone would not solve the problem, as the issue stemmed more from a bug within the kernel itself.

⚠️ Risks of Rolling Back Kernel Patches

Rolling back kernel patches can be a temporary solution, but it can leave your system vulnerable to security exploits in the long run. Therefore, when a patch is rolled back, it is essential to track when and how the relevant security vulnerability will be fixed and to transition to an updated and secure version as soon as possible. During this process, you may also consider implementing additional security measures to reduce potential attack vectors against your system.

Long-Term Solutions and Preventive Measures

This experience once again showed me the potential risks of automatic kernel updates on my production servers. It would be a safer approach to have such critical updates applied after undergoing a testing process and manual approval, rather than being applied automatically. This can be achieved through strategies like "canary deployment" or "blue-green deployment," where updates are first tested on a small group of servers and then rolled out to all servers.

Furthermore, I realized that I need to further enhance my system monitoring tools. Setting up alarms that closely track metrics such as swap usage, page faults, and memory allocation errors, in addition to CPU and RAM usage, will help in the early detection of similar issues. With tools like Prometheus and Grafana, I can collect and visualize these detailed metrics and receive automatic notifications when anomalies are detected. This is also part of the "observable systems" principle.

Finally, to be able to respond more quickly in case of a similar problem, I plan to create a "runbook" that outlines the basic troubleshooting steps. This runbook will address specific scenarios like a sudden increase in swap usage and will detail, step-by-step, which commands to run, which logs to examine, and what temporary solutions can be applied. Such preparations help in systematically resolving the problem without panicking in crisis situations.

One of the most important lessons I learned during this process is that, in addition to technical solutions, processes and monitoring mechanisms are just as important as the code itself. This swap fire on my own VPS was not just a technical problem but also an opportunity for me to review the processes in my infrastructure management.

# Making sysctl settings permanent (e.g., by adding to /etc/sysctl.conf)
# vm.swappiness = 10

Enter fullscreen mode Exit fullscreen mode

By implementing these steps, I managed to extinguish the swap fire on my VPS and restore my system to stability. This experience demonstrated that infrastructure management is not just about building "working" systems, but also about being prepared for unexpected problems and continuously improving.

# Example of reverting to a previous kernel version and pinning updates
# List installed kernel versions
dpkg --list | grep linux-image

# Remove the unwanted version
sudo apt remove linux-image-6.5.0-27-generic

# Install the previous version (the latest installed version is selected by default)
sudo apt install linux-image-6.5.0-26-generic

# Update Grub
sudo update-grub

# To prevent this package from being installed in future automatic updates
sudo apt-mark hold linux-image-6.5.0-26-generic

Enter fullscreen mode Exit fullscreen mode

These events remind us that technology is constantly evolving and can always present new challenges. What's important is to remain calm in the face of these challenges and to find solutions with a systematic approach.