Commit Graph

281678 Commits

Author SHA1 Message Date
rillig
c85833020f make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25.  In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.

Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath.  Dir_ClearPath takes full ownership of the given list and
empties it.  This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.

With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table.  This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes.  This by itself
was not a problem since the hash table would be freed afterwards.  But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again.  Boom.

Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.
2020-10-05 19:30:37 +00:00
rillig
f336e55bc4 make(1): revert previous commit
It had accidentally reverted all the work from the past few days.
2020-10-05 19:27:47 +00:00
rillig
b6c0384ff9 make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25.  In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.

Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath.  Dir_ClearPath takes full ownership of the given list and
empties it.  This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.

With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table.  This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes.  This by itself
was not a problem since the hash table would be freed afterwards.  But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again.  Boom.

Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.
2020-10-05 19:24:29 +00:00
rillig
1c039f5ce4 make(1): fix test for .ifndef when compiled with -DUSE_UCHAR_BOOLEAN
In that compilation variant, TRUE is defined to 255, to see whether all
boolean expressions evaluate to either 1 or 0.  The field If.doNot in
cond.c doesn't do this since it uses the actual value of TRUE.
Therefore, change the evaluation slightly to also handle this case.
2020-10-05 18:29:20 +00:00
rillig
d1e081ff69 make(1): clean up compat.c
Only cosmetic changes, no change of functionality.
2020-10-05 18:04:57 +00:00
rillig
37b6a2b531 make(1): extract init_machine and init_machine_arch from main 2020-10-05 17:33:21 +00:00
roy
ec2482217d Minor correction to prior 2020-10-05 17:29:22 +00:00
rillig
45096fccb8 make(1): extract parsing of sources from ParseDoDependency 2020-10-05 16:54:41 +00:00
rillig
6027965696 make(1): extract the target parsing from ParseDoDependency 2020-10-05 16:45:03 +00:00
rillig
31b39317c4 make(1): split ParseDoDependency into several smaller functions 2020-10-05 16:33:20 +00:00
roy
a6f0f00cfa ifconfig: Warn once more if media supported but no types
This reverts media.c -r1.7
2020-10-05 16:17:05 +00:00
roy
9fd3530377 ppp: Remove media
There is none after all.
Applications should be using ifi_link_state and not checking media.
2020-10-05 16:11:25 +00:00
roy
54ebee488b Note import of dhcpcd-9.3.0 2020-10-05 16:04:11 +00:00
roy
be38669a3c Sync with dhcpcd-9.3.0 2020-10-05 16:02:15 +00:00
roy
32fe301ab8 Update to dhcpcd-9.3.0 with the following changes:
* dhcpcd: Backticks have been removed from quoting filenames
 * dhcpcd: Only manipulate stdin, stdout and stderr if they are valid
 * duid: Adjust option so the type can be specified
 * logerr: Don't leak logfile fd to scripts
 * privsep: Run the launcher process in the sandbox
 * BSD: Use `ifi_link_state` as the single source of truth about carrier
 * BSD: Ignore vether(4) devices by default
2020-10-05 16:01:13 +00:00
rillig
f61ca2efc4 make(1): split ParseDoSrc into smaller functions 2020-10-05 15:43:32 +00:00
rillig
da5a66a335 make(1): replace GNode macros with inline functions
Curiously, this affects the size of the generated code: it gets smaller
than before.
2020-10-05 15:14:24 +00:00
rillig
41b60e14d8 make(1): allow easy creation of preprocessed source and assembler
To be used during development, to see how changes in the source code
affect the generated machine code.
2020-10-05 15:11:37 +00:00
nia
c50d584d1e NGPC 2020-10-05 14:54:50 +00:00
nia
baeda31567 bump date 2020-10-05 14:54:24 +00:00
christos
527b700deb revert previous octal conversion code (broken and not worth it). 2020-10-05 14:34:03 +00:00
christos
a17b1cd2d7 revert previous and don't parse octal 2020-10-05 14:31:30 +00:00
rin
098da78686 Update gdb/dwarf2expr.c hack for earmv7hf{,eb}; the situation does not
change even for GCC 9.3 with ``memcmp'' fix.
2020-10-05 13:32:31 +00:00
rin
d1007566db Update aes_ccm_tag() hack for m68k.
Even with ``memcmp fix'', GCC 9.4 miscompiles this function for -O[12].
But the situation was slightly changed from that with GCC 8.3:

* -O0 and -O1 work but -O2 fails for 68060 and 68040 (real hardware)
* -O0 and -O2 work but -O1 fails for 68020 and 68010 (TME)
2020-10-05 13:20:30 +00:00
martin
325b99962d Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.
2020-10-05 12:28:45 +00:00
tnn
7f481043e4 factor: usage(): mark __dead 2020-10-05 12:22:49 +00:00
simonb
05d9ab5269 Whitespace nit. 2020-10-05 11:29:36 +00:00
rin
06cb72d7e9 Remove -fno-omit-frame-pointer hack for sun2 kernel. 2020-10-05 10:44:09 +00:00
rin
db7d386e10 Kernel without -fno-omit-frame-pointer works fine now, both for GCC8 and 9.
Not sure which commit ``fixed'' the problem although...
2020-10-05 10:42:53 +00:00
knakahara
949f1cae7e Make sequence number of esp header MP-safe for IPsec Tx side. reviewed by ozaki-r@n.o
In IPsec Tx side, one Security Association can be used by multiple CPUs.
On the other hand, in IPsec Rx side, one Security Association is used
by only one CPU.

XXX pullup-{8,9}
2020-10-05 09:51:25 +00:00
nia
7014504d2e fix indentation 2020-10-05 09:16:53 +00:00
nia
81cc2aabb6 Adjust the default fontconfig fonts.conf to avoid selecting bitmap
fonts included as part of X11 that are also included as scalable fonts
as part of macOS.

Many websites will attempt to select these fonts, which results in
very strange, poor quality rendering.

This should keep legacy X11 applications that want the old "Helvetica"
and "Times" fonts working, but prevent them from being selected by
applications that want scalable fonts.

It should not prevent "Helvetica" or "Times" from being selected
if the user installs a scalable version.
2020-10-05 09:16:26 +00:00
roy
a89c197148 soreadable() should consider so_rerror 2020-10-05 08:38:17 +00:00
kim
a477b03dfb Add iburst to peer and server. 2020-10-05 06:45:40 +00:00
nia
a52c896f9b ifconfig up before doing wifi stuff 2020-10-05 06:41:16 +00:00
rin
d56c56e97e PR kern/55658
ubc_fault_page(): Ignore PG_RDONLY flag and always pmap_enter() the page
with the permissions of the original access_type.

It is the file system's responsibility to allocate blocks that is being
modified by write(), before calling into UBC to fill the pages for that
range. KASSERT() is added there to confirm that no clean page is mapped
writable.

Fix infinite loop in uvm_fault_internal(), observed on 16KB-page systems,
where it continues to try to make a partially-backed page writable.

No regression in ATF and KASSERT() does not fire on several architectures,
as far as I can see.

Fix suggested by chs. Thanks!
2020-10-05 04:48:23 +00:00
rin
607f089e82 Try to fix ramdisk overflow (somehow build succeeds without fix for me);
drop mount_{cd9660,nfs} as cd(4) and NFS are disabled for RAMDISK kernel.
2020-10-04 23:50:59 +00:00
rin
b335f2f241 Revert previous; ``fix'' against wrong directory... 2020-10-04 23:42:43 +00:00
rillig
56b5fdcf3f make(1): add tests for .ifndef and .ifnmake 2020-10-04 22:41:18 +00:00
rillig
fbc3dab559 make(1): fix assignment to .CURDIR via the shell assignment operator
This is probably an edge case that nobody will ever stumble upon, since
.CURDIR is usually regarded as a read-only variable.

The other variable that is affected by this code path is .MAKE.EXPORTED,
and for this variable as well, it would be unusual to assign it a value
from a shell command.
2020-10-04 21:53:28 +00:00
rillig
effd3aa663 make(1): rename local variable in VarAssign_Eval
The value to be freed is not always evalue.  In the case of VAR_SUBST,
it will be the output of the command, not the command itself.
2020-10-04 21:41:44 +00:00
rillig
f66162c421 make(1): hide some more implementation details from Parse_DoVar 2020-10-04 21:08:37 +00:00
rillig
fcc8ed8b43 make(1): clean up remaining details in variable assignment parser 2020-10-04 20:57:26 +00:00
rillig
c9be5770ba make(1): clean up code for parsing ?= variable assignments
There is no need to handle the ?= operator in ParseVarassignOp already,
when all other operators are handled later.
2020-10-04 20:37:11 +00:00
roy
82328146fe ifwatchd: Enable SO_RERROR to re-sync interface state.
Interface arrival, departure and link state changes will sync
and if different will be actioned.

Currently we do not track addresses, so any changes there are still lost.
2020-10-04 20:36:32 +00:00
rillig
5b432bdbfd make(1): clean up parsing of variable assignments 2020-10-04 20:23:32 +00:00
rillig
d9690a3f7a make(1): add test for assigning to .CURDIR 2020-10-04 20:06:48 +00:00
rillig
eccbb110ee make(1): remove duplicate code for parsing a variable name 2020-10-04 19:36:32 +00:00
christos
68ed46e98d Add BN_oct2bn(3) for factor(6) 2020-10-04 19:32:48 +00:00
christos
2c61d0e8cd - Accept octal input.
- Don't play with the original string so we can print it.
2020-10-04 19:32:15 +00:00