Daniel Axtens f407e34f38 net/netbuff: Block overly large netbuff allocs
A netbuff shouldn't be too huge. It's bounded by MTU and TCP segment
reassembly. If we are asked to create one that is unreasonably big, refuse.

This is a hardening measure: if we hit this code, there's a bug somewhere
else that we should catch and fix.

This commit:
  - stops the bug propagating any further.
  - provides a spot to instrument in e.g. fuzzing to try to catch these bugs.

I have put instrumentation (e.g. __builtin_trap() to force a crash) here and
have not been able to find any more crashes.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-06-07 16:39:33 +02:00
..
2022-03-14 15:58:06 +01:00
2022-03-14 15:58:06 +01:00
2022-03-14 15:58:06 +01:00
2022-06-07 16:39:33 +02:00
2022-03-14 15:58:06 +01:00
2022-03-14 15:58:06 +01:00