Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1116040rdb; Tue, 30 Jan 2024 08:18:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtlmy7eqzK6YQDqz4d2lTjv1dGqfyldo9g3eTVPlYRu53HbwWlbWqa4GI3ZHUFxskzg8OU X-Received: by 2002:a05:6359:4120:b0:176:71c3:80db with SMTP id kh32-20020a056359412000b0017671c380dbmr10192990rwc.16.1706631519812; Tue, 30 Jan 2024 08:18:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706631519; cv=pass; d=google.com; s=arc-20160816; b=Y5rms/H2M2Y1LXHvJtjwSxkCD8qlFIE1o+rVi8vKfo/2VfwSniw6hweCtz421Ws4J6 Nb3GfmWdZy9zsKyt6UGlljbzqizrlVgfYPZLi4vT4fD4lCvYQK2kvaGpl8xe5q0K76oW i/7lypMbpffPRflkVmPg/HxmazS5yjkTrMF1NycM9vthP6zs39gqMokrqq0OMvd3+8EX ZIwXV9KqVtIl03ne2qyzS59V+wy/FI8ep1gLZPjRsZOBqU+us7RT0dPyuVCD1wcXR2i6 F51Gy4cQJ6mzkRzqVERvSp8q0hGFCldFTsoa/+0BhDi6sH8G7echhQ2Vn4RLM+zuA9XE rUTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=7O1tmLg5OKzYWxFeisSuEd7Gff8XrdV9UOQO8wXaAg4=; fh=eX1JzOzOHKK2qBkgL2HE21LbusAYvH5qaOoHI8fEg1E=; b=atIgoQIZev6mtL9AWMnMUNu0h4aCfBrmL2EwddEAj2tP/55gP9ZUdR/p4pQsMToaC2 VE/G17pQY8mi5DYhPx2Qa2Pof6pBz1N3zIV0Nfldnmr6fn5+auBZfCjVlgm+9rGESkSD Ombwxz4p12uV4gcFIQuld1KuD935gV+97jq3Nn+nuFmz0rhW/83dD8g/It51inIpHQC1 CVgf7nAExXdCzEUmbdjlvfYuhIEUsFjqBaDdMel5scYxPLLgl096ZigNKxRLUCVeaoYP v8qmFTh5ewubj68K8WGT6Cm28HWTKUgu+aoeBSzuPSz0pu7CKhZgBqBWWuDK1w/2E7Zz JmJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=dQY24rUg; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-44878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t2-20020a6564c2000000b005cee03d1803si7387691pgv.750.2024.01.30.08.18.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:18:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=dQY24rUg; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-44878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A7480B2A080 for ; Tue, 30 Jan 2024 15:52:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE6DD85C44; Tue, 30 Jan 2024 15:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="dQY24rUg" Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 7769B8121A for ; Tue, 30 Jan 2024 15:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629923; cv=none; b=JpF7e0vungRR0UGzR36eP0gqZZvzFNXkz9ZIIgpSL7U+/PFEl2urrpjugtj/KicuPUVQDeYJDjIaDoLxiU0bi2ghl4r1yN6aJD/OAcGYgx55uumor3dI112sq2f6OmSVKbk353dSCxdDKbJj4JQ7SZu57l3RaLfGOIsuhrK8g7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706629923; c=relaxed/simple; bh=7O1tmLg5OKzYWxFeisSuEd7Gff8XrdV9UOQO8wXaAg4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=qSB2dmx5j73vfLtSXy1OAeNuH/YDPZrgEXQbCh1Lsj78FVj4r8Zp1meTelGYpmWj5QVYWZmubH/AEAywIJgLl/qLHh/3qC0cFJRmR7kp5vpEo5IDs6ziX7Qq3K8crj2uQKtAh8jp1qri8IxVmwglvDOGOUASEwLL8PGCsUPrADc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=dQY24rUg; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=7O1tmLg5OKzYWxFeisSuEd7Gff8XrdV9UOQO8wXaAg4=; t=1706629921; x=1707839521; b=dQY24rUg5oYILxgdI+FsgInKS1XdCd7PUxqjV2rIHKNs8b1 snljNEyPSqLu2Cvep9DrQUCbGYLU2oh2exwyKmFqmCbbsKjy4Q3IuWAKl38xchD5WEluuFHvG/hbk xCE/b0QmErXTJK9BxHz3eyxxWti9hjI0IeAP4+PoUKvENGWlAx6XRIaa82x2Zpzsu2aOplnBZuiPe a66quATX5jBQVg0s0ZHwW0SNpQUlmUP4Az8g5x3CbVkUvbORC0xtbSLX842bA1Y9cRM0qMMJR2xC6 907NAqKp4j83PmG3NAiC0FHw9vs7YQK47fVCDNMh8COGJAsIrJNHUOlB92DnsXEA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUqP0-000000068Ls-0mwi; Tue, 30 Jan 2024 16:51:58 +0100 Message-ID: Subject: Re: [PATCH 1/2] devcoredump: Remove devcoredump device if failing device is gone From: Johannes Berg To: Rodrigo Vivi Cc: linux-kernel@vger.kernel.org, Jose Souza , Maarten Lankhorst , Greg Kroah-Hartman , "Rafael J . Wysocki" Date: Tue, 30 Jan 2024 16:51:57 +0100 In-Reply-To: References: <20240126151121.1076079-1-rodrigo.vivi@intel.com> <33df6c78c4c47a8f57a1c2bfe835065becb5a253.camel@sipsolutions.net> <8681168464fa85061db4a7234f89cead65cb0261.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 (3.50.3-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Tue, 2024-01-30 at 10:49 -0500, Rodrigo Vivi wrote: >=20 > I will make changes to our driver to make the 'data' a standalone memory > that devcoredump will free. this ensures no uaf and no null deref. > data could be read even after unbinding the driver. >=20 > What I meant to userspace 'writing to 'data'' was to ensure that > on our CI we run something like >=20 > if /sys/.../device/devcd exists, then > echo 1 > /sys/.../device/devcd/data > before attempting the rmmod >=20 > our rmmod cannot get stuck or our CI is blocked, but then ensuring > the devcd is gone with module_put happening is the only current way > of not blocking the rmmod. >=20 Ah, you were just concerned about the module removal, sure, that makes sense. Though depending on how you make that data pointer: if you just use *sg() or *v() then you don't have this problem in the first place. OTOH, it's probably good to have a udev rule to automatically capture the data in CI anyway (and fail the test if it happened?) johannes