Q. I pray in a small schul inside a Jerusalem bomb shelter. The wall of the lavatory is thus pretty close to the wall of the area where we daven. I have noticed that I can hear the Chazan clearly when I am within the lavatory. This means I can hear Kaddish and various Brochos, including the Shem HaShem, said while I am engaged in the lavatory.
Must I equip myself with a pair of earplugs for my visits there or is there no problem with hearing these things while engaged in the lavatory?

A. Although Shulchan Aruch (O.H. 85: 2) rules that it is prohibited to even think Torah thought while inside a lavatory, we find in Talmud (Zevachim 120b) that Rava learned a din from Rabbi Elazar berabi Shimon while inside a bathroom. The Talmud explains that since it was done “leonso” or against his will it became permitted. Lev Chaim (3: 7) permits the use of a toilet near a Talmud Torah, if one concentrates his mind not to listen. Milei Dachasidusa (Sefer Chasidim 157) and Mishnas Avrohom are also lenient.
Tzitz Eliezer (13: 1: 2) addresses also this shailah and permits one to enter the facilities when in need even when he will be exposed to the direct voice of Torah, tefilos and brochos. He urges also to contain his concentration on permitted thoughts and if possible one should plug his ears.
Horav Shlomo Miller’s Shlit’a opinion is similar. The Rov advises to use one’s fingers or hands to block the ears when possible. As the posuk (Yeshayahu 33: 15) teaches “Oitem Oznoi,” He closes his ear from hearing…

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a