This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: recvmsg bug


On Fri, 31 Jul 1998 15:51:00 +0200, Thorsten Kukuk wrote:
>
>
>Hello,
>
>I have found a bug in the recvmsg wrapper. In the current version, we
>try at first to check, if we have enough space, and if we use
>SCM_CREDS.  The problem is, that the data buffer is not
>initialized. We could not test before the syscall if SCM_CREDS is
>used. The next is, we don't need to check for enough space, because
>the kernel struct is smaller then the libc ucred struct. We have to
>check it later. I have added a patch, which fixes it for me. But I
>doubt that it is correct, because the space check is missing. And I
>think we overwrite the data following after the SCM_CREDS part.

I'm confused.  The space check does need to go first, because we need
enough space for the user-side cmcred struct.  If there isn't enough,
it's wrong to make the syscall anyway - data could be lost that way.

The part about the data buffer not being initialized I don't
understand at all.  Could you clarify?   What part isn't initialized
and who should be doing it?

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]