From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 98E1C348C6E for ; Wed, 1 Jul 2026 21:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782940663; cv=none; b=FBQLONGYw3KGOJPaOlQeF4eaiIrS9ZKPaUXD2yKXcp+npZ4AXJQ8DrJ+4rue0jnSL3sDglDjAKWRYHp0+o2ZicswxAtJxaM+AcsYtvoqN3gmBi+DkbpFvhl7qLvQmXnBlS2iHhoIYrMObLR2XiN9JPaXtSGYJtFzCzZi7u0gwv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782940663; c=relaxed/simple; bh=Vz32z21t7N6QDvCWFa+4HnqwVdRj+wM5kqXaX9IPP+Y=; h=Date:Message-ID:MIME-Version:Content-Type:From:To:Cc:Subject: References:In-Reply-To; b=bcOskztUfhdMLkUS3qxQoLNkWpfL+12PVwbaURT2v3VuL4sSpRrtddhlt76aQJNVxwCaT5Y3h9MpGR9YsXwIKBo4YmkOqCciO/Uz+DayzfDIKgSNpM0T6HxOofk5c/vVdwPLb/SHSrytHRPhjj9ZxRAO68+uXazgONSKP+qDLlU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=ZbcM6/8z; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="ZbcM6/8z" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-8f2509d6becso10952206d6.2 for ; Wed, 01 Jul 2026 14:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1782940661; x=1783545461; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=NZbPHu0imB0owCgWS3wUk9cCK5G2nV/1iLDVGI58C8w=; b=ZbcM6/8z9dh/LiMJLWgbWfmcXCGWu9z7YH3qfLxuJOz+6LxXwNnXrMG8gk/W1B5sdV 2ntVCAJXFhcMoP5HW5zRo+qIsmUK+OE3iRasAg1NxK0qrNPOE1RJSkBO0rXwiYuSLXpa 5SHxQnq/vtlACfkR4hNdrbKPZxhIYsU/iyMgx4Gw+22OcKEDXOnz54oS52ZCA/OF+IVW LAz15Xp8BeOHT/lTyYYVE5RbHK3GpGR4EJyvAAL08FlXrt1Hw8n9nVuNkURSwgRpEnij YRawCQEhwOMfLRoYxeBdWOeZgq4KqYMZpmTg3GMgb3cYFnDBYygD2ze2VRMyDZhxMA9g 6BVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782940661; x=1783545461; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :mime-version:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NZbPHu0imB0owCgWS3wUk9cCK5G2nV/1iLDVGI58C8w=; b=rooe/q20rnEBSd3tnQ6Xkp1Jv24n/MrMzM/kH4F5yQhPd3DdTxO0NebDl2ZzyGJDgF kSPL/mm1Iv3c7h5xmsfiWNhx+Y8Kdy2rldz3+w848MmDLu1DQMNrPyIyZyLCUANPS6nJ q5y8ku0W2vypSdxWPkzHRjWRDKPmVjiFqDfWZoCEEiDlJttrLbHlGlPPjCYT8+ZyClPu kqg9Fz2UFYG39qaQ3a+4TBrPHaqego139Ie3Hlaa7ExmFwHTN/Q01SQ7/RGuF9C+NQrP C+239+FzT1zkRkSNa7WL9RqD1KW8ElEXsk2s5t/kjOehdK3Xpe43sBUMr60iI7OfhWOh EVgg== X-Forwarded-Encrypted: i=1; AHgh+RpLvCt/Z5E7z3ecfDiCbaDYYyFj/nrWS8Mkl9XRBtnDRgY5rMT1wMdazblpS8dBuLDyTKPKYAMacmxBeGQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyOCOT46t2Z0MH0vTM/qX1J9YFaXZtWmvJ3knWS7Z88H7Mshmmb EeRohmuWmwS8NDFx6WHBdQ5ugiaihzx4XVDX1hmnEEsU78MxDxG3NjGABl1YbUtihA== X-Gm-Gg: AfdE7cmqNMBeCEtIPtGNqcL7zztKXcZ4c4HrWnEGRaN6CQ3tjyqXNgOPfMZhD36G0Qg U8lFomyKpF/ckVDSeCxd+oLcYR+aRk658xBDEVnKNC+mQ5q47lBFOzGT/ew3YGVBS8c/DX4F63V ArdR9+nvAVy0HY4WxcIJr9ZtgFTZ6rwcNPligEVjXs6tkKnKV338fZ0IiW+SC1gucORiqIOnvXg iqzrpt/gkrgraJH2OgiCaPWcESxoE9ksbNFATahR1viohwnC0LPLyePDJH5GchaybN8xhepx3MX UDH6/SGJmxRi16cHWnepFI4/nU0l2AftO40lGrFi1HeIudhHfoJXBT2XZ20HYR+Ok+e9AH+K5yr I12jSE1k+MzhAueStDL/HrOKEtT1k+cGvT0MNb+xYuKxUgXAoOBJTlEPuRzRt9IxtPc/NevqeU2 GIYkgrZ1tFzoLLb89aKejEZ0wP0qatSGO+lLf1Ui7RnrVW7fbtEpVTcBoOZQ== X-Received: by 2002:a05:6214:84cb:b0:8cc:f074:95e with SMTP id 6a1803df08f44-8f3c8b16eeamr43341866d6.30.1782940661502; Wed, 01 Jul 2026 14:17:41 -0700 (PDT) Received: from localhost (pool-71-126-255-178.bstnma.fios.verizon.net. [71.126.255.178]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f46f112547sm8046916d6.17.2026.07.01.14.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 14:17:40 -0700 (PDT) Date: Wed, 01 Jul 2026 17:17:40 -0400 Message-ID: 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=UTF-8 Content-Transfer-Encoding: 8bit X-Mailer: pstg-pwork:20260701_1640/pstg-lib:20260701_1540/pstg-pwork:20260701_1640 From: Paul Moore To: Haoxiang Li , stephen.smalley.work@gmail.com, omosnace@redhat.com Cc: selinux@vger.kernel.org, linux-kernel@vger.kernel.org, Haoxiang Li Subject: Re: [PATCH] selinux: clean up selinuxfs resources on init failure References: <20260622143722.1167703-1-haoxiang_li2024@163.com> In-Reply-To: <20260622143722.1167703-1-haoxiang_li2024@163.com> On Jun 22, 2026 Haoxiang Li wrote: > > init_sel_fs() creates the selinuxfs mount point and registers the > filesystem before mounting selinuxfs internally. If kern_mount() > or the subsequent lookup of the null file fails, the function > returns without undoing the resources that were already registered. > > Add the missing error unwinding so the internal mount, filesystem > registration, and sysfs mount point are released as appropriate. > > Signed-off-by: Haoxiang Li > Acked-by: Stephen Smalley > --- > security/selinux/selinuxfs.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) As Stephen already pointed out, the cleanup isn't critical as the system is going to fall over any die anyway, but it shouldn't hurt. Merged into selinux/dev. -- paul-moore.com