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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC0B2C433EF for ; Thu, 12 May 2022 05:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349972AbiELFjz (ORCPT ); Thu, 12 May 2022 01:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234095AbiELFjy (ORCPT ); Thu, 12 May 2022 01:39:54 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D986E21687C for ; Wed, 11 May 2022 22:39:52 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id i1so3889770plg.7 for ; Wed, 11 May 2022 22:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y+ADADOLsy5U0cbqUSAL8sVCV2JHFFb6d6snlliJvBk=; b=CW1zEzHl2MHW93A2lOFLisKLVaijVGVVOUbJG+LpYd/sEPsAq1gJ4cZLkYTgdYyeq9 luxVY40W6rvMrywxYpQGit5+fe+LYvyCUUjqptcXIlkkwUsyu+YSIV0NWVRcHhwnVVfh 4OZSrJP7mHtdXyaAovFq2mqhstaDb0N6wzo3Q= 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=y+ADADOLsy5U0cbqUSAL8sVCV2JHFFb6d6snlliJvBk=; b=4GeEe9S3dhMOeA+TiyoCB+1UXoSdWXVTVROzyp5OH0UM5Cf0c4Tv47BnpzAt8r4uWg UkEEt8jDH9QmFNnsJSeUdtCsALp/fu0IZtAKWnZsCyGKMN+18ii15niz/5iToyM0vIx/ Z2/30r9t/428PhBqQJ1yG2oXrweIK+ED8N90drQLHK6MhIuW5JWVpMcreUeFC0uPgU54 rloGeo2nyMl47I4rtSQwFDGdkBn1Gy1/7QZ/OI3EUtSkEol9+f+/Dn67laIizepniSwf 5gL/spw4HzbSqaHEWzEUx7aVJncpfsHvEeHxc2ZJ9qQu5+CSmTRyQMjPO6RY66BTlK+M a7qg== X-Gm-Message-State: AOAM5324IQMQyXnEsmhgcNh7xZiwtME1MQZBYDnbBKn1i94nuyvCXZFF 9H1crdJsIXdrhx2MMLLx6Ey5gw== X-Google-Smtp-Source: ABdhPJzpiXxGpg3/2XDINmqm/PjN3LkXht9fMp4MYaS4FJyG7BSAhZVDPSpPqMiJLhETFW+kFl0k3Q== X-Received: by 2002:a17:902:a9ca:b0:15e:f017:91b5 with SMTP id b10-20020a170902a9ca00b0015ef01791b5mr27782532plr.27.1652333992397; Wed, 11 May 2022 22:39:52 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f10-20020a170902ab8a00b0015e8d4eb1casm2880921plr.20.2022.05.11.22.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 22:39:52 -0700 (PDT) From: Kees Cook To: songyuanzheng@huawei.com, Andrew Morton Cc: Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: usercopy: move the virt_addr_valid() below the is_vmalloc_addr() Date: Wed, 11 May 2022 22:39:41 -0700 Message-Id: <165233397814.161845.13267754142064821597.b4-ty@chromium.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220505071037.4121100-1-songyuanzheng@huawei.com> References: <20220505071037.4121100-1-songyuanzheng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 May 2022 07:10:37 +0000, Yuanzheng Song wrote: > The is_kmap_addr() and the is_vmalloc_addr() in the check_heap_object() > will not work, because the virt_addr_valid() will exclude the kmap and > vmalloc regions. So let's move the virt_addr_valid() below > the is_vmalloc_addr(). Applied to for-next/hardening, thanks! [1/1] mm: usercopy: move the virt_addr_valid() below the is_vmalloc_addr() https://git.kernel.org/kees/c/0a76d4c331b4 -- Kees Cook