On Wed, 17 Sep 2025 01:08:30 -0700
Dimon Zhao <[email protected]> wrote:
> +
> +static struct nbl_channel_ops chan_ops = {
> + .send_msg = nbl_chan_send_msg,
> + .send_ack = nbl_chan_send_ack,
> + .register_msg = nbl_chan_register_msg,
> + .setup_queue = nbl_chan_setup_queue,
> + .teardown_queue = nbl_chan_teardown_queue,
> + .set_state = nbl_chan_set_state,
> + .set_queue_state = nbl_chan_set_queue_state,
> + .notify_interrupt = nbl_chan_notify_interrupt,
> +};
> +
Can channel ops be const? Same for any other function pointer
only table. It helps with preventing accidental code vulnerabilities
where a buffer overrun can be used to cause other code to be run.
Therefore for safety all function tables should be const where loader
will put in read only memory.