Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:13:18+00:00 2026-06-10T23:13:18+00:00

I am suspecting a double kfree in my kernel code. Basically, I have a

  • 0

I am suspecting a double kfree in my kernel code. Basically, I have a data structure that is kzalloced and kfreed in a module. I notice that the same address is allocated and then allocated again without being freed in the module.

I would like to know what technique should I employ in finding where the wrong kfree is issued.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:13:20+00:00Added an answer on June 10, 2026 at 11:13 pm

    1.
    Yes, kmemleak is an excellent tool, especially suitable for system-wide analysis.

    Note that if you are going to use it to analyze a kernel module, you may need to save the addresses of the ELF sections containing the code of the module (.text, .init.text, …) when the module is loaded. This may help you decipher the call stacks in the kmemleak’s report. It usually makes sense to ask kmemleak to produce a report after the module has been unloaded but kmemleak cannot resolve the addresses at that time.

    While a module is loaded, the addresses fo its sections can be found in the files in /sys/module/<module_name>/sections/.

    After you have found the section each code address in the report belongs to and the corresponding offset into that section, you can use objdump, gdb, addr2line or a similar tool to obtain more detailed information about where the event of interest occurred.

    2.
    Besides that, if you are working on an x86 system and you would like to analyze a single kernel module, you can also use KEDR LeakCheck tool.

    Unlike kmemleak, most of the time, it is not required to rebuild the kernel to be able to use KEDR.

    The instructions on how to build and use KEDR are here. A simple example of how LeakCheck can be used is described in “Detecting Memory Leaks” section.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that parses through an html file and I stumbled across
I have an enumeration that I want to use in pattern matches in an
we have a .NET 3.5 WinForms app that uses Linq2Sql to insert records into
I've got a Core Data property that I'm trying to set at runtime, with
I have a form generator that uses (perl compatible) regexes for ther backend validation.
I am suspecting that there's a problem with Controller Plugins redirecting when used in
Does System.Activator.CreateInstance(T) method have performance issues (since I'm suspecting it uses reflection) big enough
I have a simple controller that specifies: respond_to :json When I try to build
Recently I started suspecting that I use the ends of the pipes wrongly: From
In my solution (partly c#, partly VB.NET), I am suspecting that somewhere during the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.