[Rpm-maint] [rpm-software-management/rpm] Rpm query causes corruption in the file-backed mmaped bdb regions (#232)

zhangjianwei notifications at github.com
Fri Nov 22 03:37:23 UTC 2019


@jaymzh Yes, the processes running as root account.

`the memmap() the DB read-write, and write it back out when they are done... hence if then something changes at the same time, one of those process can write back old pages.`

`# ls -lthra /var/lib/rpm
total 70M
-rw-r--r--.  1 root root    0 Oct 23 18:04 .dbenv.lock
-rw-r--r--.  1 root root    0 Oct 23 18:04 .rpm.lock
-rw-r--r--.  1 root root 8.0K Nov 21 11:03 Triggername
drwxr-xr-x. 52 root root 4.0K Nov 21 11:04 ..
-rw-r--r--.  1 root root 8.0K Nov 21 11:04 Conflictname
-rw-r--r--.  1 root root  60M Nov 21 16:46 Packages
-rw-r--r--.  1 root root  48K Nov 21 16:46 Name
-rw-r--r--.  1 root root 4.2M Nov 21 16:46 Basenames
-rw-r--r--.  1 root root  28K Nov 21 16:46 Group
-rw-r--r--.  1 root root 256K Nov 21 16:46 Requirename
-rw-r--r--.  1 root root 1.9M Nov 21 16:46 Providename
-rw-r--r--.  1 root root  24K Nov 21 16:46 Obsoletename
-rw-r--r--.  1 root root 2.1M Nov 21 16:46 Dirnames
-rw-r--r--.  1 root root  20K Nov 21 16:46 Installtid
-rw-r--r--.  1 root root  44K Nov 21 16:46 Sigmd5
-rw-r--r--.  1 root root  76K Nov 21 16:46 Sha1header
drwxr-xr-x.  2 root root 4.0K Nov 21 17:21 .
-rw-r--r--.  1 root root 344K Nov 22 11:30 __db.001
-rw-r--r--.  1 root root 188K Nov 22 11:30 __db.002
-rw-r--r--.  1 root root 1.3M Nov 22 11:30 __db.003`

the /var/lib/rpm/.dbenv.lock and /var/lib/rpm/.rpm.lock can not protect the multi processes serial execution??

I don't know much about database.

`>>> the memmap() the DB read-write, and write it back out when they are done... hence if then something changes at the same time, one of those process can write back old pages.`

It indicate that the BDB use memmap(),  and the multi proccesses rpm -q software.xxx, then changed the memory page, lead to old page write back. 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/232#issuecomment-557374263
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191121/e2a8ab7a/attachment.html>


More information about the Rpm-maint mailing list