Skip to content

mode::get_gamma and set_gamma should check lengths of slices against size argument #244

@jimblandy

Description

@jimblandy

The functions mode::get_gamma and mode::set_gamma are not marked unsafe, but the kernel will read/write as many entries of the red, green, and blue slices as directed by crtc->gamma_size regardless of their actual lengths.

It seems to me that either these functions should be marked unsafe, or they should dynamically check that the slices' lengths are adequate for the given size. The kernel doesn't perform any accesses if the size passed in does not match the CRTC's actual gamma_size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions