[PATCH v1] eal/linux: fix memory illegal accesses

Ferruh Yigit ferruh.yigit at intel.com
Wed Feb 23 12:26:04 CET 2022


On 2/23/2022 8:49 AM, Steve Yang wrote:
> 'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer.
> But as coverity warns 'recv()' doesn't guarantee that 'buf' is
> null-terminated, but 'strlcpy()' requires it.
> 
> Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can
> be set to 0 when received buffer size is EAL_UEV_MSG_LEN.
> 
> CID 375864:  Memory - illegal accesses  (STRING_NULL)
> Passing unterminated string "buf" to "dev_uev_parse", which expects
> a null-terminated string.
> 
> Coverity issue: 375864
> Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Steve Yang <stevex.yang at intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>


More information about the dev mailing list