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 12 years ago. Updated about 10 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 1 (0 open1 closed)

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

Actions
Actions

Also available in: Atom PDF