Does one have to wear socks to bed since the feet might become uncovered at night while asleep? Are feet considered covered area of the body? Can a bracha or shema be recited when feet are uncovered? According to Iggros Moshe (Yoreh De’ah vol. 3 siman 47:3) should one undress in bathroom with a shower or bath and not need to cover oneself?
The question does not specify whether it concern men or women.
Concerning women, the Gemara states that shok be’isha ervah. According to the Mishnah Berurah (75:2) this refers to the thigh area, down to the knees, and this is the ruling of some poskim. However, most poskim agree that the shok refers to the calf area, down to the feet, but not including the feet themselves (see Chayei Adam 4:2; Shulchan Aruch Harav 1; Chazon Ish 16:8; Shevet Halevi 1:1; for a position in between, see Iggros Moshe Even Ha-Ezer 4, no. 100, sec. 6).
All poskim, at any rate, agree that the feet themselves are not considered part of the shok, and therefore there is no concern of ervah in feet, and it is permitted for somebody to recite a berachah in front of a woman’s uncovered feet.
It is all the more so permitted to go to sleep without socks, and there is certainly no concern at all in doing so.
Concerning both men and women, the Mishnah Berurah (2:1) writes that in places where the custom is to cover one’s feet (even at home), one should wear socks under the blanket. In all places that I am aware of, the custom today is to sometimes walk at home with uncovered feet, and therefore this will not be a concern.
It is permitted to undress in a bathroom, because the normal way is to be undressed in a bathroom, and there is no lack of tzenius in so doing. However, as the Mishnah Berurah writes, one should not uncover one’s body where there is no need for it.