aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2019-02-19 13:09:57 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-02-19 20:52:19 -0700
commit1882ab867863531ab9caab81fd6ac5fee6d1a314 (patch)
tree0ccc875b1bf6ee1a77fd255ceea5b72cd41a774a /scripts/gdb/linux/utils.py
parente278173fd19eb537e73190c50c162950f192e047 (diff)
downloadlinux-1882ab867863531ab9caab81fd6ac5fee6d1a314.tar.gz
linux-1882ab867863531ab9caab81fd6ac5fee6d1a314.tar.bz2
linux-1882ab867863531ab9caab81fd6ac5fee6d1a314.zip
RDMA/iwcm: Fix string truncation error
The strlen() check at the beginning of iw_cm_map() ensures that devname and ifname strings are less than destinations to which they are supposed to be copied. Change strncpy() call to be strcpy(), because we are protected from overflow. Zero the entire string buffer to avoid copying uninitialized kernel stack memory to userspace. This fixes the compilation warning below: In file included from ./include/linux/dma-mapping.h:6, from drivers/infiniband/core/iwcm.c:38: In function _strncpy_, inlined from _iw_cm_map_ at drivers/infiniband/core/iwcm.c:519:2: ./include/linux/string.h:253:9: warning: ___builtin_strncpy_ specified bound 32 equals destination size [-Wstringop-truncation] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: d53ec8af56d5 ("RDMA/iwcm: Don't copy past the end of dev_name() string") Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions