Skip to content

Commit

Permalink
Merge branch 'freebsd/current/main' into hardened/current/master
Browse files Browse the repository at this point in the history
  • Loading branch information
HardenedBSD Sync Services committed Jul 4, 2024
2 parents a779cf0 + a2e65d4 commit 233ec8c
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 3 deletions.
3 changes: 1 addition & 2 deletions sbin/dhclient/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ discover_interfaces(struct interface_info *iface)
{
struct ifaddrs *ifap, *ifa;
struct ifreq *tif;
int len = IFNAMSIZ + sizeof(struct sockaddr_storage);

if (getifaddrs(&ifap) != 0)
error("getifaddrs failed");
Expand Down Expand Up @@ -119,7 +118,7 @@ discover_interfaces(struct interface_info *iface)
LLADDR(foo), foo->sdl_alen);
}
if (!iface->ifp) {
if ((tif = calloc(1, len)) == NULL)
if ((tif = calloc(1, sizeof(struct ifreq))) == NULL)
error("no space to remember ifp");
strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ);
iface->ifp = tif;
Expand Down
4 changes: 3 additions & 1 deletion tools/test/stress2/misc/all.exclude
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# List of tests not to run, unless the '-a' option is used with run.sh
# List of tests not to run, unless the '-a' option is used with all.sh
# Exclude names must start in column 1

backingstore.sh g_vfs_done():md6a[WRITE(offset=...)]error = 28 20111220
Expand Down Expand Up @@ -65,11 +65,13 @@ systrace2.sh WiP 20200227
syzkaller16.sh zonelimit issue 20210722
syzkaller28.sh panic: About to free ctl:0x... so:0x... and its in 1 20201120
syzkaller31.sh panic: Bad tailq NEXT(0xfffffe01a0899430->tqh_last) != NULL 20220420
syzkaller55.sh https://people.freebsd.org/~pho/stress/log/log0533.txt 20240702
syzkaller59.sh Page fault 20220625
syzkaller65.sh panic: in_pcblookup_hash_locked: invalid local address 20230318
syzkaller66.sh panic: in_pcbconnect: inp is already connected 20230621
syzkaller67.sh panic: ASan: Invalid access, 8-byte read at ... 20230621
truss3.sh WiP 20200915
unionfs19.sh https://people.freebsd.org/~pho/stress/log/log0519.txt 20240702

# Test not to run for other reasons:

Expand Down
74 changes: 74 additions & 0 deletions tools/test/stress2/misc/unionfs19.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/sh

#
# Copyright (c) 2024 Peter Holm <pho@FreeBSD.org>
#
# SPDX-License-Identifier: BSD-2-Clause
#

# umount FS with memory mapped file
# "panic: general protection fault" seen:
# https://people.freebsd.org/~pho/stress/log/log0519.txt

[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1

. ../default.cfg

prog=$(basename "$0" .sh)
here=`pwd`
log=/tmp/$prog.log
md1=$mdstart
md2=$((md1 + 1))
mp1=/mnt$md1
mp2=/mnt$md2

set -e
mdconfig -l | grep -q md$md && mdconfig -d -u $md1
mdconfig -l | grep -q md$u2 && mdconfig -d -u $md2

mdconfig -s 2g -u $md1
newfs $newfs_flags /dev/md$md1 > /dev/null
mdconfig -s 2g -u $md2
newfs $newfs_flags /dev/md$md2 > /dev/null

mkdir -p $mp1 $mp2
mount /dev/md$md1 $mp1
mount /dev/md$md2 $mp2
mount -t unionfs -o noatime $mp1 $mp2
mount | grep -E "$mp1|$mp2"
set +e

export RUNDIR=$mp2/stressX
export runRUNTIME=2m
export LOAD=70
export mmapLOAD=100
export TESTPROGS="testcases/mmap/mmap testcases/swap/swap"

(cd ..; ./testcases/run/run $TESTPROGS > /dev/null 2>&1) & rpid=$!
sleep 5

tail -F -n 0 /var/log/messages > $log & lpid=$!

start=`date +%s`
while [ $((`date +%s` - start)) -lt 120 ]; do
umount -f $mp2 &&
mount -t unionfs -o noatime $mp1 $mp2
sleep 5
mount | grep -q unionfs || break
pgrep -q mmap || break
done
pkill run swap mmap
while pgrep -q swap; do pkill swap; done
wait $rpid

umount $mp2 # The unionfs mount
umount $mp2
umount $mp1

mdconfig -d -u $md1
mdconfig -d -u $md2

kill $lpid && wait $lpid
grep -m 1 "pager read error" $log && s=1 || s=0
rm $log
exit $s

0 comments on commit 233ec8c

Please sign in to comment.