Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2667076rdg; Mon, 16 Oct 2023 10:59:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCx7dooBa5G+959Z1zMmTCVAVdNYXidfAwjS86doyW0vyCaVave5vhKhhr4R1d3i+RDJwd X-Received: by 2002:a05:6a00:805:b0:6bd:705b:56fb with SMTP id m5-20020a056a00080500b006bd705b56fbmr3193091pfk.6.1697479146161; Mon, 16 Oct 2023 10:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697479146; cv=none; d=google.com; s=arc-20160816; b=RNo/FGM3RBulrqoFyg/vJwAatSWj48+i8J8kxQPbkb0lUtQnbx54kurswC3ZFzmJVa tFAXQoY+SCVJ8tVqPg7zYIJqCfEMtm/w/2d7tj7GwGREeeWWarlw8PLEvwyet3GLXm8B j6Pw7EAHr5Z0hJJCHkKNmkMdFeNlL+O8WdqdL0vXuHUTL29Oc/CuGvW9a2CRRUa1WdBu wwI6R/1jhs5+X/2HTGpxa8qRRgmj3JCfl94RydHtctCorDwGFn6fLIGYN4V4R/d+0oLA 0lHZ5cOKAKCFsqgzFkY1uU7H+WWwjxJZ/N0wCI31enZbSOumikCvYOmufL6tMbaezTt/ KQzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qVWusJ2Db4z6WqZUCccjHYkqMdVCAlIn5TS+aL8ooNY=; fh=zwzNC2OO5+G/YDPYoXFg5aGPfHe+bYP556VlXp/qUa8=; b=h2Uc9vwUTF5JTrAvaWWr1d4izCjFp5T6/hy/hY/oZzwl0xLFhbOVFhSRfM1nbdN4mN 9tm+7PRdCdWtQES81np9Q9SSMZixh/nQE/RMwSRgp2B4MxkufCzXmBNdbFNavEyBWHmz Wo+affFmxJE9HMtRkSBqP3ed9Cva3cI9lxDhBtYasmQ23xZpZ5n81G0PDxg5pjtFh+n2 Fh9BZZFjVbJk2PKw5QnewuusdTnWFONVMFLhUgVU3f0FxNXvXT1Qzxvi9RBFAhijk1qz AOPdH67k61NqwfM3/qCO8EvgzGLOpWZpHOG+FkIOYuMciQS6v51rOdgRcdf2AUXy0A7U +Qug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w98KksX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q15-20020a056a00150f00b0068fdb060072si311188pfu.341.2023.10.16.10.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w98KksX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 829E58082DF5; Mon, 16 Oct 2023 10:59:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232457AbjJPR6y (ORCPT + 99 others); Mon, 16 Oct 2023 13:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232198AbjJPR6x (ORCPT ); Mon, 16 Oct 2023 13:58:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2BE83 for ; Mon, 16 Oct 2023 10:58:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B8DC433C7; Mon, 16 Oct 2023 17:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697479131; bh=AyK2SXcqdRnOrh1k76CSD8fTzBnhoJScCp2j+ldNjaY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w98KksX3ig/2ARv3Elxv4giqqgt/EaFboKZhRg/4fbwkl+Sf3iqws6nUr4eZvlZG5 JioaV3HQppmUtn/V7vxxETIxkjur9jSBYySvG6BdzgKPtB9QQ1ivyymKyl8VDUohV/ RHOqVCuNC0NLcHksup7XHzjfZ9al2UoQ/7HorQgw= Date: Mon, 16 Oct 2023 19:42:45 +0200 From: Greg Kroah-Hartman To: Hongren Zheng Cc: Shuah Khan , Valentina Manea , Andy Shevchenko , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, sfr@canb.auug.org.au Subject: Re: [PATCH v2 -next] usb/usbip: fix wrong data added to platform device Message-ID: <2023101623-amaretto-sevenfold-6b5e@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 10:59:03 -0700 (PDT) On Sat, Oct 14, 2023 at 03:46:04PM +0800, Hongren Zheng wrote: > .data of platform_device_info will be copied into .platform_data of > struct device via platform_device_add_data. That is crazy. > However, vhcis[i] contains a spinlock, is dynamically allocated and > used by other code, so it is not meant to be copied. The workaround > was to use void *vhci as an agent, but it was removed in the commit > suggested below. Again, crazy, I'm amazed it works at all. > This patch adds back the workaround and changes the way of using > platform_data accordingly. > > Reported-by: syzbot+e0dbc33630a092ccf033@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/r/00000000000029242706077f3145@google.com/ > Reported-by: syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com > Closes: https://lore.kernel.org/r/0000000000007634c1060793197c@google.com/ > Fixes: b8aaf639b403 ("usbip: Use platform_device_register_full()") > Tested-by: syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com > Link: https://lore.kernel.org/r/0000000000007ac87d0607979b6b@google.com/ > Signed-off-by: Hongren Zheng > --- > drivers/usb/usbip/vhci_hcd.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) I'll take this now, as it fixes a reported issue, but really, the root problem should be fixed instead. This is not how to treat platform data at all. thanks, greg k-h