From: "Jason A. Donenfeld" <Jason@zx2c4.com> Date: 2018-02-21 03:42:10
Before, if cb->start() failed, the module reference would never be put,
because cb->cb_running is intentionally false at this point. Users are
generally annoyed by this because they can no longer unload modules that
leak references. Also, it may be possible to tediously wrap a reference
counter back to zero, especially since module.c still uses atomic_inc
instead of refcount_inc.
This patch expands the error path to simply call module_put if
cb->start() fails.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
This probably should be queued up for stable.
net/netlink/af_netlink.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Eric Dumazet <hidden> Date: 2018-02-21 05:47:33
On Wed, 2018-02-21 at 04:41 +0100, Jason A. Donenfeld wrote:
Before, if cb->start() failed, the module reference would never be put,
because cb->cb_running is intentionally false at this point. Users are
generally annoyed by this because they can no longer unload modules that
leak references. Also, it may be possible to tediously wrap a reference
counter back to zero, especially since module.c still uses atomic_inc
instead of refcount_inc.
This patch expands the error path to simply call module_put if
cb->start() fails.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
This probably should be queued up for stable.
When was the bug added ? This would help a lot stable teams ...
Thanks.
From: Eric Dumazet <hidden> Date: 2018-02-21 15:12:04
On Wed, 2018-02-21 at 15:54 +0100, Jason A. Donenfeld wrote:
On Wed, Feb 21, 2018 at 6:47 AM, Eric Dumazet [off-list ref] wrote:
quoted
quoted
This probably should be queued up for stable.
When was the bug added ? This would help a lot stable teams ...
This needs to be backported to 4.16-rc0+, 4.15+, 4.14+, 4.13.14+, and 4.9.63+.
I guess I should have asked you to provide an appropriate Fixes: tag,
clearly identifying the commit that added the bug.
Fixes: 12-digit-sha1 ("patch title")
Thanks.
From: David Miller <davem@davemloft.net> Date: 2018-02-22 19:04:41
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Wed, 21 Feb 2018 04:41:59 +0100
Before, if cb->start() failed, the module reference would never be put,
because cb->cb_running is intentionally false at this point. Users are
generally annoyed by this because they can no longer unload modules that
leak references. Also, it may be possible to tediously wrap a reference
counter back to zero, especially since module.c still uses atomic_inc
instead of refcount_inc.
This patch expands the error path to simply call module_put if
cb->start() fails.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
This probably should be queued up for stable.