microsoft / demikernel

Kernel-Bypass LibOS Architecture
https://aka.ms/demikernel
MIT License
912 stars 118 forks source link

[inetstack] Bad Type Casting #214

Open ppenna opened 2 years ago

ppenna commented 2 years ago

Description

In protocols::tcp::established::ControlBlock::receive_data() and potentially everywhere, we are casting fixed sizes to usize to perform some checks.

We should do the other way around.

ppenna commented 1 year ago

@BrianZill is this fixed?

iyzhang commented 5 months ago

I see that many places we do this because the value might get truncated if cast down to a smaller size. Should we first check that it is safe to cast?