numam-dpdk/drivers/net/nfp
Andy Green a74640c468 net/nfp: fix buffer overflow of FW strings
drivers/net/nfp/nfp_net.c: In function ‘nfp_pf_pci_probe’:
drivers/net/nfp/nfp_net.c:3160: 23: error:
‘%s’ directive writing up to 99 bytes into a region of size 76
[-Werror=format-overflow=]
  sprintf(fw_name, "%s/%s.nffw", DEFAULT_FW_PATH, serial);

Note fw_buf still has to increase somewhat even after
restricting serial[], since otherwise:

drivers/net/nfp/nfp_net.c: In function ‘nfp_pf_pci_probe’:
drivers/net/nfp/nfp_net.c:3176:23:
error: ‘%s’ directive writing up to 99 bytes into a region of size 76
[-Werror=format-overflow=]
  sprintf(fw_name, "%s/%s", DEFAULT_FW_PATH, card);
                       ^~
drivers/net/nfp/nfp_net.c:3262:32:
  err = nfp_fw_upload(dev, nsp, card_desc);
                                ~~~~~~~~~
drivers/net/nfp/nfp_net.c:3176:2:
note: ‘sprintf’ output between 25 and 124 bytes into a destination of size 100
  sprintf(fw_name, "%s/%s", DEFAULT_FW_PATH, card);

Fixes: 896c265ef9 ("net/nfp: use new CPP interface")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-05-14 23:32:23 +02:00
..
nfpcore net/nfp: fix possible resource leak 2018-04-27 15:54:55 +01:00
Makefile net/nfp: use new CPP interface 2018-04-14 00:40:21 +02:00
nfp_net_ctrl.h net/nfp: support MAC address change 2018-04-27 15:54:55 +01:00
nfp_net_logs.h net/nfp: add newline in PMD_RX/TX_LOG macros 2018-04-27 18:00:57 +01:00
nfp_net_pmd.h net/nfp: support LSO offload version 2 2018-04-14 00:43:30 +02:00
nfp_net.c net/nfp: fix buffer overflow of FW strings 2018-05-14 23:32:23 +02:00
rte_pmd_nfp_version.map nfp: introduce driver initialization 2015-12-08 03:00:42 +01:00