Drive tester

2009-07-22 Thread Bill Weiler
I wanted to make an Application that could send scripted SCSI and SATA commands 
to my drives. I have found my Fedora Linux to be too complex to control the 
drives in this way. I have looked at minimal Linux but I think this would have 
the same problem. Is there an easier Open Source OS, or an embedded PC Linux 
that would be easier to modify?


Re: How to copy, modify and send the modified duplicate of an sk_buff

2009-07-22 Thread Michael Blizek
Hi!

On 17:11 Wed 22 Jul , Loránd Jakab wrote:
> On Wednesday, July 22, 2009 08:15:12 Michael Blizek wrote:
> > Hi!
> >
> > On 18:28 Tue 21 Jul , Loránd Jakab wrote:
> > > Hello,
> > >
> > > I am working on implementing an experimental network protocol. I
> > > have netfilter hook which changes the payload after the IP header
> > > and the destination IP in packets with a certain protocol id. This
> > > part works.
> > >
> > > For some packets, I need to generate an extra packet. To do this, I
> > > copy the sk_buff, modify stuff on the copy and try sending it with
> > > dev_queue_xmit(), then modify the original and return NF_ACCEPT.
> > > The result is: the original get through (the one with NF_ACCEPT)
> > > but the copy doesn't.
> > >
> > > Here's the code for copying and sending the copy:
> > >
> > > static void send_payload(struct sk_buff *skb, struct in_addr rloc)
> >
> > Where do you call this function? Immediately before the ip stack
> > calls dev_queue_xmit? If not, the ip stack might not have finished
> > building the packet.
> >
> > -Michi
> 
> Hi,
> 
> This function is called from an ipfilter hook, which is registered at 
> IP_PRE_ROUTING. I replace some data, but I don't do the routing so the 
> correct MAC header is not created. After discovering this, I tried three 
> approaches:
> 
> * Calling ip_route_input and then dev_queue_xmit() - same as before, I 
>   get the IP header in place of the MAC header
> * Calling ip_queue_xmit() - which does routing as well, I checked the
>   implementation - I get a kernel panic
> * Futile, but just in case, ip_route_input() and ip_queue_xmit() -
>   kernel panic

Do you get something like this?
void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{
printk(KERN_EMERG "skb_under_panic: text:%p len:%d put:%d head:%p "
  "data:%p tail:%#lx end:%#lx dev:%s\n",
   here, skb->len, sz, skb->head, skb->data,
   (unsigned long)skb->tail, (unsigned long)skb->end,
   skb->dev ? skb->dev->name : "");
BUG();
}


> It seems that ip_queue_xmit should be what I need, I don't know why it 
> crashes...

If the above text is the reason, it may be triggered by this line in
ip_queue_xmit:

skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0));

Which basically means that it assumes that there is no ip header so far and
this function wants to add it at the beginning of the buffer. However, there
is no headroom and so it crashes. You can try this immediately before calling
ip_queue_xmit(I know it is ugly, maybe someboby knows a better way?):

skb_push(skb, (int)(skb_transport_header(skb) - skb->head));

-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



new kernel newbie column is up

2009-07-22 Thread Robert P. J. Day

  http://cli.gs/q5XXS9

  at first, the column was a bit short so i thought i'd throw in some
extra stuff about generating the exported kernel headers.  ye gods,
that turned into an entire column by itself.  two for the price of one
this week.  enjoy.

rday

p.s.  there's a comments section on those columns for a reason.  ask
questions.  add information.  criticize.

--


Robert P. J. Day   Waterloo, Ontario, CANADA

Linux Consulting, Training and Annoying Kernel Pedantry.

Web page:  http://crashcourse.ca
Twitter:   http://twitter.com/rpjday
"Kernel Newbie Corner" column @ linux.com:  http://cli.gs/WG6WYX


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: sending kernel data to user application

2009-07-22 Thread SandeepKsinha
Hi Krushnal,


On Wed, Jul 22, 2009 at 8:40 PM, Mulyadi Santosa
wrote:

> Hi...
>
> I hope you don't mind if I cc my reply to kernelnewbies mailing list
> too...so that you can get more response..
>
> On Wed, Jul 22, 2009 at 4:03 PM, krushnaal pai
> wrote:
> > sir,
> > how can we send data from kernel space to user application...
>
> AFAIK, most people use netlink socket. But since it seems that you
> want alternative ways
>
> > also i had an article on that but they have used sockets ,i want one that
> > doesnt use sockets
>
> if you mean "send data" as "user space read data from kernel space by
> polling certain file descriptor", then you can create /proc or /sys or
> debugfs entries, assign the file operation in it. Then when a user
> space program read the entry, kernel simply send the data to the
> reader.


If you are just looking for alternatives, ioctl is the simplest one. Google
for configfs, thats a good one too.



>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer
> blog: the-hydra.blogspot.com
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>


Re: Checking Installed library

2009-07-22 Thread Manish Katiyar
On Sat, Jul 18, 2009 at 2:37 PM, Rishi Agrawal wrote:
>
>
> On Sat, Jul 18, 2009 at 2:25 PM, Manish Katiyar  wrote:
>>
>> On Sat, Jul 18, 2009 at 1:45 PM, Rishi Agrawal
>> wrote:
>> >
>> >
>> > On Sat, Jul 18, 2009 at 1:05 PM, Manish Katiyar 
>> > wrote:
>> >>
>> >> On Sat, Jul 18, 2009 at 9:48 AM, Rishi
>> >> Agrawal
>> >> wrote:
>> >> >
>> >> >
>> >> > On Fri, Jul 17, 2009 at 7:22 PM, Manish Katiyar 
>> >> > wrote:
>> >> >>
>> >> >> On Fri, Jul 17, 2009 at 10:34 PM, Rishi
>> >> >> Agrawal wrote:
>> >> >> >
>> >> >> >
>> >> >> > On Fri, Jul 17, 2009 at 12:40 PM, Rishi Agrawal
>> >> >> > 
>> >> >> > wrote:
>> >> >> >>
>> >> >> >>
>> >> >> >> On Fri, Jul 17, 2009 at 12:27 PM, Mulyadi Santosa
>> >> >> >>  wrote:
>> >> >> >>>
>> >> >> >>> On 7/17/09, Rishi Agrawal  wrote:
>> >> >> >>> > Is autoconfigure the only way to find this out.??
>> >> >> >>> >
>> >> >> >>> > On Wed, Jul 15, 2009 at 6:52 AM, Pei Lin 
>> >> >> >>> > wrote:
>> >> >> >>>
>> >> >> >>> Please don't do top posting...
>> >> >> >>>
>> >> >> >>> Although it's OOT, I can help a bit. IMO, you can directly check
>> >> >> >>> /usr/lib or parse /etc/ld.so.conf and so on to find the related
>> >> >> >>> DSO
>> >> >> >>> and header files. However, doing that will require more time and
>> >> >> >>> probably not portable across system, in fact it's kinda
>> >> >> >>> reinventing
>> >> >> >>> the wheel.
>> >> >> >>>
>> >> >> >>> So, I personally suggest to adopt autoconfigure.
>> >> >> >>>
>> >> >> >>> --
>> >> >> >>> regards,
>> >> >> >>>
>> >> >> >>> Mulyadi Santosa
>> >> >> >>> Freelance Linux trainer
>> >> >> >>> blog: the-hydra.blogspot.com
>> >> >> >>
>> >> >> >>
>> >> >> >> I will have a detailed look at the autoconfigure utility and see.
>> >> >> >>
>> >> >> >> Thanks for all the help.
>> >> >> >>
>> >> >> >> --
>> >> >> >> Regards,
>> >> >> >> Rishi B. Agrawal
>> >> >> >> http://www.linkedin.com/in/rishibagrawal
>> >> >> >> http://code.google.com/p/fscops/
>> >> >> >
>> >> >> >
>> >> >> > I have used it and it is working very good.
>> >> >> >
>> >> >> > I wanted to know that
>> >> >> >
>> >> >> > How to check the presence of libxml2 library using autoconfigure ?
>> >> >>
>> >> >> First link in google.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://www.kdevelop.org/index.html?filename=3.0/doc/tutorial_autoconf.html
>> >> >>
>> >> >> Thanks -
>> >> >> Manish
>> >> >>
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Regards,
>> >> >> > Rishi B. Agrawal
>> >> >> > http://www.linkedin.com/in/rishibagrawal
>> >> >> > http://code.google.com/p/fscops/
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Thanks -
>> >> >> Manish
>> >> >
>> >> > Actually I tried using that information earlier but somehow it did
>> >> > not
>> >> > work.
>> >>
>> >> Can you please tell us a little more why it didn't work ? Any errors
>> >> or anything else ??
>> >>
>> >> >
>> >> > Currently I am using a macro which checks wether a function is
>> >> > present
>> >> > in
>> >> > the mentioned library.
>> >>
>> >> I didn't understand this ? are you using something like nm ??
>> >>
>> >> >
>> >> > like printf can be checked in libc
>> >> >
>> >> > I used a function "xmlParsefile" and "libxml2" library and this works
>> >> > fine.
>> >> > The logic behind this is that when the function is present in the
>> >> > library
>> >> > then the library is also present on the system (is it correct ??)
>> >>
>> >> Should be... but by any chance are you relying the library to be
>> >> present in a particular path ?? If that's the case it is not going to
>> >> work anywhere ?
>> >>
>> >> Thanks -
>> >> Manish
>> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Regards,
>> >> > Rishi B. Agrawal
>> >> > http://www.linkedin.com/in/rishibagrawal
>> >> > http://code.google.com/p/fscops/
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks -
>> >> Manish
>> >
>> > I am using this particular line:
>> >
>> > AC_CHECK_LIB(xml2,xmlParseFile,,AC_MSG_ERROR(oops! no function
>> > xmlParseFile
>> > function in xml?!?),) in my configure.in for autoconf
>>
>> You can try something like below too ... it doesn't depend on any
>> particular function.
>>
>> /tmp/test> ./configure
>> checking for gcc... gcc
>> checking for C compiler default output file name... a.out
>> checking whether the C compiler works... yes
>> checking whether we are cross compiling... no
>> checking for suffix of executables...
>> checking for suffix of object files... o
>> checking whether we are using the GNU C compiler... yes
>> checking whether gcc accepts -g... yes
>> checking for gcc option to accept ISO C89... none needed
>> checking for -pkg-config... no
>> checking for pkg-config... /usr/bin/pkg-config
>> checking for libxml2... yes
>> configure: creating ./config.status
>>
>>
>> /tmp/test> cat configure.ac
>> #                                               -*- Autoconf -*-
>> # Process this file with autoconf to produce a configure script.
>>
>> AC_PREREQ([2.63])
>> AC_INIT(["Sample test package"], ["1.

Re: How to copy, modify and send the modified duplicate of an sk_buff

2009-07-22 Thread Loránd Jakab
On Wednesday, July 22, 2009 02:33:56 H M Thalib wrote:
> Loránd Jakab wrote:
> > Hello,
> >
> > I am working on implementing an experimental network protocol. I
> > have netfilter hook which changes the payload after the IP header
> > and the destination IP in packets with a certain protocol id. This
> > part works.
> >
> > For some packets, I need to generate an extra packet. To do this, I
> > copy the sk_buff, modify stuff on the copy and try sending it with
> > dev_queue_xmit(), then modify the original and return NF_ACCEPT.
> > The result is: the original get through (the one with NF_ACCEPT)
> > but the copy doesn't.
> >
> > Here's the code for copying and sending the copy:
> >
> > static void send_payload(struct sk_buff *skb, struct in_addr rloc)
> > {
> > struct iphdr *ipheader;
> > struct sk_buff *ccgen = skb_copy_expand(skb, 0, 0, GFP_ATOMIC);
> > if (!ccgen)
> > pr_debug("packet copy failed\n");
> >
> > ipheader = ip_hdr(ccgen);
> > ipheader->protocol = 0xfd;
> > ip_send_check(ipheader);
> >
> > /* Not sure if the next line is necessary */
> > ccgen->csum = csum_partial(ccgen->data, ccgen->len, 0);
> >
> > if (dev_queue_xmit(ccgen) < 0)
> > pr_debug("failed to send payload\n");
> > }
> >
> > I use skb_copy_expand to create the copy. I use the expand version,
> > because after I get this to work, I will have to add more payload
> > to the packet. First step is to change the protocol number and put
> > the packet on the wire.
> >
> > What am I doing wrong? Why is the packet not sent?
> >
> > Thanks in advance!
> >
> > Regards,
> > Loránd Jakab
> >
> > --
> > To unsubscribe from this list: send an email with
> > "unsubscribe kernelnewbies" to ecar...@nl.linux.org
> > Please read the FAQ at http://kernelnewbies.org/FAQ
>
> Hi,
>
> I don't have knowledge in the network driver side. but I will try,
>
> - Check you have modified the iptables rules to let out all the
> packets, make sure it is not blocking any packets.
>
> - are you sure it is sending the packets to wire, then checkout the
> ifconfig and see the packet counts of TX is incremented also look at
> /proc/interrupts
>
> - If the packets are out and the opposite machine is not showing the
> packets  then probably run the tcpdump in sender and receiver to
> watch where the packet goes, this gives some clues where it gets
> dropped

Hi,

Thanks for the pointers. There are no iptables rules loaded, netfilter 
is only for grabbing and manipulating packets. It does show up on the 
wire, but as garbage. After a closer inspection, what happens is that it 
is trasmitted with the IP header as the MAC header, and on the wrong 
interface.

Regards,
Lori

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: simulating the kernel crash and kernel panic

2009-07-22 Thread H M Thalib

Rahul K Patel wrote:

H M Thalib wrote:

SandeepKsinha wrote:

Hi Thalib,


On Tue, Jul 21, 2009 at 9:56 PM, H M Thalib > wrote:


Mulyadi Santosa wrote:

On Mon, Jul 20, 2009 at 10:54 PM, H M Thalibmailto:hmtha...@gmail.com>> wrote:

I want to test my kernel for stability. Can you help me in
artificially
simulating the kernel crash, kernel panic scenarios. Is
there any
standard way to simulate it. maybe by running applications,
scripts. but
I dont want to modify anything in the kernel space.


Try to study fault-injection. It's documented in
Documentation/fault-injection.txt inside kernel source tree.
Never use
it 'til now, so I only can give you a clue.


Thanks -

But this steps involves in kernel space,

I am looking for producing kernel panic/crash/hang by running some
script/application in user space - Is there any tool/standard
defined way to do that


Why do you feel that you would be able to achieve this? Don't you 
think that such scripts would then we used as a malware.


I think in order to have such a protection we have a user space and a 
kernel space. You can panic/hang  user space processes using user 
space programs unless you have a loop hole in the kernel 
implementation. Which no one will put intentionally.
 



You are exactly correct. I want to check whether my kernel is stable 
or it is having any loop holes left. I hope this types of test should 
be conducted by the kernel testers/Linux distribution Maintainer as a 
routine test. to check whether their system is stable with the kernel.



you can try this out.

http://www.linkedin.com/news?viewArticle=&articleID=51231726&gid=49301&articleURL=http%3A%2F%2Fblogs.computerworld.com%2Fa_linux_security_story&urlhash=tVha 


http://lwn.net/Articles/341773/

Regards,
Rahul Patel



Thanks ,, that was an excellent link.

--
Thanks & Regards,
H M Thalib.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: compiling user space and kernel space code in single makefile

2009-07-22 Thread Mulyadi Santosa
Hi

On Wed, Jul 22, 2009 at 6:47 PM, Rishi Agrawal wrote:
> I have used separate makefiles and added this piece of code in the Makefile
> in the topmost directory
>
> @for dir in ${subdirs}; do \
>       (cd $$dir && $(MAKE) all) \
>       || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
>     done && test -z "$$fail"
>
> This loop goes into each and subdir and executes "make"

So the above lines are the only thing done by the main Makefile?

With my limited knowledge of Makefile and Bash scripting, it seems
nothing is suspicious there.

perhaps a small experiment first, what's the result if you take out
the "include" line in your user space Makefile?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: How to copy, modify and send the modified duplicate of an sk_buff

2009-07-22 Thread Loránd Jakab
On Wednesday, July 22, 2009 08:15:12 Michael Blizek wrote:
> Hi!
>
> On 18:28 Tue 21 Jul , Loránd Jakab wrote:
> > Hello,
> >
> > I am working on implementing an experimental network protocol. I
> > have netfilter hook which changes the payload after the IP header
> > and the destination IP in packets with a certain protocol id. This
> > part works.
> >
> > For some packets, I need to generate an extra packet. To do this, I
> > copy the sk_buff, modify stuff on the copy and try sending it with
> > dev_queue_xmit(), then modify the original and return NF_ACCEPT.
> > The result is: the original get through (the one with NF_ACCEPT)
> > but the copy doesn't.
> >
> > Here's the code for copying and sending the copy:
> >
> > static void send_payload(struct sk_buff *skb, struct in_addr rloc)
>
> Where do you call this function? Immediately before the ip stack
> calls dev_queue_xmit? If not, the ip stack might not have finished
> building the packet.
>
>   -Michi

Hi,

This function is called from an ipfilter hook, which is registered at 
IP_PRE_ROUTING. I replace some data, but I don't do the routing so the 
correct MAC header is not created. After discovering this, I tried three 
approaches:

* Calling ip_route_input and then dev_queue_xmit() - same as before, I 
  get the IP header in place of the MAC header
* Calling ip_queue_xmit() - which does routing as well, I checked the
  implementation - I get a kernel panic
* Futile, but just in case, ip_route_input() and ip_queue_xmit() -
  kernel panic

It seems that ip_queue_xmit should be what I need, I don't know why it 
crashes...

Thanks and regards,
Lori

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: sending kernel data to user application

2009-07-22 Thread Mulyadi Santosa
Hi...

I hope you don't mind if I cc my reply to kernelnewbies mailing list
too...so that you can get more response..

On Wed, Jul 22, 2009 at 4:03 PM, krushnaal pai wrote:
> sir,
> how can we send data from kernel space to user application...

AFAIK, most people use netlink socket. But since it seems that you
want alternative ways

> also i had an article on that but they have used sockets ,i want one that
> doesnt use sockets

if you mean "send data" as "user space read data from kernel space by
polling certain file descriptor", then you can create /proc or /sys or
debugfs entries, assign the file operation in it. Then when a user
space program read the entry, kernel simply send the data to the
reader.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: A trivial I/O module - Error [SOLVED]

2009-07-22 Thread Paulo da Silva
Paulo da Silva escreveu:
> Paulo da Silva escreveu:
>
> I further simplified this ...
> Now, everything I have is reading a page after sector 1 (sector 0 also
> fails).
> Why does err come with -5?
> What am I doing wrong?
>
> ...

> bio->bi_rw=0;
> clear_bit(BIO_UPTODATE,&bio->bi_flags);
>   
The problem is here! We must set the BIO_UPTODATE bit. Not clear it.
That's what bio_alloc does anyway. So we may just ommit setting this bit
unless reusing the bio.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: compiling user space and kernel space code in single makefile

2009-07-22 Thread Rishi Agrawal
Hello,


On Sat, Jul 18, 2009 at 7:22 PM, Mulyadi Santosa
wrote:

> On Sat, Jul 18, 2009 at 3:26 PM, Rishi Agrawal
> wrote:
> > Hello All,
> >
> > I have this particular directory Hierarchy
> >
> > foo
> > |
> > |__ include(directory)
> > |
> > |__kernel(directory)
> > |
> > |__user_space(directory)
> >
> >
> > Include directory has the header file which is required by both the
> kernel
> > space code and the user space code
> >
> > kernel has a character device driver, and a kern_make_file.mk to compile
> the
> > chardev
> >
> > user_space has the user space code, make_file and the configure script.
> >
> > I want to compile the chardev using the user space make file
> >
> > for this I added a line "include kern_make_file.mk" in the user space
> make
> > file
> >
> > but it is giving me the warnings and does not compile the user space code
> >
> > the warnings are :
> >
> > Makefile:16: warning: overriding commands for target `all'
> > ../kernel/make_kernel.mk:8: warning: ignoring old commands for target
> `all'
>
> Is there "all" target in your kernel makefile? seems there is a
> clash Perhaps you need to show us the content of your Makefile,
> both for user and kernel space code, to ease clarification...
>
> > Moreover I would like to know wether it is possible to compile the user
> > space code and kernel space code in one make file
>
> I think yes, you just need to be careful for things like : CFLAGS
> (likely it will be different for user and kernel code), include path
> and so on.
>
> So, to avoid headache, I think it's better to separate the Makefile
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer
> blog: the-hydra.blogspot.com
>

I have used separate makefiles and added this piece of code in the Makefile
in the topmost directory

@for dir in ${subdirs}; do \
  (cd $$dir && $(MAKE) all) \
  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"

This loop goes into each and subdir and executes "make"





-- 
Regards,
Rishi B. Agrawal
http://www.linkedin.com/in/rishibagrawal
http://code.google.com/p/fscops/


Re: simulating the kernel crash and kernel panic

2009-07-22 Thread Srdjan Todorovic
Hi,

On 21/07/2009, H M Thalib  wrote:

> You are exactly correct. I want to check whether my kernel is stable or
> it is having any loop holes left. I hope this types of test should be
> conducted by the kernel testers/Linux distribution Maintainer as a
> routine test. to check whether their system is stable with the kernel.

This reminds me a lot of Fuzz Testing. There was a nice
paper/slides/video done by one security researcher (search "Fuzzing"
by Ilja van Sprundel), and I think he mentioned that you can also fuzz
syscalls/ioctls. So you could in theory also fuzz some of the files in
/sys.

eg. a fuzzing tool called 'mangle' broke "linux 2.4.29 XFS image
loading" (whatever image here means)

Another tool called 'sysfuzz' broke MacOS X.

Have a look for his work - it might be useful.

Hope that helps,
Srdjan

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: simulating the kernel crash and kernel panic

2009-07-22 Thread Rahul K Patel

H M Thalib wrote:

SandeepKsinha wrote:

Hi Thalib,


On Tue, Jul 21, 2009 at 9:56 PM, H M Thalib > wrote:


Mulyadi Santosa wrote:

On Mon, Jul 20, 2009 at 10:54 PM, H M Thalibmailto:hmtha...@gmail.com>> wrote:

I want to test my kernel for stability. Can you help me in
artificially
simulating the kernel crash, kernel panic scenarios. Is
there any
standard way to simulate it. maybe by running applications,
scripts. but
I dont want to modify anything in the kernel space.


Try to study fault-injection. It's documented in
Documentation/fault-injection.txt inside kernel source tree.
Never use
it 'til now, so I only can give you a clue.


Thanks -

But this steps involves in kernel space,

I am looking for producing kernel panic/crash/hang by running some
script/application in user space - Is there any tool/standard
defined way to do that


Why do you feel that you would be able to achieve this? Don't you 
think that such scripts would then we used as a malware.


I think in order to have such a protection we have a user space and a 
kernel space. You can panic/hang  user space processes using user 
space programs unless you have a loop hole in the kernel 
implementation. Which no one will put intentionally.
 



You are exactly correct. I want to check whether my kernel is stable 
or it is having any loop holes left. I hope this types of test should 
be conducted by the kernel testers/Linux distribution Maintainer as a 
routine test. to check whether their system is stable with the kernel.



you can try this out.

http://www.linkedin.com/news?viewArticle=&articleID=51231726&gid=49301&articleURL=http%3A%2F%2Fblogs.computerworld.com%2Fa_linux_security_story&urlhash=tVha
http://lwn.net/Articles/341773/

Regards,
Rahul Patel

--
_
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
_


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: Ram Disk

2009-07-22 Thread Jeffrey Cao
On 2009-07-21, Darvin Denmian  wrote:
> Use tmpfs instead Ram Disk is a better option?
>

tmpfs is out of date, use ramfs instead.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: PS/2 Mouse Driver

2009-07-22 Thread Pei Lin
i am not an expert for ps2 mouse,but i find a article about it.
http://www.computer-engineering.org/ps2mouse/

note:
there is a conclusion about command set "
Command Set:

The following is the set of command accepted by the standard PS/2
mouse.  If the mouse is in Stream mode, the host should disable data
reporting (command F5h) before sending any other commands.
"

IMO, i think before u set your sample rate,u need firstly disable data
reporting.

So i think your operation sequence maybe has some problem.

BRs,

Lin


> 2009/7/21 Yousef Alhashemi :
>> Hello again,
>>
>> I'm sorry to post about this again, but I didn't get any response last time
>> and I'm just wondering if anyone can explain this behavior for me. Shouldn't
>> changing psmouse_rate change the frequency at which the mouse polling
>> routines (or whatever) get data from the mouse?
>>
>> Thanks,
>> Yousef
>>
>>
>> 2009/4/25 Yousef Alhashemi 
>>
>>> Hello list,
>>>
>>> So I'm messing around with the PS/2 mouse driver
>>> (drivers/input/mouse/psmouse-base.c), and I'm wondering what the
>>> psmouse_rate variable is for. From the source file itself, the rate
>>> parameter of the module is described as "Report rate, in reports per
>>> second". The description is pretty straightforward, but I'm asking because
>>> when I changed that value to 1 (i.e. the mouse is now supposed to report
>>> changes in state every one second), the mouse was still very responsive (and
>>> the cursor location was updated immediately as opposed to updating every
>>> full second as I was expecting). In other words, changing psmouse_rate from
>>> 100 to 1 didn't seem to have any effects on the "report rate" (if my
>>> understanding of "report rate" is correct).
>>>
>>> Thanks,
>>> Yousef
>>>
>>
>>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ



Re: PS/2 Mouse Driver

2009-07-22 Thread Pei Lin
i am not an expert for ps2 mouse,but i find a article about it.
http://www.computer-engineering.org/ps2mouse/

note:
there is a conclusion about command set "
Command Set:

The following is the set of command accepted by the standard PS/2
mouse.  If the mouse is in Stream mode, the host should disable data
reporting (command F5h) before sending any other commands.
"

IMO, i think before u set your sample rate,u need firstly disable data
reporting.

So i think your operation sequence maybe has some problem.

BRs,

Lin

2009/7/21 Yousef Alhashemi :
> Hello again,
>
> I'm sorry to post about this again, but I didn't get any response last time
> and I'm just wondering if anyone can explain this behavior for me. Shouldn't
> changing psmouse_rate change the frequency at which the mouse polling
> routines (or whatever) get data from the mouse?
>
> Thanks,
> Yousef
>
>
> 2009/4/25 Yousef Alhashemi 
>
>> Hello list,
>>
>> So I'm messing around with the PS/2 mouse driver
>> (drivers/input/mouse/psmouse-base.c), and I'm wondering what the
>> psmouse_rate variable is for. From the source file itself, the rate
>> parameter of the module is described as "Report rate, in reports per
>> second". The description is pretty straightforward, but I'm asking because
>> when I changed that value to 1 (i.e. the mouse is now supposed to report
>> changes in state every one second), the mouse was still very responsive (and
>> the cursor location was updated immediately as opposed to updating every
>> full second as I was expecting). In other words, changing psmouse_rate from
>> 100 to 1 didn't seem to have any effects on the "report rate" (if my
>> understanding of "report rate" is correct).
>>
>> Thanks,
>> Yousef
>>
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ