From patchwork Tue Sep 10 13:11:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 19896 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCC8725A72 for ; Tue, 10 Sep 2013 13:11:46 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf8654053yhz.11 for ; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=8BO4enY7l2dtU12fhFOuUjsKy2OXuTNYtuZ6+vlHL2M=; b=G3yNiTvR7tliqzFMv44/rFrRY5WjHhCplfsnhzAv2goS27tnxS5d1gGwAaYCQVSzdG jDqaITncSChpJpUlSpzQFjvFU3esGAN8ufUnehj7KhXCAAvtQZpuLYtmYG9y0WbEMdQY Gi23jvZ03QxUf50ogsdVz21j3UfFUyuA6GQvuiiyF1PZD27pXHpF7s/kc8XEcC8hxykC IsxQxLbdPzk8GEY2dWDVvDq/RmFSD67uQOQpFX6CL6KxmW0B/j4vUT3J6Y4giKA7VIXA Wy489KJjEENZGsToEyrHqVCtuupczbNVrhgPUi0mhM6LwnvCaF7IuIKAt4sikmgK0shR Xwgw== X-Received: by 10.58.118.173 with SMTP id kn13mr1847730veb.1.1378818706524; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.244 with SMTP id u20ls2047014qeq.74.gmail; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) X-Received: by 10.52.120.78 with SMTP id la14mr19666687vdb.9.1378818706282; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id bk8si4423240vec.56.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so4877282vcb.38 for ; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) X-Gm-Message-State: ALoCoQmR6qVjxjCoSU2nZaKlCNrj+g9KLvV6ToAwDYKzrUSswdAoJURLKkt1RegL8lvTu9fzOrUb X-Received: by 10.52.230.102 with SMTP id sx6mr19108901vdc.15.1378818706203; Tue, 10 Sep 2013 06:11:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp651vcz; Tue, 10 Sep 2013 06:11:45 -0700 (PDT) X-Received: by 10.180.12.83 with SMTP id w19mr8460518wib.61.1378818704882; Tue, 10 Sep 2013 06:11:44 -0700 (PDT) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id o8si6898747wjb.172.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=209.85.212.179; Received: by mail-wi0-f179.google.com with SMTP id hm2so658400wib.6 for ; Tue, 10 Sep 2013 06:11:44 -0700 (PDT) X-Received: by 10.180.9.140 with SMTP id z12mr12903195wia.37.1378818703881; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id fv10sm3175989wic.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:43 -0700 (PDT) From: Steve Capper To: libhugetlbfs-devel@lists.sourceforge.net Cc: patches@linaro.org, linaro-dev@lists.linaro.org, Steve Capper Subject: [PATCH 3/5] Add PROT_NONE to the mprotect test. Date: Tue, 10 Sep 2013 14:11:30 +0100 Message-Id: <1378818692-24952-4-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378818692-24952-1-git-send-email-steve.capper@linaro.org> References: <1378818692-24952-1-git-send-email-steve.capper@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The mprotect unit test checks PROT_READ and PROT_READ | PROT_WRITE protections. We recently found that PROT_NONE wasn't properly supported in an early version of our huge page kernel code. This patch adds PROT_NONE tests to mprotect. The expected behaviour is that neither reads nor writes should succeed. Signed-off-by: Steve Capper --- tests/mprotect.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/mprotect.c b/tests/mprotect.c index aa4673e..db6a662 100644 --- a/tests/mprotect.c +++ b/tests/mprotect.c @@ -213,5 +213,11 @@ int main(int argc, char *argv[]) test_mprotect(fd, "RW->R 1/2", 2*hpage_size, PROT_READ|PROT_WRITE, hpage_size, PROT_READ); + /* PROT_NONE tests */ + test_mprotect(fd, "NONE->R", hpage_size, PROT_NONE, + hpage_size, PROT_READ); + test_mprotect(fd, "NONE->RW", hpage_size, PROT_NONE, + hpage_size, PROT_READ|PROT_WRITE); + PASS(); }