Re: [ATM]: refcount atm sockets

From: contractor
Date: Fri Jan 16 2004 - 12:43:51 EST


for 2.4 kernels i am afraid this is they way it has to be unless
the upper socket layer is rewritten a bit. the purpose of this patch
is to prevent stupid behavior. things will be bit racy but its better
than being able to rmmod atm when 'non device' atm sockets are still open.

In message <20040116125317.GD734@xxxxxxxxxxxx>,Muli Ben-Yehuda writes:
>On Fri, Jan 16, 2004 at 10:02:24AM +0000, Linux Kernel Mailing List wrote:
>> ChangeSet 1.1405.1.4, 2004/01/16 02:02:24-08:00, chas@xxxxxxxxxxxxxxxx
>>=20
>> [ATM]: refcount atm sockets
>
>> diff -Nru a/net/atm/common.c b/net/atm/common.c
>> --- a/net/atm/common.c Fri Jan 16 04:17:24 2004
>> +++ b/net/atm/common.c Fri Jan 16 04:17:24 2004
>> @@ -242,6 +242,8 @@
>> printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) d
>etected=
>=2E\n", atomic_read(&sk->wmem_alloc));
>> =20
>> kfree(sk->protinfo.af_atm);
>> +
>> + MOD_DEC_USE_COUNT;
>
>This has the usual wellknown races involved with handling the module's
>refcount from within the moodule. Is there a way to push the
>refcounting to the caller?=20
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/