Project

General

Profile

Actions

Feature #2735

open

104: All allocated memory should be freed on module uploading

Added by Evgeny Novikov about 12 years ago. Updated over 9 years ago.

Status:
Open
Priority:
Normal
Start date:
04/10/2012
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

  1. At the end all allocated memory should be free.
  2. It’s not allowed to free the same memory twice.
  3. It’s not allowed to free not allocated memory.

Description

The dynamic allocation is widely used in Linux. The incorrect usage of heap may lead to memory leaks or even to failures, when the module tries to free not allocated memory. So, the correct usage of heap includes
  • Freeing all allocated memory to avoid a memory leak.
  • Freeing an allocated memory only once.
  • Freeing only allocated memory.

Memory allocation functions are kmalloc and kzalloc, a free function is kfree. It is correct to free the null pointer.

Links
Sample bugfix

Note
This is a generic:resource:leaks class of our classifier.


Files

104_1a.patch (600 Bytes) 104_1a.patch Patch to linux-stable kernel to find exactly the same bug as fixed in commit c0cc359 Evgeny Novikov, 04/24/2012 02:00 PM
Actions #1

Updated by Evgeny Novikov about 12 years ago

Commit dd002ee of the master branch adds support of 104_1a model that finds a bug fixed in commit c0cc359 of the linux-stable branch before the fix and... after the fix.

Actions #2

Updated by Evgeny Novikov about 12 years ago

To find exactly the same bug as fixed in commit c0cc359 one should apply the patch attached.

Actions #3

Updated by Evgeny Novikov about 12 years ago

Also simple workaround required to detect the bug was added since commit c71d7a4 of our master branch.

Actions #4

Updated by Alexey Khoroshilov about 12 years ago

  • Subject changed from All allocated memory should be freed on module uploading to 104: All allocated memory should be freed on module uploading
Actions #5

Updated by Evgeny Novikov almost 12 years ago

Reduce priority until we'll decide that it's high actually.

Actions #6

Updated by Evgeny Novikov almost 12 years ago

  • Priority changed from High to Normal
Actions #7

Updated by Pavel Andrianov over 9 years ago

  • Description updated (diff)
  • Assignee changed from Evgeny Novikov to Pavel Andrianov
Actions #8

Updated by Vadim Mutilin over 9 years ago

  • Description updated (diff)
Actions #9

Updated by Vadim Mutilin over 9 years ago

  • Description updated (diff)
Actions #10

Updated by Vadim Mutilin over 9 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF