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

analyze: tracking issue for lighttpd algo_md5 #1025

Open
4 of 12 tasks
spernsteiner opened this issue Sep 11, 2023 · 1 comment
Open
4 of 12 tasks

analyze: tracking issue for lighttpd algo_md5 #1025

spernsteiner opened this issue Sep 11, 2023 · 1 comment

Comments

@spernsteiner
Copy link
Contributor

spernsteiner commented Sep 11, 2023

We'd like to be able to fully refactor lighttpd's algo_md5 module into safe Rust. This tracking issue covers analysis features that will be required to support that:

  • Casts from Single to non-Single Quantity. This may be a bug, possibly with our handling of array.as_mut_ptr(); if the cast's output has PermissionSet::OFFSET (causing it to have non-Single Quantity), then the input should have that permission as well.
    • Investigate to determine why the analysis wants to insert this cast
  • void* arguments for local functions. Specifically, MD5_Update takes a pointer to bytes as the argument void* _input.
    • Track concrete pointee types through void* and char* casts
    • Rewrite argument types from *mut c_void to a more specific safe type
  • Rewrite memcpy into copy_from_slice.
  • Rewrite memset(&s, 0, sizeof(s)) into zero-initialization of each field of s.
  • Fix unsupported cast kind: TypeDesc
    • Investigate further - which TypeDescs is it failing on?
  • Fix unlower_map has no origin - possibly fixed by Test.lighttpd.md5 #1020
  • Figure out why the context pointer is getting OFFSET permission in several functions
  • Fix bad cast in MD5_Update's call to li_MD5Transform:
    // old:
    ((*context).buffer).as_mut_ptr() as *const libc::c_uchar
    // new:
    &*(&mut (((*context).buffer)) as &mut [u8]) as *const libc::c_uchar
    The final ... as *const libc::c_uchar should be removed.
@aneksteind
Copy link
Contributor

Just merged #1022 which lets algo_md5 pass without modifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants