Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2993079lqo; Tue, 21 May 2024 03:47:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVltW9/AjM54HNS6PkDGnDnJUao2OWupAlCk1waaSPJuhB2qLa7nnb2HouzUi4JL+D9RNAxDBJMImOJfXGgQp8L7kcb+Pu7f5AaQFV7Zw== X-Google-Smtp-Source: AGHT+IE9e/V342W7HqnPMba/Huc/ik72GzqdddFd+wpQOlK42HhXI5onbQ4RPJGU0VDgA1JPx5Vl X-Received: by 2002:a05:6a21:3a83:b0:1b1:d91b:3d7b with SMTP id adf61e73a8af0-1b1d91b3e29mr5535552637.25.1716288432672; Tue, 21 May 2024 03:47:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716288432; cv=pass; d=google.com; s=arc-20160816; b=0QCK33ytiYU4StnkOhejqv5jmhslDZdOO+PWLcdDyI0rbkDx237iGai81pRjNqPeTU xlVlS4oxiWGZkxFp9sXnkCx052gTAaOw3Zkoo0zTjGJqeuZ3yRPZ4mb5K6YiqLlfyqoy bohS2aWW9+DglH2uCBX+c8e4SKwMy3yrkdaKE2WX+d8Zt0QMoRMG4NrOEMEd4H/ZudHG S3ky88KBA/ypNuT/hjYo7lBhM/IH9rYikwLqSNK48LndH/TBMzTiL3hbL9YZdMoH6ZVP QutlgcOcW38aTrvELs+3cVltkSzc4s14l8brg7iy7LtSBmufvhgHQL+HQZtF3iWSo67e Ge1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=wuaVmJGr5Kq6ft/XK2PUm0gpxXEysYv+8xDN87xLZ7E=; fh=hUWbz8H3BNC4Z6+hl4w0dVHdrJzbh18Wd/6leUihgaY=; b=FP/TpWvqbkjxwDfHDacQbXaZsyyvuJKawXks9Ah2+ulRzG4XcQa/aHBq1KH1FfN/Zy an4ho0w4KRBYyXzapxhbT0pDULmFmPw6ntjaJzTxRoRZCjUI4omSdwTNs41tCqGf+85l qry18E6mrntH73v53rCs/4OoWpoIYJpgKGgdizzvTgAk/QElX8ed/bdMoGsUe2zqgPVm 7n9hZW6sTZuNomoS7vmR5GHiDP2EH+P8s1lmi9j/A5kynl22dafEwxWdWIapl8KyISGG RizvlSPkSJiNrk2Y7cbP39v8vTFcIIYCwmTlDmmQGrk5XYOwUgWT0bMdj/m3IC+A6+vD 6nkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-184818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-658d180151asi1623572a12.369.2024.05.21.03.47.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 03:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-184818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F7FD282556 for ; Tue, 21 May 2024 10:47:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 588F26D1BC; Tue, 21 May 2024 10:47:06 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 44F0645BE4; Tue, 21 May 2024 10:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716288425; cv=none; b=HRehXNVGFczj7pzyxnGTGlOL9ec6fzfkBYUEdIK3QpantXcAqsCCT1OUnzUmR81wPBxYLdOa/xqzO6PC2CBryLsFXcRO73h0Iv18XNrpTGJxw2rQHr/EtSONOAB7GAhWUIjtxowN/wBIQ35wBWIA+s/pcRL8W0VQCY/M/j6KKe0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716288425; c=relaxed/simple; bh=hJS2RR8aVknN6ThkqUFI7laRMezAFpVk76pzBbaVOcM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=p/8tZDXujVw81bgHb5UIZ9V6aqlJDYO60lkMBEZqIOTk/d4NBMm8qok4UTVG9JoKLhWhb4K3ZUwkXOeRTl9QOiMJJKlf8iQIyJdXnrxGbrWyIYe0GEp5dLzQWo6q00ltHV9n35ATf5CsyVYRQgl+zy2Zf4Epf/U1cc3z3a8Zwvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4202ca70287so21794415e9.3; Tue, 21 May 2024 03:47:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716288422; x=1716893222; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wuaVmJGr5Kq6ft/XK2PUm0gpxXEysYv+8xDN87xLZ7E=; b=h3tb6RW64EgpMDcZUwTwPVPiO62lMzcRJ8k46CP6F7B760vJCnLmnVVL1MDCkO6530 bitKTeiBSQLq1SvQEmUVOQwyxy49+6/S5M/FKkO4BLeZwq2fvdC/qVOS4ULXsrnHDzje 21kJIJVawaEJGw7VPDhxnjzgirzc0PsTKuKaFEUbLeCH8CWmO0KvN6CKas4mUBdyjxbc 0z+2lfzIySOQVg7Y+IHDAjUM3GYfKJiULyRZGrGSNhMcmARJrBFe1a5gxxE49KTnpXtp A1FYFrN9zfK/ZtsPR+CQjKnXQNIqZVyOXRMgwCilAZP64smZ6n4bSyIaPXzMjqRln6Ze FDPw== X-Forwarded-Encrypted: i=1; AJvYcCW8Jl32KHGwn9m9wbksjmh2L096VScE1W96stVu7gGzbfrN4IGfJRUsRkNW5sHrtjwoTqhRFepc/bOrqWoCU4yxjPaKadIVxTMK41KWa1EzS4DWoCfw7JfVKo+ibTQPlj/zslVZQ/o6CclO X-Gm-Message-State: AOJu0YyeWdjCHmS5mpRECEnfX7HlOJHPvoe4VNuoqxXRZSD6tpZWckAu RnqprjPZNM4U9/wQuJyTcOJHyVYZkXdBIhIFdSR+RyYp3EiR/Q+hyPKSjg== X-Received: by 2002:a05:600c:a02:b0:41f:d1e0:5ba9 with SMTP id 5b1f17b1804b1-41fead64487mr335747315e9.37.1716288422266; Tue, 21 May 2024 03:47:02 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:69? ([2a0b:e7c0:0:107::aaaa:69]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccbe9011sm458838635e9.7.2024.05.21.03.47.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 03:47:01 -0700 (PDT) Message-ID: <63a5a3c5-8362-4b93-a50e-10c9cdcffdd2@kernel.org> Date: Tue, 21 May 2024 12:47:00 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: N_HDLC line discipline: Race condition To: Dianne Skoll , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman References: <20240424173114.035ddd7b@gato.skoll.ca> <20240425140127.6504ade1@gato.skoll.ca> Content-Language: en-US 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 cDpcLM2LMhlHBip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IIxXxt9FJaGc1Bgsi5K/+dyTKL wLMJgiBzbVx8G+fCJJ9YtlNOPWhbKPlrQ8+AY52Aagi9WNhe6XfJdh5g6ptiOILm330mkR4g W6nEgZVyIyTq3ekOuruftWL99qpP5zi+eNrMmLRQx9iecDNgFr342R9bTDlb1TLuRb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240425140127.6504ade1@gato.skoll.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25. 04. 24, 20:01, Dianne Skoll wrote: > Hi, > > I have (somewhat) narrowed down when the kernel bug appeared by installing > Debian 10, 11 and 12 in KVM virtual machines. > > The bug is NOT present in Debian 10, kernel version 4.19.67. > > The bug IS present in Debian 11, kernel version 5.10.209 > > The bug IS present in Debian 12, kernel version 6.1.85 > > So I guess it was introduced sometime between 4.19.67 and 5.10.209. I'll > take a look to see if I can do a git bisect. > > [To recap, the bug is that the N_HDLC line discipline sometimes > coalesces two write()s so you get them both back in a single read() > which is contrary to what it's supposed to do... preserve the write > boundaries as individual frames.] I believe it is a correct behavior after all. As you use pty for testing, the "framing" is lost during the pty-to-pty pass on the flush to ldisc path (receive_buf()). [ T1056] n_hdlc_send_frames: ptm2 sending frame 0000000081e69927, count=6 [ T1056] frame 0000000081e69927 completed [ T1056] n_hdlc_send_frames: ptm2 sending frame 00000000576db119, count=5 [ T1056] frame 00000000576db119 completed [ T123] n_hdlc_tty_receive: pts2 buf=00000000a616a2be count=11 [ T1056] n_hdlc_tty_read: pts2 rbuf=00000000a616a2be kbuf=000000004abc3c35 offset=0 ret=11 thanks, -- js suse labs