Polysiloxane comprising at least one quaternary ammonium group and of the general formula M a M' a1 M" a2 M"' a3 D b D' b1 D" b2 D"' b3 T c T' c1 Q d formula, where M = (R 1 3 Si O 1/2) M' = (R 2 R 1 2 Si O 1/2) M" = (R 3 R 1 2 Si O 1/2) M"' = (R 4 R 1 2 Si O 1/2) D = (R 1 2 Si O 2/2) D' = (R 2 R 1 Si O 2/2) D" = (R 3 R 1 Si O 2/2) D"' = (R 4 R 1 Si O 2/2) T = (R 5 Si O 3/2) T' = (R 2 Si O 3/2) Q = (Si O 4/2) a = 0 to 32; preferably 0 to 22, more particularly 0 to 12; a1 = 0 to 10, preferably 0 to 5, more particularly 0; a2 = 0 to 32; preferably 0 to 22, more particularly 1 to 12; a3 = 0 to 10; preferably 0 to 5, more particularly 0; with the proviso that a + a 1 + a 2 + a 3 > 3, preferably > 4; b = 1 to 600, preferably 10 to 500, more particularly 20 to 400; b1 = 0 to 10, preferably 0 to 5, more particularly 0; b2 = 0 to 80, preferably 0 to 50, more particularly 0 to 10; b3 = 0 to 20, preferably 0 to 10, more particularly 0; c = 0 to 30, preferably 1 to 20, more particularly 2 to 15; c1 = 0 to 10, preferably 0 to 5, more particularly 0; d = 0 to 15, preferably 1 to 12, more particularly 2 to 10; with the proviso that a 2 + b 2 > 3 and c + c 1 + d > 1, preferably > 2, more particularly ≥ 3; R 1 = independently of one another identical or different linear or branched, optionally aromatic hydrocarbon radicals having 1 to 30 carbon atoms, preferably methyl or phenyl, more particularly methyl; R 2 = independently of one another identical or different alkoxy or acyloxy radicals, such as, for example, methoxy, ethoxy, n-propoxy or isopropoxy radicals, acetoxy, more particularly ethoxy or isopropoxy radicals; R 3 = independently of one another identical or different organic radicals which carry quaternary ammonium functions; R 4 = independently of one another identical or different organic epoxy radicals; R 5 = independently of one another identical or different radicals R 1, R 3 or R 4, preferably R 1, more particularly methyl, phenyl, dodecyl or hexadecyl. M = (R 1 3 Si O 1/2) M' = (R 2 R 1 2 Si O 1/2) M" = (R 3 R 1 2 Si O 1/2) M"' = (R 4 R 1 2 Si O 1/2) D = (R 1 2 Si O 2/2) D' = (R 2 R 1 Si O 2/2) D" = (R 3 R 1 Si O 2/2) D"' = (R 4 R 1 Si O 2/2) T = (R 5 Si O 3/2) T' = (R 2 Si O 3/2) Q = (Si O 4/2) a = 0 to 32; preferably 0 to 22, more particularly 0 to 12; a1 = 0 to 10, preferably 0 to 5, more particularly 0; a2 = 0 to 32; preferably 0 to 22, more particularly 1 to 12; a3 = 0 to 10; preferably 0 to 5, more particularly 0; b = 1 to 600, preferably 10 to 500, more particularly 20 to 400; b1 = 0 to 10, preferably 0 to 5, more particularly 0; b2 = 0 to 80, preferably 0 to 50, more particularly 0 to 10; b3 = 0 to 20, preferably 0 to 10, more particularly 0; c = 0 to 30, preferably 1 to 20, more particularly 2 to 15; c1 = 0 to 10, preferably 0 to 5, more particularly 0; d = 0 to 15, preferably 1 to 12, more particularly 2 to 10; R 1 = independently of one another identical or different linear or branched, optionally aromatic hydrocarbon radicals having 1 to 30 carbon atoms, preferably methyl or phenyl, more particularly methyl; R 2 = independently of one another identical or different alkoxy or acyloxy radicals, such as, for example, methoxy, ethoxy, n-propoxy or isopropoxy radicals, acetoxy, more particularly ethoxy or isopropoxy radicals; R 3 = independently of one another identical or different organic radicals which carry quaternary ammonium functions; R 4 = independently of one another identical or different organic epoxy radicals; R 5 = independently of one another identical or different radicals R 1, R 3 or R 4, preferably R 1, more particularly methyl, phenyl, dodecyl or hexadecyl.