Overflow Vulnerability in seq_buf_putmem_hex() in Kernel

Kernel Updated 02 Oct 2025

Summary

03/08/2021
N/A
No i
Unrated
Not published

UVI-2021-1001222: seq_buf: Fix overflow in seq_buf_putmem_hex(). Affects Kernel versions >= 5e3ca0ec76fce92daa4eed0d02de9c79b1fe3920, < d57fcab190b60f43046d5836c3c56114b4f50080. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Kernel is a crucial component of the Linux operating system, responsible for managing system resources and facilitating communication between hardware and software. It provides essential functionalities such as process management, memory management, and device drivers. The seq_buf_putmem_hex() function is part of the seq_buf API, which is used for sequential output formatting. This vulnerability affects the Kernel package and can lead to a buffer overflow.

Vulnerability Detail

The seq_buf_putmem_hex() function in the Kernel is susceptible to a buffer overflow. This occurs when the function is provided with a large input, causing it to write beyond the allocated buffer. An attacker could exploit this vulnerability to overwrite adjacent memory, potentially leading to arbitrary code execution or a system crash. The vulnerability was introduced in version 2.6.27 of the Kernel and has been fixed in version 5.13.3.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a workaround, users can apply input validation to limit the size of the input provided to the seq_buf_putmem_hex() function. By ensuring that the input does not exceed the allocated buffer size, the risk of a buffer overflow can be mitigated. Here is an example of how input validation can be implemented in C:

#include <linux/seq_buf.h>

void my_seq_buf_putmem_hex(struct seq_buf *s, const void *mem, size_t len) {
  if (len > SEQ_BUF_MAX_SIZE)
    len = SEQ_BUF_MAX_SIZE;

  seq_buf_putmem_hex(s, mem, len);
}

Conclusion

In conclusion, the seq_buf_putmem_hex() function in the Kernel is vulnerable to a buffer overflow. This can be exploited by an attacker to execute arbitrary code or crash the system. It is crucial to update the Kernel package to version 5.13.3 or later to mitigate this vulnerability. Regularly updating the Kernel package is recommended to ensure the latest security patches are applied. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

This vulnerability can potentially allow an attacker to execute arbitrary code or crash the system by overwriting adjacent memory.

You can use the Vulert Playground at Vulert Scanner to check if your system is affected by this vulnerability. Simply upload your package-lock.json file, and Vulert will analyze it in real-time.

At the time of this report, there is no known exploit for this vulnerability. However, it is important to apply the recommended fix to mitigate any potential risks.

This vulnerability specifically affects the Kernel package. However, it is always recommended to keep all software dependencies up to date to ensure the overall security of the system.

The vulnerability was discovered by an automated security analysis tool and reported in the Open Source Vulnerability format. The details of the discovery can be found in the provided references link.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback