From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (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 CC964388E69 for ; Tue, 11 Aug 2026 22:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786488810; cv=none; b=px5GYOJxtUSdJjEpM3KRhrX8qejPitYZXAP32WoEqO+1DlbwEZ7bgdbXlWwZDKwfmKIzdnMR+4c41Z4NQC+aPw5zT5rgGvg2UhRNc3oN+bougEhW0HWek5KnYh7Ah9XKOnCSvH+siVe/eGhxv+k9QO6PCHreA0CTlXkHUg14hkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786488810; c=relaxed/simple; bh=YQ4HAHTxj7qU6tYzGeoF602jIIrwnSrAyak9jpfBM0s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JkEsNkAwvpHmM26nl96fP6MRLG8dlwS3uRr108Vlfs5nLxQrZfVYM/zBTHl6NTmYErnHkmQogmkOqSphIzs27vApXitRc9fSVTxj1ei3yIyRlLYaoecJrO2dgQTYjAe/i+o/Ch0rGm3z0cPC6reZTlDatFTLmqna9JOMjhwm17I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GFB4z8s8; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GFB4z8s8" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-43b7e186a0cso141593fac.0 for ; Tue, 11 Aug 2026 15:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1786488806; x=1787093606; 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=QLL9rTiC5SLvih2di+U6KnSJGxV2qGIcYMvCuEbtdHg=; b=GFB4z8s8NqXqYjmAJ6ORpacQteJA2ym8BFTZTn8BRm3RLtVRUKBijbN5H+XCrt9XKw DkodzQc276FLJamuFjAbYH1UqyfoflCCEWPslIx86vCqPxqwVKnj0y3DPzNTF66vNDQ4 IJZMBUhqoqwlUKSZ0rs0GeJVKFia7Cdg2VIOo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786488806; x=1787093606; 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=QLL9rTiC5SLvih2di+U6KnSJGxV2qGIcYMvCuEbtdHg=; b=a/Ch0nB9NcaK1QtKyTtVWdDJjOULNi7+j2XZwYtxWiKP+e8FjozXcOev2gHUOlEL0P 28usfPyTxV5aJK/wcLId91R2v2ezzxKVvZDKGgQOyilu1H0fUK0W1M/hmmYYnFTGQ5ad 23P61O+k0boje3oZutxN2uAmYPZsGOHPjO57ce1AQ0jY2iqLRQ0veI3hZOesDZyB6dnM yCPKgzJvgvvUXXFx+nJVii0W9DLrIQtW1nxRtI/wVDmUNuiku2sIklj7InzuPkLoaJiK LGFo80miMkJoqe0KCTVfu+zkXAAnB7Jn6s9GBy9h9r/l8KnM5kqlRI7SdIAIFYTJhaM8 lswg== X-Forwarded-Encrypted: i=1; AHgh+RqbPrd+tjBBk0g8ueUSvSTmii7YGnNN2OXjnOLfqNQRgdw1QhV48SQHtycm5s9a26zaDwgpqn4pSgmo2WQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwaVDOL5n4q5Lo8gquorqaKEYy311G6Eclg5aGdNwPAZRKZfaNp qMXTiWImqATp4ZEz3w9JAUE4KLjffkT1nQm5bbkSlHigXv2kpSn1bN20urQBMYPeVxM= X-Gm-Gg: AR+sD12TK/I1+Ck1mTyoTEiRCL0CxV5KpCJ6zk/XVaNX52nNRaCEtvxG/nnpY8p1ndU 0dqd+zhnxSQ/+k/zdbcMMaFVYL94Bl/xipqycMCyd9LAWowY3IrTxrVBerhNu/CzRh0czIUD2ZZ PL8dpNeac+iAza6S6c6wm44T5HvQrINm0vKZd8HH7sD3Kyjg1MbL+wGnTOkq/OD7ihuMS0qvKCb 4A2Zg/tZqKBzFhjRj6OzKaCFLLfpFgM33NPwg/KVWymg0Bwo3GgfW6+7gl6XJhp8byXjo8QbFd9 9yGdw+35JvSLzpBKLZ+on6MONJRO35/FSUGOdxvAEL0mDFNrhqOG2mlPmYU8gnAAXEGsXwHr0Or 3HUQh0jp9QuK51wf0FDTrLTbXMH2xhfirq0urJYFqhW4b1q2191V9Tkf6Gdl0N/za36XMklqgpn 1gf4+PWR2N9HNr/2ldQGdH6yQrfy3zlzctliru/Xm1lIuKNLmmy3j56LIubyYOwZ50z0QsOTx3L 6kNQQ3W X-Received: by 2002:a05:6808:1385:b0:492:5684:7ab3 with SMTP id 5614622812f47-4b210c6fe4bmr646183b6e.21.1786488806722; Tue, 11 Aug 2026 15:53:26 -0700 (PDT) Received: from [192.168.1.128] ([38.15.57.99]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4b20019e83csm1829535b6e.16.2026.08.11.15.53.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 15:53:26 -0700 (PDT) Message-ID: Date: Tue, 11 Aug 2026 16:53:23 -0600 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: [PATCH v3 0/2] usbip: usbip_host: remove legacy rebind_store in favor of drivers_probe To: Jeffin Philip , valentina.manea.m@gmail.com, shuah@kernel.org, gregkh@linuxfoundation.org Cc: i@zenithal.me, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+af76b01c9a0f0ab60fb0@syzkaller.appspotmail.com, Shuah Khan References: <20260811160541.29461-1-jeffinphilip14@gmail.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20260811160541.29461-1-jeffinphilip14@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/11/26 10:05, Jeffin Philip wrote: > do_rebind, which sleeps normally gets a mutex lock. However, it does not > or should I say, cannot check for null udev between spin lock dropped in > rebind_store and entering do_rebind. This is a potential race window > already. So, even if we check for null udev under spinlock, we cannot do > it outside. Regarding do_rebind, it is called during stub_device_rebind, > but that function is called during module exit when all files are removed. > So, do_rebind is not designed to work in a concurrent environment in the > first place. > > We have a safer function that can already do what do_rebind does, > drivers_probe. So, we use drivers_probe to rebind the device rather than > use rebind_store. > > usbip tool references this function immediately after the device is unbound, > which is safe for the tool itself but since we opted for drivers_probe, fix > it by using drivers_probe rather than rebind_store after unbinding device > which is more safer. > > Tested and working in both userspace via the tool and manually echoing > the busid in the related nodes. rebind node is still left active with a > warning to use drivers_probe upon encountering rebind_store. > > Thanks, > Jeffin. > > Signed-off-by: Jeffin Philip > --- > Changes in v3: > - Removed rebind_store in favor of drivers_probe to eliminate race > condition How did you find this problem? Is this generated code or did you write it? Also, the first patch removes code in rebind_store(), replacing it with a pr_warn()? The second patch points it driver_probe() - what happens with just the first patch? Did you run tests to see if you can bind and unbind devices - does the driver work correctly? thanks, -- Shuah