@wizard:
I never have scolded EL D for doing this nor send him to his crate (since we gave that up long ago). As soon as he realizes what's going on or hears my voice, he calms down immediately, so I've never been worried.
My previous beastie one time was sleeping on the couch curled up with his back to me and as I walked by I ran my finger across his head. He was up and out of that chair and across the room so fast I didn't even see it happen.
This sounds more and more like an instinct thing.
This is a form of the dreaded 'resource guarding'. The dog is saying don't mess with my space, regardless of being awake or asleep. The problem with saying 'oh, well, it is instinct' is that it can be behavior that escalates to not just growling, but muzzle punching, and then snapping, and then lauching off the couch or whatever piece of furniture dog is on.
I can't and don't tolerate that behavior in bed. It disrupts everyone's sleep, and if you have multiple dogs in bed, it can erupt into a fight…not very good sleeping conditions. Depending on the dog, I might just say 'knock it off' and toss them out of bed...but some dogs with resource guarding issues are likely to take that as a threat escalation, and respond even more inappropriately. At the very least the offending dog should be not allowed to sleep in the bed for the rest of the night.
If it is just an occasional..'grr, you startled me' or the dog was dreaming, or whatever, that is not the same as a recurring pattern of 'waking up badly'.
If this is happening while the human is awake...a really easy way to retrain is to be armed with some treats; when dog is sleeping on your lap, start waving the treat in front of nose, and quietly saying her name. When she awakes toss treat off lap. Basically you condition the dog to jump off lap/couch/whatever and receive reward when they wake, rather than waking up defensive.