Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2596334rdb; Wed, 4 Oct 2023 06:13:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECDDujAy6HL3VH47iF0zKOM01sdzvGq/sz3UXyuvlmEnYFsGg9PTd2ewqBpcJyNPQG3+sS X-Received: by 2002:a05:6e02:e08:b0:34f:c40c:6cc with SMTP id a8-20020a056e020e0800b0034fc40c06ccmr2016367ilk.1.1696425220808; Wed, 04 Oct 2023 06:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696425220; cv=none; d=google.com; s=arc-20160816; b=v8TTR+CWQgNWraxeOxu+R+PAxYaRp4LLTD7i5PQgHxpx+JyceyuTd+scDSI+d+qAs6 y7YJv1Twk5ehDeTJsa1G7Bh9dGMaeESwEMWwnnSTWn/7hOlUDm1KbsILIx69L+vLzJrT +F4M8gEA7rT/MT+0DWpXB7t43l8O7S7NvjyD1blVBfvEWO2XY/CbVxiQ7SScxVQYco+2 5aokEDPnBmK85HXF8qfU+3iJIwAXCZqHsDRjQjhdnPLbvmMu+1ECFK5NdqQruXd9VrMU TElEc60VA3Ynnwvy200UIaoooH+uDRYKJ0WwAMmtQI49uWnCZPytwz1aH1q6ZZBJ7HBA aT/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7lveABN+E/MxDsLsQQ+0r+BzFTqqFftEbPstfitQdEE=; fh=JRoLHFGeB+1PYsNAI0nUFU4cXm9/UKbLfQUY0Mco/J4=; b=jZbG9W0blk1KEimF5eW/z+IhfNWM7yonrRsI41pnwG5GmM8qnQ/TuUGh/c1Hv4OsNT dK2g1wjUO/iVcm1Q7F9w0vPZIdhr7DBjFJ6GJzhO0HoEdyb3xD0J2/S0BOHmljcpFob6 kLbfPIIyiAZ5rgzBgHnhwVexsPC9YtTxNn0HhZlC687/PdGHBIIIgUOjTpv58K5L/qPP gx1mId5KrXGhiUwkAA9IOsmEe3B1fyb0MFUduNSTvIJ0dhzYmjf3oz57oK3VCmaNdLJd wLcFAfAOonD723W3ej04bbeVrDXeCGixbnJtdH9jKnVVtcfAFwk+pa6F9DRNgf07BsC/ ogPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z5dGZ5Fq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e2-20020a637442000000b005859da6172bsi3568214pgn.727.2023.10.04.06.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 06:13:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z5dGZ5Fq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 52E018217066; Wed, 4 Oct 2023 06:13:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242586AbjJDNNk (ORCPT + 99 others); Wed, 4 Oct 2023 09:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242591AbjJDNNj (ORCPT ); Wed, 4 Oct 2023 09:13:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96286B0; Wed, 4 Oct 2023 06:13:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD4D5C433CA; Wed, 4 Oct 2023 13:13:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696425215; bh=AtR3jS8UHoPaRMGlNzzPwqxBetaAOpzmhjBTKMuRs1A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=z5dGZ5FqhPN0NLS42MlP7ZTzAfg1JqRm6d9pexc8zXOyVcw1I5JhLqTO2ghKqeeT9 sXXkZqKXnQLqubrYK3rcsRnW9dlKJCjgCt4akVNqDu7kSpfKOe1mCMCJ+LMjvP5DPL iNrS1nqTKtwimiGSQ1+bDS9ufwpPwEgoRu06XGKU= Date: Wed, 4 Oct 2023 15:13:32 +0200 From: Greg Kroah-Hartman To: Lee Jones Cc: linux-kernel@vger.kernel.org, Daniel Starke , Fedor Pchelkin , Jiri Slaby , linux-serial@vger.kernel.org, syzbot+5f47a8cea6a12b77a876@syzkaller.appspotmail.com Subject: Re: [PATCH 1/1] tty: n_gsm: Avoid sleeping during .write() whilst atomic Message-ID: <2023100409-brethren-gauntlet-965e@gregkh> References: <20231003170020.830242-1-lee@kernel.org> <2023100320-immorally-outboard-573a@gregkh> <20231003185500.GD8453@google.com> <2023100457-entail-freefall-06fd@gregkh> <20231004090918.GB9374@google.com> <2023100425-unwieldy-reaffirm-2a1b@gregkh> <20231004125758.GB83257@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004125758.GB83257@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 06:13:39 -0700 (PDT) On Wed, Oct 04, 2023 at 01:57:58PM +0100, Lee Jones wrote: > On Wed, 04 Oct 2023, Greg Kroah-Hartman wrote: > > > On Wed, Oct 04, 2023 at 10:09:18AM +0100, Lee Jones wrote: > > > On Wed, 04 Oct 2023, Greg Kroah-Hartman wrote: > > > > > > > On Tue, Oct 03, 2023 at 07:55:00PM +0100, Lee Jones wrote: > > > > > On Tue, 03 Oct 2023, Greg Kroah-Hartman wrote: > > > > > > > > > > > On Tue, Oct 03, 2023 at 06:00:20PM +0100, Lee Jones wrote: > > > > > > > The important part of the call stack being: > > > > > > > > > > > > > > gsmld_write() # Takes a lock and disables IRQs > > > > > > > con_write() > > > > > > > console_lock() > > > > > > > > > > > > Wait, why is the n_gsm line discipline being used for a console? > > > > > > > > > > > > What hardware/protocol wants this to happen? > > > > > > > > > > > > gsm I thought was for a very specific type of device, not a console. > > > > > > > > > > > > As per: > > > > > > https://www.kernel.org/doc/html/v5.9/driver-api/serial/n_gsm.html > > > > > > this is a specific modem protocol, why is con_write() being called? > > > > > > > > > > What it's meant for and what random users can make it do are likely to > > > > > be quite separate questions. This scenario is user driven and can be > > > > > replicated simply by issuing a few syscalls (open, ioctl, write). > > > > > > > > I would recommend that any distro/system that does not want to support > > > > this specific hardware protocol, just disable it for now (it's marked as > > > > experimental too), if they don't want to deal with the potential > > > > sleep-while-atomic issue. > > > > > > n_gsm is available on all the systems I have available. The mention of > > > 'EXPERIMENTAL' in the module description appears to have zero effect on > > > whether distros choose to make it available or not. If you're saying > > > that we know this module is BROKEN however, then perhaps we should mark > > > it as such. > > > > Also, I think this requires root to set this line discipline to the > > console, right? A normal user can't do that, or am I missing a code > > path here? > > I haven't been testing long, but yes, early indications show that root > is required. Oh good, then this really isn't that high of a priority to get fixed as root can do much worse things :) thanks, greg k-h