From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932817AbbJIHVQ (ORCPT ); Fri, 9 Oct 2015 03:21:16 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33938 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932759AbbJIHVP (ORCPT ); Fri, 9 Oct 2015 03:21:15 -0400 Message-ID: <56176AE6.30002@gmail.com> Date: Fri, 09 Oct 2015 15:21:10 +0800 From: mudongliang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: kernelnewbies@kernelnewbies.org CC: "linux-kernel@vger.kernel.org" Subject: efficient way to verify one memory block is only readable? Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When I did some experiments about vtable, and modified the virtual method address myself, I found error report : "Segment fault". When I see the /proc/self/maps, vtable is in the readonly text segment. I almost forget the fact that vtables have been stored in readonly segment. So I have a question : how to effectively verify one memory block is only readable or writable? I think it's not efficient to check all the parts in /proc/maps. Does anyone have another efficient way to do this verification? Thanks in advance. - mudongliang