From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 EB2C13CC7DC for ; Tue, 11 Aug 2026 15:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786463204; cv=none; b=SBDIDe7RUneA9MkxZ308R6knYl/MVD8w0sglSCTlERZEdG/u3XM44O2tDSYD/POBjdX6IFNfp1hTRmwqzkw9TsQ4p4KOc1b2kBfMFD5jvWhsX+h3JcBHMAhMAeCP2aNmmSxXYVLzwrCwkMSv++EUgzUbt/tCT1jmQKC/O75XNqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786463204; c=relaxed/simple; bh=eSfNvzthlWvtJ69YZYrMhr/yehzd3iAe13DIW8iMPiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XbToOF78+P0NYyMuwra//YetNX3DEwS983acaMeXf8Ec2+lhvucmZJebkp4vY6wWVSWYYIlUgaaYUax7A+LI9vNK6avSyV3e7H4TEbeLBk+xZI4vpYMplPjDxJNIXsFkJzn+saSkXHaXimRyF+4PX/QF5PdIHfGANEaRl5V67E8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=G271+u1k; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G271+u1k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786463201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FgISlfLGjn+UQ9H1W1zMKvHKz9IrVJ2M1jpg3ljKeGw=; b=G271+u1kw+UKXFphH/o4NxeTBQ03YIeJVlJroLYPAnHsml7OlvvadTBPCG/K6s1iPps0Rm bpUIwqlFUVXaBaahq2nGOrz0/K7+i9i/c9DR0qQY0A+XmipWAicYkLkGV+5AkGOnQW8hsg CFujXF9lg1dRVow2GqSPj4l4ffzTI3Q= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-53Yk6KYLNa2aBvOcochPeQ-1; Tue, 11 Aug 2026 11:46:38 -0400 X-MC-Unique: 53Yk6KYLNa2aBvOcochPeQ-1 X-Mimecast-MFC-AGG-ID: 53Yk6KYLNa2aBvOcochPeQ_1786463197 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5A0701800145; Tue, 11 Aug 2026 15:46:37 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4BDBB3001DAF; Tue, 11 Aug 2026 15:46:35 +0000 (UTC) From: Thomas Huth To: Namjae Jeon , Steve French Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , Tom Talpey Subject: [PATCH v2 5/5] smb: server: Clear Preauth_HashValue in smb2pdu.c with kfree_sensitive() Date: Tue, 11 Aug 2026 17:46:20 +0200 Message-ID: <20260811154620.2425851-6-thuth@redhat.com> In-Reply-To: <20260811154620.2425851-1-thuth@redhat.com> References: <20260811154620.2425851-1-thuth@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 From: Thomas Huth struct preauth_session contains the Preauth_HashValue[] array that might contain sensitive data. Use kfree_sensitive() to clear it before returning the memory to the heap. Signed-off-by: Thomas Huth --- fs/smb/server/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 184501e08b29a..fc44ac6b56427 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -2136,7 +2136,7 @@ int smb2_sess_setup(struct ksmbd_work *work) ksmbd_preauth_session_lookup(conn, sess->id); if (preauth_sess) { list_del(&preauth_sess->preauth_entry); - kfree(preauth_sess); + kfree_sensitive(preauth_sess); } } } else { @@ -2190,7 +2190,7 @@ int smb2_sess_setup(struct ksmbd_work *work) preauth_sess = ksmbd_preauth_session_lookup(conn, sess->id); if (preauth_sess) { list_del(&preauth_sess->preauth_entry); - kfree(preauth_sess); + kfree_sensitive(preauth_sess); } } -- 2.55.0