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.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 6DC8CC63793 for ; Thu, 22 Jul 2021 09:37:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58CD26120C for ; Thu, 22 Jul 2021 09:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231379AbhGVI4m (ORCPT ); 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: netdev@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 .