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=1795968117; b=iYY4pRyaEQQEB9HTRKMWvGam+/kHi7AvumNdyhinxiQDrSwwO7h/ilSBIY1ZvDlQC9rN WgRwfW6cOjvsmq1W083S1s6iyrDfBWCI3r1lAKDhLLs6FT+TXdvdh8XJxo8Upyat0Wl7A 5wVAsB90QWZOboMdbjmCY2GsAePa+8EgWCi02A/DMpZrXkoC/WBahYdDuQ+tng2TSedsG SZoerfmKvnhDNZKT7xvuRVwL7A3UVBFgoMwoQGrxjMXhKEdUADNyN1/nz/vg7Fjp8XcWK tIhmGlMB/xygauX+AuYnzf8O/4zj5y/B/nBOvQYQvb8Vqc0ak3PTFamLL8zQig0O+Ww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795968117; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:From:To:Cc:Subject: In-Reply-To:References:Date:MIME-Version:Content-Type; bh=/LSA0M+nJYJvKmpxa8Hq1O/7EeWoheBkIP6VJlxOSdY=; b=eqPONzuEfXSlB78G33poTcs7/hpSTAevmmNfc2VTsLEOXVJmtxQYcypexHimx6LywOAG FS2nJgjx9Jnp69cj75ua5NKvQuHrthDV+3p+HEqZ20TRu1COYemWrIl+nveskWJDpCdeB 5M9EM3mFsV0dXH+uRqGJhqnh1VgwvV4oEl4yxjdHFsQTdB1ZGW5W214cpIw3x17wHmdhq SDLTDlxbNFc6QXh9ger0rI3jJ1tSS1F9fETBoeE3oca8fOl+Enykkf8PDoXLzA47zWHjx OYTttJizhwl4VMYRK4d0+mZ8PMvd7Zanr1gWV471oqHv3/d/OmdOn0gNuHLFISerx9A== 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=qdT3SLYU; 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 19ABA606A31C; Sun, 29 Nov 2026 16:01:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 19ABA606A31C 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) header.d=manguebit.org header.i=@manguebit.org header.a=rsa-sha256 header.s=dkim header.b=qdT3SLYU 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=/LSA0M+nJYJvKmpxa8Hq1O/7EeWoheBkIP6VJlxOSdY=; b=qdT3SLYUwHzIvtXOt0uOjrpyQh ki+QoYZJ2bBxvBO9hVFscRm3KlI2eDE2WXx26LwL+mwsGYfp9mfZdtxTtZd/2cfV47JYYv1fUQ8ZG 7u5wNkiuOXMQ5WqS2XMExJfCFeLFXo+87DYyWDYzdNZ816uH8Xc6al21wfrHUICzZb0wccrw6bJgf 1WMc0ZKrwCbTzpyrFFKrjr2D1zxx+9E5f0kA9rNWDnpa+5VedUGZHtee5Z+6Q44daLWMqGmbLeWm1 TB2kmkULfiSdkEqp/QIRvkW6uOcgkNrtil6r+ft2VAEA5Az7oGTds92zZxUdu0D/15DpKsr5DgXZm K0TqLjMQ==; Received: from pc by mx1.manguebit.org with local (Exim 4.100.1) id 1xXhLe-00000001DKX-26ar; Sun, 29 Nov 2026 13:01:54 -0300 Message-ID: <66467ca68dc0c9ccab8f4237a45e151d@manguebit.org> From: Paulo Alcantara To: Stefan Metzmacher Cc: metze@samba.org, Namjae Jeon , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, stable@vger.kernel.org Subject: Re: [PATCH 0/8] smb: client: fix use-after-free of server->smbd_conn and the encryption nonce In-Reply-To: References: Date: Sun, 29 Nov 2026 13:01:54 -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 Stefan Metzmacher writes: > Hi Paulo, > > these are client fixes reported by Sashiko: > > - smbd_get_parameters(), smbd_register_mr() and > smbd_debug_proc_show() used server->smbd_conn without any > locking, while cifs_abort_connection() can destroy it at any > time (use-after-free). server->smbd_conn is now only changed > under srv_lock and only used with a reference on its socket > (the new smbdirect_socket_get()/put()) or under the lock. > > - smb3_negotiate_wsize() and smb3_negotiate_rsize() used the zero > limits of a missing connection during a reconnect, with signing > the header sizes were subtracted from 0, which underflows, so the > RDMA limit was lost. > > - smbd_get_connection() returns the real error instead of -ENOENT, > the following patches depend on that. > > - The nonce of encrypted messages is a 64-bit counter of the > session followed by random bits of the session, like Samba does, > instead of random bytes, which only made a reuse unlikely. With > AES-GCM a reused nonce reveals the authentication key. > > "smb: smbdirect: add smbdirect_socket_get() and smbdirect_socket_put()" > touches fs/smb/smbdirect, it's only used by the client changes. > > Reports fixed by this series: > > - https://sashiko.dev/#/patchset/cover.1791225453.git.metze%40samba.org > smb: client: don't use server->smbd_conn without a reference or lock > > - https://sashiko.dev/#/bug/linux-211bb822-8907-4243-9dd3-da2595595552 > smb: client: don't use server->smbd_conn without a reference or lock > > - https://sashiko.dev/#/bug/linux-d40006cd-d7c3-4ea8-8ebb-1bf2b55b0db0 > smb: client: don't use zero RDMA limits without a connection Thanks metze. Applied.