Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3744833lfb; Mon, 9 May 2022 03:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWQa6E+n75J+aARsl9aYto4yIB8HRnQFKyFSv9FAppJv/fyh1mp/isj0SzFXr8Fb1PvV27 X-Received: by 2002:a17:90b:810:b0:1dc:c33c:3fd4 with SMTP id bk16-20020a17090b081000b001dcc33c3fd4mr17616914pjb.69.1652091092776; Mon, 09 May 2022 03:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652091092; cv=none; d=google.com; s=arc-20160816; b=nDSVSb1Kzi06ZvYT/t66mXBrIyjyMoNPQA9VBh2+sw1ChgzDAI7jZWRU9D+UVUEf+T df8YcPpzIFXQBROs5tRWl0iPraKreZw0HJZ7n39MolFpkQx/hcNtSL4HkxBX7198S5qC SKYKkkzsDctBPz/L/3OOZvyqRSR99jRw19g18qeS8IaQ47XYZ5cJPGNwqsydrTq76Cur lJxlWcWBubyHvC8Lbf5AhnZt7B4i3WTgw0D/6dfMy2StKDiNqqCnyzGubjFmbqA+sB80 KjjzFA/wp2gbPIXEfJ2dWB86xLdys2HW751VijmUu+Z+DgslPv+j43c6Pbz47BnK1ntE xFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=IuWRns9pMIw65xrkUwtqZzcIMvbP9jtItO2aE2vrqao=; b=TT2fJ7Hjk1DbjDnpUakUkSsdTofHol+yBEynaeoLeN7Yi5j9O0f0rEKc10zNCjlnnz 0d/WRPDCNIXxr4eO2JxTgUUJ+jc8+tDfdZuTMLEzehES/BQ/CgBhhoZDOoj/tgWjTG/n +gawqKnFVnOgGuloSxF88kYgD1IfHhFdiUAMNKLEppCyHK68fas1kprQRRvVqBqJ3XGF EGQLOrgzj3SEGjA+ZMKbVufZVHVpkspjNGvO7Sfjn9RItwQuCkYjWAFOPKa1l9yJApRb tjpXppD1LApO2hsuVPDgdXgn83DnfycxLTFDpKayeE77DA/d53MA7EnvP9y/44YliPto t/2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyXzAoVt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u4-20020a655c04000000b0039854fb2001si11511166pgr.496.2022.05.09.03.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyXzAoVt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5602623BB6F; Mon, 9 May 2022 02:50:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234695AbiEIFsV (ORCPT + 99 others); Mon, 9 May 2022 01:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234618AbiEIFov (ORCPT ); Mon, 9 May 2022 01:44:51 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACABC9BAD9 for ; Sun, 8 May 2022 22:40:58 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id i38so22912639ybj.13 for ; Sun, 08 May 2022 22:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=IuWRns9pMIw65xrkUwtqZzcIMvbP9jtItO2aE2vrqao=; b=NyXzAoVtt5sgm+AtKlFW0eUzqe7GNpGc8ZrJqgMJ/JYp5fndo7F4SBWUkn4MIHCxOH 3WyWAlprtrjeDXqgc/fmUhUjcMaP8/jvtl1Ewd/Z60hLyjjU+3CXeWYm91v+GfSyeMKS 6veo2Bc+lgj6otgNwohuOoeWJqCbjxz0ongngBGJhj+3mYPuLKko8FGRwL7wvKq8CvPQ HCsXTgXxp65XKhvE7r6M71Y9xrTQuKYskKsV9z2F2G1olpLUCMOjrgGOidI9UB0jIgGA icIFcWd8iac+YMqYdKQlKaqD9z9s7Qh7v/c9L8zRFQyf/t1ffyunCsUxtXgxj30d4k8Y +0pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=IuWRns9pMIw65xrkUwtqZzcIMvbP9jtItO2aE2vrqao=; b=EOQUMXOedVHQMaTE5z3jTCY0doyF8VxzQTuDKA0X8PWGb6NN30i1mtKpWSonvy4fCD dWDYGCK74mnH4/f4fZnyHvvx4YtMk5Mzix+y6E4yZhwdyIYId1hLVRcRiAtpvMj6gUkP BgnwFrN+kDxYTe4R137629S8b3DldP6WoVZy8f1gW0yK/f7a2Y7gE37/bdfJN+Yq/rsY O7g+Qjdo+h4jL2IyeP5SeWN1sPM/ViIagddqvvcBpry7uCtRXbtnj215F4wuYbN3oFIk u7AJuoDNbVuSrAbOYA74nByMQYuHS29FIDWf8sFMqXrc+RyjF57/u6WWqGUlKhNLJlUW VxVg== X-Gm-Message-State: AOAM530V2U/OGURJJCHCUbT5RkcigiZhGaPg8Qi0cBMAkmoOZ7y5lSl5 zyrYJjop3YXnNGgm9UFx1p18EOz1I4Snkp2hoU9Nqg== X-Received: by 2002:a25:c64b:0:b0:649:11d:9db1 with SMTP id k72-20020a25c64b000000b00649011d9db1mr11660848ybf.128.1652074843828; Sun, 08 May 2022 22:40:43 -0700 (PDT) MIME-Version: 1.0 From: Naresh Kamboju Date: Mon, 9 May 2022 11:10:32 +0530 Message-ID: Subject: [next] gpio: gpio-sim.sh: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 To: "open list:KERNEL SELFTEST FRAMEWORK" , "open list:GPIO SUBSYSTEM" , open list , lkft-triage@lists.linaro.org Cc: Jon Hunter , Justin Chen , Shuah Khan , Mark Brown , brgl@bgdev.pl, Andy Shevchenko , andrei.lalaev@emlid.com, Linus Walleij , u.kleine-koenig@pengutronix.de, Raghuram Thammiraju , Florian Fainelli , Marc Zyngier , Nobuhiro Iwamatsu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Following kernel crash noticed while running kselftest gpio gpio-sim.sh on qemu_arm64 with Linux next-20220506 kernel [1] & [2]. Reported-by: Linux Kernel Functional Testing # selftests: gpio: gpio-sim.sh # 1. chip_name and dev_name attributes # 1.1. Chip name is communicated to user # 1.2. chip_name returns 'none' if the chip is still pending # 1.3. Device name is communicated to user # 2. Creating and configuring simulated chips # 2.1. Default number of lines is 1 # 2.2. Number of lines can be specified # 2.3. Label can be set # 2.4. Label can be left empty # 2.5. Line names can be configured # 2.6. Line config can remain unused if offset is greater than number of lines # 2.7. Line configfs directory names are sanitized # 2.8. Multiple chips can be created # 2.9. Can't modify settings when chip is live # 2.10. Can't create line items when chip is live # 2.11. Probe errors are propagated to user-space [ 218.163457] gpio gpiochip1: (gpio-sim.0-node0): line cnt 34463 is greater than fast path cnt 512 [ 218.163739] gpiochip_find_base: cannot find free range [ 218.164216] gpiochip_add_data_with_key: GPIOs 0..34462 (gpio-sim.0-node0) failed to register, -28 [ 218.164503] gpio-sim: probe of gpio-sim.0 failed with error -28 # 2.12. Cannot enable a chip without any GPIO banks # 2.13. Duplicate chip labels are not allowed # 2.14. Lines can be hogged [ 223.754983] gpio-2036 (?): hogged as input [ 224.231594] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 [ 224.233378] Mem abort info: [ 224.233719] ESR = 0x0000000096000006 [ 224.234076] EC = 0x25: DABT (current EL), IL = 32 bits [ 224.235432] SET = 0, FnV = 0 [ 224.235790] EA = 0, S1PTW = 0 [ 224.236146] FSC = 0x06: level 2 translation fault [ 224.236592] Data abort info: [ 224.236926] ISV = 0, ISS = 0x00000006 [ 224.237300] CM = 0, WnR = 0 [ 224.237738] user pgtable: 4k pages, 48-bit VAs, pgdp=000000010ab2b000 [ 224.238785] [0000000000000008] pgd=080000010b9c4003, p4d=080000010b9c4003, pud=080000010b990003, pmd=0000000000000000 [ 224.240838] Internal error: Oops: 96000006 [#1] PREEMPT SMP [ 224.241509] Modules linked in: gpio_sim rfkill crct10dif_ce sm3_ce sm3 sha3_ce sha512_ce sha512_arm64 fuse [last unloaded: gpio_mockup] [ 224.242848] CPU: 2 PID: 1105 Comm: gpio-mockup-cde Not tainted 5.18.0-rc5-next-20220506 #1 [ 224.243548] Hardware name: linux,dummy-virt (DT) [ 224.244109] pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 224.244643] pc : linereq_free+0xb0/0x120 [ 224.245515] lr : linereq_create+0x548/0x640 [ 224.245797] sp : ffff8000089eb870 [ 224.246065] x29: ffff8000089eb870 x28: ffffd5cd009d5cd8 x27: ffff0000c32da0c0 [ 224.246795] x26: ffffd5ccfeb521c8 x25: 0000000000000000 x24: ffff0000c60d1d20 [ 224.247318] x23: ffff0000c60d1c00 x22: 0000000000000000 x21: 0000000000000118 [ 224.247843] x20: 0000000000000001 x19: ffff0000c60d1c00 x18: 0000000000000000 [ 224.248352] x17: ffffd5ccfcc2c288 x16: ffffd5ccfd019804 x15: ffffd5ccfd468a48 [ 224.248875] x14: ffffd5ccfd4686c0 x13: ffffd5ccfcc11d48 x12: ffffd5ccfe224eec [ 224.249307] x11: ffffd5ccfe223b88 x10: ffffd5ccfcc2c4e8 x9 : ffffd5ccfd4688c8 [ 224.249840] x8 : ffff0000c32e6108 x7 : bbbbbbbbbbbbbbbb x6 : 0000000000000001 [ 224.250418] x5 : ffffd5ccff965000 x4 : ffffd5ccff9654f0 x3 : 0000000000000000 [ 224.251050] x2 : ffff0000c33e5080 x1 : 0000000000000000 x0 : 0000000000000000 [ 224.251741] Call trace: [ 224.251998] linereq_free+0xb0/0x120 [ 224.252315] linereq_create+0x548/0x640 [ 224.252571] gpio_ioctl+0x88/0x754 [ 224.252808] __arm64_sys_ioctl+0xb4/0x100 [ 224.253103] invoke_syscall+0x78/0x100 [ 224.253342] el0_svc_common.constprop.0+0x104/0x124 [ 224.253680] do_el0_svc+0xb4/0xcc [ 224.253922] el0_svc+0x68/0x160 [ 224.254173] el0t_64_sync_handler+0xbc/0x140 [ 224.254504] el0t_64_sync+0x18c/0x190 [ 224.254929] Code: cb160273 8b130ef3 f9409261 b9413260 (f9400422) [ 224.255783] ---[ end trace 0000000000000000 ]--- # ./gpio-sim.sh: line 318: 1105 Segmentation fault $BASE_DIR/gpio-mockup-cdev -s 1 /dev/`configfs_chip_name chip bank` 4 2> /dev/null Broadcast message from systemd-journald@juno (Fri 2022-05-06 09:51:02 UTC): kernel[304]: [ 224.240838] Internal error: Oops: 96000006 [#1] PREEMPT SMP Broadcast message from systemd-journald@juno (Fri 2022-05-06 09:51:02 UTC): kernel[304]: [ 224.254929] Code: cb160273 8b130ef3 f9409261 b9413260 (f9400422) # 3. Controlling simulated chips # 3.1. Pull can be set over sysfs # not ok 2 selftests: gpio: gpio-sim.sh # TIMEOUT 45 seconds metadata: git_ref: master git_repo: '' git_sha: 38a288f5941ef03752887ad86f2d85442358c99a git_describe: next-20220506 kernel_version: 5.18.0-rc5 kernel-config: https://builds.tuxbuild.com/28mio5DFBEfnEtkiTLdPb9tTWVa/config build-url: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/pipelines/532821646 artifact-location: https://builds.tuxbuild.com/28mio5DFBEfnEtkiTLdPb9tTWVa toolchain: gcc-11 Steps to reproduce: # cd /opt/kselftests/default-in-kernel/gpio # ./gpio-sim.sh Full test logs. [1] https://lkft.validation.linaro.org/scheduler/job/4994124#L1108 [2] https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20220506/testrun/9366936/suite/linux-log-parser/test/check-kernel-oops-4994124/log -- Linaro LKFT https://lkft.linaro.org