Re: [PATCH][ATM] make clip modular

David S. Miller (davem@redhat.com)
Mon, 12 May 2003 11:57:58 -0700 (PDT)


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/