From: Oliver Kurth Date: Fri, 5 Oct 2018 20:55:27 +0000 (-0700) Subject: Use bitwise AND operation while fetching current IOPL. X-Git-Tag: stable-10.3.5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4b07f53c71a83beed8fdc11f2dfeeb43aa20fda;p=thirdparty%2Fopen-vm-tools.git Use bitwise AND operation while fetching current IOPL. Iopl_Get() was using logical AND operation which could result in wrong IOPL value. We should be using bitwise AND instead. --- diff --git a/open-vm-tools/lib/include/ioplGet.h b/open-vm-tools/lib/include/ioplGet.h index bcecf9bf2..2ebe8aad9 100644 --- a/open-vm-tools/lib/include/ioplGet.h +++ b/open-vm-tools/lib/include/ioplGet.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2012-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2012-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -33,7 +33,7 @@ extern "C" { #endif -#define Iopl_Get() ((GetCallerEFlags() >> EFLAGS_IOPL_SHIFT) && 0x3) +#define Iopl_Get() ((GetCallerEFlags() >> EFLAGS_IOPL_SHIFT) & 0x3) #if defined(__cplusplus) } // extern "C"