Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1077872rdb; Tue, 30 Jan 2024 07:19:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVhc0l0aVadiAikEncTVKuJbBe+t4AlSnzul4Jd0j7eZNZmHoHLCmg5E9KTJ9OtsT3pF5p X-Received: by 2002:a17:906:b149:b0:a35:3eb7:3837 with SMTP id bt9-20020a170906b14900b00a353eb73837mr5817681ejb.7.1706627987465; Tue, 30 Jan 2024 07:19:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706627987; cv=pass; d=google.com; s=arc-20160816; b=kz7HLyQ5kg1FiFWgo/7dSs0BZPXW+UuCXmnLNLHzoX1+/CFEUAnqNxJPKTYCO/LIw3 QmUcsoSeHwK9qkvs86EBNYf2shfI+wrOxIELmjIiNZb/NP7C/iO15C707VL/4CaLCxAg +LnPJnNc+0I6h7F+1NBwz7BnMuQVgXREWmKSrumnLHmgAjSy4mAeDsy7mfAgeh88sAJP MOjLdPZGxNpf8Kht+smMzXy4lzufQO6kdN8Ux8NQW8bAQX0ASuH1NKk+D2l7NR7jReQF Z+K+Du3Reg6iDsMCCcVDScvOvaptZ+adRFyhk1bmfIdVQSnGEACrJPmQiigeH0icSNAP 8RIQ== 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=LMAcdJG3xZ4+Ru0fXLgdqDWcwD0srNKy2FBjYjgi3MI=; fh=eX1JzOzOHKK2qBkgL2HE21LbusAYvH5qaOoHI8fEg1E=; b=iceaNHwwB/FjfHOc9E1ux23RvbxZDk8vd0z5ccayE9qiDqzYsqvmotBU3YRjOqIrLc 0u3qxGdDEx81rVlRPC/DDTXfuxnjbcrLdlzm3FOw0k4V8pmCsD68Kq9EuA8EzoV2gXlL /5ug2CmRGFdAerm4gCjldKrSdMdjtqEyLS3xWkDhVEivQjvVJwX5YUUUGkTt6vlYKAs8 DY/sOkXxIOBvxR77AdGc4P1Z6K/ESUWLPBls/BL4rJhRvs94IHJKxAEpsCqkCAqrRA/V 1zLaPYP3Rsp9NsF1EmsdfJEqWA2xFlxd/taLOB3eaMikD5lpWFweSC8Ead/43z491HOL 7yRg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=XFA5OF+9; 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-44819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b11-20020a170906d10b00b00a35e5ba5621si1517505ejz.196.2024.01.30.07.19.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:19:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=XFA5OF+9; 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-44819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44819-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 17A771F22F19 for ; Tue, 30 Jan 2024 15:19:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4E6B82D85; Tue, 30 Jan 2024 15:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="XFA5OF+9" 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 D3F7421105 for ; Tue, 30 Jan 2024 15:19:23 +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=1706627966; cv=none; b=lehDuiiC0EEH7uFleQFwMqXbuCH6PJ/si76uKVqQphS//ZH1go7z1Ona4Rdyb8qPDy++N8hGBeZBZAKsg291DMtWwvlS9qbjRc1Ash05s0B7Es77FRjdn/N63c5W/A6GFobjJUk0b6sRjKGiXr8T7bbJYgUx7o0qRhjL8KVLXpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627966; c=relaxed/simple; bh=LMAcdJG3xZ4+Ru0fXLgdqDWcwD0srNKy2FBjYjgi3MI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=DI/WtU/pN3p6SCT6pmtT/2Q/zeiNgvHUaSDIS2Y1hY8txYJf6RsQF63lrgdyyr+i3fTg+MGNOiKBbw4jgVpGblKHX7gwayz5BhX7EHLEmKIY9Yc199fpI11oXv2/Ic36Y8MzIwSZVYfnMnuCIvsf4MMIQWlQbVQpylA7Az8bBac= 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=XFA5OF+9; 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=LMAcdJG3xZ4+Ru0fXLgdqDWcwD0srNKy2FBjYjgi3MI=; t=1706627963; x=1707837563; b=XFA5OF+9I7LOmmiXjMRn6vPHXEAyPn+KoIa//0Z/JfYofwu gJVo3DWclDIr+4OxdBCngOlIMHV03LbXmUXP6MPk/iSnmAxLa19HEPYc+ug6Yi6NmfVXiGmxt9xI5 CUZPK77rLJCddTHjETf8qq7PGCXZMUJugKgUVXrwMDUgG+X1MmqttDb2bcKUfcIr+0QPiGSO0VPtd 4ZY0yZMRVICyavbiFlj1qNxrDHKCT5HxH9phvPgm3jIHc74s5pXJTwtor1KvAn3wmnu21NoPOtaZn mCtL1jn9UQP8bmfWIB2TnBdNuFFwJiyCkB7Prw3T7MnlA6B5XBaMcACQYj5x3Gfg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUptP-000000067XL-2uX8; Tue, 30 Jan 2024 16:19:19 +0100 Message-ID: <8681168464fa85061db4a7234f89cead65cb0261.camel@sipsolutions.net> 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:19:18 +0100 In-Reply-To: References: <20240126151121.1076079-1-rodrigo.vivi@intel.com> <33df6c78c4c47a8f57a1c2bfe835065becb5a253.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:16 -0500, Rodrigo Vivi wrote: > >=20 > > But I'd rather not, it > > feels weird to have a need for it. >=20 > We could change or CI and instruct our devs to always write > something to 'data' to ensure that devcoredump is deleted > before we can reload our module. Maybe that's the right > approach indeed, although I would really prefer to have > a direct way. That's not really what I meant :-) I think we can agree that it's wrong for the kernel to be _able_ to run into some kind of use-after-free if userspace isn't doing the right thing here! What I meant though is: it's weird for 'data' to actually depend on the struct device being still around, no? Whatever you want 'data' to be, couldn't you arrange it so that it's valid as long as the module isn't removed, so that the 'data' pointer literally encapsulates the needed data, doesn't depend on anything else, and the method you pass is more like a 'format' method. johannes