From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=143.255.12.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796255538; b=bScHyldNSI26tjraQ29PhuoDLaxBAJ/DSFoDtPjpp+O32hg4YMOORQwOsK18FGyRHDrY lMH+zXEqYIprQVxq/PmRU2K4Fa3Y422N9H8GB6F7xsaVQluZYxw3cY3yhCKTLyoALnX2i pjvE4bs9NdPi0coyDSPm+j64nl3fStqmwZAr6FPDjLbA3pL7g3ikGGKE9GtS7q0pKSc0E RIljVcCbtHdjxR5QbeGODDju/zx4oBVtWENAO/660d6YAzE+hd9pKbQNFMtSNc4GkA7yd F/oiwI2pkGPh1MZY1Vnr7mYjCbEw8sxFYNrMVqkHJ21/HorTRaO/JJUaVbqGpa0Ka9Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255538; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:From:To:Cc:Subject: In-Reply-To:References:Date:MIME-Version:Content-Type; bh=yCEzJaV+ElgGNVA6OtPJKUOgM7MnBP5SK2b1/p/7Mkk=; b=QocAtxO2yo2dZiRBmxhYEtxs6uiogAXPz0EATdCJGLZOPTBBsUgYKUhEaw6z6yrT8Xuo +lt8i/a2Ph/f90sELyg2CukO69Edolb9/6ETjymhbk1ch8LqMsjo0wSY84hIN/tqvmTb4 qxB+8yHTB3wQ9naf8pJz3zl3rtMqQmdgUtfsohAGmcoogZwOJGOgw/Pn2DonHS8GOqgmh 2nJlnw2DLzbACa0pMFqM6FLfUBg5UZVu3hVRd+fthALCiewKr15iCqJ1OWGJekQwI1Nqh frfCeacDSn1RRbCqPjJQ3Gwmk3KT+AgYRaBcj9QbZgZNtEvECbQQWCNBCyP1ARJ+r+w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=manguebit.org; spf=pass smtp.mailfrom=manguebit.org; dkim=pass header.d=manguebit.org header.i=@manguebit.org header.a=rsa-sha256 header.s=dkim header.b=12tj2mnM; arc=none smtp.remote-ip=143.255.12.172 Received: from mx1.manguebit.org (mx1.manguebit.org [143.255.12.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99799606A322 for ; Wed, 2 Dec 2026 23:52:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99799606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manguebit.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manguebit.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=manguebit.org header.i=@manguebit.org header.a=rsa-sha256 header.s=dkim header.b=12tj2mnM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=manguebit.org; s=dkim; h=Content-Type:MIME-Version:Date:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yCEzJaV+ElgGNVA6OtPJKUOgM7MnBP5SK2b1/p/7Mkk=; b=12tj2mnMIcoiEQ5xlmV89XwLjs 26pIw5YRwMYhfQ+QBFm6gp1snL3Icrqv1+E4cpE7qgCc5/HlbCAKD89K+Z4McSvJSC1vpPTKbP0pp LPpRim4sK7nqYLucq/ACTKVj7YclAPvYkkAYWSeemdjU2Z2jKVvYxl9SdHOYVHNiPQUaNYqlV6+Zg EZ0G1m8M6tG2mIJ1g+n7YlqcC/pSLEl2BNicjgwG9B6D8zqoZiIRu9j/9wJc/vOi+XGaKtsYsU20I alDli1OmegV/ZM+0hck+zZdzJgUs6lIMost68ZuvxdeA1ixoAxxVB4m/dwdzxLs+TWkXY29e8EcAI zmezfEkg==; Received: from pc by mx1.manguebit.org with local (Exim 4.100.1) id 1xYu7I-00000001X0c-3pai; Wed, 02 Dec 2026 20:52:04 -0300 Message-ID: <37e3ebeaabff5994cd7b431d4bbcac63@manguebit.org> From: Paulo Alcantara To: Anh Nguyen Hoang via B4 Relay , Namjae Jeon Cc: Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , Jeff Layton , Steve French , Pavel Shilovsky , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, Anh Nguyen Hoang Subject: Re: [PATCH] smb: client: fix shift of SID authority[0] in sid_to_key_str() In-Reply-To: <20261202-kbug-l990-v1-1-0f894e0f1d77@gmail.com> References: <20261202-kbug-l990-v1-1-0f894e0f1d77@gmail.com> Date: Wed, 02 Dec 2026 20:52:04 -0300 X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain Anh Nguyen Hoang via B4 Relay writes: > From: Anh Nguyen Hoang > > sid_to_key_str() builds the description of the cifs.idmap key from a > SID. The identifier authority is a 48-bit big-endian number held in six > bytes, and the function assembles it by shifting authority[5]..[1] by 0, > 8, 16, 24 and 32 bits. authority[0] is then shifted by 48 instead of 40, > which leaves bits 40-47 empty and puts the top byte in bits 48-55. > > A SID whose first authority byte is not zero is therefore converted to > the wrong string, and the idmap upcall is asked to map a SID other than > the one the server sent. > > The value can also need 14 hex digits, while SID_STRING_BASE_SIZE > reserves room for "-0x" plus 12. With a revision of two or three digits > the string no longer fits and sprintf() writes one or two bytes past > the size requested from kmalloc(). > > Shift authority[0] by 40 so that the authority is the 48-bit value the > comment and the buffer size expect. > ... Applied.