[PATCH] POC for fault injection
haris iqbal
haris.phnx at gmail.com
Tue Mar 22 03:25:25 UTC 2016
On Tue, Mar 22, 2016 at 5:56 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Mon, Mar 21, 2016 at 10:36:03AM +0530, haris iqbal wrote:
>> I have sent a patch which demonstrates the Idea that I thought of for
>> failing system calls. It overwrites the return value of the system
>> call with -1 to make it fail.
>
> If you want to "fail" a syscall, it has to be done on entering,
> on exiting it's too late.
Yes, I thought of the same thing. So only you would find the that in
the other standalone POC, I reset the important parameter of the
syscall also to 0 while entering, and then I put -1 in place of return
value while exiting.
>
> Could you elaborate how would you "fail" various syscalls, please?
By reseting the important parameters to 0.
Some examples below.
For instance, for the read() system call only, what I did was to reset
the important parameter with 0. The important parameter for read() is
the second parameter which would hold the bytes read, and which the
program would use to read the data.
One more thing I can do is reset the first parameter holding the fd,
that would also fail the system call.
For fstat() syscall, we can change the value of the first parameter
(which holds the socket number) to a negative number.
Similarly, picking the important parameter and changing it to
something that can fail the syscall would work for us I think.
>
>
> --
> ldv
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>
--
With regards,
Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
More information about the Strace-devel
mailing list