file map: cause SIGBUS when access to a page beyond EOF

Change-Id: Iaf7d792413e674267fd1c05c382212c8f67d8f5b
Refs: #1291
This commit is contained in:
Ken Sato
2019-08-30 13:46:06 +09:00
committed by Masamichi Takagi
parent 1492f16d67
commit c371fbf13b
7 changed files with 341 additions and 1 deletions

62
test/issues/1291/C1291.sh Executable file
View File

@ -0,0 +1,62 @@
#/bin/sh
USELTP=1
USEOSTEST=0
. ../../common.sh
issue=1291
tid=01
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
tp=mmap13
sudo $MCEXEC $LTPBIN/${tp} 2>&1 | tee $tp.txt
ok=`grep TPASS $tp.txt | wc -l`
ng=`grep TFAIL $tp.txt | wc -l`
if [ $ng = 0 ]; then
echo "*** ${tname} PASSED ($ok)"
else
echo "*** ${tname} FAILED (ok=$ok ng=%ng)"
fi
let tid++
echo ""
for devf in /dev/mem /dev/zero
do
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
if [ ! -e $devf ]; then
echo "$devf is not exist"
echo "*** ${tname} SKIP"
let tid++
echo ""
continue
fi
sudo $MCEXEC ./map_and_read ${devf}
if [ $? = 0 ]; then
echo "*** ${tname} PASSED"
else
echo "*** ${tname} FAILED"
fi
let tid++
echo ""
done
for tp in mmap01 mmap02 mmap03 mmap04 mmap05 mmap06 mmap07 mmap08 \
mmap09 mmap12 mmap14 mmap15
do
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
sudo $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
ok=`grep TPASS $tp.txt | wc -l`
ng=`grep TFAIL $tp.txt | wc -l`
if [ $ng = 0 ]; then
echo "*** ${tname} PASSED ($ok)"
else
echo "*** ${tname} FAILED (ok=$ok ng=%ng)"
fi
let tid++
echo ""
done