This series fixes two latent crash bugs in pfinet where mmap return values go unchecked, may causing crash when memory is tight.
Both bugs follow the same pattern: mmap is called to grow a buffer, but the returned pointer is dereferenced before (or without) checking for MAP_FAILED. Under normal operation mmap rarely fails, so these have gone unnoticed, but under address-space pressure pfinet would crash. Patch 1 fixes S_pfinet_siocgifconf Patch 2 fixes S_pfinet_getroutes Sophiel Zhou (2): pfinet: add MAP_FAILED check after mmap in S_pfinet_siocgifconf pfinet: check MAP_FAILED immediately after mmap in S_pfinet_getroutes pfinet/pfinet-ops.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) -- 2.54.0
