Commit 51a2a58
net/i40e: validate DDP segment header before use
rte_pmd_i40e_get_ddp_info() retrieves the I40E segment header with
i40e_find_segment_in_package(). That helper may return NULL if the
segment cannot be found.
The returned pointer is validated only in one code path, while other
branches use it without checking. This can lead to a NULL pointer
dereference when parsing a malformed or incomplete DDP package.
Move the NULL check right before the segment usage so it applies to all
request types needed.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: edeab74 ("net/i40e: get information about DDP profile")
Cc: stable@dpdk.org
Signed-off-by: Daniil Agalakov <ade@amicon.ru>
Signed-off-by: Daniil Iskhakov <dish@amicon.ru>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>1 parent f90fbc2 commit 51a2a58
2 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1878 | 1878 | | |
1879 | 1879 | | |
1880 | 1880 | | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
1881 | 1886 | | |
1882 | 1887 | | |
1883 | 1888 | | |
| |||
1893 | 1898 | | |
1894 | 1899 | | |
1895 | 1900 | | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
1899 | | - | |
1900 | | - | |
1901 | 1901 | | |
1902 | 1902 | | |
1903 | 1903 | | |
| |||
0 commit comments