Skip to content

Integer overflow in apps/speed.c #16899

@yiyuaner

Description

@yiyuaner

In speed.c, the option multi can be specified through command line:

multi = atoi(opt_arg());

The value of multi is not sanitized and passed directly into do_multi:

if (multi && do_multi(multi, size_num))

which is then used as size for memory allocation:

fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
.

By specifying multi (e.g., making it very large), one can trigger a signed integer overflow during the computation of the allocation size, which is a bug and can be dangerous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    branch: 3.0Applies to openssl-3.0 branchbranch: masterApplies to master branchtriaged: bugThe issue/pr is/fixes a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions