Use-After-Free bug in HuginBase::ImageVariable<double>::linkWith
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Hugin |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi there
We want to share that the latest version (2022.0.0) of pto_merge causes heap-use-
We assume that the function HuginBase:
Here is the output of program with address sanitizer attached.
### Bug Report
=================================================================
==3836==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000001960 at pc 0x7fee211f5506 bp 0x7ffd73f55460 sp 0x7ffd73f55450
READ of size 8 at 0x606000001960 thread T0
#0 0x7fee211f5505 in HuginBase:
#1 0x7fee211fc618 in HuginBase:
#2 0x560fdf074975 in main /home/ubuntu/
#3 0x7fee1e8f0082 in __libc_start_main ../csu/
#4 0x560fdf075c5d in _start (/home/
0x606000001960 is located 32 bytes inside of 57-byte region [0x606000001940
freed by thread T0 here:
#0 0x7fee2169b51f in operator delete(void*) ../../.
#1 0x7fee211c97aa in __gnu_cxx:
#2 0x7fee211c97aa in std::allocator_
#3 0x7fee211c97aa in std::__
#4 0x7fee211c97aa in std::__
#5 0x7fee211c97aa in std::__
#6 0x7fee211c97aa in HuginBase:
#7 0x7fee211c97aa in HuginBase:
#8 0x7fee211fc618 in HuginBase:
#9 0x560fdf074975 in main /home/ubuntu/
#10 0x7fee1e8f0082 in __libc_start_main ../csu/
previously allocated by thread T0 here:
#0 0x7fee2169a587 in operator new(unsigned long) ../../.
#1 0x560fdf07f9b8 in void std::__
#2 0x7fee211c9736 in void std::__
#3 0x7fee211c9736 in void std::__
#4 0x7fee211c9736 in std::__
#5 0x7fee211c9736 in HuginBase:
#6 0x7fee211c9736 in HuginBase:
#7 0x7fee211fc618 in HuginBase:
#8 0x560fdf074975 in main /home/ubuntu/
#9 0x7fee1e8f0082 in __libc_start_main ../csu/
SUMMARY: AddressSanitizer: heap-use-after-free /home/ubuntu/
Shadow bytes around the buggy address:
0x0c0c7fff82d0: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x0c0c7fff82e0: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
0x0c0c7fff82f0: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd
0x0c0c7fff8300: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x0c0c7fff8310: 00 00 00 00 00 00 00 00 fa fa fa fa fd fd fd fd
=>0x0c0c7fff8320: fd fd fd fd fa fa fa fa fd fd fd fd[fd]fd fd fd
0x0c0c7fff8330: fa fa fa fa 00 00 00 00 00 00 00 01 fa fa fa fa
0x0c0c7fff8340: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
0x0c0c7fff8350: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd
0x0c0c7fff8360: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x0c0c7fff8370: 00 00 00 00 00 00 00 01 fa fa fa fa fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==3836==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: hugin 2022.0.0
Program: pto_merge
libhuginbase: 2020.0.0 (retrieved and compiled from source code)
libpano13: 2.9.19
To reproduce the problem, we need to build hugin:
sudo cmake -DCMAKE_
### How to reproduce
$ pto_merge poc-file *.jpg
(*.jpg any name of jpg file including asterisk(*))
poc-file is attached.
description: | updated |
information type: | Private Security → Public Security |
Changed in hugin: | |
status: | Fix Committed → Fix Released |
Fixed in repository.