Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp80128iob; Wed, 27 Apr 2022 19:44:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2aFaeSlToZbv/lgHY540D5rPqPFGuMDJzAaoMP5wHsNBdC/36w/tOBsW4g2rNHt5tqdG9 X-Received: by 2002:a17:907:8b13:b0:6f3:9216:b73e with SMTP id sz19-20020a1709078b1300b006f39216b73emr19556888ejc.188.1651113855578; Wed, 27 Apr 2022 19:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651113855; cv=none; d=google.com; s=arc-20160816; b=hkgC/5t1tUW5895bmKbpVic54jE2aVj2IlL+FapbXJJMwwo9GkLFmX5ZCFMA41CIYy E4LflqDDXlo9bdVd/UMEwRD0WjgPm4QndihRysGwrcAZ5Ljw9uA6latUvORIUrI3R8Ob eiQCCa9Z4q9PYykPa0UV3/fR1QTTuE3ig/pkzRf+pu15k+N3o8z/AzQ16JrAhZyy8NVV Y1zAnYcWH5Gncih43EIXh/d9WMa3D2uwSU+Sez8P7ANJLnWJC7Mtexph0ErvT0FS+RxU s8QUPGKslqJvqVtu0RXsYgRq9YvuMuti55Hp6kEovps8pqUCIZ7jQKL8s0irMWwGL1Ep KrNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ktLjh0arY7M9jHkCEl8as+aaLtThvm0ZUfC/SiXTrT0=; b=osPOC8tylm9l3rxSQwTc9FHiOcH8o64PULKFA9yPvH7YUTf7Rhc4JET8eQ+9DZhA3o OYh05x1090r/0NQAi18kRqjC3jP64/r/4F9QZ2aqQoi8awPLcpuc+151BHwsDxkKzn3X WZDjTHHKom9RLet9iXOH7X+T337M/sib3vU0xsu0M9WqBHNFLqyZ70l1fhSbUFFkmnhH EdhPPXSqJ+Ek0MxqWrqA70pVQAV6l7FpO8j7y4W/LzOvOCSazA1TKWa+Rs8bK34Orc8S OEyGnqyKV5pO0ZZGIrY1WkcWvQde3/EpFqhrX9p+u/LEHIjKgOFNGdo4Vu7xE//3Gb1w zNPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=deJz5bfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a17090636cf00b006e7d2a018a5si2721293ejc.61.2022.04.27.19.43.51; Wed, 27 Apr 2022 19:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=deJz5bfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238194AbiD0Wt4 (ORCPT + 99 others); Wed, 27 Apr 2022 18:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237258AbiD0Wtp (ORCPT ); Wed, 27 Apr 2022 18:49:45 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14AE347076 for ; Wed, 27 Apr 2022 15:46:25 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id k23so6157159ejd.3 for ; Wed, 27 Apr 2022 15:46:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ktLjh0arY7M9jHkCEl8as+aaLtThvm0ZUfC/SiXTrT0=; b=deJz5bfr1wzbr/xa1nRDWV0Z2KQa4zDAniqQ9qqH+0/M7kOOIqGgya9NtzEe+Q7B/K fZU+C1XHzzyFz/Vj605IEDbk+6nwhB3vofo5hRBrsaRko/bvBIgVN+1FweCXo/Eb/UXr 3o2US3nJ+oAyow2HF+srqWZyFOZP594EkwS+Br/PH0+FS77gWzsEnO7IBXwk5kz12K41 FxyAtZAXtJul2flX6xNcPy+Bv6IkuoK3OUYGbUcPCje7EXrijBZBsqKiuSfS+/mW0POY 9Yjn3nBtSOCJ7BYIkBBfu5ip6Ojb/SgzOrZRWqTCKbPv/Pqs+YqramtF81zqQbGybMhX 85Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ktLjh0arY7M9jHkCEl8as+aaLtThvm0ZUfC/SiXTrT0=; b=0QXzI3euy4rhL2NGTg5UBn6NIFn+uoZJHy/pCX33nDpfoONWFXlrGa/69qj5753nSB B4NqunikJ4BzUtT3QOcTXwtjWnbCjdKP9KA6/ntoPqMRzizEUZKe440kwcNQ1ZPP683y mrnOJ1E19RnjVzeklSe1Tir0A0/uR7hZFKFEhIRo3q4x7dBy71kc0/Pki3cI8RA3FWCU XrhN4nIA6mnLtA12wfTyMCjTTaC41Dr5jR8eats0CEWvEGgHV0ZX+pOEnwRjcPHR10iu 25CORDj07zayeBa47jWqfGxVjkbZ1xvUnsLYdyEoVyK9gEPR/fdL/o+MyMl/rjOsRtWA TsyQ== X-Gm-Message-State: AOAM530RlNEnDXS/KBKp5oHAFNbFjeIbxubZzV5Z6ns0/sUOOaui7BKj v+uPZd/ybZ2MsmuIB+XBMfg= X-Received: by 2002:a17:906:1691:b0:6f3:a3bf:451a with SMTP id s17-20020a170906169100b006f3a3bf451amr14130112ejd.61.1651099583709; Wed, 27 Apr 2022 15:46:23 -0700 (PDT) Received: from nlaptop.localdomain (ptr-dtfv0poj8u7zblqwbt6.18120a2.ip6.access.telenet.be. [2a02:1811:cc83:eef0:f2b6:6987:9238:41ca]) by smtp.gmail.com with ESMTPSA id o14-20020a170906774e00b006d5b915f27dsm7351657ejn.169.2022.04.27.15.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 15:46:23 -0700 (PDT) From: Niels Dossche To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mina Almasry , Niels Dossche Subject: [PATCH 2/2] selftest/vm: test that mremap fails on non-existent vma Date: Thu, 28 Apr 2022 00:44:39 +0200 Message-Id: <20220427224439.23828-3-dossche.niels@gmail.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220427224439.23828-1-dossche.niels@gmail.com> References: <20220427224439.23828-1-dossche.niels@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a regression test that validates that mremap fails for vma's that don't exist. Signed-off-by: Niels Dossche --- tools/testing/selftests/vm/hugepage-mremap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/vm/hugepage-mremap.c b/tools/testing/selftests/vm/hugepage-mremap.c index 1d689084a54b..585978f181ed 100644 --- a/tools/testing/selftests/vm/hugepage-mremap.c +++ b/tools/testing/selftests/vm/hugepage-mremap.c @@ -178,6 +178,12 @@ int main(int argc, char *argv[]) munmap(addr, length); + addr = mremap(addr, length, length, 0); + if (addr != MAP_FAILED) { + printf("mremap: Expected failure, but call succeeded\n"); + exit(1); + } + close(fd); unlink(argv[argc-1]); -- 2.35.2