Skip to content

Incorrect memmove library function specification #1121

@sim642

Description

@sim642

Our old-style library function specifications for memmove are the following:

"memmove", writes [2;3];(*keep [2;3]*)
"__builtin_memmove", writes [2;3];(*keep [2;3]*)
"__builtin___memmove_chk", writes [2;3];(*keep [2;3]*)

These seem to be flipped, because the actual signature is

void* memmove( void* dest, const void* src, size_t count );

So the first argument is written and the second one read.

This causes some spurious race warning in chrony (due to the extra src write) but also could be unsound (due to the missing dst write).

This could also be done in #1079.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions