Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp334264lqp; Fri, 12 Apr 2024 22:09:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWy5PS6flmyyh3ipXfODV9VpKnnNf+T1g6/Wlg++X73z7Gp2EGLvxAlzR9Ww79hxeOLk7l0VMPsbmtTZX/6dr6r/6WlA6nmHoOtF11dBQ== X-Google-Smtp-Source: AGHT+IEewIutC0wDz4Y+b4U4zcLYPGFDfIxWceuKwgxwQZPi1/afYoE4PvcxNSyDzlh+Wun2FVu6 X-Received: by 2002:ac8:5803:0:b0:436:b3a6:c7f0 with SMTP id g3-20020ac85803000000b00436b3a6c7f0mr2020548qtg.34.1712984945844; Fri, 12 Apr 2024 22:09:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712984945; cv=pass; d=google.com; s=arc-20160816; b=cMWX0ZXJIvzL3sW+fOC6ODGumd8EuSuJIgeLo4UxifLSa8+KzSEN221/pU5zURgKyU J+48iUnzc23nI07rNBlbr5b7l4vze3Vwb8tjhArp4Gx7l26H0tt5Q68aZ7bIicldOzGO /3fhiIX0pLJlX3iulHRh7eI852LKlCDG3b1oPBbq26i8HPpVRsbuENoJkfVjbM+XwjAd svU5+2GpoXeL1J3lkjFVNd9xPaiJzSogP4xFwMUOi/Z7S25imBNNgazVwTj3CXSiTfte JF0IPcEUge5J1GqGTJF5/PdWqLi37gSJ4Whod9H7n9Un6K0MVGel5SFw2LbfMLXLscYS NFZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=5qvXKC5wSDQIOCusiNuNNePSI2BJ5XEbrAPDJxd5/Tg=; fh=EDfjBLe1lemz5ppHAShVbzd9zc3fWlEb/dmH7Y+coK8=; b=mj/5cndqDkM7Pk12Q4ChUAGw78wyPTmaLOMXJXeKITSGvBEbZzCU2PFROq/OtBRi4J mj1XAynhcneEfF35HNPnQ4pD6hVc+Xx+liCVv+P/6nRkQZakAUpdT5H6hQ7OzmxbyaUn 4RkDCaJZ4xMDCDw7YyfOR5b9TR0w2fzAWAfmlqEwrzmJcCGeBQ88wk1+uKieRGfJYRA8 RZJGjwRoMMBpzZ6JtFtouGZhRHyN1RyeKAo18u4p8JmTPym41HSgRTCmqqvQ+8r6vQ4e VkCqhljKUIZtDNrHNCrKD/Vcx+phKSzsQtq/XDZgEOblNendge72cAfujBPOCG3u9+wS xvlw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QBDZWn3N; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-143580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 16-20020ac85710000000b004346027ee25si5147196qtw.333.2024.04.12.22.09.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 22:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QBDZWn3N; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-143580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F7F11C21E86 for ; Sat, 13 Apr 2024 05:09:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 613521C6BB; Sat, 13 Apr 2024 05:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QBDZWn3N" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 117EA33EE; Sat, 13 Apr 2024 05:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712984936; cv=none; b=od6E46t5l5cBrloapfUu+zBEfh4yXO2GHuZW50V8maQVZMeNJMicIncwYnX/TeJ2YcJz3m02FmNUQx36dyLpo5F14JSC+eVqWiI/iXNRDbiguurVgfRInceVI9Ufbn3lB3vpbfwQqzrLCMNfpCiZwpFOZxJVs6nI6svP9SAI4Rs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712984936; c=relaxed/simple; bh=bIQsW1CPYkILDa5kQaHHU3RJyOH+XS4wmaA2E+aT+gg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aGtySnda3HXTF1kqAck8Ia3pVe9vYHWlgNdLlASHZ3Gv3EURGL8knZefTL9cmitp4xKJ9BRPV8sFAWgHsPMg+GCekgR4aHV+llYMzn3NAqQ6xJ5NRGlP5BgLIn5MmVnzHrmhjNnD4pEqwGJI2Hga34Kn2K7pgpaJ2//Aq4Fwugw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QBDZWn3N; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a46a7208eedso211990766b.0; Fri, 12 Apr 2024 22:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712984933; x=1713589733; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5qvXKC5wSDQIOCusiNuNNePSI2BJ5XEbrAPDJxd5/Tg=; b=QBDZWn3N5Cn24lucqpOa/n4BaFh0xdHWx5P6f5kP6HCI4vMXIE4RgMitKTOxMW721H peXLcue3e3zRoz0irLGVEL/niRWBB7RGfsTMQ1ea9lRjagpid39bJrWKsW9oAqbEVkpT lXw2x9p1nmaDY8B7l5sw761mP/XJGYnFHXS9WLuunGIqPsrCRNEdn3Y30eNnH+L259zA 9LB5uqE4M7E+lihqJCdbAoGhRZ55JFXhB7ToddpTlccEccpWOxhDCRKNDSF5/P3kBoRy K8v4nxbUky3i0GZWPeIzXSbWyJyUTLpl3vngACrYuXgTf1sysYh62J7+z7yz+COVHy2X jVGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712984933; x=1713589733; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5qvXKC5wSDQIOCusiNuNNePSI2BJ5XEbrAPDJxd5/Tg=; b=Ah6qovWUQH9rbjy5Y4MM/NY1izPZ7iulcEiQXPpBUfAGPMv6/JZImtb01TPs+LIhmH vrSB8O4uNGa7LzhOTKBi666wH23GXs1Bxzgo2PXW5ohBuWEPPPhWuKfG9Gvm5hqMk43h FUr7NmcovBP71oafBo3gh4uU6AZWjm613TX0QEm8YTSjHQmKQM2Ufh91ihzJyTEaN6zV HGI5f2ctb6afTgSuj7vgeKfLi794MZDBk/TOjFk/GdVuUrPI/+sbC/5umvgu6rXiD71H vY7S9jRkDr94XJeS6sRlMkL0+thYJ48rpiilZAON7FU7QUnRKkhgIoFmQtNir/1vDny0 6RaA== X-Forwarded-Encrypted: i=1; AJvYcCXZT6RtHHCYwcRmGhcX8aWLck+X+27ZbkLIXArhZ0Xcwdp6tqJYioB15J9GWlUypGTqmpWm7eVRqAvSzGEkBui1LYTG4qkmBxXv X-Gm-Message-State: AOJu0Yyo2ghs4pJCEzTjJxpQ9q1sJM59F/7IjIZw9Wua82ZChdaR01YC zhjgXJURwgNs0YeuGVnrAV/wjI8t+WYrQKl0XeMkSslRrY89P3P69E+58dfYFn505Fhn5DgqpHi ikTihoMlp5By1FSiiWpySvQqMf2k= X-Received: by 2002:a17:906:d54c:b0:a51:a09c:16a5 with SMTP id cr12-20020a170906d54c00b00a51a09c16a5mr2907887ejc.23.1712984933012; Fri, 12 Apr 2024 22:08:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <92fe8e95-bc01-4d7d-9678-8cfc55cc4a7b@rowland.harvard.edu> <45e246ab-01e8-40b7-8ede-b47957df0d7b@rowland.harvard.edu> <69a6f4c9-6470-40d1-99f1-aaf532497d02@rowland.harvard.edu> In-Reply-To: <69a6f4c9-6470-40d1-99f1-aaf532497d02@rowland.harvard.edu> From: Sam Sun Date: Sat, 13 Apr 2024 13:08:41 +0800 Message-ID: Subject: Re: [Linux kernel bug] general protection fault in disable_store To: Alan Stern Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Greg KH , swboyd@chromium.org, ricardo@marliere.net, hkallweit1@gmail.com, heikki.krogerus@linux.intel.com, mathias.nyman@linux.intel.com, royluo@google.com, syzkaller-bugs@googlegroups.com, xrivendell7@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 13, 2024 at 2:11=E2=80=AFAM Alan Stern wrote: > > On Sat, Apr 13, 2024 at 12:26:07AM +0800, Sam Sun wrote: > > On Fri, Apr 12, 2024 at 10:40=E2=80=AFPM Alan Stern wrote: > > > I suspect the usb_hub_to_struct_hub() call is racing with the > > > spinlock-protected region in hub_disconnect() (in hub.c). > > > > > > > If there is any other thing I could help, please let me know. > > > > > > Try the patch below. It should eliminate that race, which hopefully > > > will fix the problem. > > > I applied this patch and tried to execute several times, no more > > kernel core dump in my environment. I think this bug is fixed by the > > patch. But I do have one more question about it. Since it is a data > > race bug, it has reproducibility issues originally. How can I confirm > > if a racy bug is fixed by test? This kind of bug might still have a > > race window but is harder to trigger. Just curious, not for this > > patch. I think this patch eliminates the racy window. > > If you don't what what is racing, then testing cannot prove that a race > is eliminated. However, if you do know where a race occurs then it's > easy to see how mutual exclusion can prevent the race from happening. > > In this case the bug might have had a different cause, something other > than a race between usb_hub_to_struct_hub() and hub_disconnect(). If > that's so then testing this patch would not be a definite proof that the > bug is gone. But if that race _is_ the cause of the bug then this patch > will fix it -- you can see that just by reading the code with no need > for testing. > > Besides, the patch is needed in any case because that race certainly > _can_ occur. And maybe not only on this pathway. > Thanks for explaining! I will check the related code next time. > May I add your "Reported-and-tested-by:" to the patch? Sure, thanks for your help! Best Regards, Yue