-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection of issues related to new procedure for disabling 'taint', including 5.36 blockers. #19657
Comments
Thanks Yves – some good points there. Some of them were discussed at the RFC stage, but some not. We theoretically have at least three options:
I’ve added this to the agenda for today’s PSC meeting, but at the moment I think #2 is the way to go. |
The PR is going to be reverted, and I'll start the RFC process again. |
On Sat, 23 Apr 2022 at 12:26, Neil Bowers ***@***.***> wrote:
The PR is going to be reverted, and I'll start the RFC process again.
I regret that outcome, especially as if I had realized that my email had
been lost we might have had time to resolve this without a revert.
Sorry mate, I know you put a lot of effort into this. I feel crappy being
the messenger here. :-(
Yves
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
Don't feel bad – the job here is to make the best Perl we can, and as a result of you raising this issue, we'll end up with a better version of "turn off taint". I'm glad you did send this, and that we reverted my PR before 5.36 went out. Sure we would have "patched it up", but the end result will be better this way. |
This reverts commit 39f8eb4. This is because of a variety of issues discussed Perl#19657 and at the PSC meeting 064 2022-04-22 https://www.nntp.perl.org/group/perl.perl5.porters/2022/04/msg263670.html
This reverts commit 39f8eb4. This is because of a variety of issues discussed Perl#19657 and at the PSC meeting 064 2022-04-22 https://www.nntp.perl.org/group/perl.perl5.porters/2022/04/msg263670.html
This reverts commit 39f8eb4. This is because of a variety of issues discussed Perl#19657 and at the PSC meeting 064 2022-04-22 https://www.nntp.perl.org/group/perl.perl5.porters/2022/04/msg263670.html
Description
The new procedure for disabling taint support has several issues, some of which are merely annoying technical debt, some of which are show-stoppers.
Background: The logic to support taint mode, even when taint mode is not enabled, impose a non-trivial performance burden on all perl code executed. Conservative estimates for disabling it at compile time are a 3%-5% speedup, but some workloads may see significantly more performance win. In Perl 5.18 options were provided to disable taint support at compile time, the 'NO_TAINT_SUPPORT' define and the 'SILENT_NO_TAINT_SUPPORT' define. Enabling either removes taint related logic from the compile process, NO_TAINT_SUPPORT results in a perl which will throw a fatal exception when the
-t
option is used to enable taint, and SILENT_NO_TAINT_SUPPORT builds a perl which silently ignores the-t
switch, so scripts previously using it will continue to run, albeit without taint protections.In PR #19541 a new procedure was added to control these features. This involved adding support for a 'taint_support' fake define which can be used with Configure via
-Utaint_support
to "undefine" this fake define. This then defines 'SILENT_NO_TAINT_SUPPORT'. There does not seem to be a way to enable the safer 'NO_TAINT_SUPPORT' mode other than the "old way".-Accflags='-DNO_TAINT_SUPPORT'
or-Accglags='-DSILENT_NO_TAINT_SUPPORT'
results in a perl whose %Config is incorrect and which states that $Config{taint_support}='define', even though that is not true. This is definitely a show-stopper.$Config{taint_support}
has two false modes which means the opposite of each other. If$Config{taint_support}
is undefined (because it does not exist) it means the same thing as when taint support is true. This is not a show stopper, but it is very awkward, and I consider it basically to be technical debt.if we are offering this as a Configure option this language is unfortunate. This is not a show stopper but indicates the most recent change is incomplete.
I believe that ultimately it was a mistake that we will come to regret that we created this "fake" reverse polarity define "taint_support" for this feature. It produces several awkward outcomes that I believe we will come to regret. I believe very strongly that the new define should be "no_taint_support" and it should have two values, "silent" or "define". That would be the most backwards compatible option, and introduce the least confusion. We will pay the price of this reverse polarity fake define for the rest of the history of perl if we release as is.
I know this is frustrating to hear after it has been merged, and I am truly sorry for that, but for what it is worth I actually tried to raise some of the issues mentioned in this ticket in response to the original PR before it was merged, but I did so via email reply and unbeknownst to me it was not added to the ticket (github "ate" the mail) so no-one else actually saw it. I though my objections were actually being ignored, and was growing frustrated about it, but did not want to kick up a stink as I do think that in principal this new configure functionality is a good thing. So it was merged even though I had raised serious misgivings about the implementation choice of "taint_support".
I think this ticket raises larger issues frankly. Configure thinks it is in charge of the configuration process, but it really isn't. The sole and only keeper of the truth about our defines is the C code itself. I believe long term we need to get Configure about of the business of constructing the %Config hash and move it all into the build process itself, so that the C code generates it during the build process absolutely truthfully regardless of how a setting is set. I will raise a separate ticket for this discussion however, it is a digression from the immediate issues of this ticket.
Steps to Reproduce
The biggest issue is that $Config{taint_support} can end up being 'define' when in fact taint support has been disabled by using the "old way" of configuring it:
Configure perl with
-Accflags='-DNO_TAINT_SUPPORT'
or-Accflags='-DSILENT_NO_TAINT_SUPPORT'
Execute:
./perl -Ilib -MConfig -le'print $Config{taint_support}'
you will see it print out 'define', this is wrong.You can also do
./perl -Ilib -V:taint_support
, you will see:Grep
./perl -Ilib -V
case-insensitively and you will not see anything about 'taint_support' but you will see NO_TAINT_SUPPORT or it and SILENT_NO_TAINT_SUPPORT depending on which you configured with:Expected behavior
-Accflags='-DNO_TAINT_SUPPORT'
or-Accflags='-DSILENT_NO_TAINT_SUPPORT'
Perl configuration
Note the locally applied patch is the one from PR #19656 to disable a compile warning associated with building with NO_TAINT_SUPPORT.
With -DNO_TAINT_SUPPORT:
With SILENT_NO_TAINT_SUPPORT:
The text was updated successfully, but these errors were encountered: