Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6241733rwi; Sun, 23 Oct 2022 21:16:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MkdUDi/2owezXQFrUiNxbF8EKZEgkxnAq5oMdiwjRIxT8boROg1Iy2spqTQpEwlT9vHpA X-Received: by 2002:a17:907:b15:b0:7a7:19a3:e9e7 with SMTP id h21-20020a1709070b1500b007a719a3e9e7mr3279389ejl.361.1666585010301; Sun, 23 Oct 2022 21:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666585010; cv=none; d=google.com; s=arc-20160816; b=039ci+Ms/eyGDAXkjzbgKPkq5TIV4sPA7wnB2SwTBGcmr9kegpE8NFllryKcYJ7MGB I+qvnYcYFd3fcvt9g60Yv/lWN0PtO96TjwlZ08I5DPCfECpHwziDXeUuWh7qLXYK/ciz Dx8zU1OJmqcEuVbBboE+xf/d0Nf57yzAPSEwRnsZz5aWkNsZcst8BEfTsFRQ1UU34Hk/ dXO/x9vmodQVVdi3OrUBTjcZETSaAnNKFqxj6K3+vbLYW2XuOQbpS+qKEt2bnxv81d0q omkOSmkkseFzjlNEVqqjXyGT5rO4TKlwvrdlsjNGlYS9x7v1mMZYBpDWCqcQ8RD1RVVq PLsQ== 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=H8qeZMvOxiwOAkzS5A81naYZa4/kimVXnTgTuHv+nGI=; b=hEcvYjKdX03js5+tkb4BgeQm3foGdMPvrAJKUvpuyIoHFDEq6R+cXrqNg6wB41Wy9Y ANMypcIKj0NOaGHzxELFiAMxXGFwVih95sT8xSUrfLFTZ5K8qHjjg3GiZiDBY2NRVqxZ Hi+5Oq69m/O7JEaQVV3fY4kHZj2hYhjdxLJgBiM36oP99WQgWXWwZCRDiuuqG/usoDip +G7d41vyo+UULeyBDBOZQJ+5MfMwjw3iMm0+w8fu9KBx9QPBW34nqASje6KLqverjb5G oU9oheqAn5H1Bn1Wu7CzJN1GY4uY4etGVQFK3ndg2DTN0bkM0lqUYlEmpheAf34t9nRq ZVFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oQd9UYHh; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js21-20020a17090797d500b007986956bd91si12123974ejc.210.2022.10.23.21.16.25; Sun, 23 Oct 2022 21:16:50 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=oQd9UYHh; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbiJXDEz (ORCPT + 99 others); Sun, 23 Oct 2022 23:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiJXDEt (ORCPT ); Sun, 23 Oct 2022 23:04:49 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC8811453; Sun, 23 Oct 2022 20:04:46 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id y4so7421665plb.2; Sun, 23 Oct 2022 20:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=H8qeZMvOxiwOAkzS5A81naYZa4/kimVXnTgTuHv+nGI=; b=oQd9UYHhiDqkqm5/Zc/uYEpCWSQbAmgiUE2690Eju87ixMRFMPrCP69gZigjjWH58o p8mt1HH7zOLOTExa9BYSJzygKaZF58pl0FeCfHCn1K3M9PPIDDaPKqRp+vvyjXAl/IAo JYf8d3Ipg6ssH7e/AF60iMbArTtg59dkcyw/8SkWzb2FnvrH9mFkVgVrXpGthT61jkcW vjnGXVERAhS9uGB0vf4kvLnFPNC1ekEj6oKtS6bCbLQUQii3l5/wT4Iq/uh+sgG9nLsd PBtc1O7QwN8BasQFhNy9lDSWQHOzCAmtW+NJtl55WOaMrO32tR0dpf18dk7x+ZQKFkmt jP+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=H8qeZMvOxiwOAkzS5A81naYZa4/kimVXnTgTuHv+nGI=; b=EKBysc2rUB0R5kb6VsVM0S0spgv+puA4y1Og0MUqakdJV45aE5ieekeNim+I2JQo6n yL1Zqnug9ER9NRPKGCKd7+WsxlIRWRN02GyreTpxaTP8zWlJwQBCm0cPWnMgv1H3q45h Lp/mPCbmADoe7tsM2Y5t9IK6zqalLlsaxkF/ezeXP5ShRMaunuc5ppf29SBzqwGHCBPh bfT4d9XeJiWdKURSECLlequ112zkXDs2DvH0b9U8Vy1/PsmcRFG0CmeKbKV/pNcfypRi Zn3WHWAxruf5movYwNiLv+99QKyWX47l9hwaWp3IfPHpv8W/jS+WAL2S86AkTEngJeDW 4xRA== X-Gm-Message-State: ACrzQf0nxRwkk/CB8L3u5+JzMF/X6Sy/p0GoS3X1US6phPF7/2JGxACp lmK6QbM+jrCKlZBbEGz4IQg= X-Received: by 2002:a17:90a:4316:b0:212:fadd:5d59 with SMTP id q22-20020a17090a431600b00212fadd5d59mr6964297pjg.45.1666580685494; Sun, 23 Oct 2022 20:04:45 -0700 (PDT) Received: from debian.me (subs02-180-214-232-9.three.co.id. [180.214.232.9]) by smtp.gmail.com with ESMTPSA id e15-20020a170902784f00b0017a09ebd1e2sm18567456pln.237.2022.10.23.20.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 20:04:44 -0700 (PDT) Received: by debian.me (Postfix, from userid 1000) id 17F26103B1A; Mon, 24 Oct 2022 10:04:41 +0700 (WIB) Date: Mon, 24 Oct 2022 10:04:41 +0700 From: Bagas Sanjaya To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Johannes Zink , Ariel Marcovitch , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kconfig: fix segmentation fault in menuconfig search Message-ID: References: <20221023191055.85098-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PFpEuUJq57bt2SZs" Content-Disposition: inline In-Reply-To: <20221023191055.85098-1-masahiroy@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS 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 --PFpEuUJq57bt2SZs Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2022 at 04:10:55AM +0900, Masahiro Yamada wrote: > Since commit d05377e184fc ("kconfig: Create links to main menu items > in search"), menuconfig shows a jump key next to "Main menu" if the > nearest visible parent is the rootmenu. If you press that jump key, > menuconfig crashes with a segmentation fault. >=20 > For example, do this: >=20 > $ make ARCH=3Darm64 allnoconfig menuconfig >=20 > Press '/' to search for the string "ACPI". Press '1' to choose > "(1) Main menu". Then, menuconfig crashed with a segmentation fault. You missed the prerequisites: search EFI and press 1 to jump to CONFIG_EFI. >=20 > The following code in search_conf() >=20 > conf(targets[i]->parent, targets[i]); >=20 > results in NULL pointer dereference because targets[i] is the rootmenu, > which does not have a parent. >=20 > Commit d05377e184fc tried to fix the issue of top-level items not having > a jump key, but adding the "Main menu" was not the right fix. >=20 > The correct fix is to show the searched item itself. This fixes another > weird behavior described in the comment block. >=20 > Fixes: d05377e184fc ("kconfig: Create links to main menu items in search") > Reported-by: Johannes Zink > Signed-off-by: Masahiro Yamada > Link: https://lore.kernel.org/r/20221023191055.85098-1-masahiroy@kernel.o= rg Missing Cc: stable? The segfault (IMO) appears after v5.15, so all supported stable branches are affected. Anyway, the segfault gone away with this patch applied. Thanks. Tested-by: Bagas Sanjaya --=20 An old man doll... just what I always wanted! - Clara --PFpEuUJq57bt2SZs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCY1YAxAAKCRD2uYlJVVFO o2HWAQCc8AnxqmRk7EXDCw/tGNQvDKVAAcBJxEwn0+m5LiNlKgEA8X42VnAZRZRu vsjQyQZtBJWTWn+v2wPuOLCMP+wTpwc= =x7fI -----END PGP SIGNATURE----- --PFpEuUJq57bt2SZs--