Project

General

Profile

Actions

Bug #7498

open

rust: cleanup of extern "C" functions and no_mangle

Added by Jason Ish 2 days ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

I recently ran into an issue where a plugin was using a sha256 library that had a function names sha256_transform. Suricata also has a function:

#[no_mangle]
extern "C" fn sha256_finalize

The plugin was using our version leading to a crash.

On our side we should:
- only use no_mangle for pub extern "C", and these must be prefixed with "SC"
- if not pub, we shouldn't need no_mangle, for example if the function is only ever used by pointer. We can let normal Rust mangling deal with it.

I plan to do this as a sweeping change.


Related issues 1 (1 open0 closed)

Related to Suricata - Story #7148: extensibility: pluginsNewVictor JulienActions
Actions #1

Updated by Victor Julien 1 day ago

Actions

Also available in: Atom PDF