classification
Title: Use-after-free in list contain
Type: crash Stage: resolved
Components: Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: corona10 Nosy List: corona10, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2020-01-25 14:22 by corona10, last changed 2020-02-17 09:37 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18181 merged corona10, 2020-01-25 14:53
PR 18202 merged corona10, 2020-01-27 16:28
PR 18204 merged corona10, 2020-01-27 16:43
PR 18205 closed corona10, 2020-01-27 16:49
PR 18206 closed corona10, 2020-01-27 17:13
PR 18535 merged miss-islington, 2020-02-17 09:14
Messages (7)
msg360686 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-01-25 14:22
class poc() :
    def __eq__(self,other) :
        l.clear()
        return NotImplemented

l = [poc(), poc(), poc()]
3 in l

[1]    2606 segmentation fault

sigh..
msg360687 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-01-25 14:22
I will send a patch ASAP.
msg360769 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-01-27 15:02
New changeset 4dbf2d8c6789a9b7299b142033073213604b8fdc by Pablo Galindo (Dong-hee Na) in branch 'master':
bpo-39453: Make list.__contains__ hold strong references to avoid crashes (GH-18181)
https://github.com/python/cpython/commit/4dbf2d8c6789a9b7299b142033073213604b8fdc
msg360780 - (view) Author: miss-islington (miss-islington) Date: 2020-01-27 17:04
New changeset 9e1ed518a576897f914227bf538bac426a02a081 by Miss Islington (bot) (Dong-hee Na) in branch 'master':
bpo-39453: Add testcase for bpo-39453 (GH-18202)
https://github.com/python/cpython/commit/9e1ed518a576897f914227bf538bac426a02a081
msg362125 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-02-17 09:13
New changeset f64abd10563c25a94011f9e3335fd8a1cf47c205 by Dong-hee Na in branch '3.8':
[3.8] bpo-39453: Fix contains method of list to hold strong references (GH-18204)
https://github.com/python/cpython/commit/f64abd10563c25a94011f9e3335fd8a1cf47c205
msg362128 - (view) Author: miss-islington (miss-islington) Date: 2020-02-17 09:30
New changeset 3c57ca699910be74e7cf67d747b24bbc486932f1 by Miss Islington (bot) in branch '3.7':
[3.8] bpo-39453: Fix contains method of list to hold strong references (GH-18204)
https://github.com/python/cpython/commit/3c57ca699910be74e7cf67d747b24bbc486932f1
msg362129 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-02-17 09:37
Thanks Dong-hee Na for the fix.
History
Date User Action Args
2020-02-17 09:37:52vstinnersetstatus: open -> closed
versions: + Python 3.7, Python 3.8
messages: + msg362129

resolution: fixed
stage: patch review -> resolved
2020-02-17 09:30:48miss-islingtonsetmessages: + msg362128
2020-02-17 09:14:05miss-islingtonsetpull_requests: + pull_request17911
2020-02-17 09:13:56vstinnersetmessages: + msg362125
2020-01-27 17:13:34corona10setpull_requests: + pull_request17583
2020-01-27 17:04:32miss-islingtonsetnosy: + miss-islington
messages: + msg360780
2020-01-27 16:49:40corona10setpull_requests: + pull_request17582
2020-01-27 16:43:19corona10setpull_requests: + pull_request17581
2020-01-27 16:28:35corona10setpull_requests: + pull_request17579
2020-01-27 15:02:27pablogsalsetmessages: + msg360769
2020-01-25 14:53:27corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request17567
2020-01-25 14:22:50corona10setmessages: + msg360687
2020-01-25 14:22:26corona10create