Skip to content

cpython3:fuzz_builtin_unicode: Use-of-uninitialized-value in maybe_small_long #102509

Description

@illia-v

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Mar 7, 2023
  2. added 2 commits that reference this issue on Mar 7, 2023
  3. terryjreedy commented on Mar 7, 2023

    @terryjreedy
    Member

    @ammaraskar commented on the report, asking if it has been 'triaged'. There was no response; it appears from text on the report is that it is not monitored by people on the project. The report claims "Issue filed automatically" (without a URL) but I found no evidence searching cpython open/closed issues for 'unicode' or 'uninitialized'.

  4. illia-v commented on Mar 8, 2023

    @illia-v
    ContributorAuthor

    @terryjreedy I think "Issue filed automatically" refers to the issue 51574 on https://bugs.chromium.org/p/oss-fuzz/issues/list,

  5. ammaraskar commented on Mar 8, 2023

    @ammaraskar
    Member

    Terry when I was asking if it was triaged there I was referring to whether the other core devs who have access to the fuzzer results had taken a look and filed a CPython issue.

  6. mdickinson commented on Mar 18, 2023

    @mdickinson
    Member

    See comments on the PR; I believe this is a false positive, and can safely be closed.

  7. added
    pendingThe issue will be closed if no feedback is provided
    on Mar 18, 2023
  8. mdickinson commented on Mar 18, 2023

    @mdickinson
    Member

    tl;dr: In the case in question, we do retrieve an integer from allocated but uninitialised memory, but we then multiply that integer by zero, so the lack of initialisation has no adverse effect.

  9. illia-v commented on Mar 18, 2023

    @illia-v
    ContributorAuthor

    @mdickinson thanks for looking into this! I assumed it is a false positive, but it prevents fuzzing and building --with-memory-sanitizer.

    Can #102510 be accepted to fix the issues?
    If not, the --with-memory-sanitizer flag should let a compiler know that it is a known issue probably. https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

  10. mdickinson commented on Mar 19, 2023

    @mdickinson
    Member

    but it prevents fuzzing and building --with-memory-sanitizer.

    Hmm, that's awkward. Is there no way to annotate to tell the sanitiser that this case has been checked and deemed safe? E.g., something like this: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

    Slowing down a hot path by adding an unnecessary extra step just so that a tool doesn't emit a false positive error doesn't seem like the right solution.

  11. added a commit that references this issue on Mar 20, 2023
  12. illia-v commented on Mar 20, 2023

    @illia-v
    ContributorAuthor

    Hmm, that's awkward. Is there no way to annotate to tell the sanitiser that this case has been checked and deemed safe? E.g., something like this: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

    Yes, ignoring is an option, I mentioned it in my previous comment 🙂

    #102838, I checked and it looks to fix python infra/helper.py reproduce cpython3 fuzz_builtin_unicode clusterfuzz-testcase-minimized-fuzz_builtin_unicode-6313066228219904.

  13. added a commit that references this issue on May 17, 2023
  14. markshannon commented on Jul 28, 2023

    @markshannon
    Member

    The C spec says that an uninitialized value can include trap values, so in theory multiplying by zero could trap.
    That won't happen on any mainstream hardware, but we should probably fix it.

  15. removed
    pendingThe issue will be closed if no feedback is provided
    on Jul 28, 2023
  16. illia-v commented on Jul 28, 2023

    @illia-v
    ContributorAuthor

    @markshannon could you please check if #102510 is an acceptable fix?

  17. added a commit that references this issue on Jul 28, 2023
  18. added a commit that references this issue on Jul 30, 2023
  19. added a commit that references this issue on Jul 31, 2023
  20. illia-v commented on Aug 2, 2023

    @illia-v
    ContributorAuthor

    I'm closing this issue because the fix has been verified by ClusterFuzz. Thanks everyone involved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions