Message ID | 1687955688-20809-3-git-send-email-quic_mojha@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8899154vqr; Wed, 28 Jun 2023 05:51:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6MZ3SK4basck3qKyX3MtoBtdmivSwPHIrlcFhgp15VLKNpR46/10lrNRGO6zEHAxDBt/+O X-Received: by 2002:a17:907:6088:b0:988:c97b:894b with SMTP id ht8-20020a170907608800b00988c97b894bmr27356500ejc.68.1687956715211; Wed, 28 Jun 2023 05:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687956715; cv=none; d=google.com; s=arc-20160816; b=aa7GBO1KnYnIHd/IsQq+M7Lbs900b04fjlUo6oThUsvvXbgMHVS2srgyjqRBsaXeia QcnA9dTQ+KQN/SXPS12Ac8nC107uZRpm6z78UQygQ4ti9OgGor6coOaSudkBf2DRqBEP 9XA1O+h4N11b8AZZtpjLMWyYWib7cHIfWDDcg+ZCmLuy+zTI8yhVDmfJzLWSizNuniSd mNfNlMTfdXdTSgTcK+xmKLcgInMNLx5iuAJr7+k7wxAoAR+U7stS8auH+3lnUd71HdKf qm7XsznyGF1GEtT7KOR48yOcUcQzhxEtp3DUlzLqMFMMhYWlWlb1NLFZ4zRud5AwSjcb VzUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=z/38/L7Qb4rY0gn24IqUDEH0xFQsfWB9pSUqCcrV3P8=; fh=xfNbOz4I/Hg3jG8SBg8wTUJPSewLm0J/G1fLCBug3yE=; b=CsSMYDKnYVtAo5CNG/IeIGZ7jEVBm/bDN2px0+7wKwSsTdJv0k81vkDy1S+sIwMWuc tokPPDjokEgdRW7SpAVczF+A5wC7VQ66HYRNZEHR+ESnghweWtHQb8Gr2JPQdKpsIUxw YpkBV3OtqPSQXb/NNExRS/fp4bxBwYeh8o2K8eReMazfuoHFM6Uzdgn75PiP2GhukuCz olpC1A2blLo7O7chOjx7bzLsdlWymy8hPQh30eJXAjVKkOqbdPOXGe8SWShQw+DbXktd INCa5KeLvgybbUC++jOPf0bU4m1MzSrpcGLYc/h4zZj5pMSefvIoUDSuVMniSQdqlXo/ Osew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="HNt/zEUQ"; 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=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170906b29100b0098276521c40si5405439ejz.901.2023.06.28.05.51.31; Wed, 28 Jun 2023 05:51:55 -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=@quicinc.com header.s=qcppdkim1 header.b="HNt/zEUQ"; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231350AbjF1MgM (ORCPT <rfc822;adanhawthorn@gmail.com> + 99 others); Wed, 28 Jun 2023 08:36:12 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]:30942 "EHLO mx0b-0031df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbjF1MgA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 28 Jun 2023 08:36:00 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBBj0W032212; Wed, 28 Jun 2023 12:35:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=z/38/L7Qb4rY0gn24IqUDEH0xFQsfWB9pSUqCcrV3P8=; b=HNt/zEUQKPRanF5fARYX0Inv7LCG2imfF6HYWksc/Eli2gqIe2VjIiOwyMrLlCPlZq19 l7bZCVuDQIuguhcfQV4LBj2QX6OqqTet7/YZqtdc9aRZ4ZfFrnMzqqGdEOOe0454ugB3 2gHE8oIBdGiJ06ixILlRJyde0MVBVa/Wno6UPBe81pLh74ci9+r1ej5jdcEDUxdB/e+m D9e6DFlPygSCp1mGmaDrpB+oe0G5Nr265ncA/pUoLUCtmh0Dhq1lbmGQSHVzMV6xCzWK g1PFLDK/ezpJc9LCowsl1GwG81f0kMZS0Wwb2aDUM5/GqYYYjdeDIWHLrTdPBU6stiFJ gw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rgetpgw4j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Jun 2023 12:35:28 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35SCZRr3025624 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Jun 2023 12:35:27 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Wed, 28 Jun 2023 05:35:20 -0700 From: Mukesh Ojha <quic_mojha@quicinc.com> To: <corbet@lwn.net>, <agross@kernel.org>, <andersson@kernel.org>, <konrad.dybcio@linaro.org>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <keescook@chromium.org>, <tony.luck@intel.com>, <gpiccoli@igalia.com>, <mathieu.poirier@linaro.org>, <catalin.marinas@arm.com>, <will@kernel.org>, <linus.walleij@linaro.org>, <andy.shevchenko@gmail.com> CC: <linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-hardening@vger.kernel.org>, <linux-remoteproc@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-gpio@vger.kernel.org>, "Mukesh Ojha" <quic_mojha@quicinc.com> Subject: [PATCH v4 02/21] kallsyms: Export kallsyms_lookup_name Date: Wed, 28 Jun 2023 18:04:29 +0530 Message-ID: <1687955688-20809-3-git-send-email-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1687955688-20809-1-git-send-email-quic_mojha@quicinc.com> References: <1687955688-20809-1-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: cdOZ3jlYYRrz3hYIl8DadVmQZGPwRH6s X-Proofpoint-GUID: cdOZ3jlYYRrz3hYIl8DadVmQZGPwRH6s X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 bulkscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280111 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769950900900844095?= X-GMAIL-MSGID: =?utf-8?q?1769950900900844095?= |
Series |
[v4,01/21] docs: qcom: Add qualcomm minidump guide
|
|
Commit Message
Mukesh Ojha
June 28, 2023, 12:34 p.m. UTC
Module like minidump providing debugging support will need to
get the symbol information from the core kernel e.g to get
the linux_banner, kernel section addresses bss, data, ro etc.
commit 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name()
and kallsyms_on_each_symbol()") unexports kallsyms_lookup_name
due to lack of in-tree user of the symbol. Now, that minidump
will one of its user, export it.
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
kernel/kallsyms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Jun 28, 2023 at 3:35 PM Mukesh Ojha <quic_mojha@quicinc.com> wrote: > > Module like minidump providing debugging support will need to > get the symbol information from the core kernel e.g to get > the linux_banner, kernel section addresses bss, data, ro etc. > > commit 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name() Commit > and kallsyms_on_each_symbol()") unexports kallsyms_lookup_name > due to lack of in-tree user of the symbol. Now, that minidump > will one of its user, export it. users ... Is it a direct revert? Then make it visible by leaving pieces from `git revert`. ... > - If not, drop this stray change. > +EXPORT_SYMBOL_GPL(kallsyms_lookup_name);
On Wed, Jun 28, 2023 at 06:04:29PM +0530, Mukesh Ojha wrote: > Module like minidump providing debugging support will need to > get the symbol information from the core kernel e.g to get > the linux_banner, kernel section addresses bss, data, ro etc. > One might ask why we would need such a debug driver to be compiled as module? What would you do if we need to capture more kernel data structures later? Do you plan to continue use kallsyms_lookup_name() to query all the symbols? I have seen v3 discussion where you are asked to compile this driver as module but that time there was no reason why your driver needs to be compiled as statically, now you have a reason (linux_banner) for it. > commit 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name() > and kallsyms_on_each_symbol()") unexports kallsyms_lookup_name > due to lack of in-tree user of the symbol. Now, that minidump > will one of its user, export it. > > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> Thanks, Pavan
On 6/28/2023 6:54 PM, Andy Shevchenko wrote: > On Wed, Jun 28, 2023 at 3:35 PM Mukesh Ojha <quic_mojha@quicinc.com> wrote: >> >> Module like minidump providing debugging support will need to >> get the symbol information from the core kernel e.g to get >> the linux_banner, kernel section addresses bss, data, ro etc. >> >> commit 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name() > > Commit > >> and kallsyms_on_each_symbol()") unexports kallsyms_lookup_name >> due to lack of in-tree user of the symbol. Now, that minidump >> will one of its user, export it. > > users > > ... > > Is it a direct revert? Then make it visible by leaving pieces from `git revert`. > No, it is not direct revert.. > ... > >> - > > If not, drop this stray change. ok - Mukesh > >> +EXPORT_SYMBOL_GPL(kallsyms_lookup_name); > >
On 6/28/2023 7:23 PM, Pavan Kondeti wrote: > On Wed, Jun 28, 2023 at 06:04:29PM +0530, Mukesh Ojha wrote: >> Module like minidump providing debugging support will need to >> get the symbol information from the core kernel e.g to get >> the linux_banner, kernel section addresses bss, data, ro etc. >> > One might ask why we would need such a debug driver to > be compiled as module? What would you do if we need to capture more > kernel data structures later? Do you plan to continue use > kallsyms_lookup_name() to query all the symbols? You are on point, i needed this driver to be static but i don't have any example at present to collect more than just _linux_banner_ from my existing set of patches.. Agree, it will be easier to make this driver as static instead of opening up the doors for modules to abuse via exporting kallsyms_lookup_name() and also it will be very slow for production kernel uses. > > I have seen v3 discussion where you are asked to compile this driver > as module but that time there was no reason why your driver needs to > be compiled as statically, now you have a reason (linux_banner) for > it. Yes, at present minidump driver will not be able to compile without exporting kallsyms_lookup_name() -Mukesh > >> commit 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name() >> and kallsyms_on_each_symbol()") unexports kallsyms_lookup_name >> due to lack of in-tree user of the symbol. Now, that minidump >> will one of its user, export it. >> >> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> > > Thanks, > Pavan
On Wed, Jun 28, 2023 at 08:52:57PM +0530, Mukesh Ojha wrote: > > > On 6/28/2023 7:23 PM, Pavan Kondeti wrote: > > On Wed, Jun 28, 2023 at 06:04:29PM +0530, Mukesh Ojha wrote: > > > Module like minidump providing debugging support will need to > > > get the symbol information from the core kernel e.g to get > > > the linux_banner, kernel section addresses bss, data, ro etc. > > > > > One might ask why we would need such a debug driver to > > be compiled as module? What would you do if we need to capture more > > kernel data structures later? Do you plan to continue use > > kallsyms_lookup_name() to query all the symbols? > > You are on point, i needed this driver to be static but i don't have > any example at present to collect more than just _linux_banner_ from > my existing set of patches.. > > Agree, it will be easier to make this driver as static instead of > opening up the doors for modules to abuse via exporting > kallsyms_lookup_name() and also it will be very slow for production > kernel uses. Right, I unexported that symbol deliberately in 0bd476e6c671 ("kallsyms: unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()") and I don't think we should add it back for this driver. Will
On Wed, Jun 28, 2023 at 04:32:47PM +0100, Will Deacon wrote: > On Wed, Jun 28, 2023 at 08:52:57PM +0530, Mukesh Ojha wrote: > > > > > > On 6/28/2023 7:23 PM, Pavan Kondeti wrote: > > > On Wed, Jun 28, 2023 at 06:04:29PM +0530, Mukesh Ojha wrote: > > > > Module like minidump providing debugging support will need to > > > > get the symbol information from the core kernel e.g to get > > > > the linux_banner, kernel section addresses bss, data, ro etc. > > > > > > > One might ask why we would need such a debug driver to > > > be compiled as module? What would you do if we need to capture more > > > kernel data structures later? Do you plan to continue use > > > kallsyms_lookup_name() to query all the symbols? > > > > You are on point, i needed this driver to be static but i don't have > > any example at present to collect more than just _linux_banner_ from > > my existing set of patches.. > > > > Agree, it will be easier to make this driver as static instead of > > opening up the doors for modules to abuse via exporting > > kallsyms_lookup_name() and also it will be very slow for production > > kernel uses. > > Right, I unexported that symbol deliberately in 0bd476e6c671 ("kallsyms: > unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()") and I > don't think we should add it back for this driver. I agree, it shouldn't be needed by any in-kernel module/driver. If you really want the name, look it up afterward in userspace :) thanks, greg k-h
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 77747391f49b..34a074f58736 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -283,7 +283,7 @@ unsigned long kallsyms_lookup_name(const char *name) return module_kallsyms_lookup_name(name); } - +EXPORT_SYMBOL_GPL(kallsyms_lookup_name); /* * Iterate over all symbols in vmlinux. For symbols from modules use * module_kallsyms_on_each_symbol instead.