Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1057524rwl; Wed, 5 Apr 2023 11:08:10 -0700 (PDT) X-Google-Smtp-Source: AKy350YRrdbVJTrHN0dibxWaS2BX1Prsp8RkkrHd2HBVj6nh6zvosJVrsiGyHwqEKkM5s0xWzBMl X-Received: by 2002:a17:902:f145:b0:1a1:b174:836c with SMTP id d5-20020a170902f14500b001a1b174836cmr5738761plb.16.1680718090121; Wed, 05 Apr 2023 11:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680718090; cv=none; d=google.com; s=arc-20160816; b=a3vOC7F4G9gbnA3rjaZttiJ5fYi49FCIzEPQpOtfw+csUcKZ9VTzwe1lRF6aOjY8Yw wAJroUnjCyv6nYdKZoJVCJMHtapoNrH7hWFWCytfXSa6R7gSm9Ny4CSjgfSo1zfcDsiY vBB1TctIeelVEy8ZTe4rOXOU1Pioyns7kVhgY9V+fkFecrr4r2IaNYLoTLPXLJKcCPz7 wsZ11LXsMAwgyMl68OZC/tUV5+4D/pQbWw6Ny203vjY/I3RvJTZ0H6Ba43fU4y9aDTTh +M0y3qyhsNh+rZji9ng7vwk5TnMJTigC938AfoF5/dQG14l6l5JOmPBKtv50m4OpZh9P 2TMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IruhkEGZZCoFzKGgFnTGC1NJqEOuwMvRvEbYMgFxXUc=; b=qNZ1DV7gvIYiv2oPUpsn8ZVOLOQK5AebGovvisicmoaHc0gftwxj6BafNUGFdd+TdG Jtg0l/uhVPtMI9Jvc0J+cV7kWN0+vHid/EC99My0GbXuwvANqv7MTc8pvnPQrP00C31W a+6Xs6DBT3DMLliUuFjoDFdKendRIKFQ8RiFcSPI+qpsxxzY+7hgLav/OO2diEN6tDAb 2X2eC80e4gOK9R93CUlx+wnthvAp/4v5Sb0C1V8FMkD5uPF8dgH9c3+QuejT+v1ORXBo /VwGfWT8t1bk5bc1WvtqgT5leF7B3mr7eoZlzDu3FAGGXQjKmHs0R+5dwBwdrN8OuEIi 5vJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eHH+9g92; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b00503016f280dsi12934352pgd.823.2023.04.05.11.07.47; Wed, 05 Apr 2023 11:08:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eHH+9g92; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229520AbjDESHd (ORCPT + 99 others); Wed, 5 Apr 2023 14:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233953AbjDESHb (ORCPT ); Wed, 5 Apr 2023 14:07:31 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C64BE7683 for ; Wed, 5 Apr 2023 11:07:10 -0700 (PDT) Received: from zn.tnic (p5de8e687.dip0.t-ipconnect.de [93.232.230.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E2C281EC0104; Wed, 5 Apr 2023 20:06:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1680718013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=IruhkEGZZCoFzKGgFnTGC1NJqEOuwMvRvEbYMgFxXUc=; b=eHH+9g929JkpCyAzbzKst67IZsNmNd2C26rlAtkQ8eniAIWhIuj158xXsqIjso7oQolSeh 3+nnsnsI12CiKDcLjy5ZY65XKBKt0FDvxfXqdc+PWOs7aMf1zdo7D2O+r/2WURNyA59vea 0tOugR2zfWSfGVlRuU/5H8Eh+fOjHB0= Date: Wed, 5 Apr 2023 20:06:48 +0200 From: Borislav Petkov To: Yazen Ghannam Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/amd_nb: Check for invalid SMN reads Message-ID: <20230405180648.GEZC24uJ+GSMZxczaW@fat_crate.local> References: <20230403164244.471141-1-yazen.ghannam@amd.com> <20230403193245.GCZCsp3RjNZFSE5f9s@fat_crate.local> <20230403203623.GDZCs4x5yVReaPVOaS@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 03, 2023 at 05:36:40PM -0400, Yazen Ghannam wrote: > Yes, that's fine. Should I send another revision? On a second thought, I think we should do what you said in the write function too. Because the write can fail too. So if it can, we need to handle that potential error too. Care to send a new version which does this check in the read and in the write function? Basically what you had initially but with the write side check added too to amd_smn_write. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette