From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52972C433EF for ; Wed, 30 Mar 2022 09:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244780AbiC3JYw (ORCPT ); Wed, 30 Mar 2022 05:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244764AbiC3JYs (ORCPT ); Wed, 30 Mar 2022 05:24:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D512AE25 for ; Wed, 30 Mar 2022 02:23:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D40F6104D for ; Wed, 30 Mar 2022 09:23:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07549C340EE; Wed, 30 Mar 2022 09:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648632182; bh=brpHtBxVuS3ZLsL1Fi+IfeBWIo75mcyggExqK08yFhI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zjBE6YUWjMdMUzBtc3OqqoVaRGNgigFMUqp55Oy+4vhgAo/NSqeyp//MR2DjsRzie a5Wv83cQ1iFvqkJovAZRZKRiWR1Ybj51tmV3QtBrosx1XPSFglVkdhj6N4s6Md1uv0 bYyeoZP186CxNdPfASC4roYj1rRAFRsX4eNp4A8U= Date: Wed, 30 Mar 2022 11:22:59 +0200 From: Greg KH To: Mukesh Ojha Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: Race condition in kobject_get_path() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 02:47:20PM +0530, Mukesh Ojha wrote: > Hi All, > > We are facing one issue where one driver is trying to register its device > from driver probe > and from another path  dev_set_name() done from driver probe of the added > device whose > length can be more than earlier which could result in redzone overwritten > issue. What drivers are doing this so we can see the code? This should be happening in order and not at the same time. > > Can we get your suggestion here ? is this case of a race here ? > > > p1 p2 > > *kobject_get_path* > > >                             =>  get_kobj_path_length  (length is calculated > from this path) >                                dev_set_name(same dev name) >                                  => fill_kobj_path  (path is copied here) I do not understand this trace, sorry. What code are you referring to? confused, greg k-h