Tying the hair in a bun is permissible, but tying a bun in the middle of the head like the hump of a camel is impermissible.
There is a Hadith in Sahih Muslim in which the Holy Prophet (Sallallahu alaihi wa sallam) declares such women to be a group of hell who are nude in spite of wearing clothes i.e. they wear revealing clothes, who attract others to themselves or are attracted towards others, their heads are like the hump of a camel. They will not enter Jannah and will not get its fragrance and indeed, the fragrance of Jannah can be felt from such and such a distance. (Sahih Muslim, Hadith No. 2128)