Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2584730rdb; Wed, 4 Oct 2023 05:58:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwErgZkoedjrRzHJA2XxOEVSc8Kl2q5UeG0b23hDUW5eqMsFY0GpWK0kVlANEjFlp1d4P3 X-Received: by 2002:a17:90b:1241:b0:274:9a85:2596 with SMTP id gx1-20020a17090b124100b002749a852596mr2088656pjb.32.1696424326701; Wed, 04 Oct 2023 05:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696424326; cv=none; d=google.com; s=arc-20160816; b=hrfTLTGk41S2F4Ugery7Dmz//zggNI4+elercOe2S9d6xXeUt2ZG0J1GxjI5+3a7rQ GTDbELZVNIroa2tiiygl0eHTuv6voAGZSYaVLowohQcwlfAzo0IImLwr36I++T98yaid GcjfQP7VtWzKgQDaZcJWWwgoYf6K/yaSqyQj/H//IrCxs8VpXit5nYOJsXDTB7zMfycR qubbW0LRRQdCFRXLQ8D39JbfCxI9FpGlIVPcMyy/EqPWbL6eVPhXFzANI59Xn/97s/4+ +M2nVkbSS5jGZOeCEBKgbKg+E1MHo5wnl1qqZRjE4jSpx5FekfCoMyVWFOFd0SU9q53y bkSA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DfXp8W3/Z1YIQXAWRy4tvnBR0VRacHfXqwp0B+zrHk4=; fh=OabIJe1AYnVSdxUUhDo+lzqWSJxt0S2XMFhWFOAsYCk=; b=LdWUEtXnSzPegUsAS69zoXhEljjFUEMLWcaCZ5rO9b+D+wSHoVbwQU2r0+8ehPv973 Zs1IyZ1go0p+5PgzrEuB/l1ouzzAptUXeZGMrzFR9IIO8of5vrxXOSOEjbiq0jSy/bwy Tv01umQD4+Qmu4he/o22IgiFOx8UyqRFgws1/lJUH6V2bNOxF1uvY3vm4bo8SO0MnqaZ exVoOe6a8GUc1Ua9NJNYYYvhoIjk8CDnNM0S1rOs4tb7VnriV6B9BiOwJVQGxOFPwZ8D 26sPoxvKhc4Ir4uF32rMxM+8WQDQ2wjmj5IgUGEVY94a3Ux1rLWJadOUTG/ALvsKfJSQ VZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d7sT6GWX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id lk15-20020a17090b33cf00b002774daac5e7si1630838pjb.0.2023.10.04.05.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d7sT6GWX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 0959182663EC; Wed, 4 Oct 2023 05:58:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242504AbjJDM6H (ORCPT + 99 others); Wed, 4 Oct 2023 08:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242354AbjJDM6G (ORCPT ); Wed, 4 Oct 2023 08:58:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634D1DC; Wed, 4 Oct 2023 05:58:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B91CC433C8; Wed, 4 Oct 2023 12:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696424283; bh=sWP2Ntp9DcBxpiuxS4XRjZnJcYZJ+LQRso0hX8SK6OE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7sT6GWXNBxb7Txv/otjKxL6J9JMmbE7bWzzXKFrD7kvj39jdbrM41xvR/ta+oRSm 4bFrbL2PW2+Q5cnajaUwJOEtogybJeKBv9gMLzrvO3s0U4Iriv6lXyxfcbm8qNNT+L 0eRc6vobJX+tpFesBEOlNMBk5/IZx0kZwf6hXBUuorTQ9JV16tfSVWFS9bcZMpV4Ad kxl61vqu/Wi7s5qltq0VoLjAWRjQNX3S6h64vE675VyFuGQqrdjahbGYV3GC4gslsi iIwCDyoapuQjxUAFz49DY4e1sooGW1euSwAjTSy16d5GDcVq+ArxlSLB92knD3woHc 3xoU7UEH1xAiQ== Date: Wed, 4 Oct 2023 13:57:58 +0100 From: Lee Jones To: Greg Kroah-Hartman 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: <20231004125758.GB83257@google.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2023100425-unwieldy-reaffirm-2a1b@gregkh> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:58:44 -0700 (PDT) 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. > Is there a reproducer somewhere for this issue that runs as a normal > user? I couldn't find one in the syzbot listings but I might have been > not looking deep enough. https://syzkaller.appspot.com/text?tag=ReproC&x=15578d8fa80000 -- Lee Jones [李琼斯]