Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1413759pxb; Fri, 18 Feb 2022 07:19:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeu81sP1kzZfsSfMbvmh9mPCK7Qi2ComWEqq6KImsOuP+8IGLf1NB00luZpbm4skps9eol X-Received: by 2002:a17:906:9711:b0:6bd:181b:a5a4 with SMTP id k17-20020a170906971100b006bd181ba5a4mr7023309ejx.98.1645197547537; Fri, 18 Feb 2022 07:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645197547; cv=none; d=google.com; s=arc-20160816; b=Vmq3VaYfeKyc0H82e0BjVutravYZx41eEa/8LaVLXtYtQ1CxzY5RH1qkBU9VvXgfYw fHUUrjqHZJTtnof+oBbwNSYcSKBSfD6cdHXB5Kf7fKp0mfdIXnFVcHO+y8qI2LM4leRu sUezwq3/5pQB31s58lAVF3tL+3UB1eQYhK1+AqG7nsEfv4YWLE0SjYs0jolJX2VYg9T5 /EyUqo3QTgJrSaA/cccSPNJfrZivcVNVf//SQmrfjsqqyBMjnbEp2YRZEBJp3+s9nUJj u81iicBCtaPRIw/tDxQdvxTWe/rSzLaf2v+sWjbIoT9JxmKs0bAhzfchN/Hd5tU0uVC6 bKQA== 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=UFK1H0MLL3zfV8rrVT42KAQLrDb10EeLRg7qACWBZgo=; b=AuPmcTZuHB0aPRxvYw6VYbAv2/WEKH8HDhB5NaRcWclN/aa8GdlHUZBTlhOQnT3s3I N2XAxYp0hVgwmWgpIvyolOsyxCpTxpM1LxbBziDpOu5/qkptLMkBLlGuto760eH67h9A vfDQnsc3Huc4MYw7g6CR6DGyiLOdac4vhluqIqClw0NxXyxv+CdKBYHcTuqeQrCZiKzF SNpSpuySRsVr1qKRpoEUlhzl+zm0BWl9Wo+rZ/gZgZ61BZo6w5OrWg5E7pSEIhZVOiLo NbV8ZweKePcmJUjWjwxi9rExBLu5IXv6M8jHMb3EdH8BY5KEknmLufUQGqOKnKAiuhXg K8rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=loqXxekc; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh37si2760085ejc.862.2022.02.18.07.18.41; Fri, 18 Feb 2022 07:19:07 -0800 (PST) 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=@ziepe.ca header.s=google header.b=loqXxekc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236897AbiBRPMh (ORCPT + 99 others); Fri, 18 Feb 2022 10:12:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232052AbiBRPMf (ORCPT ); Fri, 18 Feb 2022 10:12:35 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84384163063 for ; Fri, 18 Feb 2022 07:12:18 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id n185so8275598qke.5 for ; Fri, 18 Feb 2022 07:12:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UFK1H0MLL3zfV8rrVT42KAQLrDb10EeLRg7qACWBZgo=; b=loqXxekcoX4BlDC6iJQG0PRWrLmv96YvYeNl8NRamBd2P2OGZnI0oi2OBzO5/s8rhl T+PXXlTJp48Z+7ULhVkAqr9KouVemM7c8uUYgfL8QJYTv12dM4D8HDCxA0SDDpUhGOvg rE5oFChEjkRNN04dRyvaVz5kbXhbhHWa1S8RXEqKgxqJ9VPxpBhGsDP3+sEp4wKCq39Q dG9tbJMPhNg+QCNvnwXuWzsvFTtj0VJCYY0sjVhMuNodOyeHr9bFiaeXdANNhcKhZxk2 y1x49gtOrmgtEUcvR4vYY5ULHDEpPUdlFhiU0tJXMWUkdNB/+4dbfbamE96F8vrSX6yS OGkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UFK1H0MLL3zfV8rrVT42KAQLrDb10EeLRg7qACWBZgo=; b=pthttxleEGuz0lVROoYXmHK71NiVFZkybqxxkJfHnJAwgIezQSrrzXMmRsLWtpjATT kcgvtybIIkSnbGL8ObTDMNzFYze49Y/7Q1/shCzgBGLD7WFBatg7aH8Cl0b4hsjtgDc3 GeJrtYEog+3KlHiQijasVH+TMzeglWf6IudBMui2jBLMCCCxyIS11jwZINSV+3EWrz84 Nqy4lR4Mo5SRVq1ZJs6jPcck3pkIH5K+xA8PTm8yLNlBnjpTUcmHcfxqCv+uKlGjL060 /zmKzFbF6yj/P6ebG8GwUFVHGDs6EbTEN8dmGzd7h9K5Ja53TkcCxgS9XV+ithMN86h8 y18w== X-Gm-Message-State: AOAM532v7/10FvBHHF0TNEF0hu9pv8iYIpzm/AQSEC4najoJYgMoxnmB FZ4kVFWi7fTEvgcys7Nd8lVTi1V8NKf4TQ== X-Received: by 2002:a37:af81:0:b0:502:7ea:34e7 with SMTP id y123-20020a37af81000000b0050207ea34e7mr4972743qke.737.1645197137730; Fri, 18 Feb 2022 07:12:17 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id i12sm23483248qkn.83.2022.02.18.07.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 07:12:16 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1nL4vg-006d8h-D0; Fri, 18 Feb 2022 11:12:16 -0400 Date: Fri, 18 Feb 2022 11:12:16 -0400 From: Jason Gunthorpe To: Jakob Koschel Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Greg Kroah-Hartman , Thomas Gleixner , Arnd Bergman , Andy Shevchenko , Andrew Morton , Kees Cook , Mike Rapoport , "Gustavo A. R. Silva" , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [RFC PATCH 04/13] vfio/mdev: remove the usage of the list iterator after the loop Message-ID: <20220218151216.GE1037534@ziepe.ca> References: <20220217184829.1991035-1-jakobkoschel@gmail.com> <20220217184829.1991035-5-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220217184829.1991035-5-jakobkoschel@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, Feb 17, 2022 at 07:48:20PM +0100, Jakob Koschel wrote: > It is unsafe to assume that tmp != mdev can only evaluate to false > if the break within the list iterator is hit. > > When the break is not hit, tmp is set to an address derived from the > head element. If mdev would match with that value of tmp it would allow > continuing beyond the safety check even if mdev was never found within > the list I think due to other construction this is not actually possible, but I guess it is technically correct This seems like just a straight up style fix with nothing to do with speculative execution though. Why not just send it as a proper patch? Jason