Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4363065rwb; Mon, 21 Nov 2022 06:50:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7n1t0rfTolLs1iB/0gku+PfNq1QRDDrYQnlvBCcCzdIavOAyhwbRALQcBhZBUnwT2HQTPP X-Received: by 2002:a17:90b:3d0d:b0:1fd:5b5d:f09d with SMTP id pt13-20020a17090b3d0d00b001fd5b5df09dmr21132514pjb.69.1669042210978; Mon, 21 Nov 2022 06:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669042210; cv=none; d=google.com; s=arc-20160816; b=L2qSM97cBajo3hvyuk1h19/ceAQhbhlh4Fr2e4pQ3npOZbz9X6czOnM1ELRhK2O1TC QFjrLAdOv9YNDV9VPGGmzY0AjRynIkvCQuNpSHkU2LEHvZCipWpBZ4btZx0b5nttwEDF jpuiotePsRh/UA9zfYAYhcCFXzEEo9KsV8TN4JmuUe18XV34Zb6UyZ00k2rrR9dXZCAu WFcOP+SBM6xpV7KXOYKlXvgivFiV/7s9d8APN5jhvsFCaQNjgbc654REZMyR1U7FlCr6 lk9ts8VEWdgrFhJwWmKbdCkbCSLutqwa3PFxqEX88tvgzonkDEBQEJrkq8Aaiz6Kfv8C COhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RzwUXYL+lOes2ybdcf0NZZVm/N58p9fAtL62cIEmTQ8=; b=kbvzM2Jhgrnx2TSFau+PcuzxK2gK91BKVFjeoHa5EiocH8PHVpl0n91T940th4QCU4 0toCAd6yOTRa9M6818VDGn8eaeRo48+tOu4+2fEjI5dVf69ivj4lrI7nil43MVw03UAd nm620VqKTF52MyrISRngAX/25WtH3Y/ExtJDhw/kk+F+eqdY1i73EGghLN0tXmv+js7E TiShxWtFnCAN+27+BdN8G0Q1vZ4AxFKpQkIZVxhL9VtOEUioKPOYO/syE09KGGUKG5No t1FWjMHezX/sqvSE5FkNaHuFgSVlvdE3A5X+beQpwALIDPpXKBaE0qEVgkn59ti+6Pcl ApCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=LrQQfp2v; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b00476bfc9e1f5si11231659pgp.610.2022.11.21.06.49.58; Mon, 21 Nov 2022 06:50:10 -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=@crudebyte.com header.s=kylie header.b=LrQQfp2v; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229961AbiKUORO (ORCPT + 92 others); Mon, 21 Nov 2022 09:17:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiKUOQy (ORCPT ); Mon, 21 Nov 2022 09:16:54 -0500 Received: from kylie.crudebyte.com (kylie.crudebyte.com [5.189.157.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D543B3 for ; Mon, 21 Nov 2022 06:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=RzwUXYL+lOes2ybdcf0NZZVm/N58p9fAtL62cIEmTQ8=; b=LrQQfp2vf+LInWD7Pq23o3xJGr DUEtxldzGHAomYP2XolcLqhKbKSnWpTJJlP9m28pm3MlR1hX1kM7yhn2xAFZSea4MP7FJ8UqUop5E w5OZHh2vOuH/2PE8QwURiSh1gVZWysiN3bm8ta6I/Xnv7sEQZsRrOTCdA/jDu1C/Wkq6rUAiy/6Ol OAvSAxIj0pEetsQ92u1JjNdfWAZ+fkLCrcUUfcLk6VUq9J2jXoVUQa01jrziXw/Z+r8ylSOR8JMHS CzskN+efWyyjFT9Nsd/LaN9zKzvGGe4SRW1Hdj5sOgp7oHcoTkI2IJuhxksOuHZIh/E2KfyXKdxGJ 0wJsNNE1VComS4uJlfk2VaZQlZN7Gsjl9T467w5lE7caRW5Qe8qieoZ+B1hWwNnhGndlDXE+jMICf PNbgZM8HRBnL7MaTgOdAqeS5HzoXvZ9N4SaXIrMuLTD0fl9c0FWGQJ9Vf/As64zgJvBQE3n8d4VYM c3158o6e92/M2V89Xkhi5tNUt7W/GFNc/qGWWu4WMTHtuoyFkq+cXgjCZSIKkjtA2g5Cm6xRfEQQA E473z7aYo/k/mI/R624PSVseVf6KnYhNm05hDUARAPFBghvGjyVVJDWt9zAriVM0OAZgzYvc5K9mP N7Q8W+dbcZ9fhupbI6AEyj7UI+PNLlILKPNh5HjB0=; From: Christian Schoenebeck To: Stefano Stabellini , Dominique Martinet Cc: GUO Zihua , v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] 9p/xen: check logical size for buffer size Date: Mon, 21 Nov 2022 15:16:10 +0100 Message-ID: <8926859.ZlztnY0qrB@silver> In-Reply-To: References: <20221118135542.63400-1-asmadeus@codewreck.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Saturday, November 19, 2022 3:31:41 AM CET Dominique Martinet wrote: [...] > > I made this change and tried the two patches together. Unfortunately I > > get the following error as soon as I try to write a file: > > > > /bin/sh: can't create /mnt/file: Input/output error > > > > > > Next I reverted the second patch and only kept this patch. With that, it > > worked as usual. It looks like the second patch is the problem. I have > > not investigated further. > > Thanks -- it's now obvious I shouldn't send patches without testing > before bedtime... > I could reproduce easily with virtio as well, this one was silly as well > (>= instead of >). . . With another problem when zc requests get > involved, as we don't actually allocate more than 4k for the rpc itself. > > If I adjust it to also check with the zc 'inlen' as follow it appears to > work: > https://github.com/martinetd/linux/commit/162015a0dac40eccc9e8311a5eb031596ad35e82 > But that inlen isn't actually precise, and trans_virtio (the only > transport implementing zc rpc) actually takes some liberty with the > actual sg size to better fit hardwre, so that doesn't really make > sense either and we probably should just trust trans_virtio at this > point? > > This isn't obvious, so I'll just drop this patch for now. > Checking witih msize isn't any good but it can wait till we sort it out > as transports now all already check this one way or another; I'd like to > get the actual fixes out first. > > (Christian, if you have time to look at it and take over I'd appreciate > it, but there's no hurry.) OK, I'll look at this. Best regards, Christian Schoenebeck