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 6B6D3C54EBE for ; Sun, 8 Jan 2023 13:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233411AbjAHNZs (ORCPT ); Sun, 8 Jan 2023 08:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjAHNZp (ORCPT ); Sun, 8 Jan 2023 08:25:45 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EE2910062 for ; Sun, 8 Jan 2023 05:25:41 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so4550532wms.2 for ; Sun, 08 Jan 2023 05:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gDnBglhmzrQ+ClSXJPmLD7+J1IxdL5cQgOysiOvvUiw=; b=eNEHVpDt9oHcojHcitkH0RCFZbeCHiKuUEagDi9ApI0PQk7B6q6TOUmIbbLEdM1o1c lrTJWPTi9nP3BTxC4nE+BQ3kpUS9/WmalhvXEVg3Ixw8aSv5GGpOww4ujobdhkNLmzW4 JLypJU8j7d6X7lL5kUfl7yWzn+04gMiE41Ny3txm70Rts0Zr8I2Ax+qoorYRoTD1Vg7H 5j7zosyfyOD9XwWxIm4VIqAe3vHRg1aw/lP8LC8BvDenCovDeKCMm8/N+slPLTRRnPUE u3jBE9/Sw2cH6tHHcNG6wpuBpbPxEe+onr6Kh69FHruG98LFVJcVQfkBr4ZuTXuNczSt /ShQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gDnBglhmzrQ+ClSXJPmLD7+J1IxdL5cQgOysiOvvUiw=; b=eeL7boPv5JNZfh5BoD+bs7zm4qvf7NAP+g3t6X/cX+pp70H2DVEGo+EmlME+P9DU0N cgFk3sqsVw6v+UASx8+ALoAnJpmo7oIl79O8SXg3xd4ggIBkhLSBfqhQ0pbj6g5D5PLZ yumDTdXkdRToKPTXo8y5EQRkEc13LjofOdRGvpdPFeLOeeEXf6WnXBt/EKLuG2pt+kxd QVY5vHenJp+3msRBGmAdEfEABW9IRHzlu4+0GFQel+RcoVXsn/0XRQGYbwAojbun6xVU RXiAv/q2LXFm0E6sw+eau2F2KkUgkIj0y3+0nnzCL6fHOZn3x0Xail+NZOZiOtoTelk1 Lm6g== X-Gm-Message-State: AFqh2koMEiQ0DlepujUtyWbXsnYvakMA9Z8owqY/rTt1Tg6P55HKL3DZ dBv2+45l2DSqfPuPL5MfNMapGA== X-Google-Smtp-Source: AMrXdXvmxxT+2bZviglEVMaCStY9tOI31zWc9TENsTM9uSLk3EaKSggauRRgvpQ6d98KRB5ltb90jA== X-Received: by 2002:a05:600c:4e04:b0:3d2:381f:2db5 with SMTP id b4-20020a05600c4e0400b003d2381f2db5mr42893495wmq.22.1673184339665; Sun, 08 Jan 2023 05:25:39 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm4060240wmq.9.2023.01.08.05.25.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Jan 2023 05:25:39 -0800 (PST) Message-ID: <82526863-d07a-0a5d-2990-1555b1387f26@linaro.org> Date: Sun, 8 Jan 2023 14:25:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Regression: NULL pointer dereference after NFS_V4_2_READ_PLUS (commit 7fd461c47) Content-Language: en-US From: Krzysztof Kozlowski To: Anna Schumaker , Trond Myklebust Cc: linux-nfs@vger.kernel.org, Linux Kernel Mailing List , "regressions@lists.linux.dev" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2023 16:44, Krzysztof Kozlowski wrote: > Hi, > > Bisect identified commit 7fd461c47c6c ("NFSv4.2: Change the default > KConfig value for READ_PLUS") as one leading to NULL pointer exception > when mounting NFS root on NFSv4 client: > > [   25.739003] systemd[1]: Set hostname to . > [   25.771714] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid > argument > [   26.199478] 8<--- cut here --- > [   26.201366] Unable to handle kernel NULL pointer dereference at > virtual address 00000004 > ... > [   26.555522]  mmiocpy from xdr_inline_decode+0xec/0x16c > [   26.560628]  xdr_inline_decode from nfs4_xdr_dec_read_plus+0x178/0x358 > [   26.567130]  nfs4_xdr_dec_read_plus from call_decode+0x204/0x304 > > Full OOPS attached. Full log available here: > https://krzk.eu/#/builders/21/builds/3901/steps/15/logs/serial0 > > Disabling NFS_V4_2_READ_PLUS fixes the issue, so obviously the commit is > not the cause, but rather making it default caused the regression. > > I did not make the bisect yet which commit introduced it, if every > config includes NFS_V4_2_READ_PLUS. When every kernel is built with NFS_V4_2_READ_PLUS, bisect pointed to: d3b00a802c84 ("NFS: Replace the READ_PLUS decoding code") commit d3b00a802c845a6021148ce2e669b5a0b5729959 Author: Anna Schumaker Date: Thu Jul 21 14:21:34 2022 -0400 NFS: Replace the READ_PLUS decoding code We now take a 2-step process that allows us to place data and hole segments directly at their final position in the xdr_stream without needing to do a bunch of redundant copies to expand holes. Due to the variable lengths of each segment, the xdr metadata might cross page boundaries which I account for by setting a small scratch buffer so xdr_inline_decode() won't fail. Signed-off-by: Anna Schumaker Signed-off-by: Trond Myklebust With a trace: [ 25.898462] systemd[1]: Set hostname to . [ 25.933746] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument [ 25.986237] random: crng init done [ 26.264564] 8<--- cut here --- [ 26.266823] Unable to handle kernel NULL pointer dereference at virtual address 00000fe8 ... [ 26.597263] nfs4_xdr_dec_read_plus from call_decode+0x204/0x304 [ 26.603222] call_decode from __rpc_execute+0xd0/0x890 [ 26.608328] __rpc_execute from rpc_async_schedule+0x1c/0x34 [ 26.613960] rpc_async_schedule from process_one_work+0x294/0x790 [ 26.620030] process_one_work from worker_thread+0x54/0x518 [ 26.625570] worker_thread from kthread+0xf4/0x128 [ 26.630336] kthread from ret_from_fork+0x14/0x2c Best regards, Krzysztof