From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 723EF3D3338 for ; Mon, 13 Jul 2026 08:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783933006; cv=none; b=mlGK8h7HSVl0/EGa/v/JZErdVSf1ME9xVQCv+5BWMM9AydRDbNTzfmxVT+MpTwPupAS7047+fV+0FLLo9JFyj8n4cJjH7Cuou6rmscmeuPA2QDa1H0RISPYnSSOQBFSZ6JW+MPyUzT3Nm5uePjUxu1ld3jyYo23z9gI1D07JdbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783933006; c=relaxed/simple; bh=AvM3Cgy/Ra73nGrF9esWzL68qEBWFII09uJw1zMVULQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gKRvioC3G3KWNWhb30Yi+KNPbixF/Pd0cyHbuyBvHnrLgjb0anpVFp2TgfVhdOrFsnWnSVl8G9YZIdjU3y11VtZ4tnkczGsxaiziJ4Yq0b+NZvBi3uUGoRzlX7NYr7hQVDDH9/RX8ZS2vnNqcTTqpUkAx3xaMZ0w+TbdzMB2Dvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b=Sb3YGq+6; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b="Sb3YGq+6" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39c7ce122c7so26496081fa.2 for ; Mon, 13 Jul 2026 01:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20251104.gappssmtp.com; s=20251104; t=1783933000; x=1784537800; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=x1nIX3sdRj3FebWw4JZT1K0eCGVCwy9cixatVxw9QSU=; b=Sb3YGq+6+VLMioEzFI76UWcYJ+j9aqpJyA06pp9/iYqwgAeld3dwSQ60rL34sD8zZz iDOgEmllxEV5xMQluyr2xMZG3ZNrFOffg80O3AJv1EMSdyWop7vsSWpEhC7RveAk1b7c 70i7VEe1DEYElCNevI1fP9u0LEeHUtm7GfPeY6dM6y7BCmcNw9dIlLe4SUisOE9AzbS3 QZEbP6P6AEi1g0KiWhH4m3TlFk1Lj+hNsYPX4+ozxbSUEiZ8Yl8vQ+Pu3n3DQqwNDDBJ Povh2qd3WDt2/RMKSoWSwywYgcfGV1msrW8twwr5ID/4mvVfnr/+wooGIK4MvxMMHt8T RhSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783933000; x=1784537800; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=x1nIX3sdRj3FebWw4JZT1K0eCGVCwy9cixatVxw9QSU=; b=Edw09lAFfBbxX6EZ5wqg4khvrIbAu6tnUTh55rWk7P0pLDPTZU3w+lhuKCoMHYKFjp 1glU5mQ9NIVZ3mOITZgHv25sZabDj0g7/lPzqpEBizXddIeWJ/7yHGFQhA4MVA6j5aGO Rjxws5KSoNyRa0hfGfH03ddlwdtGw0bHw7SwK15ZCtezl0Dca8y4LD7dm6Q1YNhGn4FH +i0bn63raBiEdMsVWSlRDiWGjK+Wg0ItCLu0URG+nx2Jpipxb23HqD0yx92YgcrfRuZm o5m5/LB9QTA4JPgtglOzRIMz3FW7kLhtTdB3OkuKmU799Oj5uUHJjNWKqjUmHZk8u0F7 iz5w== X-Forwarded-Encrypted: i=1; AHgh+Ro69UYYrgJ1HbCi/FgZ4oUBdaEn9K0LBdpMqpDuaX+RW0P0zCgx/RyK/mmUwA81KQCTpECJB/VSd8tz0t8=@vger.kernel.org X-Gm-Message-State: AOJu0YwMgN9IbOR+lzwt7YSpajs2nnzjOVI79azK76BR9aCHeABJNtJh +5SMiWechJC1SoiLzmVUFNdmry4hNVUrTfP4o9yupKbyw+tS51L4IqFfcc/zfGo2sxM= X-Gm-Gg: AfdE7cm59Ncmf1LQx467CHACkZ772Szcnr+z6V8RRB/FEqRN873m/NoaBXFBxZaA7ol mYR7YGObKkEf+5WOQ/PXJsgE6jcEpo9mm+51QKhAqJmU1oJgHuHtz0bX7mAdZv/NsyOhpOk7EPT jC+hsHRUhblB7xFgKMj6Oq7zYATQbjYxDN953qVLWgR6QQBbDe5igxENVimOxr8JzLQ2pIvv5p9 VR31a1u2B6IM1Ya3UlEEmzrb3AItw3kFKXcOi4HNXqM/bYnyihI5s2rClPjRlFCuPcq7pfy2SV+ sOUBRI3mDbPpOzPbecRdqwfCbRGNAC/a01gc1g/hwEM5K9P3uudGiTpo1B6hMUMePzt5Z5j+uE7 v5EHNu54Sq8TOPo67SIhHnV5DyUw4y/LIr8e3tSZ4gMjYGPm16S0Q52WarNPqENzituUQ3Uqm6S Jf02MdgJSlbJBaGTbzL+PwKg== X-Received: by 2002:a05:651c:b28:b0:393:d6dd:e8a1 with SMTP id 38308e7fff4ca-39caa807641mr16871121fa.2.1783933000242; Mon, 13 Jul 2026 01:56:40 -0700 (PDT) Received: from localhost ([140.209.217.211]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-39c84bb0a36sm26676391fa.41.2026.07.13.01.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 01:56:39 -0700 (PDT) Date: Mon, 13 Jul 2026 10:56:35 +0200 From: Jiri Pirko To: Ivan Vecera Cc: netdev@vger.kernel.org, Vadim Fedorenko , Arkadiusz Kubalewski , Przemek Kitszel , Milena Olech , Jakub Kicinski , open list Subject: Re: [PATCH net] dpll: fix NULL pointer dereference in dpll_msg_add_pin_ref_sync() Message-ID: References: <20260710193625.1378822-1-ivecera@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260710193625.1378822-1-ivecera@redhat.com> Fri, Jul 10, 2026 at 09:36:25PM +0200, ivecera@redhat.com wrote: >When a dpll_pin is shared across multiple dpll_device instances and >those devices are being unregistered (e.g. during driver module removal), >a NULL pointer dereference can occur in dpll_msg_add_pin_ref_sync(). > >This happens under the following conditions: > - A pin is registered with two or more dpll devices (dpll_A, dpll_B) > - The pin has ref_sync pairs with other pins > - During unregistration of dpll_A's pins, a ref_sync partner pin is > unregistered first, removing it from dpll_A->pin_refs > - But since the partner pin is still registered with dpll_B, its > dpll_refs is not empty, so dpll_pin_ref_sync_pair_del() does NOT > run and the partner stays in the pin's ref_sync_pins xarray > - When the pin itself is then unregistered from dpll_A, the delete > notification calls dpll_msg_add_pin_ref_sync() which finds the > partner in ref_sync_pins, passes dpll_pin_available() (partner is > still registered with dpll_B), but dpll_pin_on_dpll_priv(dpll_A, > partner) returns NULL because partner was already removed from > dpll_A->pin_refs > - The NULL priv pointer is passed to the driver's ref_sync_get > callback, which dereferences it > > BUG: kernel NULL pointer dereference, address: 0000000000000034 > Oops: Oops: 0000 [#1] SMP NOPTI > RIP: 0010:zl3073x_dpll_input_pin_ref_sync_get+0x73/0x80 [zl3073x] > Call Trace: > dpll_msg_add_pin_ref_sync+0xb8/0x200 > dpll_cmd_pin_get_one+0x3b6/0x4b0 > dpll_pin_event_send+0x72/0x140 > __dpll_pin_unregister+0x5a/0x2b0 > dpll_pin_unregister+0x49/0x70 > >Fix this by skipping ref_sync pins whose priv pointer cannot be resolved >for the current dpll device. > >Fixes: 58256a26bfb3 ("dpll: add reference sync get/set") >Signed-off-by: Ivan Vecera Reviewed-by: Jiri Pirko