Re: [PATCH] 2.4: fix memory corruption from misinterpreted bad_inode_ops return values

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Willy Tarreau <w@...>
Cc: dann frazier <dannf@...>, <linux-kernel@...>
Date: Thursday, January 24, 2008 - 5:06 pm

Willy Tarreau wrote:

Sorry... here you go.  Forgot to post this sooner.  I hit it with
this on 2.6.x


#include <stdio.h>
#include <sys/types.h>
#include <sys/errno.h>

static int return_EIO(void)
{
        return -EIO;
}

int main(int argc, char ** argv)
{
	ssize_t error;
	ssize_t realerror = -EIO;
	ssize_t (*fn_ptr)(void);

	fn_ptr = (void *)return_EIO;

	error = (ssize_t)fn_ptr();
	printf("and... error is %ld, should be %ld\n", error, realerror);
	return 0;
}

-Eric
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] 2.4: fix memory corruption from misinterpreted b..., Eric Sandeen, (Thu Jan 24, 5:06 pm)