Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp331501pxa; Tue, 11 Aug 2020 04:16:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfg2FoJcIDNa4BnrzhKoHwilhyY1YF0wrul9yLNRQE11vZTK+vsC/MNoFZJ7CwrjfxA6Oi X-Received: by 2002:aa7:d9d7:: with SMTP id v23mr26619715eds.112.1597144613979; Tue, 11 Aug 2020 04:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597144613; cv=none; d=google.com; s=arc-20160816; b=y6S8ckJKTgHe+uw33qUyYA2qxCibwSgNGPHZBVCj2rwtalkjZJ400Alp/BdlAW800W xcyVmIDQ2BmEPxiC8a84JDYfvgaXrHp/3rgZKGdDUiYSsXLbHLJdrgSc739c8NzOvkof +CiPKTAGqlU8oJdBKnYV2Va6Y4TwoU/44mDK03TxMtMDRjugLmmWReSEhqm/YJOnkZtu xEpDv0gRptLVYi3T3hDoeHavUNFQlUdHw2Qo30rLPTTULG647reU7N0uHP4C0GpcZbRd AKmM/b4u/VPYTnGNSeRfGfEjvvn/7B0BBD+uHhb8VnXGgi1UEp9K5uy8lZQwa2eRuzr+ aK0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kCHf+VL4duteKdg0UssB570JNuzWsR7MbWxx0VCXWFY=; b=MsmA18CEVTVlRAgnx/RVuedv/Y0i7z0LUG2PUwmjGoV7oTWfYkxRyCmuBsfZIdqJuL 71a88SZ4X3gqMu4Ea/Tpd1deSMKKDvAiOZ+RcwX03Brc0Q3SJW5/IdBMSCcPBH/COAry UJOLoo0t2dd7mXyLwaTNDk3EG+3nD6g2w/P1rHBh35aPK0AHSThkJA2MVdrcxzbpQ4NJ 9+PK0FQyFkbq9ckzDyas9smuOSBTnoDGrR4x1jhiYhhgeGUG7VLHCv7L+xBE5R1wZeXT e4Enr6oUZ55Z2DYnYVZ9HrkivArtajwJRu8m6KBuF6UFwvwRP9Ft17tC4n1ddno82Trs sNtQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r17si14974449eda.525.2020.08.11.04.16.31; Tue, 11 Aug 2020 04:16:53 -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; 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 S1728605AbgHKLPz (ORCPT + 99 others); Tue, 11 Aug 2020 07:15:55 -0400 Received: from verein.lst.de ([213.95.11.211]:39919 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbgHKLPy (ORCPT ); Tue, 11 Aug 2020 07:15:54 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 00C5C67357; Tue, 11 Aug 2020 13:15:51 +0200 (CEST) Date: Tue, 11 Aug 2020 13:15:51 +0200 From: Christoph Hellwig To: Miles Chen Cc: Christoph Hellwig , "David S . Miller" , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com Subject: Re: [PATCH] net: untag pointer in sockptr_is_kernel Message-ID: <20200811111551.GA3958@lst.de> References: <20200811102704.17875-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200811102704.17875-1-miles.chen@mediatek.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 06:27:04PM +0800, Miles Chen wrote: > From: Miles Chen > > sockptr_is_kernel() uses (sockptr.kernel >= TASK_SIZE) to tell > if the pointer is kernel space or user space. When user space uses > the "top byte ignored" feature such as HWAsan, we must untag > the pointer before checking against TASK_SIZE. > > sockptr_is_kernel() will view a tagged user pointer as a kernel pointer > and use memcpy directly and causes a kernel crash. Dave merged a patch from me to rever the optimized sockptr implementation for now. If we bring it back we should fold in your fix.