Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-17 Thread Paul FLOYD
> This is incorrect for C99 and indeed any compiler that supports "long long". > On such systems, the integer constant 3222829167 > has type "long long", and it is absolutely guaranteed to preserve that value > when cast to unsigned. Assuming 32-bit int, of course. It is also incorrect for

Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-16 Thread Patrick J. LoPresti
On Sat, Aug 15, 2020 at 10:59 AM John Reiser wrote: > > The fact that you write '0xc018786f' here, but '3222829167' in the code, > shows that you are not sufficiently paranoid. First, if the bit pattern is important > then you should write hex. If you insist on decimal, then you should write

Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-16 Thread John Reiser
long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg) { int err = -EFAULT; //unsigned int openLink = kIoctlOpenEthernetLink; unsigned int openLink = 3222829167; "3222829167" is not a legal 32-bit value in source code. You MUST use "3222829167u" with a

Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-15 Thread Manomugdha Biswas via Valgrind-users
hout valgrind then it works fine. Note3: this is a kernel module and ioctl is called from user space application. Regards, Mano -Original Message- From: John Reiser Sent: Saturday, August 15, 2020 11:28 PM To: valgrind-users@lists.sourceforge.net Subject: Re: [Valgrind-users] compat_ioctl cmd doe

Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-15 Thread John Reiser
I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is # uname -a Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux Which version of valgrind? The source code of valgrind: commit

[Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-15 Thread Manomugdha Biswas via Valgrind-users
Hi, I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is # uname -a Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux Ioctl function is following: long mgr_compat_ioctl(struct file *pFile,

Re: [Valgrind-users] compat_ioctl cmd does not match even if it shows same value

2020-08-15 Thread Manomugdha Biswas via Valgrind-users
(openLink - cmd) shows zero still if check fails. Note: this is happening only under valgrind! Regards, Mano, IxNetwork [Keysight-signature-block-5] From: Manomugdha Biswas Sent: Saturday, August 15, 2020 6:38 PM To: valgrind-users@lists.sourceforge.net Subject: