Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 352F351597A; Thu, 17 Sep 2026 17:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667139; cv=none; b=Nf29QUuhjrHHCRSHb/KITOQ4VOls40k48TpmX5oOTy7eUoFDM5ScZLaXfTb89oVxhXytkE++4n278UggNS1ivnSF5SSef+z90Zq50iPIISCxlyR61VS8PIOMMXLelTc2D7sSY4onrUtJzbjzBBxqpWpXnwOlLF3yTjVVk4ZhTps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667139; c=relaxed/simple; bh=8nEcL5cRRlxLEOXo46P0YVbOLwVN5vlseiCwfOHfbEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bApXv3Plj//8f57knp5kJomHHFkbKg/3Kt7lsqD3y4zDxPUGrJD3MKQXjApvF+q1liWG7wqTNKQgX/3Z/f8b6xERkE3a4XvP0xAWfOoPx9cxLAKKRizq1ARiucE6Zpt2Ahllbpg/KjvhNVq4DYvl4/8ZoZdocEyYRKECz97+wSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W6X1SgEI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="W6X1SgEI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 430151F000FF; Thu, 17 Sep 2026 17:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789667137; bh=HVfHFLXPVZ6wd+lydoGgMVzgm85AhktpB0l4zlRbVbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W6X1SgEISYeScFKPX+oJoSA/43e0/DFRv1IpISNfptUOT1KoX2Geb1fte6WnGM961 SDh39PQ+bDPiQfGDB5p6JpPS78lIhJqTPRguJwrGYwYN81lP4lEo+42B+ejCZ9sSgj s79zhlVg/kf+hfSMDWnpN2cG7T2Gwav43zBoVzzU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ralph Boehme , Steve French , Sasha Levin Subject: [PATCH 6.18 1242/1250] smb: client: refactor ACL setting control flow in id_mode_to_cifs_acl() Date: Thu, 17 Sep 2026 16:17:17 +0100 Message-ID: <20260917151625.959089842@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ralph Boehme [ Upstream commit a540a64c4801fe02e452ee37e961018106418260 ] Refactor the control flow in id_mode_to_cifs_acl() to reduce nesting and prevent error code overwriting. Instead of wrapping the call to ops->set_acl() in a conditional block, introduce early exits (goto id_mode_to_cifs_acl_exit) when build_sec_desc() fails or ops->set_acl is NULL. This ensures that any actual error returned by build_sec_desc() is not overwritten with -EOPNOTSUPP. Signed-off-by: Ralph Boehme Signed-off-by: Steve French Stable-dep-of: d05045177a85 ("smb: client: fail DACL rewrite when the new DACL exceeds 64K") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/cifsacl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -1799,14 +1799,18 @@ id_mode_to_cifs_acl(struct inode *inode, cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc); - if (ops->set_acl == NULL) - rc = -EOPNOTSUPP; + if (rc != 0) + goto id_mode_to_cifs_acl_exit; - if (!rc) { - /* Set the security descriptor */ - rc = ops->set_acl(pnntsd, nsecdesclen, inode, path, aclflag); - cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc); + if (ops->set_acl == NULL) { + rc = -EOPNOTSUPP; + goto id_mode_to_cifs_acl_exit; } + + /* Set the security descriptor */ + rc = ops->set_acl(pnntsd, nsecdesclen, inode, path, aclflag); + cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc); + id_mode_to_cifs_acl_exit: cifs_put_tlink(tlink);