Re: [PATCH][ATM] make clip modular

From: David S. Miller (davem@redhat.com)
Date: Mon May 12 2003 - 13:57:58 EST


   From: chas williams <chas@cmf.nrl.navy.mil>
   Date: Mon, 12 May 2003 15:33:22 -0400

   this patch lets one build clip as a module.
   
This doesn't work and is quite racey.

   + if (!atm_clip_ops || !try_module_get(atm_clip_ops->owner)) {

Q: What prevents atm_clip_ops from going NULL between the
   !atm_clip_ops test and the atm_clip_ops->owner dereference?

A: Nothing.

Therefore you have to protect these things some how, I would
suggest using a semaphore, put it right next to atm_clip_ops
and hold it around register, derferegister, and code sequence
like this one trying to get a reference to it.

The various ioctl hooks in net/socket.c are good models to
work from.

MPOA/LEC/MPC probably have nearly identical bugs and it would
be great if you could fix them up too.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:41 EST