Re: Spinlocks & schedule_timeout

2013-12-25 Thread SaNtosh kuLkarni
Sent from my Sony Xperia™ smartphone
On Dec 25, 2013 4:16 PM, "Pranay Srivastava"  wrote:
>
> Hi santosh
>
> I hope you understand difference between semaphores and spin locks.
>

Ya I am completely aware of sleeping locks n spin locks
> If however you are stuck a situation where you can afford being preempted
then you can use sem/mutex. But i think your serialization requires that
you use spin locks then best is to have a guarded variable with spin lock
and release the lock before you schedule.
>

I just wanted to verify if it was possible n if yes considering preemption
is disabled..
> Even if you set the state preempt count would be increased when you
acquire spin lock. so you Cant schedule or go to sleep after spin lock.
>

Since schedule_timout would make sure the task remains on the run queue and
intended to be scheduled back after the specificed jeffies period. It was
just out of curiosity anyway .Thanks !!!

> Regards
>
> On Dec 25, 2013 3:36 PM, "SaNtosh kuLkarni" 
wrote:
>>
>> Hi,
>>
>> I wanted to verify/clarify if using schedule_timeout after acquiring a
spinlock is safe?. So basically you have a situation where you are working
on a critical code and you acquire a spin lock and you end up using
a schedule_timeout after say setting the current task to Interruptible
state 'cause you are waiting for some user space code to fill in some
buffer from which you want to read.
>> So my doubt is simple, is it safe to acquire a spinlock and use
schedule_timeout.
>> I assume the task is put in the run queue and will "ALWAYS"
be scheduled back after the specified delay in schedule_timeout.
>>
>> --
>> Regards,
>> Santosh
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Spinlocks & schedule_timeout

2013-12-25 Thread SaNtosh kuLkarni
Hi,

I wanted to verify/clarify if using schedule_timeout after acquiring a
spinlock is safe?. So basically you have a situation where you are working
on a critical code and you acquire a spin lock and you end up using
a schedule_timeout after say setting the current task to Interruptible
state 'cause you are waiting for some user space code to fill in some
buffer from which you want to read.
So my doubt is simple, is it safe to acquire a spinlock and use
schedule_timeout.
I assume the task is put in the run queue and will "ALWAYS"
be scheduled back after the specified delay in schedule_timeout.

-- 

*Regards,Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


NFSv4/SUNRPC kernel cache

2013-07-01 Thread SaNtosh kuLkarni
Hi,

Can anyone briefly help me understand on how the upcall/downcall/cache
management interface (used for kernel and user space daemon communication
interface) of SUNRPC (as seen in NFSv4) works exactly.

A documenation link would suffice else a brief explanation would be fine.


-- 
*Regards,
Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: can i replace a .S file with .c file.

2013-01-07 Thread SaNtosh kuLkarni
Hi Anuz,

say if i want to replace checksum with a checksum.c considering say if i
get a better performance , what needs to be done,

Thanks


On Mon, Jan 7, 2013 at 7:09 PM, Anuz Pratap Singh Tomar <
chambilketha...@gmail.com> wrote:

>
>
> On Mon, Jan 7, 2013 at 12:34 PM, SaNtosh kuLkarni <
> santosh.yesop...@gmail.com> wrote:
>
>> Hi is it possible that the assembly code .S file in linux kernel be
>> replaced by a .C file.
>>
>> This seems like a very general question. Which file do you want to
> replace and why?
> You should understand that any *.S file contains arch specific code, which
> is written in assembly for optimization/efficiency reasons. Replacing it
> with an equivalent C code may undermine those goals.
>
> --
>> *Regards,
>> Santosh*
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
> Thank you
> Warm Regards
> Anuz
>



-- 
*Regards,
Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


can i replace a .S file with .c file.

2013-01-07 Thread SaNtosh kuLkarni
Hi is it possible that the assembly code .S file in linux kernel be
replaced by a .C file.

-- 
*Regards,
Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Callback function from kernel module

2012-11-07 Thread SaNtosh kuLkarni
I think you are looking for Upcall Functionality

upcall functionality allows a kernel module to invoke a function in user
space. It is possible to start a program in user space, and give it some
command line arguments, as well as setting environment variables.


**
int call_usermodehelper  (char * *path*, char ** *argv*, char ** *envp*,
int *wait*);

Runs a user-space application. The application is started asynchronously if
wait is not set, and runs as a child of keventd. (ie. it runs with full
root capabilities).

Must be called from process context. Returns a negative error code if
program was not execed successfully, or 0.

**man pages

Regards

Santosh



On Wed, Nov 7, 2012 at 8:30 PM, Bernd Petrovitsch  wrote:

> Hi!
>
> On Sam, 2012-11-03 at 19:14 +0530, Jeshwanth Kumar N K Jeshu wrote:
> [...]
> > Can I call userspace function from kernel module ? Actually I need to
> > process some data in user space for every event occured in kernel module.
>
> The usual way to implement this with a character device. The userspace
> application opens the character device. It then read()s the events from
> it, handles it and write()s results back (if needed).
> The kernel part handles to IRQs, puts that into a buffer where it waits
> for the read() from user space.
>
> You can use netlink sockets for this which may save some code though or
> implement a character device directly.
>
> Kind regards,
> Bernd
> --
> Bernd Petrovitsch  Email : be...@petrovitsch.priv.at
>  LUGA : http://www.luga.at
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
*Regards,
Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Encfs detailed design guide?!! [hope this is relevant to this forum]

2012-05-27 Thread SaNtosh kuLkarni
Thanks bill ..rohan ..will into them ..
On 25-May-2012 7:35 PM, "rohan puri"  wrote:

>
>
> On Fri, May 25, 2012 at 7:24 PM, Bill Traynor  wrote:
>
>> On Fri, May 25, 2012 at 9:36 AM, SaNtosh kuLkarni
>>  wrote:
>> > Any help regarding Encfs (encrypted file system) detailed design.
>> > Any suitable link would be helpful.Thanks.
>>
>> See:  http://en.wikipedia.org/wiki/ECryptfs
>>
>> And relevant references therein.
>>
>> >
>> > --
>> > Regards,
>> > Santosh
>> >
>> >
>> > ___
>> > Kernelnewbies mailing list
>> > Kernelnewbies@kernelnewbies.org
>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
> Hi Santosh,
>
> The basic design concept is of stackable file system. You can get the
> paper for wrapfs by Prof. Erez Zadok (which is also a stackable file
> system) from internet.
>
> - Rohan
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Encfs detailed design guide?!! [hope this is relevant to this forum]

2012-05-25 Thread SaNtosh kuLkarni
Any help regarding Encfs (encrypted file system) detailed design.
Any suitable link would be helpful.Thanks.

-- 
*Regards,
Santosh*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Looking for small Confirmation about skb_pull & NF_ACCEPT !!!

2012-04-05 Thread SaNtosh kuLkarni
are u doin some sort of tunneling ?

On Fri, Apr 6, 2012 at 6:03 AM, Sri Ram Vemulpali
wrote:

> Whenever you manipulate the packet before PRE_ROUTING point in the
> stack, the kernel will decide whether to route the packet to LOCAL or
> FORWARD. If you have pointer pointing to right IP header kernel will
> use it to route. You really do not have to write routing code.
>
> Also, when you say inner and outer header what do you mean by it. I
> did not encounter this.
>
> Thanks,
> Sri.
>
> On Thu, Apr 5, 2012 at 5:00 AM, SaNtosh kuLkarni
>  wrote:
> > i had a similar problem where in i was using SKB_PUSH to add extra
> > header i used this... structure called flowi which can be used to
> > define a sort of traffic class...based on some combination of fields
> >
> >
> > iph->daddr =htonl(xx);
> > {
> > struct rtable *rt;
> > struct flowi fl;
> > memset(&fl, 0x0, sizeof(struct flowi));
> > fl.fl4_dst  = htonl(xxx);
> > fl.proto = IPPROTO_TCP;
> > if (!ip_route_output_key(&init_net, &rt, &fl))
> > {
> > iph->saddr= htonl(ntohl(rt->rt_src));
> >
> > skb_dst_set(skb2, &rt->u.dst);
> >
> > }
> >
> > }
> >
> >
> > On Mon, Apr 2, 2012 at 2:12 PM, Kesava Srinivas  >
> > wrote:
> >>
> >> HI Friends,
> >> Looking for a Confirmation on my analysis.
> >>
> >> Once after Capturing the Socket Buffer in PRE_ROUTING Hook; Manipulated
> >> the Socket Buffer by using the "skb_pull" Kernel Function. Using
> skb_pull;
> >> stripped 28 bytes (IP+UDP) which are the Part of outer UDP/IP Header.
> Now;
> >> My intention was to route the skb based on the Inner IP Header which is
> >> sitting after stripping 28 bytes. At the END; returned NF_ACCEPT.
> >>
> >> Even though; skb_pull worked Fine., Kernel's Stack is still looking in
> to
> >> Outer Header only for Routing the Packet.I expected ;Kernel will look
> the
> >> Inner Header (As data Pointer was incremented by 28 bytes via skb_pull)
> and
> >> Take decision based on the Inner one. But; that didn't  happened. It
> looks
> >> to me like; we need to always use NF_STOLEN & should write our own code
> to
> >> route based on the INNER HEADER. Was my conclusion correct ??
> >>
> >> -Thanks in Advance,
> >> VKS
> >>
> >>
> >>
> >> ___
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >>
> >
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
>
>
> --
> Regards,
> Sri.
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Looking for small Confirmation about skb_pull & NF_ACCEPT !!!

2012-04-05 Thread SaNtosh kuLkarni
i had a similar problem where in i was using SKB_PUSH to add extra
header i used this... structure called flowi which can be used to
define a sort of traffic class...based on some combination of fields


iph->daddr =htonl(xx);
{
struct rtable *rt;
struct flowi fl;
memset(&fl, 0x0, sizeof(struct flowi));
fl.fl4_dst  = htonl(xxx);
fl.proto = IPPROTO_TCP;
if (!ip_route_output_key(&init_net, &rt, &fl))
{
iph->saddr= htonl(ntohl(rt->rt_src));

skb_dst_set(skb2, &rt->u.dst);

}

}


On Mon, Apr 2, 2012 at 2:12 PM, Kesava Srinivas wrote:

> HI Friends,
> Looking for a Confirmation on my analysis.
>
> Once after Capturing the Socket Buffer in PRE_ROUTING Hook; Manipulated
> the Socket Buffer by using the "skb_pull" Kernel Function. Using skb_pull;
> stripped 28 bytes (IP+UDP) which are the Part of outer UDP/IP Header. Now;
> My intention was to route the skb based on the Inner IP Header which is
> sitting after stripping 28 bytes. At the END; returned NF_ACCEPT.
>
> Even though; skb_pull worked Fine., Kernel's Stack is still looking in to
> Outer Header only for Routing the Packet.I expected ;Kernel will look the
> Inner Header (As data Pointer was incremented by 28 bytes via skb_pull) and
> Take decision based on the Inner one. But; that didn't  happened. It looks
> to me like; we need to always use NF_STOLEN & should write our own code to
> route based on the INNER HEADER. Was my conclusion correct ??
>
> -Thanks in Advance,
> VKS
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: kernel boot procedure

2012-03-04 Thread SaNtosh kuLkarni
I guess this is wot u r looking for ..not sure thou..

 initial RAM filesystem is bsasically a ramfs which is loaded by the  boot
loader (loadlin or lilo) and that is mounted as root  before the normal
boot procedure is done and is typically used to  load modules needed to
mount the original root file system,[[[Documentation/initrd.txt

If BLK_DEV_RAM is also included it also enables initial RAM disk (initrd)
support and adds 15 Kbytes (more on some other architectures) to the kernel
size.

On Sun, Mar 4, 2012 at 3:15 AM, Manavendra Nath Manav
wrote:

> On Sun, Mar 4, 2012 at 2:46 AM, beyond.hack  wrote:
> > ***when bootloader in bios executes its code, it do POST and
> other
> > things...then as I read from somewhere  kernel does initrd to load some
> > basic modules so as to mount the root file system and then removes the
> > initrd fs.
> > (srry my mistake)
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
> Quoting from Understanding the Linux Kernel:
>
> The LILO boot loader is too large to fit into a single sector, thus it
> is broken into two parts. The
> MBR or the partition boot sector includes a small boot loader, which
> is loaded into RAM starting from
> address 0x7c00 by the BIOS. This small program moves itself to the
> address 0x00096a00, sets up
> the Real Mode stack (ranging from 0x00098000 to 0x000969ff), loads the
> second part of the LILO boot
> loader into RAM starting from address 0x00096c00, and jumps into it.
>
> The LILO boot loader, which relies on BIOS routines, performs
> essentially the following operations:
> 1. Invokes a BIOS procedure to display a "Loading" message.
> 2. Invokes a BIOS procedure to load an initial portion of the kernel
> image from disk: the first 512 bytes of the kernel image are put in
> RAM at address 0x0009, while the code of the setup( ) function is
> put in RAM starting from address 0x00090200.
> 3. Invokes a BIOS procedure to load the rest of the kernel image from
> disk and puts the image in RAM starting from either low address
> 0x0001 (for small kernel images compiled with make zImage) or high
> address 0x0010 (for big kernel images compiled with make bzImage).
> We say that the kernel image is "loaded low" or "loaded high" in RAM,
> respectively.
> 4. Jumps to the setup( ) code.
>
> So, you see the init routine is run only after the kernel has been
> loaded in RAM.
>
> --
> Manavendra Nath Manav
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Semaphore

2012-02-22 Thread SaNtosh kuLkarni
 as a result the driver will release
> > the lock.
> >
> > In the second case:
> > A kernel thread has a lock held, for whatever reason. It can be
> > terminated for a variety of reasons (*all* of them bugs or hardware
> > problems). For example it fails a BUG_ON check, or causes a fault by
> > accessing unmapped memory. In that case the oops handler will terminate
> > the thread, but in that case the lock will still be held, and never
> > unlocked.
> > This results in an incorrect state of the kernel! Some things might
> > still work, others will be broken.
> >
> > Regards,
> > Kristof
> >
> >
> > ___
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>
> --
> Regards,
> Sri.
>



-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Semaphore

2012-02-21 Thread SaNtosh kuLkarni
A certain  kernel process has acquired a semaphore lock and meanwhile
during this period the process gets killed abruptly (and it has not
released the sem lock..//.sem down).and the other processes cannot
acquire the lock, what can be done in this case.

-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to read and manipulate IP header using Java.

2012-02-04 Thread SaNtosh kuLkarni
On Sun, Feb 5, 2012 at 10:30 AM, Prashant Patil
wrote:

> 
>
> Hello,
>
>I am doing a project, titled “Steganography using TCP/IP”. In
> this project, first we have to encrypt the secret message that sender wants
> to send for the receiver. After encrypting, embed that cipher data into
> image file, the output is as a stego image and that stego image we have to
> store in unused field of ip header. Like, identification field is used only
> when fragmentation occurs, if we avoid fragmentation then identification
> field is always be unused, we can store our stego imgae in it. I have
> completed Encryption and Embedding part, but problem with the IP header.
> Please suggest how to read IP header using JAVA.
>
> Thanks in advance…
>
>
>
>
>
> Regards,
>
> Prashant Patil.
>



If you want to manipulate packet headers in linux network stack you can use
a framework called netfilter and work around with skbuff by writing a LKM,
you can then provide an interface so that ur java application can read it
out or pass required parameters in the user land application.


> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Writing to kernel address space && KWE UWE bits in PTE

2012-02-03 Thread SaNtosh kuLkarni
My doubt is when , in a, say 3:1 partition of kernel user space address
space, if a user space application tries to write/access the 1gb portion of
kernel space which it cant, is it because there is not page table entry in
the user space process page table entry or. is it because of a PTE
 ( page table entry)  entry related to access control set to KWE and a
kernel trap occurs.What events take place when a user land process tries to
write to kernel space address.

-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: from where to start..

2012-01-21 Thread SaNtosh kuLkarni
On Sat, Jan 21, 2012 at 4:21 PM, Javier Martinez Canillas <
martinez.jav...@gmail.com> wrote:

> On Sat, Jan 21, 2012 at 4:52 AM, SaNtosh kuLkarni
>  wrote:
> > Hi Sukrit,
> >
> > Ya kernel development..kernel space is fun...but since kernel has loads
> of
> > subsystems...you must be or will be later interested in certain
> > subsytems,,,but you ought to understand the basic working and operations
> > carried by a kernel and sorting of programming and structures
> required...i
> > would suggest Kernel Development by Rober Love
> >
> >
> http://blog.rlove.org/2010/07/linux-kernel-development-third-edition.html
> >
> >  as he doesnt dig deep into core kernel development instead focuses on
> stuff
> > such as Process mgnt , synchronization ,VFS...etc etc...in a rather
> simple
> > easy to understand manner...but if you are interested or rather want to
> get
> > into specific subsystems like Networking ...network stack,...etc you can
> > always start off with network internals...but my suggestion is Robert
> Love
> > and start of writing few LKMstats my opinion
> >
> > On Sat, Jan 21, 2012 at 6:58 AM, Jeff Haran 
> wrote:
> >>
> >>
> >>
> >> From: kernelnewbies-boun...@kernelnewbies.org
> >> [mailto:kernelnewbies-boun...@kernelnewbies.org] On Behalf Of Sukrit
> Sangwan
> >> Sent: Friday, January 20, 2012 4:19 PM
> >> To: Kernelnewbies@kernelnewbies.org
> >> Subject: from where to start..
> >>
> >>
> >>
> >> I want to become a kernel developer. I have never done anything related
> to
> >> kernel uptil now. I am unable to figure out how to start off. Please
> help me
> >> doing my first exercise on kernel development.
> >>
> >>
> >>
> >> --
> >>
> >> Sukrit Sangwan
> >>
>
> Hi Sukrit,
>
> People ask me this a lot so I wrote a post in blog about it, you can
> read it here:
>
>
> http://martinezjavier.blogspot.com/2011/10/what-is-best-way-to-learn-linux-kernel.html
>
> Also I used to maintain a repo with the Linux Device Drivers 3 book
> examples:
>
>
> But I haven't committed anything for over a year because I'm too busy
> to do it. So cloning that tree, forward porting those virtual drivers
> and send me the patches would be a good way to learn and also great
> for the newbies community.
>
> Even you can fork that tree and try to maintain yourself :)
>
> Good luck
> Javier
>

Hi Javier,

Thats a really nice blog you have mate.and examples and ideas you have
posted is really good...even thou our opinions are similar the android
porting that you have mentioned is a really good way,

-- 
*  \m / Cheers \m/
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Calling a module method from inside the kernel - is it possible Inbox

2012-01-21 Thread SaNtosh kuLkarni
Can you be more specific...wot do u mean by inside the kerneldo like
want to call a function written inside another kernel module

On Sat, Jan 21, 2012 at 3:38 PM, Kevin Wilson  wrote:

> Hi, all,
>
> I want to calling a module method  (I am developing the module)
> from inside the kernel. How can I achieve it ?
>
> (BTW, I know that vice versa is possible by EXPORT_SYMBOL.)
>
> rgs,
> Kevin
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: from where to start..

2012-01-20 Thread SaNtosh kuLkarni
Hi Sukrit,

Ya kernel development..kernel space is fun...but since kernel has loads of
subsystems...you must be or will be later interested in certain
subsytems,,,but you ought to understand the basic working and operations
carried by a kernel and sorting of programming and structures required...i
would suggest Kernel Development by Rober Love

http://blog.rlove.org/2010/07/linux-kernel-development-third-edition.html

 as he doesnt dig deep into core kernel development instead focuses on
stuff such as Process mgnt , synchronization ,VFS...etc etc...in a rather
simple easy to understand manner...but if you are interested or rather want
to get into specific subsystems like Networking ...network stack,...etc you
can always start off with network internals...but my suggestion is Robert
Love and start of writing few LKMstats my opinion

On Sat, Jan 21, 2012 at 6:58 AM, Jeff Haran  wrote:

> ** **
>
> *From:* kernelnewbies-boun...@kernelnewbies.org [mailto:
> kernelnewbies-boun...@kernelnewbies.org] *On Behalf Of *Sukrit Sangwan
> *Sent:* Friday, January 20, 2012 4:19 PM
> *To:* Kernelnewbies@kernelnewbies.org
> *Subject:* from where to start..
>
> ** **
>
> I want to become a kernel developer. I have never done anything related to
> kernel uptil now. I am unable to figure out how to start off. Please help
> me doing my first exercise on kernel development.
>
> ** **
>
> -- 
>
> Sukrit Sangwan
>
> B.Arch. III Yr.
>
> IIT Roorkee
>
> ** **
>
> Assuming you are competent in programming C and want to dive right in, the
> below might be a good place to start:
>
> ** **
>
> http://kernelnewbies.org/KernelJanitors
>
> ** **
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does Linux process exist information leakage?

2012-01-19 Thread SaNtosh kuLkarni
sorry guys did not read tat properly..he is just referring to user
spaceas far malloc is concerned it basically calls *brk*() and
*sbrk() * tand
they basically end up changing the location of thelocation of program break
which is nothing but  the end of the process's data segment so it has
nothing to do with u getting any info or any memory leaks...i mean not too
specific to PDT...or any such previously exited processes...

2012/1/19 SaNtosh kuLkarni 

> am not sure about my answer but regarding kmalloc if i am going out of
> context ..but when u do a* kmalloc it doesnt clear *the memory obtained
> and still holds the prvious contents...what happens in that case ..and as
> far as i know when u take the case of reparenting during process
> termination  exit_mm() is called to release the mm_struct held by this
> process. If no other process
> is using this address space, if the address space is not shared―the
> kernel then destroys it and also there is the senario of zombie exit...i
> mean PDT remains after parent exits
>
>
> 2012/1/19 夏业添 
>
>> Thanks!
>>
>> It seems that the function do_page_fault() will finally call
>> fast_clear_page()<http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L125>
>>  or 
>> slow_zero_page()<http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L336>
>>  to
>> zero a new physical page for a process. So calling malloc() cannot get a
>> page used by another process which is dead already.
>>
>> The assemble language is difficult to me, so please tell me if I am wrong.
>>
>> 2012/1/18 Fredrick 
>>
>>> When you malloc a memory or mmap a MAP_ANON memory, it is virtually
>>> allocated. When you read or write to it, the process takes a page fault.
>>> The page fault handler zeroes those memory and hands it to the process. So
>>> I think there is no leak.
>>>
>>> -Fredrick
>>>
>>>
>>> On 01/11/2012 04:53 AM, 夏业添 wrote:
>>>
>>>> Hi,
>>>>My tutor asked me to test whether one process leaves information in
>>>> memory after it is dead. I tried to search some article about such thing
>>>> on the Internet but there seems to be no one discuss about it. And after
>>>> that, I tried to write some program in the User Mode to test it, using
>>>> fork() to create lots of processes and filling char 'a' into a 102400
>>>> bytes char array in each process. Then I used malloc() to get some
>>>> memory to seek char 'a' in a new one process or many new processes, but
>>>> failed. All memory I malloced was full of zero.
>>>>As the man page of malloc said:"The memory is not initialized", I
>>>> believe that the memory which was got by malloc() could be used by other
>>>> process, and therefor information leakage exists. But how can I test it?
>>>> Or where can I get related information?
>>>>Thanks!
>>>>
>>>>
>>>> ______**_____
>>>> Kernelnewbies mailing list
>>>> Kernelnewbies@kernelnewbies.**org 
>>>> http://lists.kernelnewbies.**org/mailman/listinfo/**kernelnewbies<http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
>>>>
>>>
>>>
>>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
> *Regards,
> Santosh Kulkarni*
>
>


-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Does Linux process exist information leakage?

2012-01-18 Thread SaNtosh kuLkarni
am not sure about my answer but regarding kmalloc if i am going out of
context ..but when u do a* kmalloc it doesnt clear *the memory obtained and
still holds the prvious contents...what happens in that case ..and as far
as i know when u take the case of reparenting during process
termination  exit_mm() is called to release the mm_struct held by this
process. If no other process
is using this address space, if the address space is not shared―the
kernel then destroys it and also there is the senario of zombie exit...i
mean PDT remains after parent exits


2012/1/19 夏业添 

> Thanks!
>
> It seems that the function do_page_fault() will finally call
> fast_clear_page()<http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L125>
>  or 
> slow_zero_page()<http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L336>
>  to
> zero a new physical page for a process. So calling malloc() cannot get a
> page used by another process which is dead already.
>
> The assemble language is difficult to me, so please tell me if I am wrong.
>
> 2012/1/18 Fredrick 
>
>> When you malloc a memory or mmap a MAP_ANON memory, it is virtually
>> allocated. When you read or write to it, the process takes a page fault.
>> The page fault handler zeroes those memory and hands it to the process. So
>> I think there is no leak.
>>
>> -Fredrick
>>
>>
>> On 01/11/2012 04:53 AM, 夏业添 wrote:
>>
>>> Hi,
>>>My tutor asked me to test whether one process leaves information in
>>> memory after it is dead. I tried to search some article about such thing
>>> on the Internet but there seems to be no one discuss about it. And after
>>> that, I tried to write some program in the User Mode to test it, using
>>> fork() to create lots of processes and filling char 'a' into a 102400
>>> bytes char array in each process. Then I used malloc() to get some
>>> memory to seek char 'a' in a new one process or many new processes, but
>>> failed. All memory I malloced was full of zero.
>>>As the man page of malloc said:"The memory is not initialized", I
>>> believe that the memory which was got by malloc() could be used by other
>>> process, and therefor information leakage exists. But how can I test it?
>>> Or where can I get related information?
>>>Thanks!
>>>
>>>
>>> __**_
>>> Kernelnewbies mailing list
>>> Kernelnewbies@kernelnewbies.**org 
>>> http://lists.kernelnewbies.**org/mailman/listinfo/**kernelnewbies<http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
>>>
>>
>>
>>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Current Thread mapping

2012-01-15 Thread SaNtosh kuLkarni
Thanks Andi ,,Rohanfor the quick reply

ya you are rite ..i was asking bout kernel side scheduling user space
threads and how they handle them

On Sun, Jan 15, 2012 at 4:02 PM, Andi  wrote:

> **
> Hi Santi,
>
> I'm no sure that I've fully understood the question. What do you mean
> about mapping?
> If you mean kernel/user memory memory mapping, in the kernel there is not
> a mapping of the memory user task in the kernel.
> If with mapping you mean the relation between userspace task and
> scheduling entries, then the relation is 1:1.
> Remember that the kernel doesn't really know that there is a difference
> between process and threads, it's why they are called tasks, threads,
> process at the same way. The only difference is the way you create it in
> userspace. As soon as you create it in your userspace process, the kernel
> links it to a kernel structure called 'struct task_struct' (linux/sched.h)
> which contains many descriptions on the thread/process you have just
> created.
> 1 userpace thread:1 struct task_struct, this is what I mean with 1:1
> mapping
>
> Andi
>
> On 01/15/2012 10:32 AM, SaNtosh kuLkarni wrote:
>
> HI everyone just wanted to know whats the current implementation of user||
> kernel space thread mapping ...is it 1:1 or does it depend on the needs ?
> For example say if i have 12k user space thread running ,,,how many kernel
> space thread would be managing them... as far as i know there is 1:1 mappin
>
>  Thanks
>
>  --
> *Regards,
> Santi*
>
>
> ___
> Kernelnewbies mailing 
> listKernelnewbies@kernelnewbies.orghttp://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>


-- 
*Regards,
Santosh Kulkarni*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Current Thread mapping

2012-01-15 Thread SaNtosh kuLkarni
HI everyone just wanted to know whats the current implementation of user||
kernel space thread mapping ...is it 1:1 or does it depend on the needs ?
For example say if i have 12k user space thread running ,,,how many kernel
space thread would be managing them... as far as i know there is 1:1 mappin

Thanks

-- 
*Regards,
Santi*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies