The odds are very very low. Its just it can occur. The fact doing something
similar to what you are doing has taken 5 years to catch me says that. Also
its rare that the name would be split over two pages. If its in a single page
then the fortunate layout of sethostname saves your butt as you will get
either the old or new name, since the copy_from_user won't fault during a
copy of the hostname but only until the first byte appears. In that case
once the copy begins there is no further race on a single CPU host. On
a dual CPU host there is still a race but its a matter of clocks wide.
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu