OSDN Git Service

NTB: Fix zero size or integer overflow in ntb_set_mw
authorAllen Hubbe <Allen.Hubbe@emc.com>
Mon, 13 Jul 2015 12:07:13 +0000 (08:07 -0400)
committerJon Mason <jdmason@kudzu.us>
Sun, 9 Aug 2015 20:32:22 +0000 (16:32 -0400)
commit8c9edf63e75f036b42afb4502deb20bbfb5004b4
treee1a20719e91d54e26384642d8665854b44cb7ed7
parent8b5a22d8f18496f5921ccb92554a7051cbfd9b0c
NTB: Fix zero size or integer overflow in ntb_set_mw

A plain 32 bit integer will overflow for values over 4GiB.

Change the plain integer size to the appropriate size type in
ntb_set_mw.  Change the type of the size parameter and two local
variables used for size.

Even if there is no overflow, a size of zero is invalid here.

Reported-by: Juyoung Jung <jjung@micron.com>
Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c