<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML \9884\8BBE\683C\5F0F \5B57\7B26";
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:SimSun;}
span.DefaultFontHxMailStyle
{mso-style-name:"Default Font HxMail Style";
font-family:DengXian;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.HTML
{mso-style-name:"HTML \9884\8BBE\683C\5F0F \5B57\7B26";
mso-style-priority:99;
mso-style-link:"HTML \9884\8BBE\683C\5F0F";
font-family:SimSun;}
span.od
{mso-style-name:od;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=ZH-CN link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:black'>David Howells <dhowells@redhat.com> wrote:</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> Hillf Danton <hdanton@sina.com> wrote:</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> > - struct request_key_auth *rka = dereference_key_rcu(key);</span></p><p class=MsoNormal><span lang=EN-US>> > + struct request_key_auth *rka;</span></p><p class=MsoNormal><span lang=EN-US>> > +</span></p><p class=MsoNormal><span lang=EN-US>> > + rcu_read_lock();</span></p><p class=MsoNormal><span lang=EN-US>> > + rka = dereference_key_rcu(key);</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> This shouldn't help as the caller, proc_keys_show(), is holding the RCU read</span></p><p class=MsoNormal><span lang=EN-US>> lock across the call. The end of the function reads:</span></p><p class=MsoNormal><span lang=EN-US>> and the documentation says "This method will be called with the RCU read lock</span></p><p class=MsoNormal><span lang=EN-US>> held".</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>1, callee has no pre defined duty to help caller in general; they should</span></p><p class=MsoNormal><span lang=EN-US>not try to do anything, however, to help their callers in principle due to</span></p><p class=MsoNormal><span lang=EN-US>limited info on their hands IMO.</span></p><p class=MsoNormal><span lang=EN-US>2, uses of rcu can be nested.</span></p><p class=MsoNormal><span lang=EN-US>3, no comment can be found in security/keys/request_key_auth.c about</span></p><p class=MsoNormal><span lang=EN-US>the rcu already documented.</span></p><p class=MsoNormal><span lang=EN-US>4, the newly added rcu can avoid incidental messup anywhere else.</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Hillf<span class=DefaultFontHxMailStyle><o:p></o:p></span></span></p></div></body></html>