Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp709337pxu; Thu, 3 Dec 2020 10:35:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbN6pIrnI/zJCsXdNFJH/qys6f9IuT5kCCZxQY4+YuZK1L//BaGOVkjMrYwB3HItiNQDaF X-Received: by 2002:a50:f61b:: with SMTP id c27mr4052765edn.61.1607020558432; Thu, 03 Dec 2020 10:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607020558; cv=none; d=google.com; s=arc-20160816; b=tL7tdyxHd85oUCZ0UiChfqvNjsBTSW9+mYXjQnWZFr0T6IqGH6uX1LBfJkIWcwLuTe eWeGvv7x9tkTLixRu4ybHMzwvW6w4P9BzFVD2drLiYSIf7n/DYcQMpyd+/n0sJn2ynj1 /JALpf3gNjOShNBaTN+t/GYIqxc44hntGujI+u+TDdEK6cydLfcIDcb8GbgOhjweQJAa xp780kp4O0bmr6IF08eKlQLwMTDYbUHGtY4fPN8tFXxiJLh3ELmhvxGiYD3uN92Ou32E VtVAYotqo8ZhZt1yl2R+hMvdPaNH9m895T1S+jCRavQaitDBT7t6OObS5jv7kLAInhQE EDMQ== 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:dkim-signature:date; bh=zx1RjCvahE3RtjA8mkMz1/IOP5D1QA4lgbCpVb3itu4=; b=tDO6fsVqvB2gNMcWgyzltoNK6mOhivTxBMJqcMa12fyFbwpFF+VKdcKICd+zcWDqhw XoeW6nFBYPwfAC+PDDOqyCXSfBTqqU3o/3lZR5jAWMjFXlsMeMJWOYcQxnKgWKA00d7L dkem96gTd855gz1KPjZlsBMwy46kfI5pcw2FhyYLgiHR+2o35Dnh1TJhcOPSAn9odqJ+ OZvYhohz2h0f1W8Debb1FBkuxol6qRadl9cgQlkdIXKvQg/xRnJhYeG7Iiy4YEHEF45e NedZCAlGdpoBa+8czoYmFxR+qo/BKZgJXSTRugU+btIkG8DsjQ/+ZHEVvSi9jIL092hT w9yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zxRgUcXk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si1555286ejk.9.2020.12.03.10.35.35; Thu, 03 Dec 2020 10:35:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zxRgUcXk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbgLCSb7 (ORCPT + 99 others); Thu, 3 Dec 2020 13:31:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727599AbgLCSb6 (ORCPT ); Thu, 3 Dec 2020 13:31:58 -0500 Date: Thu, 3 Dec 2020 19:32:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1607020272; bh=ooOaTQVTWODxjzPcn11n7fZSJANiXkVMAWaIlK7pTZY=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=zxRgUcXk6SIi5v94rKZmgeeoN4ml7+qC96MjLr/CW22p/Jua1cK3pQI3Ye3J37zVe 0SG0FFw/ZAGT1zFVb91ZnRAmDht/V0eMirkKUurk+bYTHtKl96pzvXL3igbqJnHtHm qDQuw8sqsIKuZ3J9tIU/7vPAlGXLxajMy5uaojf0= From: Greg KH To: Jessica Yu Cc: linux-kernel@vger.kernel.org, systemd-devel@lists.freedesktop.org, Franck Bui , Nicolas Morey-Chaisemartin Subject: Re: [systemd-devel] [PATCH RFC 1/1] module: delay kobject uevent until after module init call Message-ID: References: <20201203135124.16695-1-jeyu@kernel.org> <20201203135124.16695-2-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201203135124.16695-2-jeyu@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 03, 2020 at 02:51:24PM +0100, Jessica Yu wrote: > Apparently there has been a longstanding race between udev/systemd and > the module loader. Currently, the module loader sends a uevent right > after sysfs initialization, but before the module calls its init > function. However, some udev rules expect that the module has > initialized already upon receiving the uevent. > > This race has been triggered recently (see link in references) in some > systemd mount unit files. For instance, the configfs module creates the > /sys/kernel/config mount point in its init function, however the module > loader issues the uevent before this happens. sys-kernel-config.mount > expects to be able to mount /sys/kernel/config upon receipt of the > module loading uevent, but if the configfs module has not called its > init function yet, then this directory will not exist and the mount unit > fails. A similar situation exists for sys-fs-fuse-connections.mount, as > the fuse sysfs mount point is created during the fuse module's init > function. If udev is faster than module initialization then the mount > unit would fail in a similar fashion. > > To fix this race, delay the module KOBJ_ADD uevent until after the > module has finished calling its init routine. > > References: https://github.com/systemd/systemd/issues/17586 > Signed-off-by: Jessica Yu Nice fix: Reviewed-by: Greg Kroah-Hartman