Date: Thu, 19 Sep 1996 11:58:22 -0400
From: "Randy J. Ray" <rjray@uswest.com>
Subject: Patch: Untaint FH flag and clean DATA handles
This patch adds a IOf_UNTAINT flag in sv.h, as one of the possibles
on an xpvio->xio_flags struct member. It is used to mark the given
file handle as a clean source, even when tainting is turned on.
There are also patches to pp_sys.c in pp_sysread to check this flag
before tainting data, and in pp_hot.c in do_readline for the same
reason. Lastly, it patches toke.c to automatically set this flag on
on a __DATA__ filehandle. The creation of the $pack::DATA
pseudo-filehandle is already checked against running under eval, so
this should not introduce any insecurity.
This patch *does not*:
* Add the "untaint" keyword.
Date: Fri, 20 Sep 1996 15:38:57 -0400
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Subject: Re: "Attempt to free non-existent shared string"? (with patch)
I found a subtle problem with the lazydelete mechanism (which is used
to postpone the delete of a entry that may be getting iterated over).
I was using the HeKLEN slot to hold the hint, but the real HeKLEN is
needed later to call unsharepvn(). This means that only magical
hash entries can use the HeKLEN slot to hold flags.
Here's a tested patch against 5.00305 that fixes the problem.
The patch simply moves the LAZYDEL hint to become a SV-level private
flag.
#define SVpbm_TAIL 0x20000000
#define SVphv_SHAREKEYS 0x20000000 /* keys live on shared string table */
+#define SVphv_LAZYDEL 0x40000000 /* entry in xhv_eiter must be deleted */
#ifdef OVERLOAD
#define SVpgv_AM 0x40000000
#define IOf_START 2 /* check for null ARGV and substitute '-' */
#define IOf_FLUSH 4 /* this fp wants a flush after write op */
#define IOf_DIDTOP 8 /* just did top of form */
+#define IOf_UNTAINT 16 /* consider this fp (and it's data) "safe" */
/* The following macros define implementation-independent predicates on SVs. */