Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp486609imn; Wed, 27 Jul 2022 11:32:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sKOyVBwy7XBAfV8pgx3rwJk+2L5F4s1bppmjwHFct/NMCBMQ2VZpRsrKztJdNBNlS2+JhN X-Received: by 2002:a17:907:6890:b0:72e:dc8f:ad42 with SMTP id qy16-20020a170907689000b0072edc8fad42mr17911564ejc.683.1658946775338; Wed, 27 Jul 2022 11:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946775; cv=none; d=google.com; s=arc-20160816; b=wSwgOBW4Nv6LALwez8j39EIVfj4z9LoYVXxmLzALhruLrkABu9Z6tKT4DUth6ZILv9 ojQ0Ex5/nA3cCzoRgimXwqavJm4KUIlE5jvIlMvqKdumLrky++JyIFrBbyXiFWsWowPJ eeEphs0OuWKfmFIak+1aajvb3iTOBLVOYiYJmpzXaaL3UJlkZ0NpBZ/J9sGz/WL868hr YPdQ8dSVwAXRFDxlDtlkP0Rxlwc1WV55gveIropMIMoYEj6CEZrmeOzsFAXKqSspdHAw Ed/OKTGUHvmw1b/DUYiwQ9MzW716qyUDUdTu8Jzxy9UJTxrEwytItZt7tIBZmQ7Df7iQ 5VLw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LakhMdOakTGo8ZN7SkGdR+lx7DvtoqbUuKKlJEciZoA=; b=ySijI14s8tfrKOzEJ5IUZT+cTsigNS6izFx3ZYNQWXQZh6+8tor1ldvqo6DsJGyEdh 19u0vhLb3BwNaTO87zYKbk7M7GhhZB/b330hcgB9TR3KcvbQ4xTXcxtrRjnrz80wwdT+ L7Nkubvqxyk6jlyuT8Edptha5RvqWABtx+dD4uU0R5408dowYZaNechCZau0VDaquOp8 w0uV2Mv8UYgLWsjmTZy1LT1045GeDlJPbNnByQOCgs7MyqypD9Brwkct4lBpuAfWltGh WjOoaMIEkUxiWZcrFF0YWmL8aBqR081rzCUitMkBoa4lBxjdwzKb5E3nzt+gOiB0G5eb IuLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TD49W+aq; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw15-20020a170906478f00b0072f36fddba7si22670709ejc.812.2022.07.27.11.32.28; Wed, 27 Jul 2022 11:32:55 -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=@linuxfoundation.org header.s=korg header.b=TD49W+aq; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236522AbiG0RDl (ORCPT + 99 others); Wed, 27 Jul 2022 13:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232874AbiG0RDH (ORCPT ); Wed, 27 Jul 2022 13:03:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B3606D572; Wed, 27 Jul 2022 09:38:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 595BA601CE; Wed, 27 Jul 2022 16:38:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66D5AC433D6; Wed, 27 Jul 2022 16:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939911; bh=+kCkmqrmQ+ezg/La72IVCkAR8CRuOOBy4ZA/yaCOHtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TD49W+aqMwWTUmQvgk18oduiuVI0WnBY90Y2k4fehujqGHGN03xTC59+lBtyD/V5j vxg4A7LCaQGTbUJIkTatO41BlEbxYBK0s8sMjDgEi/dA4AF9cgOrAY49jREAhgyGwa 28WGMDiqVBqaCB3WxcI8nQSr1guEv/U3pTaI/sx4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "sidhartha.kumar@oracle.com, stable@vger.kernel.org, Oleksandr Tymoshenko" , Oleksandr Tymoshenko Subject: [PATCH 5.15 008/201] Revert "selftest/vm: verify remap destination address in mremap_test" Date: Wed, 27 Jul 2022 18:08:32 +0200 Message-Id: <20220727161027.294082875@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161026.977588183@linuxfoundation.org> References: <20220727161026.977588183@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Oleksandr Tymoshenko This reverts commit 0b4e16093e081a3ab08b0d6cedf79b249f41b248. The upstream commit 18d609daa546 ("selftest/vm: verify remap destination address in mremap_test") was backported as commit 2688d967ec65 ("selftest/vm: verify remap destination address in mremap_test"). Repeated backport introduced the duplicate of function is_remap_region_valid to the file breakign the vm selftest build. Fixes: 0b4e16093e08 ("selftest/vm: verify remap destination address in mremap_test") Signed-off-by: Oleksandr Tymoshenko Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/vm/mremap_test.c | 24 ------------------------ 1 file changed, 24 deletions(-) --- a/tools/testing/selftests/vm/mremap_test.c +++ b/tools/testing/selftests/vm/mremap_test.c @@ -66,30 +66,6 @@ enum { .expect_failure = should_fail \ } -/* - * Returns false if the requested remap region overlaps with an - * existing mapping (e.g text, stack) else returns true. - */ -static bool is_remap_region_valid(void *addr, unsigned long long size) -{ - void *remap_addr = NULL; - bool ret = true; - - /* Use MAP_FIXED_NOREPLACE flag to ensure region is not mapped */ - remap_addr = mmap(addr, size, PROT_READ | PROT_WRITE, - MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED, - -1, 0); - - if (remap_addr == MAP_FAILED) { - if (errno == EEXIST) - ret = false; - } else { - munmap(remap_addr, size); - } - - return ret; -} - /* Returns mmap_min_addr sysctl tunable from procfs */ static unsigned long long get_mmap_min_addr(void) {