[17233] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: [PATCH 4/4] Use gssalloc_malloc()/gssalloc_free() with

daemon@ATHENA.MIT.EDU (Jeffrey Altman)
Wed Sep 28 17:49:26 2011

X-Envelope-From: jaltman@secure-endpoints.com
X-MDaemon-Deliver-To: krbdev@mit.edu
Message-ID: <4E839660.2030401@secure-endpoints.com>
Date: Wed, 28 Sep 2011 17:49:20 -0400
From: Jeffrey Altman <jaltman@secure-endpoints.com>
MIME-Version: 1.0
To: krbdev@mit.edu
In-Reply-To: <1317239459-13699-5-git-send-email-hartmans@painless-security.com>
Reply-To: jaltman@secure-endpoints.com
Content-Type: multipart/mixed; boundary="===============2065824540=="
Errors-To: krbdev-bounces@mit.edu

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============2065824540==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig01303A0AC34B0C703C1D1FD7"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig01303A0AC34B0C703C1D1FD7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

In addition to Nico's comments, the following block appears to be
misplaced in this patchset.


On 9/28/2011 3:50 PM, Sam Hartman wrote:
> From: Kevin Wasserman <kevin.wasserman@painless-security.com>
>=20
> gss_buffer_t may be freed in a different module from where they
> are allocated so it is not safe to use malloc/free.
>=20
> Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
> diff --git a/src/appl/gss-sample/gss-misc.c b/src/appl/gss-sample/gss-m=
isc.c
> index 98d2045..e124dcc 100644
> @@ -124,6 +125,64 @@ read_all(int fildes, char *buf, unsigned int nbyte=
)
>              return (ptr - buf);
>          ret =3D recv(fildes, ptr, nbyte, 0);
>          if (ret < 0) {
> +#ifdef _WIN32
> +            const char* msg =3D "Unknown error";
> +            int error_code =3D WSAGetLastError();
> +            switch (error_code)
> +            {
> +            case WSANOTINITIALISED:
> +                msg =3D "A successful WSAStartup call must occur befor=
e using this function.";
> +                break;
> +            case WSAENETDOWN:
> +                msg =3D "The network subsystem has failed.";
> +                break;
> +            case WSAEFAULT:
> +                msg =3D "The buf parameter is not completely contained=
 in a valid part of the user address space.";
> +                break;
> +            case WSAENOTCONN:
> +                msg =3D "The socket is not connected.";
> +                break;
> +            case WSAEINTR:
> +                msg=3D"The socket was closed.";
> +                break;
> +            case WSAEINPROGRESS:
> +                msg=3D"A blocking Winsock call is in progress, or the =
service provider is still processing a callback function.";
> +                break;
> +            case WSAENETRESET:
> +                msg =3D "The connection has been broken due to the kee=
p-alive activity detecting a failure while the operation was in progress.=
";
> +                break;
> +            case WSAENOTSOCK:
> +                msg =3D "The descriptor is not a socket.";
> +                break;
> +            case WSAEOPNOTSUPP:
> +                msg =3D "MSG_OOB was specified, but the socket is not =
stream style such as type SOCK_STREAM, out of band (OOB) data is not supp=
orted in the communication domain associated with this socket, or the soc=
ket is unidirectional and supports only send operations.";
> +                break;
> +            case WSAESHUTDOWN:
> +                msg =3D "The socket has been shut down; it is not poss=
ible to receive on a socket after shutdown has been invoked with how set =
to SD_RECEIVE or SD_BOTH.";
> +                break;
> +            case WSAEWOULDBLOCK:
> +                msg =3D "The socket is marked as nonblocking and the r=
eceive operation would block.";
> +                break;
> +            case WSAEMSGSIZE:
> +                msg =3D "The message was too large to fit into the spe=
cified buffer and was truncated.";
> +                break;
> +            case WSAEINVAL:
> +                msg =3D "The socket has not been bound with bind (Wind=
ows Sockets), an unknown flag was specified, MSG_OOB was specified for a =
socket with SO_OOBINLINE enabled, or (for byte stream sockets only) len w=
as zero or negative.";
> +                break;
> +            case WSAECONNABORTED:
> +                msg =3D "The virtual circuit was terminated due to a t=
ime-out or other failure. The application should close the socket as it i=
s no longer usable.";
> +                break;
> +            case WSAETIMEDOUT:
> +                msg =3D "The connection has been dropped because of a =
network failure or because the peer system failed to respond.";
> +                break;
> +            case WSAECONNRESET:
> +                msg =3D "The virtual circuit was reset by the remote s=
ide executing a hard or abortive close. The application should close the =
socket because it is no longer usable.";
> +                break;
> +            default:
> +                break;
> +            }
> +            perror(msg);
> +#endif
>              if (errno =3D=3D EINTR)
>                  continue;
>              return (ret);


--------------enig01303A0AC34B0C703C1D1FD7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)

iQEcBAEBAgAGBQJOg5ZgAAoJENxm1CNJffh4K9AIAKz0t5IUiUvJ3jOjEailORt0
EREqPDNEeJF7hrR02S6TKcLbhJ9Zs1tblOdxDsDxL5aDRgpoB4dcaw46vUlB81l5
lkbJajF2zBk1PvmNfVlpY0l9YEPccxlWtPd9kxbHhwQL3/uUuychKiDgJVOUrbs6
JL1UvAlZeSimO+MBfo45estl2CwnGZzFv0rhMhCQfHp4H2FZY1IhJffaq8exgw5Y
c775P152l12bJnGzWvqXwCRT8zvKYZHixzTuupxy8z2gu13jNqoSDdW1Do0aT0Sa
Wq8ZGQLKdrTnM3jaLkaOcJukjvjjensqXmStEbddzgnZgzvoQcvOL7lxYCYboX4=
=MIqc
-----END PGP SIGNATURE-----

--------------enig01303A0AC34B0C703C1D1FD7--


--===============2065824540==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

--===============2065824540==--


home help back first fref pref prev next nref lref last post