Messages in this thread | | | From | "Gilbert, Douglas" <> | Subject | Re: verify_area(...) possible problem. | Date | Tue, 13 Apr 1999 11:21:10 -0400 |
| |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2232.0"> <TITLE>Re: verify_area(...) possible problem.</TITLE> </HEAD> <BODY>
<P><FONT SIZE=2>Linus Thorvalds wrote:</FONT> </P>
<P><FONT SIZE=2>> ... you can do</FONT> <BR><FONT SIZE=2>></FONT> <BR><FONT SIZE=2>> error = access_ok(VERIFY_READ, p, 3*sizeof(*p));</FONT> <BR><FONT SIZE=2>> if (!error) {</FONT> <BR><FONT SIZE=2>> __put_user(a, p);</FONT> <BR><FONT SIZE=2>> __put_user(b, p+1);</FONT> <BR><FONT SIZE=2>> __put_user(c, p+2);</FONT> <BR><FONT SIZE=2>> }</FONT> <BR><FONT SIZE=2>></FONT> <BR><FONT SIZE=2>> where the __xxx versions are faster but "unsafe" unless you have</FONT> <BR><FONT SIZE=2>> verified the area by hand first.</FONT> </P>
<P><FONT SIZE=2>Can this be extended to:</FONT> </P>
<P> <FONT SIZE=2>error = access_ok(VERIFY_READ, p, 3*sizeof(*p));</FONT> <BR> <FONT SIZE=2>if (! error) {</FONT> <BR> <FONT SIZE=2>interruptible_sleep_on(&some_wait_queue);</FONT> <BR> <FONT SIZE=2>...</FONT> <BR> <FONT SIZE=2>__put_user(a, p);</FONT> <BR> <FONT SIZE=2>__put_user(b, p+1);</FONT> <BR> <FONT SIZE=2>__put_user(c, p+2);</FONT> <BR> <FONT SIZE=2>}</FONT> <BR><FONT SIZE=2>??</FONT> </P>
<P><FONT SIZE=2>Doug Gilbert</FONT> </P>
</BODY> </HTML> | |