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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E703FC388F9 for ; Thu, 22 Oct 2020 14:28:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DACA424171 for ; Thu, 22 Oct 2020 14:28:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DACA424171 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 33F096B0068; Thu, 22 Oct 2020 10:28:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F1956B006E; Thu, 22 Oct 2020 10:28:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E1736B0071; Thu, 22 Oct 2020 10:28:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id E5E086B0068 for ; Thu, 22 Oct 2020 10:28:41 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 88D48180AD807 for ; Thu, 22 Oct 2020 14:28:41 +0000 (UTC) X-FDA: 77399792442.04.cry59_330477727251 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 5FD868003FAF; Thu, 22 Oct 2020 14:28:41 +0000 (UTC) X-HE-Tag: cry59_330477727251 X-Filterd-Recvd-Size: 5976 Received: from mout-xforward.kundenserver.de (mout-xforward.kundenserver.de [82.165.159.38]) by imf37.hostedemail.com (Postfix) with ESMTP; Thu, 22 Oct 2020 14:28:40 +0000 (UTC) Received: from mail-qt1-f169.google.com ([209.85.160.169]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M2OEq-1kZSOm15zy-003w4d; Thu, 22 Oct 2020 16:28:38 +0200 Received: by mail-qt1-f169.google.com with SMTP id c13so1142216qtx.6; Thu, 22 Oct 2020 07:28:37 -0700 (PDT) X-Gm-Message-State: AOAM5307OJFyR7AXnqXR5wWoCCV3/DygIHz1fpVOD+eBgIcwKEEQ9ueM +PlAtNcAgkLgHdeArFpEDeShg2m2NUBtZqwcf60= X-Google-Smtp-Source: ABdhPJy77s7KKjlWYs+GpQ9BVZMwbpfFajbVvneugmSCOs60Axm7zukaXFA8sOvFMoh0YrQxNjUHh2dxLvicpR0yxI8= X-Received: by 2002:ac8:7cba:: with SMTP id z26mr2234550qtv.7.1603376916673; Thu, 22 Oct 2020 07:28:36 -0700 (PDT) MIME-Version: 1.0 References: <20201022090155.GA1483166@kroah.com> <5fd6003b-55a6-2c3c-9a28-8fd3a575ca78@redhat.com> <20201022104805.GA1503673@kroah.com> <20201022121849.GA1664412@kroah.com> <98d9df88-b7ef-fdfb-7d90-2fa7a9d7bab5@redhat.com> <20201022125759.GA1685526@kroah.com> <20201022135036.GA1787470@kroah.com> In-Reply-To: <20201022135036.GA1787470@kroah.com> From: Arnd Bergmann Date: Thu, 22 Oct 2020 16:28:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c" To: Greg KH Cc: David Hildenbrand , David Laight , Al Viro , Nick Desaulniers , Christoph Hellwig , "kernel-team@android.com" , Andrew Morton , Jens Axboe , David Howells , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mips@vger.kernel.org" , "linux-parisc@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-s390@vger.kernel.org" , "sparclinux@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-aio@kvack.org" , "io-uring@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-mm@kvack.org" , "netdev@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-security-module@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:WJI60hlhVP/3ncQQb/4F2PQEJIDF97C9BRf7gxvY6yIckyQY+fK 6/eKnNsLGxDR0GVibt9Nz3uAthtuomIj7mD+yNjSL7HIIM2a94BVv5ub0VClRIf/BnfkOHE ru9+y7Ka2TRFa1hAGJ98UTI028rrYBBo6C6/0zOv1oIswXMj8T0/X/e3tzi+Tkrjd44U3Hu /gNi0RCGAV1ANIWATFdbw== X-UI-Out-Filterresults: junk:10;V03:K0:rhUYaX2z4B4=:oouc111h5e/X7CP42HA+XLwp YUrL3emEHucxDxWhmeOr9gXTjdQAhzdcwjmWj6nobi64ggjbKRNOwMggZorPRB1LNl8bcMcDe UWnVB+2GvFpcg8I6wy/IwxHGvykMQ71in+T3w7gpqBvRsq2SlGZ51QjFTGi0crwkt8MPTIiUu hL0qezDdOg1aNshnwE0hojHe4czZv82fx+TAJ0vpLM8oUjH8cyU/LXltmbBKKFqzVxzcZEojr x/nv8le8kt5hYKeZ4oJ0IpwXSSNl1MVBQQxrOCDyD8tCZbRTwv8x6xbnWpzsFR1msWqSaAZvI vEAoKY7esJsLgQmK83KYYmMXYQUbifh+OeoIVV0Gsibp5pnRSv8OYW/k2J0R82ffR1Ffb0KpL wyk1ZV2Shi9X+tU8AhiKjb/eqp+kSEyfy2xd0ywEXbWCPINuYO6Cjkh7FiN/B7TNQN7OPBu5j hFvwj05clocBPge6pGTGzZ3DqHQrQZ2NCd2hpofDpvdz4kdrcsZ4RGA5+GgjKtvZIDvjQHolF Kth/FLKt3Xk97BrIoqOhTRGl5cngO4BdsjfjoeZxHEvBrCflVs/zvOYx6eD6TJ3dfXwoJQqDN Evkywglqk9WMze5qqLX37DAxt+SnRTWS0ZA5Ks0rM4NnyhmsDpsjzA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 22, 2020 at 3:50 PM Greg KH wrote: > On Thu, Oct 22, 2020 at 02:57:59PM +0200, Greg KH wrote: > > On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > > > struct iovec *iovec_from_user(const struct iovec __user *uvec, > > > - unsigned long nr_segs, unsigned long fast_segs, > > > + unsigned nr_segs, unsigned fast_segs, > > > struct iovec *fast_iov, bool compat) > > > { > > > struct iovec *iov = fast_iov; > > > @@ -1738,7 +1738,7 @@ ssize_t __import_iovec(int type, const struct > > > iovec __user *uvec, > > > struct iov_iter *i, bool compat) > > > { > > > ssize_t total_len = 0; > > > - unsigned long seg; > > > + unsigned seg; > > > struct iovec *iov; > > > > > > iov = iovec_from_user(uvec, nr_segs, fast_segs, *iovp, compat); > > > > > > > Ah, I tested the other way around, making everything "unsigned long" > > instead. Will go try this too, as other tests are still running... > > Ok, no, this didn't work either. > > Nick, I think I need some compiler help here. Any ideas? I don't think the patch above would reliably clear the upper bits if they contain garbage. If the integer extension is the problem, the way I'd try it is to make the function take an 'unsigned long' and then explictly mask the upper bits with seg = lower_32_bits(seg); Can you attach the iov_iter.s files from the broken build, plus the one with 'noinline' for comparison? Maybe something can be seen in there. Arnd 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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8137C388F9 for ; Thu, 22 Oct 2020 14:31:12 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 AC90924171 for ; Thu, 22 Oct 2020 14:31:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC90924171 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CH8tN3dxXzDqnw for ; Fri, 23 Oct 2020 01:31:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=arndb.de (client-ip=82.165.159.6; helo=mout-xforward.kundenserver.de; envelope-from=arnd@arndb.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Received: from mout-xforward.kundenserver.de (mout-xforward.kundenserver.de [82.165.159.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CH8qg333fzDqn5 for ; Fri, 23 Oct 2020 01:28:45 +1100 (AEDT) Received: from mail-qt1-f180.google.com ([209.85.160.180]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MYcy3-1krxgr31AR-00VhFo for ; Thu, 22 Oct 2020 16:28:38 +0200 Received: by mail-qt1-f180.google.com with SMTP id h12so1161599qtu.1 for ; Thu, 22 Oct 2020 07:28:37 -0700 (PDT) X-Gm-Message-State: AOAM530iQ1D5tj1xQUHXmo34wxTI5klBi6F0HyGKue4nmlphEEDErl81 O3TwkK0rRQD0cxb8FOICCUSvUPeoig6XuFYr41Q= X-Google-Smtp-Source: ABdhPJy77s7KKjlWYs+GpQ9BVZMwbpfFajbVvneugmSCOs60Axm7zukaXFA8sOvFMoh0YrQxNjUHh2dxLvicpR0yxI8= X-Received: by 2002:ac8:7cba:: with SMTP id z26mr2234550qtv.7.1603376916673; Thu, 22 Oct 2020 07:28:36 -0700 (PDT) MIME-Version: 1.0 References: <20201022090155.GA1483166@kroah.com> <5fd6003b-55a6-2c3c-9a28-8fd3a575ca78@redhat.com> <20201022104805.GA1503673@kroah.com> <20201022121849.GA1664412@kroah.com> <98d9df88-b7ef-fdfb-7d90-2fa7a9d7bab5@redhat.com> <20201022125759.GA1685526@kroah.com> <20201022135036.GA1787470@kroah.com> In-Reply-To: <20201022135036.GA1787470@kroah.com> From: Arnd Bergmann Date: Thu, 22 Oct 2020 16:28:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Buggy commit tracked to: "Re: [PATCH 2/9] iov_iter: move rw_copy_check_uvector() into lib/iov_iter.c" To: Greg KH Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:563Oe+HDI9Flae2NXjN+oZ9qVkvDrQBWUUhzR9O4j3w17QBSSz1 1ROLh8OVssdksqzhwpW7RpaEYvyclM0Gd//bTgHO4zdilpUyO3QA3VpM7n0fOAuvBaB0ghN lATFJJxMAM/nRMhmUhpcUKXrdShJaMWdHchPpfk+Bx0Xp+VfEG8mpUZZ0YEed7MUNr29ztn rDdWAs8AVhF66QoWPI87g== X-UI-Out-Filterresults: junk:10;V03:K0:NwBIcXc/D3I=:rL4MZXiWi7GfTSdyg7P3RD8n 0Nxk6pKhmvV6mMKLKRf1VuE/PF1xI7EJUX899hxDhilponPSEN+VDMxH23AgU/cAO7V4zcUZt KRyTjVSNubgoRJQgXZEXIGk/U/QF7L14kL9L6yoablAmKfh7JfqLGkcBVTOu6KGmr+Vggoa/9 vRNL/enSJpH8ulb5iPWN4BrQhtcfWNtCw1Cdz7A7xMWJlNAcBc3GaqDLH8hmFQHbb0+zZkcnv oi2OO4BWBeaaUt+bzhJWE+Q/9hCqrYGJrRCxXZXDwPmhUAwbuRN5v/T73N83EvrAtPYQwNPP7 +5NqXqqBOdOQhhfXM7X+sfPqYSqnOqS3RjlVEjHCvwT8+xiuy1e14SV0Y3e8xskwpFZm4EBEp zhg6SH5ztb7ibH3O5pNb9NZSZiYo6oVOTjJNL8Y/DKW6biZBlXX8+j9EgaoqtA3EuKKHrUCDY BSYBbHdFOLJ8IU6N4dkcxqq55S5kie1OeKp+BO5F8fF+SjnXHPo7l/s8hHaFjEWD1jaZvD6Q= = X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-aio@kvack.org" , David Hildenbrand , "linux-mips@vger.kernel.org" , David Howells , "linux-mm@kvack.org" , "keyrings@vger.kernel.org" , "sparclinux@vger.kernel.org" , Christoph Hellwig , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "kernel-team@android.com" , "linux-block@vger.kernel.org" , Al Viro , "io-uring@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Jens Axboe , "linux-parisc@vger.kernel.org" , "netdev@vger.kernel.org" , Nick Desaulniers , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" , David Laight , "linux-fsdevel@vger.kernel.org" , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Oct 22, 2020 at 3:50 PM Greg KH wrote: > On Thu, Oct 22, 2020 at 02:57:59PM +0200, Greg KH wrote: > > On Thu, Oct 22, 2020 at 02:42:24PM +0200, David Hildenbrand wrote: > > > struct iovec *iovec_from_user(const struct iovec __user *uvec, > > > - unsigned long nr_segs, unsigned long fast_segs, > > > + unsigned nr_segs, unsigned fast_segs, > > > struct iovec *fast_iov, bool compat) > > > { > > > struct iovec *iov = fast_iov; > > > @@ -1738,7 +1738,7 @@ ssize_t __import_iovec(int type, const struct > > > iovec __user *uvec, > > > struct iov_iter *i, bool compat) > > > { > > > ssize_t total_len = 0; > > > - unsigned long seg; > > > + unsigned seg; > > > struct iovec *iov; > > > > > > iov = iovec_from_user(uvec, nr_segs, fast_segs, *iovp, compat); > > > > > > > Ah, I tested the other way around, making everything "unsigned long" > > instead. Will go try this too, as other tests are still running... > > Ok, no, this didn't work either. > > Nick, I think I need some compiler help here. Any ideas? I don't think the patch above would reliably clear the upper bits if they contain garbage. If the integer extension is the problem, the way I'd try it is to make the function take an 'unsigned long' and then explictly mask the upper bits with seg = lower_32_bits(seg); Can you attach the iov_iter.s files from the broken build, plus the one with 'noinline' for comparison? Maybe something can be seen in there. Arnd