Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_ssl.c uses PyWeakref_GetObject but doesn't incref result #52928

Closed
pitrou opened this issue May 10, 2010 · 3 comments
Closed

_ssl.c uses PyWeakref_GetObject but doesn't incref result #52928

pitrou opened this issue May 10, 2010 · 3 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@pitrou
Copy link
Member

pitrou commented May 10, 2010

BPO 8682
Nosy @pitrou, @giampaolo
Files
  • sslweakref.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pitrou'
    closed_at = <Date 2010-06-24.23:00:17.072>
    created_at = <Date 2010-05-10.23:32:10.246>
    labels = ['extension-modules', 'type-crash']
    title = "_ssl.c uses PyWeakref_GetObject but doesn't incref result"
    updated_at = <Date 2010-06-24.23:00:17.071>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2010-06-24.23:00:17.071>
    actor = 'pitrou'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2010-06-24.23:00:17.072>
    closer = 'pitrou'
    components = ['Extension Modules']
    creation = <Date 2010-05-10.23:32:10.246>
    creator = 'pitrou'
    dependencies = []
    files = ['17761']
    hgrepos = []
    issue_num = 8682
    keywords = ['patch']
    message_count = 3.0
    messages = ['105481', '108526', '108560']
    nosy_count = 4.0
    nosy_names = ['exarkun', 'janssen', 'pitrou', 'giampaolo.rodola']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue8682'
    versions = ['Python 3.1', 'Python 3.2']

    @pitrou
    Copy link
    Member Author

    pitrou commented May 10, 2010

    PyWeakref_GetObject() returns a borrowed reference, which can therefore become invalid at any time (especially when the GIL gets released). This provides a way to crash the interpreter deliberately.
    The returned reference should be incref'ed immediately before any other action is taken.

    @pitrou pitrou self-assigned this May 10, 2010
    @pitrou pitrou added extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump labels May 10, 2010
    @pitrou
    Copy link
    Member Author

    pitrou commented Jun 24, 2010

    Here is a patch. Will commit soon if there's no remarks.

    @pitrou
    Copy link
    Member Author

    pitrou commented Jun 24, 2010

    Committed in r82204 (py3k) and r82205 (3.1).

    @pitrou pitrou closed this as completed Jun 24, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant