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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: PATCH: BPs for libio & stdio.


Greg McGary <greg@kayak.mcgary.org> writes:

> You had a problem with this patch when you saw it in weeks past.  The
> problem I need to solve is that the bounds of a stdio FILE handle need
> to include the _IO_FILE_plus member vtable.  The way the code is
> written now, the assorted stdio open functions return only the
> _IO_FILE portion, with vtable excluded, so later uses of the FILE*
> that want vtable get bounds violations.  We need to return a
> _IO_FILE_plus* to the user on open, so that when the user passes it
> back to us it has the proper bounds for accessing vtable.  This should
> be safe since _IO_FILE_plus and _IO_FILE always start at the same
> address.

It looks OK given that it is necessary.

> The patch below is minimally invasive, but uses more casts than
> I'd like.  Changing _IO_{new_,old_,}file_init to accept
> _IO_FILE_plus* will help.

These are internal function so changing is possible.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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