Long-term locks

NTFSD Folk:

I’m using ERESOURCE locks to synchronize access to internal structures, but
there are times when I need to do things like file operations while holding
the lock.

As I understand it, doing file operations with APCs disabled is a Bad Thing.
So what is the “correct” way to hold a lock over file operations? Can I
just re-enable APCs (KeLeaveCriticalRegion) and keep the lock?

Ken

KeLeaveCriticalRegion while holding the resource is a
security hole.

The best thing to do is to change your design to not
hold the lock. If you don’t, you may not notice any
problems until other filters are introduced, etc…
These problems will pop up at the worst time :wink:

— Ken Cross wrote:

> NTFSD Folk:
>
> I’m using ERESOURCE locks to synchronize access to
> internal structures, but
> there are times when I need to do things like file
> operations while holding
> the lock.
>
> As I understand it, doing file operations with APCs
> disabled is a Bad Thing.
> So what is the “correct” way to hold a lock over
> file operations? Can I
> just re-enable APCs (KeLeaveCriticalRegion) and keep
> the lock?
>
> Ken
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

Randy:

I’m certainly not disputing you (hence the reason for the question in the
first place), but: Why?

If a thread has the lock, why is it a security hole to enable APCs? Other
threads that try to acquire the lock will still be blocked, won’t they?

Inquiring minds and all that…

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Randy Cook
Sent: Tuesday, September 20, 2005 12:43 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Long-term locks

KeLeaveCriticalRegion while holding the resource is a
security hole.

The best thing to do is to change your design to not
hold the lock. If you don’t, you may not notice any
problems until other filters are introduced, etc…
These problems will pop up at the worst time :wink:

— Ken Cross wrote:

> NTFSD Folk:
>
> I’m using ERESOURCE locks to synchronize access to
> internal structures, but
> there are times when I need to do things like file
> operations while holding
> the lock.
>
> As I understand it, doing file operations with APCs
> disabled is a Bad Thing.
> So what is the “correct” way to hold a lock over
> file operations? Can I
> just re-enable APCs (KeLeaveCriticalRegion) and keep
> the lock?
>
> Ken
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndevice/html/Locks_Sync.asp

Click on “Security Issues”

— Ken Cross wrote:

> Randy:
>
> I’m certainly not disputing you (hence the reason
> for the question in the
> first place), but: Why?
>
> If a thread has the lock, why is it a security hole
> to enable APCs? Other
> threads that try to acquire the lock will still be
> blocked, won’t they?
>
> Inquiring minds and all that…
>
> Ken
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf
> Of Randy Cook
> Sent: Tuesday, September 20, 2005 12:43 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] Long-term locks
>
> KeLeaveCriticalRegion while holding the resource is
> a
> security hole.
>
> The best thing to do is to change your design to not
> hold the lock. If you don’t, you may not notice any
> problems until other filters are introduced, etc…
> These problems will pop up at the worst time :wink:
>
> — Ken Cross wrote:
>
> > NTFSD Folk:
> >
> > I’m using ERESOURCE locks to synchronize access to
> > internal structures, but
> > there are times when I need to do things like file
> > operations while holding
> > the lock.
> >
> > As I understand it, doing file operations with
> APCs
> > disabled is a Bad Thing.
> > So what is the “correct” way to hold a lock over
> > file operations? Can I
> > just re-enable APCs (KeLeaveCriticalRegion) and
> keep
> > the lock?
> >
> > Ken
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@comcast.net
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

Yuck. OK, thanks.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Randy Cook
Sent: Tuesday, September 20, 2005 4:59 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Long-term locks

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndevice/ht
ml/Locks_Sync.asp

Click on “Security Issues”

— Ken Cross wrote:

> Randy:
>
> I’m certainly not disputing you (hence the reason
> for the question in the
> first place), but: Why?
>
> If a thread has the lock, why is it a security hole
> to enable APCs? Other
> threads that try to acquire the lock will still be
> blocked, won’t they?
>
> Inquiring minds and all that…
>
> Ken
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf
> Of Randy Cook
> Sent: Tuesday, September 20, 2005 12:43 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] Long-term locks
>
> KeLeaveCriticalRegion while holding the resource is
> a
> security hole.
>
> The best thing to do is to change your design to not
> hold the lock. If you don’t, you may not notice any
> problems until other filters are introduced, etc…
> These problems will pop up at the worst time :wink:
>
> — Ken Cross wrote:
>
> > NTFSD Folk:
> >
> > I’m using ERESOURCE locks to synchronize access to
> > internal structures, but
> > there are times when I need to do things like file
> > operations while holding
> > the lock.
> >
> > As I understand it, doing file operations with
> APCs
> > disabled is a Bad Thing.
> > So what is the “correct” way to hold a lock over
> > file operations? Can I
> > just re-enable APCs (KeLeaveCriticalRegion) and
> keep
> > the lock?
> >
> > Ken
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@comcast.net
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com