Skip to content

Commit

Permalink
synchronized texlive 68868.
Browse files Browse the repository at this point in the history
  • Loading branch information
clerkma committed Nov 16, 2023
1 parent f8c7aaa commit ca615be
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
34 changes: 30 additions & 4 deletions texlive/texk/texlive/linked_scripts/texlive/tlmgr.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# $Id: tlmgr.pl 68283 2023-09-15 13:11:11Z preining $
# $Id: tlmgr.pl 68818 2023-11-12 00:30:53Z preining $
# Copyright 2008-2023 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
Expand All @@ -8,8 +8,8 @@

use strict; use warnings;

my $svnrev = '$Revision: 68283 $';
my $datrev = '$Date: 2023-09-15 15:11:11 +0200 (Fri, 15 Sep 2023) $';
my $svnrev = '$Revision: 68818 $';
my $datrev = '$Date: 2023-11-12 01:30:53 +0100 (Sun, 12 Nov 2023) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
Expand Down Expand Up @@ -7340,6 +7340,32 @@ sub setup_one_remotetlpdb {
}
}

# check for remote main db being *older* than what we have seen before
# The check we employ is heuristic: texlive-scripts is updated practically
# every day. We compare the locally installed texlive-scripts with the
# remove revision, and if that does not line up, we error out.
# Alternative approaches
# - loop over all installed packages and take the maximum of the found revisions
# - on every update, save the last seen remote main revision into 00texlive.installation
#
if ($is_main) {
my $remote_revision = $remotetlpdb->config_revision;
my $tlp = $localtlpdb->get_package("texlive-scripts");
my $local_revision;
if (!defined($tlp)) {
info("texlive-scripts not found, not doing revision consistency check\n");
$local_revision = 0;
} else {
$local_revision = $tlp->revision;
}
if ($local_revision > $remote_revision) {
info("fail load $location\n") if ($::machinereadable);
return(undef, "Remote database (rev $remote_revision) seems to be older than local (rev $local_revision), please use different mirror or wait a bit.")
} else {
debug("Remote database revision $remote_revision, texlive-scripts local revision $local_revision\n");
}
}

# check for being frozen
if ($remotetlpdb->config_frozen) {
my $frozen_msg = <<FROZEN;
Expand Down Expand Up @@ -10246,7 +10272,7 @@ =head1 AUTHORS AND COPYRIGHT
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
$Id: tlmgr.pl 68283 2023-09-15 13:11:11Z preining $
$Id: tlmgr.pl 68818 2023-11-12 00:30:53Z preining $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
Expand Down
8 changes: 8 additions & 0 deletions texlive/texk/web2c/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2023-11-15 Karl Berry <karl@freefriends.org>

* tex.ch,
* mf.ch (Undump the dynamic memory): check that p does not
become too small, due to fmt/base corruption.
Report from Gregory James DUCK to Karl, 14 Sep 2023.
Found with a fuzz tester similar to AFL-fuzz.

2023-10-25 Andreas Scherer <https://ascherer.github.io>

* weave.ch: Fine print for command-line options.
Expand Down
9 changes: 9 additions & 0 deletions texlive/texk/web2c/mf.ch
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,15 @@ if mem_min+1100>mem_top then goto off_base;
mem:=xmalloc_array (memory_word, mem_max - mem_min + 1);
@z

@x [48.1195] l.22714 - Check that p did not become corrupt.
if (p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto off_base;
@y
{If the base file is messed up, that addition to |p| might cause it to
become garbage. Report from Gregory James DUCK to Karl, 14 Sep 2023.
Found with a fuzz tester similar to AFL-fuzz. Also changed in \TeX.}
if (p<mem_min)or(p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto off_base;
@z

@x [48.1199] l.22750 - Allow command line to override dumped value.
undump(batch_mode)(error_stop_mode)(interaction);
@y
Expand Down
11 changes: 10 additions & 1 deletion texlive/texk/web2c/tex.ch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% $Id: tex.ch 64547 2022-09-29 01:20:56Z karl $
% $Id: tex.ch 68865 2023-11-15 21:23:49Z karl $
% tex.ch for C compilation with web2c, derived from various other change files.
% By Tim Morgan, UC Irvine ICS Department, and many others.
%
Expand Down Expand Up @@ -3653,6 +3653,15 @@ repeat for k:=p to q+1 do undump_wd(mem[k]);
repeat undump_things(mem[p], q+2-p);
@z

@x [50.1312] l.23955 - Check that p did not become corrupt.
if (p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto bad_fmt;
@y
{If the format file is messed up, that addition to |p| might cause it to
become garbage. Report from Gregory James DUCK to Karl, 14 Sep 2023.
Found with a fuzz tester similar to AFL-fuzz. Also changed in \MF.}
if (p<mem_min)or(p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto bad_fmt;
@z

@x [50.1312] l.23878 - Make dumping/undumping more efficient.
for k:=p to lo_mem_max do undump_wd(mem[k]);
@y
Expand Down

0 comments on commit ca615be

Please sign in to comment.