From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4054EC12002 for ; Wed, 14 Jul 2021 23:29:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC179613D0 for ; Wed, 14 Jul 2021 23:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC179613D0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BB9678D0006; Wed, 14 Jul 2021 19:29:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B41F68D0003; Wed, 14 Jul 2021 19:29:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BB178D0006; Wed, 14 Jul 2021 19:29:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id 6EFDD8D0003 for ; Wed, 14 Jul 2021 19:29:16 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 53B128248076 for ; Wed, 14 Jul 2021 23:29:15 +0000 (UTC) X-FDA: 78362786670.25.6941E00 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf29.hostedemail.com (Postfix) with ESMTP id E83E9900025A for ; Wed, 14 Jul 2021 23:29:14 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C977460E08; Wed, 14 Jul 2021 23:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1626305351; bh=KiaUNthSqIm6qp0ZYhb+eE2W5WkK/bRcOtub2aM1quQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AB5cc9RBEQTtdOfs9KDcS6XQpfo6Q1bSZITsx5AZYcwWdsRA+RimOL5kujnZIgI8o SKKA3f5XOS5crug806jLMl9kEHR7zTo7TBlN5BWvTxNUl/VWxZA2+4LLa1H8q6vVYC aQ+DLQOMVd5Vk+BoA2ZYQO0RImD48uDL8QE3aK6A= Date: Wed, 14 Jul 2021 16:29:10 -0700 From: Andrew Morton To: Chen Wandun Cc: , , , , , , Hulk Robot Subject: Re: [PATCH] mm/vmalloc: fix wrong behavior in vread Message-Id: <20210714162910.4cb5434f7745dcf7ce9d85c2@linux-foundation.org> In-Reply-To: <20210714015959.3204871-1-chenwandun@huawei.com> References: <20210714015959.3204871-1-chenwandun@huawei.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E83E9900025A X-Stat-Signature: n4ob3ga8nxiecjum4kdixs41q8193ihf Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=AB5cc9RB; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1626305354-721440 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 14 Jul 2021 09:59:59 +0800 Chen Wandun wrote: > commit f608788cd2d6 ("mm/vmalloc: use rb_tree instead of list for vread() > lookups") use rb_tree instread of list to speed up lookup, but function > __find_vmap_area is try to find a vmap_area that include target address, > if target address is smaller than the leftmost node in vmap_area_root, > it will return NULL, then vread will read nothing. This behavior is > different from the primitive semantics. What is "the primitive semantics"? Does this refer to behaviour prior to f608788cd2d6? > The correct way is find the first vmap_are that bigger than target addr, > that is what function find_vmap_area_exceed_addr does. Is this problem observable from userspace? If so, what are the effects and what must an application do to trigger it?