Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2461717rdb; Wed, 4 Oct 2023 01:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuRcIhpU71VSpl8QKhvdXSsVsunT7W9SCk/+/qBjNZzY5fP5GDA+2QU0omgh4IBbeQW673 X-Received: by 2002:a17:903:120f:b0:1bb:994c:bc43 with SMTP id l15-20020a170903120f00b001bb994cbc43mr1878375plh.18.1696408876765; Wed, 04 Oct 2023 01:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696408876; cv=none; d=google.com; s=arc-20160816; b=ZJH7ldmDWw/ojvMxfYmfaX5/tnlVr1Go7ABw4Rh/Rn5Z3GGeIP4TP7GB/nLQ/wpB7u jvzSRAB3ZyuOywk0nNghpVXbrg8zFG9qEsEaybjoRsBgvSDrC0yExumPonle7DL7o9ky 62KbE8++LjCujTNdVdA/43YTqxZPZ2TSKnJYDJNNxoIs5jz2i2LURru5uK/7CzAlLisY cUFnAyVhY0/Q14XQjpFBQ1AZG11pu3XsbCAJNW4SgFM1SjJWWe+bRcEfYmxAv/MIETno afXLwCMQCkgcDaDJIDYub+ahkHPtAzhg37aoXWLyhATyMpaD8xSKkWEHrCAsgzhrgUIN 94jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=JwS6r/k20TxWUixpI6BWekpE6wEIncfWTUeXYGGnevg=; fh=TkLvyj4f4nfnPjIkQWdx6t9wRzarqtrwNV1evyskmx8=; b=GV3LRbqJ0cAikwNu5UAB/deMiwtoQbqyhRPAdTI72XsVL4nCNDNvhaLW58hZtscPeX 5uoJCZ3d5h3Pw+Mkt99EWXLtAvXeGF6WpMv2J0aO1sfL9UfXuUX5F5nDyeFL3pXIHNqh kGzm6XBBYfjvy5cyDGN7i70wak970ZpT8d/8f1KSO8zFoF/MT3T+5bdRdHBZWFQTzl5l XgjkrOY6AYvV0Gaix9Kr5AZuts9bhDgIzcfO8nfkXQ2BpfQnt/GjJwlSenrbFSQ/laGo 3aF74COrjLbqA8NQiPar8maHJWt44ruVyEPAbbgj6+pGEb85JH6BM+q5+vgXx7KlJX7G hCLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e6-20020a170902cf4600b001bf1a9dbcc9si3073705plg.549.2023.10.04.01.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 01:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4BA8D81E1B78; Wed, 4 Oct 2023 01:41:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241728AbjJDIku (ORCPT + 99 others); Wed, 4 Oct 2023 04:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241691AbjJDIkt (ORCPT ); Wed, 4 Oct 2023 04:40:49 -0400 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29F74BD; Wed, 4 Oct 2023 01:40:46 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso18861075e9.3; Wed, 04 Oct 2023 01:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696408844; x=1697013644; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JwS6r/k20TxWUixpI6BWekpE6wEIncfWTUeXYGGnevg=; b=L0LQ+G6aZQszQBKwUcLSxXPvX38S1SliohB91E/e/U6s/twN2xKnOy6+I3xb39i1Hf RY6SruohkJxuAxvJ/RGGHrK0RtV8SSY8Zya/fI5T9p7ckpGOP82qlHbwnFeaNbjDO/6k GoWYsSaXzwtBdq52IVF6Qa7uZKusFUCnze1v9dQy12jnIz/Cy4kWc9UeT8jgR/H9AlDA W9xF8byGbSFbyFEaCQ4dKavQJmMKSIYumpWzfpAYzL+Jt+JzXTMx9SsnldExYeN6Dmeg JHvU48XCI4DNWGJdh/l9vlkrPzC3X9hAFihLymAsw8x0kiU+xq44nvnb0mU5ia99Wb0g Zk0w== X-Gm-Message-State: AOJu0YxCpvDwraomHkx2Q2mCMyF5TqEkyKAVKdG9vGv8RuTklaQEIhRt BNj7pdnZdq3m9x9yzYyBqjM= X-Received: by 2002:a7b:cd11:0:b0:405:40ec:415d with SMTP id f17-20020a7bcd11000000b0040540ec415dmr1583850wmj.39.1696408844151; Wed, 04 Oct 2023 01:40:44 -0700 (PDT) Received: from [192.168.1.58] (185-219-167-24-static.vivo.cz. [185.219.167.24]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c229100b00405959469afsm946544wmf.3.2023.10.04.01.40.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 01:40:43 -0700 (PDT) Message-ID: <49453ebd-b321-4f34-a1a5-d828d8881010@kernel.org> Date: Wed, 4 Oct 2023 10:40:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] tty: n_gsm: Avoid sleeping during .write() whilst atomic Content-Language: en-US To: Greg Kroah-Hartman , "Starke, Daniel" Cc: Lee Jones , "linux-kernel@vger.kernel.org" , Fedor Pchelkin , "linux-serial@vger.kernel.org" , "syzbot+5f47a8cea6a12b77a876@syzkaller.appspotmail.com" References: <20231003170020.830242-1-lee@kernel.org> <2023100320-immorally-outboard-573a@gregkh> <2023100421-negotiate-stammer-1b35@gregkh> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwN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IWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <2023100421-negotiate-stammer-1b35@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 04 Oct 2023 01:41:14 -0700 (PDT) On 04. 10. 23, 8:05, Greg Kroah-Hartman wrote: > On Wed, Oct 04, 2023 at 05:59:09AM +0000, Starke, Daniel wrote: >>> Daniel, any thoughts? >> >> Our application of this protocol is only with specific modems to enable >> circuit switched operation (handling calls, selecting/querying networks, >> etc.) while doing packet switched communication (i.e. IP traffic over PPP). >> The protocol was developed for such use cases. >> >> Regarding the issue itself: >> There was already an attempt to fix all this by switching from spinlocks to >> mutexes resulting in ~20% performance loss. However, the patch was reverted >> as it did not handle the T1 timer leading into sleep during atomic within >> gsm_dlci_t1() on every mutex lock there. >> There was also a suggestion to fix this in do_con_write() as >> tty_operations::write() appears to be documented as "not allowed to sleep". >> The patch for this was rejected. It did not fix the issue within n_gsm. >> >> Link: https://lore.kernel.org/all/20221203215518.8150-1-pchelkin@ispras.ru/ >> Link: https://lore.kernel.org/all/20221212023530.2498025-1-zengheng4@huawei.com/ >> Link: https://lore.kernel.org/all/5a994a13-d1f2-87a8-09e4-a877e65ed166@kernel.org/ > > Ok, I thought I remembered this, I'll just drop this patch from my > review queue and wait for a better solution if it ever comes up as this > isn't a real issue that people are seeing on actual systems, but just a > syzbot report. I remember too and it is not easy. So without actually looking into the code, can we just somehow disallow attaching this line discipline to a console (ban such a TIOCSETD) and be done with this issue? IOW disallow root to shoot their foot. regards, -- js suse labs