Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1001103iob; Fri, 13 May 2022 19:11:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPWY8IObYxpcTmYbGdLcPM5zs+I9yjuN9yPJEGW1USYz8Qnfv+s5A5tGTOJuw92lPoWmDn X-Received: by 2002:a05:600c:1d18:b0:394:6469:abec with SMTP id l24-20020a05600c1d1800b003946469abecmr6911401wms.89.1652494315884; Fri, 13 May 2022 19:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652494315; cv=none; d=google.com; s=arc-20160816; b=bk8CArcp2/cDB6YeLuS5Pg5rLhSb8a058MNmR+Kgf1X60hhPcq4Xlk5v5SD4ZZuLNA fS2q3+1V/ifncR9hNkNV0AOFebKvPnLztTlPSkUNPk+Y59ARL47nmBTUtBeOITZuGirJ hl6vmqmuqSgrc7F8l3qUuyFBLK1DLF7ssqaGgL/6+vU/FFaqFzEy9hrLlDbAqvaCC39W D+C0cuZGfnlMgffxnONe34zkBP1nc2RzaC19we61tp5QDrJVz9cph30xtyY+ibXJGSGu 5H8OiDAx1K/Hq+B+RsUaWvR6tRNdGBL8zoHynu4IIKmkfqCK3KzHMIP0PthYnK7JsRQw shwg== 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=lu8Yk3g+KqauzNzBiFKSP6KQpOiG+G3Df6KTkrdelIs=; b=TobKABri+TI7T4sMR9MFap+nXQeb9GNjYthCJ04Uya0jI9xGc0fMh03+Ob6rdzrz+j 2M2yz1vHfEKz9/2wRE2KKRanIeradYIuHWa4GTmKV+jo/Mh4gNXp/3IC+H3LkJosqr34 QxZlaIEumhLAtUHXrWTjANgojdv4uvJAs6M4lQGgloqCficLbUevH/v9ioTBKN/4IaHl umF4uZ4Zxc8P7hKZMHIHn5o5WGGCa/o0X9uVSNHF9gIXT5UsRRhTgGI7qLp5xn2aHvd3 MEBfnMh+Li8MQ49Tj50FHrcspKLxVHgC81P/I56KGtGla33TCOjQ5WnPIejEmlQqSWRp RW5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=niGOrTTE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bs3-20020a056000070300b00207a8314533si3588106wrb.82.2022.05.13.19.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:11:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=niGOrTTE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2711C49C07A; Fri, 13 May 2022 17:30:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348804AbiEKWci (ORCPT + 99 others); Wed, 11 May 2022 18:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348781AbiEKWcc (ORCPT ); Wed, 11 May 2022 18:32:32 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8B562A18 for ; Wed, 11 May 2022 15:32:30 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id x23so3160219pff.9 for ; Wed, 11 May 2022 15:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lu8Yk3g+KqauzNzBiFKSP6KQpOiG+G3Df6KTkrdelIs=; b=niGOrTTEvvwDakGPfaEm+H/jXShM05yULb78ZRtInqcr0ntY7ypT568jGc5K9zi/NK RvZCIZgIO5a6JOvTXSsEU9k1t13N7gMcSLzP7XtdlnXEccTeQnQtMdAFVAY2OvP9VNc5 cf+eEx6HGQtK59kyC+ae06R1Pb5Bl+TkVXjvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lu8Yk3g+KqauzNzBiFKSP6KQpOiG+G3Df6KTkrdelIs=; b=e/BNagSHcOTA3NxtwzImTQFgp4zcS17p35lehe2AJFut4+2IjcTKhvXEpv3pWPxY8B pv1iRLkCjA1mIJIzVrJ0HAMKb0MrySWmMxUevQBsfaa9+QBEN+y9JvcphNkieFICBR49 pO767sYv0NkFRd013jj95P6fu0kAKDBSZOVQEZT/z/VLmTk4LRSqXYEmmcZ/McY3YBZS mdmdbuo231GNzY4GHXoNNxwtO1emJa+YOTwxFUSwltAo3KYsbdwvIeBdM54AHhxpbonQ 9uRqiLYNboeHOdV/cfp9fteDw3RoJCuSrYaw+NAIYh2WYDaxdWf+zLaNGtzyqAeW3pvD /ByA== X-Gm-Message-State: AOAM530nOnP1vmikPeYcj2zwfNsteYKYCDOSSTFSsB3rkOZTjLa0Q0rE FZpwi4OR34CThaUg6ZnD203QOtmBU8v80A== X-Received: by 2002:a63:1a5c:0:b0:3c1:9a7c:3739 with SMTP id a28-20020a631a5c000000b003c19a7c3739mr22723271pgm.272.1652308350421; Wed, 11 May 2022 15:32:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t19-20020a62d153000000b005087c23ad8dsm2240431pfl.0.2022.05.11.15.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 15:32:29 -0700 (PDT) Date: Wed, 11 May 2022 15:32:29 -0700 From: Kees Cook To: Maninder Singh Cc: mcgrof@kernel.org, avimalin@gmail.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, pmladek@suse.com, rostedt@goodmis.org, senozhatsky@chromium.org, andriy.shevchenko@linux.intel.com, naveen.n.rao@linux.ibm.com, davem@davemloft.net, mhiramat@kernel.org, anil.s.keshavamurthy@intel.com, linux@rasmusvillemoes.dk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, v.narang@samsung.com, Onkarnath Subject: Re: [PATCH 1/2] kallsyms: add kallsyms_show_value definition in all cases Message-ID: <202205111525.92B1C597@keescook> References: <20220511080657.3996053-1-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511080657.3996053-1-maninder1.s@samsung.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=unavailable 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 Wed, May 11, 2022 at 01:36:56PM +0530, Maninder Singh wrote: > kallsyms_show_value return false if KALLSYMS is disabled, > but its usage is done by module.c also. > Thus when KALLSYMS is disabled, system will not print module > load address: Eek, I hadn't see the other changes this depends on. I think those changes need to be reworked first. Notably in the other patch, this is no good: /* address belongs to module */ if (add_offset) len = sprintf(buf, "0x%p+0x%lx", base, offset); else len = sprintf(buf, "0x%lx", value); This is printing raw kernel addresses with no hashing, as far as I can tell. That's not okay at all. Once that other patch gets fixed, this one then can be revisited. And just on naming: "kallsyms_tiny" is a weird name: it's just "ksyms" -- there's no "all". :) -- Kees Cook