Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp386536pxv; Thu, 22 Jul 2021 02:38:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXo6Loh0jxZJWBHVItaX5/C1UI6QiiRkP9fqkq16bI8nnobqXmz2+ZqCIH3PcvPOxNN4Pk X-Received: by 2002:a5d:928f:: with SMTP id s15mr29680679iom.142.1626946738357; Thu, 22 Jul 2021 02:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626946738; cv=none; d=google.com; s=arc-20160816; b=iockytgpMCYCkX7Fj2YTGOGVh7MmSqhSFSodICVxXM4gmYO60vg1rUS9dcBQqlDfQ0 0qHJ+aYaiDrPOpFJ5bat7+NKz7g9u5xv8QC+z8i7V+1t/Xx7jzmfYGjVEic9DSRJmAql NNi9JeOjc/Nkwpw8qOyStrSshcyhXdocZ0B8/bVZNA64fucU+eReEYHl+UoL2i7Ac5JO tlHfCwRv0uZ+IhbMl1T6ImXY7cuUYdlZTMNPEfP+XMEAr+g3WlXU+axCL/hXjhKM6Yff MeOi0WisrFoFG7NMDSb1XOUC85DLicxQ+eCWj9gA6BrkKDQRSOfm6Xjd0pdKMYBwtWca ZMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=DmYKbGpiEE7eD+Xvz3tNa7XabzRtVdg+7qC0oYGAXdM=; b=Lsqyp53VAwXFXFLT+nL9l3tr5+L/7dl4WHxU/zbIDyYNXQaOQkFjaHM1VtlWdTLUXh G3L7sxUMARALp0dTZczT2EQSA3vtLWmBHs09D3EM4OKtYnZQYjsUjzmZVhmBIEA/d6sD rqZDBAZlmuKqryor5mUJ7kF1D8m8EtzG3NYjPHopUu4ivZxExBMgb5XXd10awmccNwIb IrN7Vrp0r44+2nz0EogkX6gsjKYoGJiCkZZZa1ZPQ8dtXv0elEgVX3bj3h5k7vFk1Z/n dRx+beRWzsv3cpDC70JvNjiPTmiR/4W4ReuJx0OXkp+APvFzhGi8zH4tYIxYXLh7hiem OXvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 m10si40195738ilu.53.2021.07.22.02.38.30; Thu, 22 Jul 2021 02:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbhGVI4m (ORCPT + 99 others); Thu, 22 Jul 2021 04:56:42 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:54126 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbhGVI4m (ORCPT ); Thu, 22 Jul 2021 04:56:42 -0400 Received: from fsav119.sakura.ne.jp (fsav119.sakura.ne.jp [27.133.134.246]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 16M9b0cC038549; Thu, 22 Jul 2021 18:37:00 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav119.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp); Thu, 22 Jul 2021 18:37:00 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 16M9b0RL038546 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Jul 2021 18:37:00 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) From: Tetsuo Handa Subject: Re: [PATCH v3] Bluetooth: call lock_sock() outside of spinlock section To: LinMa <3160105373@zju.edu.cn> Cc: Desmond Cheong Zhi Xi , Luiz Augusto von Dentz , Johan Hedberg , Marcel Holtmann , "linux-bluetooth@vger.kernel.org" , "David S. Miller" , Jakub Kicinski , "open list:NETWORKING [GENERAL]" References: <20210627131134.5434-1-penguin-kernel@I-love.SAKURA.ne.jp> <9deece33-5d7f-9dcb-9aaa-94c60d28fc9a@i-love.sakura.ne.jp> <48d66166-4d39-4fe2-3392-7e0c84b9bdb3@i-love.sakura.ne.jp> <674e6b1c.4780d.17aa81ee04c.Coremail.linma@zju.edu.cn> <2b0e515c-6381-bffe-7742-05148e1e2dcb@gmail.com> <4b955786-d233-8d3f-4445-2422c1daf754@gmail.com> <4bd89382.4d087.17aafed62b1.Coremail.3160105373@zju.edu.cn> Message-ID: Date: Thu, 22 Jul 2021 18:36:58 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <4bd89382.4d087.17aafed62b1.Coremail.3160105373@zju.edu.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 2021/07/17 0:26, LinMa wrote: > Hello everyone, > > Sorry, it's my fault to cause the misunderstanding. > > As I keep mentioning "hci_sock_sendmsg()" instead of "hci_sock_bound_ioctl()". In fact, > both these two functions are able to cause the race. I sent two patches for avoiding page fault with kernel lock held. [PATCH v2] Bluetooth: reorganize ioctls from hci_sock_bound_ioctl() https://lkml.kernel.org/r/39b677ce-dcbf-6393-6279-88ed3a9e570e@i-love.sakura.ne.jp [PATCH] Bluetooth: reorganize functions from hci_sock_sendmsg() https://lkml.kernel.org/r/20210722074208.8040-1-penguin-kernel@I-love.SAKURA.ne.jp These two patches will eliminate user-controlled delay at lock_sock() which [PATCH v3] Bluetooth: call lock_sock() outside of spinlock section https://lkml.kernel.org/r/48d66166-4d39-4fe2-3392-7e0c84b9bdb3@i-love.sakura.ne.jp would suffer. Are you aware of more locations which trigger page fault with sock lock held? If none, we can send these three patches together. If we are absolutely sure that there is no more locations, we could try choice (1) or (2) at https://lkml.kernel.org/r/05535d35-30d6-28b6-067e-272d01679d24@i-love.sakura.ne.jp .