-
Notifications
You must be signed in to change notification settings - Fork 5
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
Replace UAPI one-element arrays with flexible-array members #113
Comments
Apparently, the one-element arrays in include/uapi/linux/videodev2.h are merely placeholders for alignment, and are not being used as variable-length arrays:
|
It's non-trivial to update UAPI headers, so to eliminate one-element arrays, it's likely that anonymous unions need to be used. There are some caveats with that, though: https://www.mail-archive.com/[email protected]/msg48095.html |
Without changing the structure size (since it is UAPI), add a proper flexible array member, and reference it in the kernel so that it will not be trip the array-bounds sanitizer[1]. Link: KSPP#113 [1] Cc: Juergen Gross <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Oleksandr Tyshchenko <[email protected]> Cc: Gustavo A. R. Silva <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
Without changing the structure size (since it is UAPI), add a proper flexible array member, and reference it in the kernel so that it will not be trip the array-bounds sanitizer[1]. Link: KSPP/linux#113 [1] Cc: Juergen Gross <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Oleksandr Tyshchenko <[email protected]> Cc: Gustavo A. R. Silva <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
All the UAPI 1-element arrays used as flexible arrays have been refactored. |
There are currently 7 files containing one-element arrays in UAPI:
The text was updated successfully, but these errors were encountered: