Whamcloud - gitweb
LU-4629 libcfs: fix buffer overflow of string buffer 89/9389/19
authorDmitry Eremin <dmitry.eremin@intel.com>
Tue, 25 Feb 2014 18:34:13 +0000 (22:34 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 20 Jun 2014 03:00:20 +0000 (03:00 +0000)
commit21d716e6c16424d9deb646456758ebbaa9c70fec
treebce7d46501f6c91f7252615a6147d31bef120acb
parent58e218b8a9b78fdbd4332ea2fa8c99fc10c2c673
LU-4629 libcfs: fix buffer overflow of string buffer

Buffer overflow of string buffer due to non null terminated string.
Use strlcpy() when it's justifiable.
Use sizeof(var) instead of constants.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ib8d5493898a292e3c764170d0a0870bee26b23a0
Reviewed-on: http://review.whamcloud.com/9389
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
53 files changed:
libcfs/libcfs/autoMakefile.am
libcfs/libcfs/debug.c
libcfs/libcfs/hash.c
libcfs/libcfs/posix/posix-debug.c
libcfs/libcfs/upcall_cache.c
libcfs/libcfs/user-prim.c
libcfs/libcfs/user-string.c [new file with mode: 0644]
libcfs/libcfs/util/parser.c
libcfs/libcfs/workitem.c
lnet/klnds/socklnd/socklnd.c
lnet/lnet/config.c
lnet/selftest/conrpc.c
lnet/selftest/console.c
lnet/utils/lst.c
lnet/utils/lstclient.c
lnet/utils/portals.c
lustre/fid/fid_store.c
lustre/include/lustre/lustre_user.h
lustre/include/lustre_disk.h
lustre/llite/dir.c
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/lod/lod_pool.c
lustre/lov/lov_pool.c
lustre/mdt/mdt_coordinator.c
lustre/mgs/mgs_llog.c
lustre/obdclass/dt_object.c
lustre/obdclass/obd_mount.c
lustre/ofd/ofd_io.c
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_oi.c
lustre/osp/lwp_dev.c
lustre/ptlrpc/gss/gss_pipefs.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/sec_config.c
lustre/quota/qmt_dev.c
lustre/target/tgt_lastrcvd.c
lustre/tests/mpi/Makefile.am
lustre/utils/Makefile.am
lustre/utils/gss/gssd.c
lustre/utils/gss/lgss_keyring.c
lustre/utils/gss/svcgssd_proc.c
lustre/utils/l_getidentity.c
lustre/utils/lfs.c
lustre/utils/lhsmtool_posix.c
lustre/utils/libiam.c
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_json.c
lustre/utils/ltrack_stats.c
lustre/utils/lustre_rsync.c
lustre/utils/mount_utils.c
lustre/utils/mount_utils_ldiskfs.c