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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12E70C433F5 for ; Tue, 16 Nov 2021 11:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2B9161B4C for ; Tue, 16 Nov 2021 11:09:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2B9161B4C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E74E6E9F4; Tue, 16 Nov 2021 11:09:21 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38DE16E9F4 for ; Tue, 16 Nov 2021 11:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637060959; 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: in-reply-to:in-reply-to:references:references; bh=HL9hhLdIrLyUpBuE4w+BC97fd9zpve2OyGyAHsqNBwE=; b=DEC4tYVqVE97FFFuwOk91/GtZN1xD2nGcA0K3Pfuk1kN83eX2c4qMIzAW7FqXsitywfPFR H4xhqjlKnjY7xGm92W1Rm65P3Kyxac4+XFeorqFwi0zsWI4vERAMhuh86lZoQ4TZo1a/qQ 0N9Cy+lkzXFvKtQF+SAA9+GJt7vGh7U= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-I9OmwNCEOYuLb6EuMMER3g-1; Tue, 16 Nov 2021 06:09:18 -0500 X-MC-Unique: I9OmwNCEOYuLb6EuMMER3g-1 Received: by mail-wr1-f70.google.com with SMTP id q17-20020adfcd91000000b0017bcb12ad4fso4398031wrj.12 for ; Tue, 16 Nov 2021 03:09:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HL9hhLdIrLyUpBuE4w+BC97fd9zpve2OyGyAHsqNBwE=; b=KNbCyJWUT9e/RJ+YB/yJZJn5VoUJk6/CbefRf6CgRFly5uu2DHTEaAObDe7q5AScNt U1nhg+IxlPKNqLfSRCYRX8+g87DtnvugqsWmhG7jyTnrllXtI6LlaH/1An2c2EbA8Amg XiLCp/vjNqH2b03CjwcvVebBG8V39CJaO6PzNMPwl8nz+/etW245NeP7wKGAok8F+8eN 6suJWmiABXZYYn+zxNFoVErCzFHRZo482v3rfjBlcz3KH14t4nFQ9Wq/7U9ymSo8m8xO WnKTvOn3jgOIQWNRL2Gc5WAS1A5oXJ54AghU/7owbVNuVsIAjsunYJP1dhOCG1Scmeze roDQ== X-Gm-Message-State: AOAM531hZDRCyWiQfhKmnUVFDhkUAsDukoppSpLO0uSpvJgJKYR6hnSr /K13Nj5mkleOjWES6+3sV8dn0GyIyym5G90FO3wAuU1x8LJ0IPN5JnbWhFihAGWfZSUKt8XazbV XKJnlS7642tVmAYeAtSvFjNOe/OsVoVk4ss5P/Tbk/A== X-Received: by 2002:adf:dcd0:: with SMTP id x16mr8196479wrm.229.1637060956898; Tue, 16 Nov 2021 03:09:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTgah4x2G9O8O+iUz5EmWC3uhlRWC07X48xzTEYzOUA98ZreV80VeBn9mcy5hBafA5uvas47+J9y5b040RUo4= X-Received: by 2002:adf:dcd0:: with SMTP id x16mr8196441wrm.229.1637060956649; Tue, 16 Nov 2021 03:09:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Karol Herbst Date: Tue, 16 Nov 2021 12:09:05 +0100 Message-ID: To: Yizhuo Zhai Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kherbst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [Nouveau] [PATCH] drm/nouveau/core: fix the uninitialized use in nvkm_ioctl_map() X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau , LKML , dri-devel , Ben Skeggs , Daniel Vetter Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Tue, Nov 16, 2021 at 6:58 AM Yizhuo Zhai wrote: > > Hi Karol: > Thanks for the feedback, the patch might be too old to apply to the > latest code tree. Let me check and get back to you soon. > sorry, that's not what I meant. It used whitespaces instead of tabs and the headers were also a bit broken. I just suspect that when sending it something went wrong or so. > On Sat, Nov 13, 2021 at 12:22 PM Karol Herbst wrote: > > > > something seems to have messed with the patch so it doesn't apply correctly. > > > > On Thu, Jun 17, 2021 at 9:39 AM Yizhuo Zhai wrote: > > > > > > In function nvkm_ioctl_map(), the variable "type" could be > > > uninitialized if "nvkm_object_map()" returns error code, > > > however, it does not check the return value and directly > > > use the "type" in the if statement, which is potentially > > > unsafe. > > > > > > Signed-off-by: Yizhuo > > > --- > > > drivers/gpu/drm/nouveau/nvkm/core/ioctl.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c > > > b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c > > > index d777df5a64e6..7f2e8482f167 100644 > > > --- a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c > > > +++ b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c > > > @@ -266,6 +266,8 @@ nvkm_ioctl_map(struct nvkm_client *client, > > > ret = nvkm_object_map(object, data, size, &type, > > > &args->v0.handle, > > > &args->v0.length); > > > + if (ret) > > > + return ret; > > > if (type == NVKM_OBJECT_MAP_IO) > > > args->v0.type = NVIF_IOCTL_MAP_V0_IO; > > > else > > > -- > > > 2.17.1 > > > > > > > > -- > Kind Regards, > > Yizhuo Zhai > > Computer Science, Graduate Student > University of California, Riverside >