Re: linux-ipsec: valid module function pointer?

Richard Guy Briggs (rgb@conscoop.ottawa.on.ca)
Fri, 17 Sep 1999 19:32:26 -0400 (EDT)


-----BEGIN PGP SIGNED MESSAGE-----

> On Fri, Sep 17, 1999 at 04:21:44PM -0400, Richard Guy Briggs wrote:
> > Can anyone suggest a way to test a module function pointer for
> > validity? The problem is that we currently save pointers to kernel
> > space funciton pointers which might go away if a pcmcia card is
> > removed. Is there a way to test if the function pointer belongs to a
> > module which is still loaded?
>
> No, you don't.
>
> Counter example: Something is unloaded, and after a while, something
> else is loaded into same memory area.
>
> Now how you know that the pointer is valid ?
> I would say: you don't.

Right...I kinda had that scenario in the back of my mind...

> A way out could be eternally growing array of pointers, which may then
> latter be removoked by writing a NULL back into place at module unload.
> ... but it would be eternally growing non-swappable array... Not good.

Yeah, this does sound horrid.

> You must find some other approach. What is the original problem, which
> is now "solved" with cached function pointers ?

The original problem is an IPSec processing module which links a
virtual device to a physical device, receiving packets on the virtual
device (one for each potential physical device that may be used to
carry IPSec'ed traffic), IPSec processing it, then stuffing it out the
physical device. This approach is going away soon in our 2.2.xx , so
unless it is a relatively simple check or notification, it is not
worth spending lots of time on it.

Thanks for your response.

> > slainte mhath, RGB
>
> /Matti Aarnio <matti.aarnio@sonera.fi>

slainte mhath, RGB
- --
Richard Guy Briggs -- PGP key available Auto-Free Ottawa! Canada
<http://www.conscoop.ottawa.on.ca/rgb/> </www.flora.org/afo/>
Prevent Internet Wiretapping! -- FreeS/WAN:<www.xs4all.nl/~freeswan>
Thanks for voting Green! -- <green.ca> Marillion:<www.marillion.co.uk>

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBN+LPiN+sBuIhFagtAQGp+wP/X0hgbykUH0Hnfa44IloNfa2b++1GCHXe
X5+CMwxbp4ouwxNS/s6/rQVUScIc2cE7SPCNdScZgtfZPS6fx11wG6wAkDvOBlfW
ckvDJruotVVU2vPMxmXZb8+dxWQR98vin6DvuJHVqjf3NT+5hdr6wxYk2RHDLG5X
uHwpr/fwPag=
=P+Az
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/