Project

General

Profile

Actions

Feature #3338

open

140: register_netdev() must be paired with unregister_netdev(). alloc_netdev() must be paired with free_netdev().

Added by Ilya Shchepetkov over 9 years ago. Updated over 7 years ago.

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

0%

Estimated time:
Published in build:

Description

You mast call unregister_netdev() for already registered device, free_netdev() is not enough.

The proper rollback is to call unregister_netdevice, not free_netdev.
Otherwise - kernel BUG at net/core/dev.c:4057!

Example of bug:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=822973ba79fd5a5b711270c2de7196c6b50c6687
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=38bddf04bcfe661fbdab94888c3b72c32f6873b3

Freeing netdev without free_netdev() leads to net, tx leaks.
It might lead to dereferencing freed pointer.

Example of bug:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=b37e0c619dc231f292ed199f50c18f5bf508e16d


Related issues

Related to Linux Kernel Safety RuleDB - Feature #3339: alloc_netdev() must be paired with free_netdev()ClosedIlya Shchepetkov08/10/2012

Actions
Actions #1

Updated by Ilya Shchepetkov almost 9 years ago

  • Subject changed from 140: register_netdev() must be paired with unregister_netdev() to 140: register_netdev() must be paired with unregister_netdev(). alloc_netdev() must be paired with free_netdev().
  • Description updated (diff)
  • Status changed from New to Resolved

Added in commit 9f78ee2 of master branch.

Actions #2

Updated by Evgeny Novikov over 7 years ago

  • Status changed from Resolved to Open
  • Assignee changed from Ilya Shchepetkov to Vadim Mutilin

This rule specification should be likely used in rc launches. But one needs to run it on the whole kernel and evaluate results.

Actions

Also available in: Atom PDF