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 8703877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:57:55+00:00 2026-06-13T02:57:55+00:00

I’m debugging my kernel module, which appears to have a memory corruption, basically a

  • 0

I’m debugging my kernel module, which appears to have a memory corruption,
basically a piece of memory allocated by alloc_netdev() for ‘net_device’
instance has been corrupted.

1) I turned on CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_SLAB, CONFIG_DEBUG_KMEMLEAK in my kernel’s .config, however not sure what to expect from kmemleak. Is it supposed to print out a trace dump of suspected memory leaks whenever I read /sys/kernel/debug/kmemleak? Is there a way to reset the statistics/information accumulated by kmemleak? An the most important — could anyone help to decipher the output, e.g. :

unreferenced object 0xc625e000 (size 2048):
  comm "swapper", pid 1, jiffies 4294937521
  backtrace:
    [<c00c89f0>] create_object+0x11c/0x200
    [<c00c6764>] __kmalloc_track_caller+0x138/0x178
    [<c01d78c0>] __alloc_skb+0x4c/0x100
    [<c01d8490>] dev_alloc_skb+0x18/0x3c
    [<c0198b48>] eth_rx_fill+0xd8/0x3fc
    [<c019ac74>] mv_eth_start_internals+0x30/0xf8
    [<c019c5fc>] mv_eth_start+0x70/0x244
    [<c019c810>] mv_eth_open+0x40/0x64
    [<c01e00f0>] dev_open+0xb4/0x118
    [<c01df788>] dev_change_flags+0x90/0x168
    [<c001a3e4>] ip_auto_config+0x1bc/0xecc
    [<c00212f4>] do_one_initcall+0x5c/0x1bc
    [<c00083d0>] kernel_init+0x8c/0x108
    [<c0022f58>] kernel_thread_exit+0x0/0x8
    [<ffffffff>] 0xffffffff

2) I was also wondering if I could apply some “read-only” attribute on this memory, this way I expect to have Oops generated when someone tries to modify the memory. Does it sound reasonable?

Appreciate any advices, thanks.

Mark

  • 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-13T02:57:56+00:00Added an answer on June 13, 2026 at 2:57 am

    To catch incorrect memory accesses, KAsan or kmemcheck could probably be more useful. Note that Kmemcheck, however, is known to incur a significant which may sometimes be unacceptable, so it is up to you to decide. KASan should be much faster.

    1.
    Concerning kmemleak, its operation is described in detail in the kernel docs.

    In short, it is more reliable to execute

    echo scan > /sys/kernel/debug/kmemleak
    

    as root to trigger memory analysis immediately before you read /sys/kernel/debug/kmemleak. Sometimes, I found even more reliable to execute the above command twice before reading kmemleak’s report.

    To "reset" the data collected by kmemleak, you can execute

    echo clear > /sys/kernel/debug/kmemleak
    

    The output you have posted means that kmemleak thinks that a memory area 2Kb in size at address 0xc625e000 has not been freed at the time the tool has last analyzed memory. The backtrace specifies where the memory was allocated. "swapper" is the name of the process that has allocated that memory area.

    2.
    As far as setting memory read-only is concerned, this technique is indeed used in some places of the kernel, e.g. to protect the code of the kernel proper and the modules. I cannot give you exact instructions here but the implementation of set_page_attributes() function is a good place to start digging in.

    Note that kmemcheck I mentioned above uses a somewhat similar technique to track memory accesses: makes pages "look" like they do not exist so that each access to them causes a page fault, etc. The details are in the kernel docs, as usual.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,

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.