]> code.ossystems Code Review - openembedded-core.git/commit
runqemu: Remove potential lock races around tap device handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 7 Jul 2021 10:08:41 +0000 (11:08 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Tue, 13 Jul 2021 06:08:16 +0000 (14:08 +0800)
commit61682a1a8bfe5f7be6e271a4143fa4a02ca5dca9
tree1d1576ad5cc517b733edfa4a30d0a52cfe5d5c46
parentf5f831c3a76456bce543d42d0f14411b28770b45
runqemu: Remove potential lock races around tap device handling

The qemu tap device handling is potentially race ridden. We pass the
fd to the main qemu subprocess which is good as it means the lock is held
as long as the qemu process exists. This means we shouldn't unlock it
ourselves though, only close the file. We also can't delete the file
as we have no idea if qemu is still using it. We could try and obtain
an exclusive new lock, then the file would be safe to unlink but it
doesn't seem worth it.

Also fix the same issue in the port lock code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2a87bddabf816d09ec801e33972879e6983627eb)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
scripts/runqemu