Re: calling skb_queue_purge() causes oops when called from FreeS/WAN under 2.2.x

Richard Guy Briggs (rgb@conscoop.ottawa.on.ca)
Tue, 26 Oct 1999 14:53:31 -0400


--trn+QUW9U3JCIvJ2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 26, 1999 at 09:58:15PM +0400, kuznet@ms2.inr.ac.ru wrote:
> Hello!
>=20
> > Can you quote the lines or tell me what version of the file you are
>=20
> pfkey_v2.c, pfkey_upmsg():
>=20
> if(!(skb =3D alloc_skb(pfkey_msg->sadb_msg_len, GFP_ATOMIC) )) {
> return -ENOBUFS;
> }
>=20
> skb->h.raw =3D skb_put(skb, pfkey_msg->sadb_msg_len);
> memcpy(skb->h.raw, pfkey_msg, pfkey_msg->sadb_msg_len * IPSEC_PFKEYv2_AL=
IGN);
> ^!!!!!!!!!

What is wrong with this? The pfkey_msg->sadb_msg_len contains the
size of the message extension in long-long's, in other words 64-bit
blocks, not octets. Other than that, is there something I am missing?

I am in the process of fixing the userland code that should actually
try to empty the queue as well, but it should not depend on that.

> > choice if we are to continue to support more than one kernel version.
>=20
> Look at ethernet drivers, f.e. drivers/net/tulip.c. They compile
> for any kernel, including really ancient ones and contain not so
> much of ifdefs. F.e. look at macro DEV_ALLOC_SKB(). You could use
> the same approach. Now it is just unparsable.

I will have a look at the tulip driver. It is a little more parsable
now, but pfkey_destroy_socket is still a huge mess because I am still
trying lots of different things to try to understand the problem. If
you cannot parse it, perhaps you are not investing enough effort!
(just kidding, a reference to some of your previous comments about the
Linux network code ;-)

I have checked in an update.

> Alexey

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

--trn+QUW9U3JCIvJ2
Content-Type: application/pgp-signature

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

iQCVAwUBOBX4qd+sBuIhFagtAQEb/wP+NIfi9lLmz2JAvddRNfFNtvHRcllNXxM7
nWMAHOFePf6yV0QZM0zKeRWQiZfdDBAxbJ4JaH3hftM3wawKFV4IqXW0N/HzG/sK
NEOOjLUSZ9ppmR7tBB0d+VKI9fCupFvAkZFipnkIXer8Cmy06dhQK+wAJN9mb7o5
qTOM4p+vEcg=
=ddiF
-----END PGP SIGNATURE-----

--trn+QUW9U3JCIvJ2--

-
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/