From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.201.61 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796068709; b=r3USpCoUmV+lIF9/ZodSapkG9wSGx5uvIXu9DG0CS755xJhCuRYPrUDBDZrrpYveGN/S pFF4SiTVFG5q/EV5lC49/ulDU6Rmx6k2HPjt10aSIqO3xs33sLs3qgUHLojzK101rXpzM R0gmdSc9BN2DZZ8Qj7mqvRKF3QipoYErEfjr1OzCOyORsOTFpazt7w7gJQEG0iXxiwOZm 0gcOss5dXyA4ewWdPLCfbQNa6I8ce3FcWF/hJrWh+fiBiVc4aZW2LD0spb4VeIJJGxV/r staSZ+xIK+IrGgoAwwydu9d1FKzmXdByWKytKR9ue5/AvyLs3YtvFbV7KEkycVkXS5Q== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796068709; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:Cc:References:From:Content-Language:Autocrypt: In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy: MIME-Version:X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=zbXSH01IoSHLOEPl9Hgjr7xOcpaFpS1oR2eXTQzUzK4=; b=qffmDQbSxPa++4z42+z2SS9lggQC5fBT6WbjxZTlBED+cp7o2ySSZR3KH3JGvMeXFcmm VO8eXAOG5mS7yBLzUduasSIxQKwsghoL0Or6XFRWvccpVgKcV+7kTAtR51K4fK93qKkGP tEXaYXVp3G4BlO9A+9pRdF/w37Bg0l3J1MbBKoW7QKa1oFI7HbfuR+/UTJX0ry/gSnOx1 EA+VuDlHcun/QrSDxI8w/AX7ihpS8SYt8w0nAg+ILQbh6HrOBEaXF/hfBZLKoOu1jEyLq B2VdOOCZdHBTqJ5oU2/jlxE2pMU7tKxd09xpnF0VQZjx1qKudHqgAirNuPccK/mcr0w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=XtllQJxh; arc=pass header.oldest-pass=0 smtp.remote-ip=40.93.201.61 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013061.outbound.protection.outlook.com [40.93.201.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E90CB606A32F; Mon, 30 Nov 2026 19:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E90CB606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=XtllQJxh ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NKws1ssDu6bBXOT9qquy1tsNpAM9ZanKKeprPPMbdimr/K0atKVG90Kpn/7DufC1H5CD8lxSYT7507bAJPkfHVECVWvZ4Vf23EeQhpfMTy2xtVuIMeS63kwGqj8QXuA0GvkAI9z/i6AoVVXVyef5jggoZOLYCH/ZB5zyohyNp5ps6ZSaDqLa2faZlx1VhlCAR+LKHIGtEwXCgpouym0wJGvQc3xBZKN+uwvuh4zl/vNF0634xOsvSBZxaq5n923sdSEFNE7cm8kynOfH1ryQrOk5t623HlSEGXAASQQzTFVVnMHWRjMG8BKBwKlkbVqwlW6CWuhRYRjL+raXE3vwdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zbXSH01IoSHLOEPl9Hgjr7xOcpaFpS1oR2eXTQzUzK4=; b=UX+o2jok4sO5CW+yiof+gn+XjPK9yhyXd/nMHp464S0PB+e+lbxyENixgKD5Pb//GuYdCiY7LK1hlPqDk5nZrWNHw0lHb+mF/hoG7+O5LDNRF1tBiKwSBJlFeUA8X4N9gTzR09Fk7Fr1RqF+E8542qohAvdQqULRVmLj4NfRysjuaST1vnTDSzuhTJMp1/gWEWaIG7ByZTly7knuHNFRwidCEyM9eZbaeZxuLj/uxk2KXkSZV2Dtvkn4lC892Dh11N4rRDVUnQIL5gl/8RFXjAzPhNi04KHXv+h3XBCZhbNe5h/0ahL5ksYMVWiq8hdpJ/jsa5zKfNCzkHNDbGS0cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zbXSH01IoSHLOEPl9Hgjr7xOcpaFpS1oR2eXTQzUzK4=; b=XtllQJxh4JVj8MOSWC4Cyij2pSLl65joNYH49Jzh5XEqXyZQ31tR+ismDKVsRzIU4BxqPPgj75Vy3VvN58aTZ0Izxa0oFDLXBQXdQhMtfl9B3E5F9qfu+9XsX3zulwQs1aj7AQdsdVHjGDyVEOPRu9hlQlyeQhbpj5xFqLzRPeQ= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SN7PR12MB8131.namprd12.prod.outlook.com (2603:10b6:806:32d::12) by IA0PPFD78AA37BB.namprd12.prod.outlook.com (2603:10b6:20f:fc04::be6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 19:58:20 +0000 Received: from SN7PR12MB8131.namprd12.prod.outlook.com ([fe80::c2dd:62c5:67fe:aa46]) by SN7PR12MB8131.namprd12.prod.outlook.com ([fe80::c2dd:62c5:67fe:aa46%6]) with mapi id 15.21.0662.004; Mon, 30 Nov 2026 19:58:17 +0000 Message-ID: <4f761ba2-2ede-4dda-89d4-427bf7bf4020@amd.com> Date: Mon, 30 Nov 2026 13:58:14 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] crypto: ccp - Do not hand a short INIT_EX file to the firmware To: Gokul K , Ashish Kalra , Herbert Xu , "David S . Miller" , linux-crypto@vger.kernel.org Cc: Sean Christopherson , David Rientjes , Peter Gonda , Atish Patra , linux-kernel@vger.kernel.org References: <20261126092001.2099312-1-gokul02k@gmail.com> From: Tom Lendacky Content-Language: en-US Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDG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kRyGRu2zgIwXAOXCHTqy9TW10LGq1+04+ LmJHwpAABSLtr7Jgh4erWXi9mFoRABEBAAHCwXwEGAEKACYCGwwWIQTdWKXnw4wULDeIG/Xe /5rkTzBNUwUCaRto5wUJFlBqXgAKCRDe/5rkTzBNUw4/EAClG106SeHXiJ+ka6aeHysDNVgZ 8pUbB2f8dWI7kzD5AZ5kLENnsi1MzJRYBwtg/vVVorZh6tavUwcIvsao+TnV57gXAWr6sKIc xyipxRVEXmHts22I6vL1DirLAoOLAwWilkM+JzbVE3MMvC+cCVnMzzchrMYDTqn1mjCCwiIe u5oop+K/RgeHYPsraumyA9/kj8iazrLM+lORukCNM7+wlRClcY8TGX+VllANym9B6FMxsJ5z Q7JeeXIgyGlcBRME+m3g40HfIl+zM674gjv2Lk+KjS759KlX27mQfgnAPX4tnjLcmpSQJ77I Qg+Azi/Qloiw7L/WsmxEO5ureFgGIYDQQUeM1Qnk76K5Z3Nm8MLHtjw3Q7kXHrbYn7tfWh4B 7w5Lwh6NoF88AGpUrosARVvIAd93oo0B9p40Or4c5Jao1qqsmmCCD0dl7WTJCboYTa2OWd99 oxS7ujw2t1WMPD0cmriyeaFZnT5cjGbhkA+uQGuT0dMQJdLqW3HRwWxyiGU/jZUFjHGFmUrj qFAgP+x+ODm6/SYn0LE0VLbYuEGfyx5XcdNnSvww1NLUxSvuShcJMII0bSgP3+KJtFqrUx9z l+/NCGvn/wMy6NpYUpRSOmsqVv0N71LbtXnHRrJ42LzWiRW2I5IWsb1TfdMAyVToHPNaEb0i WiyqywZI5g== In-Reply-To: <20261126092001.2099312-1-gokul02k@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH0PR03CA0379.namprd03.prod.outlook.com (2603:10b6:610:119::6) To SN7PR12MB8131.namprd12.prod.outlook.com (2603:10b6:806:32d::12) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR12MB8131:EE_|IA0PPFD78AA37BB:EE_ X-MS-Office365-Filtering-Correlation-Id: e42b7f8b-049d-46b1-98e1-08df4f1c4686 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|10067099003|56012099006|261026121527099003|261022105027099003|261026140227099003|261028144727099003|261021121427099003|261021123027099003|261022075727099003|261102123227099003|261009223027099003|22082099003|18002099003|5023799004|11063799006|3023799007; X-Microsoft-Antispam-Message-Info: M7wKBCkOGVxC+Q8dtISJpBZsc/eSEazAndeWoSWgFm+nM4wgFTqBGipc74DMpfpPOpb5yfNBXxuyqax3QjztgLMetVrojFGP5SdFvYbxJfnMK0GSaBEpaWetoPEs6PJV8VaIvT2WfEIpR/ay4/daWKnz5/26gjFAsq9ItnIxMRRZzp1Ti2wgax9414p0KjBPtnPNXWreWPUXyjmvrURTbUZul8XrPh0qIm13CRVv7fEb2NNdXOJ3aUpv+x8sDCb1g8NiAD4T67VrHg9eerLFyHKWLZHgZeGFvv/HinN/pwZYC2mc3Z+b3ne//p/sfuJlLyCXrMDhL7+ahfFNYdTdqsLPyOIaEm8mPSlMLXW9AQuRpWOJCaxC6AyHB8MDbk+jnNc96Rq9adxKrpbWpFzY3/voD73UFnu0QkVVl7KbjFJsueE6isjK1J4Itrux15ZZYapAI0l+sN3Bi5Nj66zWkEtiOfHCO7SQgMKh8KPvMmFYt2gaN+MYLklGs//M0Edc6hqeeWwenJNhYAzcjpq19yX+jh5UoNVYOD+z43+PK9dUsCVI+zv0puFjmn2g0F1O3zzS3LZByDBeU44E3w2vVSGyz15A49hRI9WpnPjQTI8gTxNyPgHnBI19gJthew6T X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR12MB8131.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(10067099003)(56012099006)(261026121527099003)(261022105027099003)(261026140227099003)(261028144727099003)(261021121427099003)(261021123027099003)(261022075727099003)(261102123227099003)(261009223027099003)(22082099003)(18002099003)(5023799004)(11063799006)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TDExeU1nc1h0b3laYUw1YkdITjRvUjA5d3RtMUV6emtyeXZVVTN6a3Z4SmdC?= =?utf-8?B?V2h6VW0zczMzcFpEU1JCcTltcjd0d1Z4K09OSGRIdWU1VG5DaURoQjNpNXo2?= =?utf-8?B?MzdSUHVsNXNIeE93ZmFkb283dG8vbkNIQXN0L0RSeVFuSEk1UVpWYnJDUy96?= =?utf-8?B?ZWxlVDlQSWtSQ2NjUWRGU1ZNbW8xOHIyZFdCOVpWT0V4RCttUUJuL3ZhbkRa?= =?utf-8?B?VWUyeHYwYlpwNndoamxmRmdhZERvTmptbWJLa0NXRkJ2TkVrM1VzamJWZzYz?= =?utf-8?B?N2ZGWUZ1TzRsN0p6T2x6MzdnY1hpTlZyVVVhUmEyeW4zVWszZGg5a0RDVTM1?= =?utf-8?B?R21yRHdZUWdSblA1d1hOMkk2VTBkNkRMRDIxcEQ0UEM2NXlZVzBLNVd4K3VQ?= =?utf-8?B?WUs0bld0K00rRERNNzlZNCtVT2RCSGo3cjNwbzJ5Wlp0L0htVCtJYUNiRzU3?= =?utf-8?B?ZTlhUExaRjg1MEFGMkRnVkl1bGEwUzh5OFM3OXo2dVhXSUg1Tkp0citGUGFH?= =?utf-8?B?UDNLbkVtYS9LQ1kvRmpLYXdGNkIvanJzcXp3bVZoNVU5RXdWKzVJY21GTnd6?= =?utf-8?B?ZUlBM2tWQmdpZENXdmJrQytxT0w4WDR6RG43QUlJUndlUk55bGJqY0h6MEd4?= =?utf-8?B?cGxSbTdCQXdFbj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1hqM3ZWaitlQzNrSW1scTY5clQ4ODhFU3ExcmcySi8yY2FUU2dZ?= =?utf-8?B?OVBzQUVlampnWnQ3SnlWUmlodU9LNlJTcFlLRGN3dkdWWSsyQVF3c0RRMXly?= =?utf-8?B?OWpxOHlmL25yT3d3ZlUxU1VLbGZ5dkdCRTlkRmY1MnBGd3A1RWJvNzlIY2Vn?= =?utf-8?B?T3VXTm1mclpLWEpJVUx6Qy9ZU3daS0Z0cXNxLzh4dnN2MWxtZnowWTJrTW5D?= =?utf-8?B?N3B3ZDNzaDQ5eDB5bTA2SUhYSTk2YS9ZOUM0TzdPN3pMZlpGQTJKVFByZTR1?= =?utf-8?B?cXJNUVI4a2JhRWcyRHg1cU94ZjJ5YnAwdlM1NXRJV0pkandZUFFIWTY3Vk5n?= =?utf-8?B?MUZ1STR5eEpYVDlhN2I2Ny9TbmNzZDllZHlIUksyOGlFTUlVd2FEWU56ZEND?= =?utf-8?B?MHAvZ2Q2dEQ4YlhURnk0MUtEQm5JL3ZQN21aL21CTWkyVDV6cTFqbUpxZGNy?= =?utf-8?B?d3Z2alBJM1g3TXpOY1F4NkJPS0dCU2Y0Vkp5dUZJSjFJemhFRUxpTVh2emo4?= =?utf-8?B?bHlITUdEOWl2bU56b3NjVW44ZE9hWVlPaXg1OW5kL2dEZlpySXVnNmlnSVhB?= =?utf-8?B?bGg4dVY4Q2RHSUQ5bVNVVFFIenZ1QlgvYlRpUlVORkdzcFZHVkhoYmZnTHAx?= =?utf-8?B?OVVTZFRCNDlUNHBDcWVhdWtpVWd1eWQzNnF5eExFSFNsMlozbldwTnVtcWNn?= =?utf-8?Q?8sgzxJlSS3VBU8rG10?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e42b7f8b-049d-46b1-98e1-08df4f1c4686 X-MS-Exchange-CrossTenant-AuthSource: SN7PR12MB8131.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 19:58:17.2775 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7Du0jYLWsk0nWzYWA2nKxdvy//Vu04dsXRwcXYWrOWDy1mWji7qlgLCJdi+r9InDP/DjzsoiFH1hw0KWvnONmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PPFD78AA37BB On 11/26/26 03:20, Gokul K wrote: > sev_read_init_ex_file() reads the INIT_EX non-volatile state from > init_ex_path into sev_init_ex_buffer. When the read returns anything other > than NV_LENGTH it logs the fact and then returns 0, so the caller carries > on and __sev_init_ex_locked() passes the buffer to the PSP as the > platform's saved state. > > For a truncated file that buffer holds a prefix of the old contents > followed by the zeroes the page was allocated with, which is not a state > the firmware ever wrote. A negative return from kernel_read() is treated > the same way, and then the buffer holds nothing but zeroes while the code > still reports success. > > This is not what the interface promises. Documentation/virt/kvm/x86/ > amd-memory-encryption.rst says of init_ex_path: > > If the file specified by ``init_ex_path`` does not exist or is invalid, > the OS will create or override the file with PSP non-volatile storage. > > A file that cannot be read in full is invalid, so discard what was read > and let INIT_EX run from a zeroed buffer, exactly as it does when the file > does not exist yet. The firmware then repopulates the buffer and > sev_write_init_ex_file_if_required() writes it back, which is the > "override" half of the documented behavior. > > Doing this for a negative kernel_read() return means a transient read > error costs the platform its persisted state rather than failing the > init. That is the deliberate trade: the documented contract allows the > file to be overridden, and feeding the firmware a buffer it did not write > is worse than starting over. > > This was found while looking at the INIT_EX failure reported by Sean > Christopherson, where an interrupted writeback leaves the platform > unusable. It addresses only the case of a file that is short or unreadable > on the next init. An interrupted write leaves a full-length file holding a > mix of old and new bytes, which a length check cannot detect, so the > reported failure is not fully fixed by this patch. > > Fixes: 3d725965f836 ("crypto: ccp - Add SEV_INIT_EX support") > Reported-by: Sean Christopherson > Closes: https://lore.kernel.org/all/abSWm4wyY91I4zf8@google.com/ > Signed-off-by: Gokul K > --- > Compile-tested only. I have AMD hardware but not a working SEV INIT_EX > setup, so the path this touches has not been exercised on a machine. Built > at W=1 with CONFIG_CRYPTO_DEV_SP_PSP=y, and confirmed sev-dev.o is not built > with it =n. Tested-by: Tom Lendacky Comments below. > > What this does not cover, and I would rather say so up front than have it > found in review: the failure in the report starts with an interrupted > kernel_write() in sev_write_init_ex_file(). That file is opened without > O_TRUNC, so a partial overwrite leaves a full-length file whose head is new > and whose tail is stale. Such a file passes the length check this patch > adds and still reaches the firmware. Making the write side leave either > nothing or something detectably invalid behind is a separate change, and I > did not want to bundle an untested design decision with this one. > > I also have no explanation yet for the widespread memory corruption in the > report. A zeroed or stale NV buffer should not produce corrupted page > tables, so I assume something else is going on there and this patch does > not claim to address it. > > If anyone with an INIT_EX setup is willing to run the reproducer from the > report against this, I would appreciate it, and I am happy to follow up on > the write side. > > drivers/crypto/ccp/sev-dev.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c > index f833cb7e4da3..6d7ea028d24f 100644 > --- a/drivers/crypto/ccp/sev-dev.c > +++ b/drivers/crypto/ccp/sev-dev.c > @@ -302,14 +302,23 @@ static int sev_read_init_ex_file(void) > } > > nread = kernel_read(fp, sev_init_ex_buffer, NV_LENGTH, NULL); > + filp_close(fp, NULL); > + > if (nread != NV_LENGTH) { > dev_info(sev->dev, > "SEV: could not read %u bytes to non volatile memory area, ret %ld\n", > NV_LENGTH, nread); > + /* > + * Whatever was read is not what the firmware last wrote, so > + * none of it can be handed back to the firmware. Discard it > + * and let INIT_EX start from a zeroed buffer, which is what > + * happens when the file does not exist yet. > + */ Maybe just simplify this comment to say: A full file wasn't read, resulting in a buffer containing invalid state, so let SNP_INIT_EX start with a zeroed buffer, similar to when the file doesn't exist. ? Up to you... > + memset(sev_init_ex_buffer, 0, NV_LENGTH); > + return 0; > } > > dev_dbg(sev->dev, "SEV: read %ld bytes from NV file\n", nread); You could just move the dev_dbg() into an else. That would remove the "return 0" that matches the function ending "return 0" and you wouldn't have to move the filp_close() call. Thanks, Tom > - filp_close(fp, NULL); > > return 0; > }