Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp859484pxv; Wed, 14 Jul 2021 17:44:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHati7AmQOk2BU41RrkpLf/3Eu1Jhi8M3mRoTTOzERZe36kgShjoVAK2FZyleP5j+hLJwh X-Received: by 2002:a50:ee88:: with SMTP id f8mr1511255edr.331.1626309855213; Wed, 14 Jul 2021 17:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626309855; cv=none; d=google.com; s=arc-20160816; b=lwyn6cY+G3H6D3w5n8o0kNBFM4F+mFR81g5g27xuGs4Y6s60AH9qoCVvCO1+p37DWk NclbHd7xKBEQZM4/9tyelf8MHoda5S46ZZt9q3Bs5JyvLbPYWA42UknNpgsZtaitbqeH i3RwOKTnkIqCo6pDtcEB3rnkId39NUK1M3p1QzIVmj2xQweiTrfsiCoWEZU6pCV1akMo 5/qlEIxqkGyrS0yyXZBznOrpMfgGqyBs2H6pYcbpUilwEPqvV4mZ4ZnGhaVaaEuvdkcQ QnmoIHBb2QnPRyb8MpphjNfEDtmmHZLWt83wOVtC7vxGf8rnX9Z2CMnbSQIIVJnVK8tG yu3g== 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:subject:cc:to:from:date :dkim-signature; bh=FnsY/am16e3nzkM2dF+myaJyEhdbfDkz5I1bDmvdcZQ=; b=n8vk8KhSM3hV86cNqkIFEgvlYvO6MLd8fh/2t+nWLFjjx9c0ws9XnVu2cemDg7I+Lx bbX3H0Vk2aeD5dFDTK8awMrfaJVe/dou+t6K+hydaFduVnqvCfjEkIicdhmw33W5ly9+ iRNz9CMFEtT1oWJPzYDQiT96/tVqKnzYg8H5J3q4h3rJkhusL3RMIY8Ateky6+T0zD6G DMvEUUBs/1J9VST1yaSl1aoGr0hb0lwGcKbvw32G8s0o7yt1ZFT0zTTvtZXy/oWRR5qj maRbugoW2zYPiSY6i+7+EmVu4WCiWoRN3dIwf4EcFl81aDarVKi00pFEccYjNJ2Sstd5 vsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=AB5cc9RB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd35si4874195ejc.274.2021.07.14.17.43.49; Wed, 14 Jul 2021 17:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=AB5cc9RB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237634AbhGNXcE (ORCPT + 99 others); Wed, 14 Jul 2021 19:32:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:38452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235198AbhGNXcE (ORCPT ); Wed, 14 Jul 2021 19:32:04 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?