From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 042B33F1AD7; Wed, 26 Aug 2026 13:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787749817; cv=none; b=FJ9xKeC76LKXI19gQTOB4tPgRLCnjfL3d0gBuChjCS4hEz7a6EimV7vZY7an0/3LHi7mTFpwSKlJ02xy5QGRgSv6+TtKB4WXVRsD0GTInFvwFy4AmbcNpkXZUyWv1MYBibZBqAyW9mr/43u7Pv9TwBaEi7DHamSdxW/ugLK8m34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787749817; c=relaxed/simple; bh=DikMXrn6dNejgfcuxe4iWYRZZU6hw6FARPjRMsrHE9s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DHoTRX6xPmNu2NgjXptf45r9EUVgQ6Ujsaz3kYjXNkVjTLSYH9yJUUTc3Y2ioR+JZiv45W+k9KS9qRBXd5Vsxxyj/vEAw5ChYzqUQ2qXmuJRJCMyPerAk8bPLxJKql1ED4sv3lwxgyxVNd0EkO0C8mOQ2/+f6tUZqHql0lodvHc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hnoUkDCR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hnoUkDCR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB1241F000E9; Wed, 26 Aug 2026 13:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787749815; bh=z29EKC1TEcpdEn0ZbUlK5fEa15VDOjDwmxfz9RTXdqI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=hnoUkDCRtz++B5hNmtoD1jlGKWqCfoTBsaIX+dYjA6/zxajl3xysiiFoMU3DCy9PD 1t+59qGAuFl+SkbrXocFqBvCOoCHOPNEsmX6w5WIiCw/4vKSeM1upiPIXw0oL5yz9I RbIHKYtyPOcZPbsDbH4Z0wvkwRZ88oApiOKqptmY= Date: Wed, 26 Aug 2026 15:10:14 +0200 From: Greg KH To: Bradley Morgan Cc: atomlin@atomlin.com, corbet@lwn.net, da.gomez@kernel.org, dakr@kernel.org, driver-core@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org, mathieu.desnoyers@efficios.com, mcgrof@kernel.org, mhiramat@kernel.org, petr.pavlu@suse.com, rafael@kernel.org, rdunlap@infradead.org, rostedt@goodmis.org, samitolvanen@google.com, skhan@linuxfoundation.org Subject: Re: [PATCH 2/2] driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers Message-ID: <2026082604-freewill-pretzel-0057@gregkh> References: <20260826-bind_taint-v1-2-52b05f4a965c@linuxfoundation.org> Precedence: bulk X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Aug 26, 2026 at 12:58:00PM +0100, Bradley Morgan wrote: > On 26 August 2026 10:19:33 BST, Greg Kroah-Hartman > wrote: > >The ability to add and remove devices from a driver through the sysfs > >"bind" and "unbind" files was created all those decades ago as a way > >that kernel developers can iterate faster, and provide a debugging way > >for users to attempt to add a new device to a driver without having to > >rebuild their kernel. > > > >This api over the years has been abused and recently come under a major > >fuzzing "attack" through tools like syzbot which decided that it would > >attempt to just randomly bind any driver to any type of device, causing > >loads of unneeded errors and pointless kernel patches to be generated by > >unsuspecting new developers. > > > >Handle all of this by adding a new taint flag, TAINT_FORCED_BIND, which > >will be set on the driver if the bind/unbind sysfs files are ever > >successfully written to. This lets kernel developers "know" that a user > >is attempting to do something that is not normal, and as such, if the > >kernel breaks they get to keep the shiny pieces laying around on the > >floor. > > > >Note, the taint flag gets set _BEFORE_ the bind/unbind callback happens, > >as many times crashes/oops/warnings/failures happen within the callback, > >and the taint flag needs to be there to show what was being attempted. > >If it were to be set after the callback happens, the oops report would > >not properly reflect what foolishness was being attempted. > > > > sashiko found a couple valid concerns for 2/2 Yes, will fix that for v2. thanks, greg k-h