remoteproc: core: Remove casting to rproc_handle_resource_t
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sami Tolvanen
Reviewed-byHi,
Quoted 10 lines · Jindong Yue
There are four different callback functions that are used for the
rproc_handle_resource_tcallback that all have different second parameter types.
rproc_handle_vdev-> structfw_rsc_vdevrproc_handle_trace-> structfw_rsc_tracerproc_handle_devmem-> structfw_rsc_devmemrproc_handle_carveout-> structfw_rsc_carveout
Quoted 4 lines
These callbacks are cast to
rproc_handle_resource_tso that there is no error about incompatible pointer types. Unfortunately, this is a control flow integrity violation, which verifies that the callback function's types match the prototypes exactly before jumping.
Thank you for sending the patch! It might be worth noting that Clang's Control-Flow Integrity checking is currently used only in Android kernels, so while the type mismatches are real and should be fixed, they don't result in runtime errors without this feature.
Quoted 7 lines
To fix this, change the second parameter of all functions to void * and use a local variable with the correct type so that everything works properly. With this, we can remove casting to
rproc_handle_resource_tfor these functions.Signed-off-by Jindong Yue <[email protected]>Reviewed-by Peng Fan <[email protected]>
This looks correct to me. Please feel free to add:
Sami
Quoted 29 lines · Sami Tolvanen
Hi,
Quoted 10 lines · Jindong Yue
There are four different callback functions that are used for the
rproc_handle_resource_tcallback that all have different second parameter types.
rproc_handle_vdev-> structfw_rsc_vdevrproc_handle_trace-> structfw_rsc_tracerproc_handle_devmem-> structfw_rsc_devmemrproc_handle_carveout-> structfw_rsc_carveoutQuoted 4 lines
These callbacks are cast to
rproc_handle_resource_tso that there is no error about incompatible pointer types. Unfortunately, this is a control flow integrity violation, which verifies that the callback function's types match the prototypes exactly before jumping.Thank you for sending the patch! It might be worth noting that Clang's Control-Flow Integrity checking is currently used only in Android kernels, so while the type mismatches are real and should be fixed, they don't result in runtime errors without this feature.
Quoted 5 lines
To fix this, change the second parameter of all functions to void * and use a local variable with the correct type so that everything works properly. With this, we can remove casting to
rproc_handle_resource_tfor these functions.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Jindong Yue <[email protected]>Reviewed-by Peng Fan <[email protected]>This looks correct to me. Please feel free to add:
Reviewed-by Sami Tolvanen <[email protected]>
Where is the original patch? I can't find it on the linux-remoteproc and linux-kernel mailing lists.
Quoted 2 lines
Sami
Quoted 34 lines · Mathieu Poirier
Quoted 32 lines · Sami Tolvanen
Hi,
Quoted 10 lines · Jindong Yue
There are four different callback functions that are used for the
rproc_handle_resource_tcallback that all have different second parameter types.
rproc_handle_vdev-> structfw_rsc_vdevrproc_handle_trace-> structfw_rsc_tracerproc_handle_devmem-> structfw_rsc_devmemrproc_handle_carveout-> structfw_rsc_carveoutQuoted 4 lines
These callbacks are cast to
rproc_handle_resource_tso that there is no error about incompatible pointer types. Unfortunately, this is a control flow integrity violation, which verifies that the callback function's types match the prototypes exactly before jumping.Thank you for sending the patch! It might be worth noting that Clang's Control-Flow Integrity checking is currently used only in Android kernels, so while the type mismatches are real and should be fixed, they don't result in runtime errors without this feature.
Quoted 7 lines
To fix this, change the second parameter of all functions to void * and use a local variable with the correct type so that everything works properly. With this, we can remove casting to
rproc_handle_resource_tfor these functions.Signed-off-by Jindong Yue <[email protected]>Reviewed-by Peng Fan <[email protected]>
Quoted 6 lines
Quoted 3 lines
This looks correct to me. Please feel free to add:
Reviewed-by Sami Tolvanen <[email protected]>Where is the original patch? I can't find it on the linux-remoteproc and linux-kernel mailing lists.
Looks like it was sent to linux-remoteproc, but I also don't see it in lore.kernel.org. Not sure what happened there. Jindong, perhaps it's worth resending and including linux-kernel too?
Sami
Quoted 39 lines · Sami Tolvanen
Quoted 36 lines · Mathieu Poirier
Quoted 34 lines · Sami Tolvanen
Hi,
Quoted 10 lines · Jindong Yue
There are four different callback functions that are used for the
rproc_handle_resource_tcallback that all have different second parameter types.
rproc_handle_vdev-> structfw_rsc_vdevrproc_handle_trace-> structfw_rsc_tracerproc_handle_devmem-> structfw_rsc_devmemrproc_handle_carveout-> structfw_rsc_carveoutQuoted 4 lines
These callbacks are cast to
rproc_handle_resource_tso that there is no error about incompatible pointer types. Unfortunately, this is a control flow integrity violation, which verifies that the callback function's types match the prototypes exactly before jumping.Thank you for sending the patch! It might be worth noting that Clang's Control-Flow Integrity checking is currently used only in Android kernels, so while the type mismatches are real and should be fixed, they don't result in runtime errors without this feature.
Quoted 7 lines
To fix this, change the second parameter of all functions to void * and use a local variable with the correct type so that everything works properly. With this, we can remove casting to
rproc_handle_resource_tfor these functions.Signed-off-by Jindong Yue <[email protected]>Reviewed-by Peng Fan <[email protected]>This looks correct to me. Please feel free to add:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Reviewed-by Sami Tolvanen <[email protected]>Where is the original patch? I can't find it on the linux-remoteproc and linux-kernel mailing lists.
Looks like it was sent to linux-remoteproc, but I also don't see it in lore.kernel.org. Not sure what happened there. Jindong, perhaps it's worth resending and including linux-kernel too?
Something definitely happened because I can't find anything from Jindong on the linux-remoteproc list... A resend it indeed in order.
Quoted 2 lines
Sami