lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwip and MPU (FreeRTOS-MPU)


From: Simon Goldschmidt
Subject: Re: [lwip-users] lwip and MPU (FreeRTOS-MPU)
Date: Thu, 30 Aug 2012 09:51:33 +0200

jblackarty wrote:
> An: Ivan Delamer <address@hidden>, Mailing list for lwIP users 
> <address@hidden>
> Betreff: Re: [lwip-users] lwip and MPU (FreeRTOS-MPU)

> > Question: is it important for your application thread and the tcpip
> thread
> > to be in different protected memory regions? is it possible for that
> > memory to be accessed by both threads?
> 
> As I said already, I did it so. I've placed application thread stack
> in separate memory region and added this region to user
> memory regions of tcpip thread with read/write access. Thanks to this,
> I was able to run my tcpip-enabled application.
> 
> Is it important to avoid this in my application ?
> [..]

To me, the essence of what you wrote is that the system doesn't run stable. 
That's of course a problem, but it wouldn't run stable with protected threads, 
either. So while I also think that protecting the thread's stacks against each 
other would be a good thing, the lack of this protection doesn't seem to be the 
cause of your problems!

> Please, note that I didn't even talk about such
> details like that there are chaos is going in whole global
> memory shared between tasks, and network-enabled part of my
> application is not adequate anymore.

What kind of chaos in global shared memory are you talking about?

> [..]
> Nothing can crash kernel, provided that tasks are
> run in user-mode and each task has no access to other tasks threads.
> LwIP thread is the only thread which violates this...

"Nothing can crash kernel": this would only hold for a kernel that is strictly 
seperated from tasks stacks and very strictly checks arguments passed from 
threads to kernel functions, wouldn't it? Is FreeRTOS-MPU designed like that?

As a summary, lwIP's multithreading design should certainly be improved if used 
in situations like that. However, the fact remains that global memory like 
pbufs is still shared (e.g. between ISR, tcpip_thread and application threads), 
so I don't think you would gain too much security unless protecting most pools.

The reason for all this is that lwIP has not been designed for MPU systems. It 
has been designed for very small systems at a time where MPUs were not 
available for systems of that size.


Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]