From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 794E1C001DD for ; Mon, 3 Jul 2023 18:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbjGCS4v (ORCPT ); Mon, 3 Jul 2023 14:56:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbjGCS4l (ORCPT ); Mon, 3 Jul 2023 14:56:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC02CE73 for ; Mon, 3 Jul 2023 11:56:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 635F561013 for ; Mon, 3 Jul 2023 18:56:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AA6EC433C8; Mon, 3 Jul 2023 18:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688410598; bh=31v3e8KBJo1QBJ3RXpcuztJ3Nb20e7DqMZEIkTQHJ10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r+6F4Xge4d4qlv1y9uCo/ej230vJbhEhD2rde4+YncBAsM/SIMeMJEJIPkazOlhFI H1lZxupW36xiJh0TYJqgZqF5escp7t4Q2lbOlBxaeEtnNOoWiKH/RIr3Z0VScJXPlO 9yVyEEqp1UtE7zcH+Eu0FQTY2hTHZert1/25UG7I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bas Nieuwenhuizen , Alex Deucher Subject: [PATCH 6.1 11/11] drm/amdgpu: Validate VM ioctl flags. Date: Mon, 3 Jul 2023 20:54:30 +0200 Message-ID: <20230703184519.454621100@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703184519.121965745@linuxfoundation.org> References: <20230703184519.121965745@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bas Nieuwenhuizen commit a2b308044dcaca8d3e580959a4f867a1d5c37fac upstream. None have been defined yet, so reject anybody setting any. Mesa sets it to 0 anyway. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2363,6 +2363,10 @@ int amdgpu_vm_ioctl(struct drm_device *d long timeout = msecs_to_jiffies(2000); int r; + /* No valid flags defined yet */ + if (args->in.flags) + return -EINVAL; + switch (args->in.op) { case AMDGPU_VM_OP_RESERVE_VMID: /* We only have requirement to reserve vmid from gfxhub */