From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E47644D6B2 for ; Mon, 7 Sep 2026 09:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788774649; cv=none; b=CsY9S2tGvvmVAPLVX1T6Kvitr5czzwoiDAH9MsbPMm2FP9xb1hwPpI3yaUegtLuUCUXrkrHBbyR0zTcJ8hX0ZxvTIcivVhehnM1HBw2j966lu9or7lwif829nog1C1PRW+5pT2q9CegYMzbIIfvvsA10HZt3m7yd2yIX+hVe8dQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788774649; c=relaxed/simple; bh=q1vbWVYZfrrPPpMgx2AV24vWcv0xH2e65F7GQzJtG90=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Za5jKxp3pBrpStEPVEa6zsav2J/RnUyyVXsppEIdxSlLH9nIur6S8gyw002M63BImsHzYlRZC0JPLcPWVlV65OJkpB9Q9ppXIB1fdKDDH3QTfQR9QvSu7j0Ti/h74BK72kQLFL70dnQuuqXpPakecqLYJGxiRo1MnQ8pheVtbrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=M5ZCkBe0; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="M5ZCkBe0" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4859245e493so1413533f8f.1 for ; Mon, 07 Sep 2026 02:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1788774643; x=1789379443; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Lb18HKgR/gRWdLmmzTs+5hKvWsiCHq7F1zLseYYFjf8=; b=M5ZCkBe0qY4Z0O/QQzvNMUKVIXcH6wv0+nvIeiAKOFKc/QGURoG9U1KFDc8NXZkbgG iqwN6IG+U8C54EMszpWtvZLkCiukA1HJ60+EwKslM5Lo3F/wZokyDpAqy9AFLdombz0l dRYIVfVf+hygi1SUnck4u50HlCx2xrhmgQcBnYu40ZkF8ZTBx5qB0b3mv+nqmqOZ5UlR nLFTdezqgzh/heqYTsekxmw7Zuh7YpU3dXYrgoXEPKvSeMOxE7dRWopWdTjYF8cTID16 9W+KDPPNdEdSrUg8aqX/Qav733VUyd5Om2Ts7kAM0vWX2kRggesZWvSzhXYwyU6OpzMM wjtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788774643; x=1789379443; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Lb18HKgR/gRWdLmmzTs+5hKvWsiCHq7F1zLseYYFjf8=; b=iWMD8ooK/P/mmqBYzFjHj/QSoZd1HrPVXWNdtfy16sCqNERHD8MrF9oTtL+s4X8rtf AONdKNA/MSwwKVgWbTWoIXLnZ5DCK1b/09uheCVOwOVwzpJL5Z3UQSGqnW1dPyFhZNAC /Kl0Ej152xmDs0rEZdFQ2WvajNXASxmmceUaGDESL1daQiYy5hCm0/DHR6HDcvV7Vmf+ afF6Wm/Pu5MZS9ysPBSuYO5ECh8RhDIQBcnHZAge+wir8bngWLRJU6olJvL7sFYINuDr GM42hsgzOV9rXrOz6KWEYiwOC6YTK2LrefIMxZ/9VVtqLlJy9mw521J84PK+912kMI/m E/yA== X-Forwarded-Encrypted: i=1; AKwUvBye24BLNTGMEOJb/cWOI5Phe42X253hmtnoZSpNrGHfHtLM4ogNCkAZuAtMeyIcQWbVbxp1pvvBLcE=@vger.kernel.org X-Gm-Message-State: AFuF++m5BMjfrM6/jUGZDQSwUP4GfCJpHVLUepLFOizNBkpY+IVAtsXO RaY2fI3YwuOhuQl5c0XEGfFVLdhAekPDyiYkPVUf17flSkR98k/C5nXy/qHHR9sJ5qG88HZDZgp yOQyU2ek= X-Gm-Gg: AYBFou1+BorJdd0jhXtqWz4Dpn6e1b9UQcm7upqsm7iiGEzXmL4aEXIRKC7fY37QVAf bEw86Qds2cgay7sxTOge0ki572f1+PAYomV9lbMruNb5wwW8Vp/3b5jQisPRbuDw1k3wPBYyS4+ Uq1qTwM5my1QSNtLY9HwaDd4OuJNSsxOIH7SPWCbb/+O4O21k00OZT9AvDU8q6LFaOAYpsolDyi axhbzvYlFPiWtaouJML8Ti2rThmbfW8HmNucQQFBPjnghFRi4s1TkpqyuMDtP+3WCUHeQEPRN8h lwBJkZZJhDaBHDYcWJKFZaGtztO7bOHuRpw4ZQrjK+2MXUSAejHR2ObAeuW19vuWMfWPlF4U/oh CkMBhDcHmCZ8DxDNys2dtzaT+mj7Lg+cXsmadKzmTM+pv5e9rYJcRQiAjkBXjD/OvSjFaOd0YSN XMXUzIL7vdjJEnby3KTGKM4sTe8PTHxi7uxoEynBLDmASNXELkdcLmvtKX8dmDlTQf3J+5X3roY 7pxWTt3zFhVg49oO1BEbQKpZpc= X-Received: by 2002:a05:6000:470a:b0:47f:4919:d5b2 with SMTP id ffacd0b85a97d-4858707f262mr23189860f8f.1.1788774642756; Mon, 07 Sep 2026 02:50:42 -0700 (PDT) Received: from ?IPV6:2001:a61:1340:dc01:654b:3cf0:59cd:498? ([2001:a61:1340:dc01:654b:3cf0:59cd:498]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4859207c28fsm20770188f8f.5.2026.09.07.02.50.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Sep 2026 02:50:42 -0700 (PDT) Message-ID: <72615ee3-46eb-4639-a408-ba29c1235d08@suse.com> Date: Mon, 7 Sep 2026 11:50:41 +0200 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] USB: cdc-acm: fix racy TIOCMIWAIT implementation To: Johan Hovold , Oliver Neukum Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260907065501.101013-1-johan@kernel.org> Content-Language: en-US From: Oliver Neukum In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07.09.26 10:47, Johan Hovold wrote: > On Mon, Sep 07, 2026 at 10:17:38AM +0200, Oliver Neukum wrote: >> On 07.09.26 08:55, Johan Hovold wrote: >>> The wakeup condition needs to be checked after adding the task to the >>> waitqueue and updating the task state to avoid missing a racing modem >>> status update or disconnect. >> >> I am sorry, but in this case I have to ask: >> Isn't TIOCMIWAIT inherently racy against the hardware? > > What do you mean? The interface does not state from or to which state it changed. Now you could say that it is implicitly the last time TIOCMGET was called, but that is 1. not clearly stated 2. not enforceable > Looking at the implementation again now, it seems further changes are > needed to fix the implementation, though. The completion handler should > not be updating old_count. That's for each TIOCMIWAIT to do. I am sorry to be obnoxious about that, but I am afraid that would break TIOCGICOUNT Regards Oliver