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

Allow enabling control flow guard in Windows build #88547

Closed
zooba opened this issue Jun 10, 2021 · 7 comments
Closed

Allow enabling control flow guard in Windows build #88547

zooba opened this issue Jun 10, 2021 · 7 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-windows type-security A security issue

Comments

@zooba
Copy link
Member

zooba commented Jun 10, 2021

BPO 44381
Nosy @pfmoore, @tjguk, @zware, @zooba, @miss-islington, @neonene
PRs
  • bpo-44381: Windows build now allows enabling control flow guard #26645
  • [3.10] bpo-44381: Windows build now allows enabling control flow guard (GH-26645) #26681
  • [3.9] bpo-44381: Windows build now allows enabling control flow guard (GH-26645) #26682
  • 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/zooba'
    closed_at = <Date 2021-06-11.21:39:25.558>
    created_at = <Date 2021-06-10.17:07:15.163>
    labels = ['type-security', '3.8', '3.9', '3.10', '3.11', 'build', 'OS-windows']
    title = 'Allow enabling control flow guard in Windows build'
    updated_at = <Date 2021-08-25.19:34:26.981>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2021-08-25.19:34:26.981>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2021-06-11.21:39:25.558>
    closer = 'steve.dower'
    components = ['Build', 'Windows']
    creation = <Date 2021-06-10.17:07:15.163>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44381
    keywords = ['patch']
    message_count = 7.0
    messages = ['395556', '395557', '395661', '395662', '395663', '400281', '400294']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'miss-islington', 'neonene']
    pr_nums = ['26645', '26681', '26682']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'security'
    url = 'https://bugs.python.org/issue44381'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    @zooba
    Copy link
    Member Author

    zooba commented Jun 10, 2021

    Currently we don't enable CFG (which is runtime protection against code injection into tables), because it likely has a performance impact and the kind of attack is outside our scope.

    However, we should make it easier to build CPython with CFG enabled, so that third-parties who do want to include it in their scope can do so.

    @zooba zooba added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 10, 2021
    @zooba zooba self-assigned this Jun 10, 2021
    @zooba zooba added build The build process and cross-build OS-windows type-security A security issue 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 10, 2021
    @zooba zooba self-assigned this Jun 10, 2021
    @zooba zooba added build The build process and cross-build OS-windows type-security A security issue labels Jun 10, 2021
    @zooba
    Copy link
    Member Author

    zooba commented Jun 10, 2021

    FWIW, I don't actually know what the performance impact is. I'm not set up for running the perf benchmarks, and I don't know if anyone else is (on Windows), but if someone would like to then it'll be easier once the environment option to enable it is in there.

    @zooba
    Copy link
    Member Author

    zooba commented Jun 11, 2021

    New changeset 5af56c6 by Steve Dower in branch 'main':
    bpo-44381: Windows build now allows enabling control flow guard (GH-26645)
    5af56c6

    @zooba
    Copy link
    Member Author

    zooba commented Jun 11, 2021

    New changeset 9580d38 by Miss Islington (bot) in branch '3.9':
    bpo-44381: Windows build now allows enabling control flow guard (GH-26645)
    9580d38

    @miss-islington
    Copy link
    Contributor

    New changeset 42612db by Miss Islington (bot) in branch '3.10':
    bpo-44381: Windows build now allows enabling control flow guard (GH-26645)
    42612db

    @zooba zooba closed this as completed Jun 11, 2021
    @zooba zooba closed this as completed Jun 11, 2021
    @neonene
    Copy link
    Mannequin

    neonene mannequin commented Aug 25, 2021

    I'd like to leave my pyperformance (x64) results here.
    cpython: ae52591 (2021-8-23)

    1. release + CFG : 1.00x

    2. release + CFG,/Ob3 : 1.05x faster | 41 faster
      | 9 slower
      | 8 not significant

    3. release (default) : 1.07x faster | 52 faster
      | 4 slower (regex_v8,
      | regex_effbot,
      | nbody,
      | hexiom)
      | 2 not significant

    4. release + /Ob3 : 1.11x faster | 56 faster
      | 1 slower (regex_v8)
      | 1 not significant (regex_dna)

    5. PGO + CFG : 1.15x faster | 53 faster
      | 2 slower (regex_dna,
      | pidigits)
      | 3 not significant

    6. PGO + CFG,/Ob3 : 1.15x faster | 54 faster
      | 1 slower (regex_dna)
      | 3 not significant

    7. PGO (default) : 1.21x faster | 56 faster
      | 1 slower (regex_dna)
      | 1 not significant (regex_effbot)

    8. PGO + /Ob3 : 1.21x faster | 57 faster
      | 1 slower (regex_dna)
      | 0 not significant

    @zooba
    Copy link
    Member Author

    zooba commented Aug 25, 2021

    That looks to me like no impact at all, which is great to see!

    @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
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build OS-windows type-security A security issue
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants