<div dir="ltr"><div>I think I can do that by getting the related pte of a virtuak kaddr, starting with<br><br> <a href="http://lxr.free-electrons.com/ident?i=pgd_offset_k">pgd_offset_k</a>(<a href="http://lxr.free-electrons.com/ident?i=address">address</a>)<br><br>, or directly with <pre><a href="http://lxr.free-electrons.com/ident?i=pte_t">pte_t</a> *<a href="http://lxr.free-electrons.com/ident?i=lookup_address">lookup_address</a>(unsigned long <a href="http://lxr.free-electrons.com/ident?i=address">address</a>, unsigned int *<a href="http://lxr.free-electrons.com/ident?i=level">level</a>);</pre>  And then I can checks the flags of this pte.<br><br><br></div><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-05 12:59 GMT+02:00 Oscar Salvador <span dir="ltr">&lt;<a href="mailto:osalvador.vilardaga@gmail.com" target="_blank">osalvador.vilardaga@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all,<br><br></div>I&#39;m writing a module to read/write kernel memory, and for this I&#39;d like to check if a page is marked as read-only, so we don&#39;t have the right to write there (kernel code for instance).<br><br></div>I though about the flags field from &quot;struct page {}&quot;, but from the name I can&#39;t see any useful flag to check this.<br><br>The only flag I saw is different between kernel code and module code is that kernel code has the flag &quot;reserved&quot; enabled, so it&#39;s not swapped.<br><br></div><div>Could someone provide me a hint about that?<br><br></div><div>Thank you very much<br></div></div>
</blockquote></div><br></div>