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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9A27C4727E for ; Wed, 30 Sep 2020 12:00:31 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1405520644 for ; Wed, 30 Sep 2020 12:00:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=vt-edu.20150623.gappssmtp.com header.i=@vt-edu.20150623.gappssmtp.com header.b="SKiGyobH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1405520644 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1kNam4-0003ls-7f; Wed, 30 Sep 2020 07:59:56 -0400 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kNam1-0003ln-9Y for kernelnewbies@kernelnewbies.org; Wed, 30 Sep 2020 07:59:53 -0400 Received: by mail-qk1-x72d.google.com with SMTP id q63so1056553qkf.3 for ; Wed, 30 Sep 2020 04:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vt-edu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:in-reply-to:references:mime-version :content-transfer-encoding:date:message-id; bh=1C2UJcRs5Ig4pfC6q5Qncp4l6trHV7cuj7Vc7iec+9o=; b=SKiGyobHMoVjbwwolQyEw0VuXMYqr0N32xsQdmfMFuxjEM8aiLPco8P0to4BljHwX9 Evsumyc9cuzgSGDXakn3hmEX8wBJC53IyQWOKP0cBo8Iq+DM8S7WKC9ktSKGfEG3Hbvr wjgdS1VY7L1PeyOKJtw/o3/EQ8b7kSAIlFwoy646tZ5InAHjiW3I2dfHb53/4UEEkXA5 XcisxQnuBpKl3YcH41nVflrZ4vUpXUAoANe4K8XbP1lr2uTQ/sAWJbAEOXalddr97mRa s3J2/MRHF5GXemRlxw0zXc2iNbnhdMyK6ziScQ2Qpghgqr6AWziLJx/m/ek1+TvUMigr eVOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=1C2UJcRs5Ig4pfC6q5Qncp4l6trHV7cuj7Vc7iec+9o=; b=fKtRHUdLizX9QgcFIJP3t6sw4iehw2IDU7hfqLGbNt7F9goEAik5mQnxkRcBN89xDW dHx/tFJRiUGUJGYXHa7Xag3ANzUAW9AknCbor4J1BzZpwvoIxMEH+po+pqTrrOxA0Gyb tdlppXO8YIgC9GgB9ZiICtGnYedYyQ5xDO2Wqxi1+ioEu57tjZVRWO+YsCfO1C0peD0I XISGfsOZUODvfMlew2ktMZeqgEI5O4vIIYH+IobBodL2QF3QyaAArgG0AmLIfgJ7tQZg OFR/vSpIIilFSVLHhsvmZh9Sd/DVZ9hJCi+2XerFR6C50LjiV0Po/rwuGLPkcmOgvs37 Odng== X-Gm-Message-State: AOAM533BpZMEEZRA7s1UaP+/J5fAm1mWeNunnFQiThtUFi8YC7sOteVH vVtHQBYbVR6WZa5fMpdXUr2nyQ== X-Google-Smtp-Source: ABdhPJx2IyPgxiKpwvBDF4RRjbi4ZYqMGqcufQu2SmjmBr8R8vrP+G/6u4jgur7usFm7Pkgjuk6bCw== X-Received: by 2002:a05:620a:13f0:: with SMTP id h16mr2075852qkl.319.1601467189939; Wed, 30 Sep 2020 04:59:49 -0700 (PDT) Received: from turing-police ([2601:5c0:c000:a8c1::359]) by smtp.gmail.com with ESMTPSA id a3sm1980871qtp.63.2020.09.30.04.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 04:59:48 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: John Wood Subject: Re: Read the "real_parent" field of task_struct In-Reply-To: <20200925161142.GA2857@ubuntu> References: <20200925161142.GA2857@ubuntu> Mime-Version: 1.0 Date: Wed, 30 Sep 2020 07:59:47 -0400 Message-ID: <53033.1601467187@turing-police> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0004094293936810947==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============0004094293936810947== Content-Type: multipart/signed; boundary="==_Exmh_1601467187_12263P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1601467187_12263P Content-Type: text/plain; charset=us-ascii On Fri, 25 Sep 2020 18:11:42 +0200, John Wood said: > There are more examples but are similars to the ones showed. So my question > is how to read the "real_parent" field correctly. If I can understand all > the above examples I think I will have the knowledge to implement my LSM in > a correct way. There's multiple data structures which contain a pointer to the "real_parent" that we're interested in. So depending on which data structure you're working with, you'll be following a different path to the real_parent, and depending on what locks (if any) the calling code already has, the access method may be different. It's similar to giving directions to where I used to live on Long Island. If you were coming from the Boston area, you wanted to take I-95 South, then either the Throg's Neck or Whitestone Bridge, get to I-495 (Long Island Expressway), get off at a given exit, take that road south, and turn left to enter the neighborhood from the north, but if you're coming from New Jersey, you want to get to Staten Island, Verazanno Narrows Bridge, then Southern State Parkway to *its* exit for that same road going north, but the right turn to enter the neighborhood from the south isn't the same one as if you're coming from the north (unless you prefer driving another 3/4 of a mile to turn at the same light as if you were coming from the north...) You end up at the same place, even though you're using different paths to get there. The inside of the kernel works the same way. Which way you get to 'real_parent' depends on what data structure you are already working with. --==_Exmh_1601467187_12263P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBX3RzMwdmEQWDXROgAQL2nxAAp6uEHIyT5uBQP1IgCQJm9Tc8IEtSbhOE 2bHnbJkgfsVOCVWw/tnwhjEXVDI+M9H0mMxqlOw/OzUpyE2MLbDDCc/275FoMbFz LzftHwZkSIiNJ2M0siXUUkIp/dJDx35P0svgjCZ8R3qbIvC+xZQ5l6RwnKyUTiLQ 9BOpPczgiKkXRs99X5SYQQ53zNMq1TWX6tLEOh9PWVUh2uNFtlzbQsblzVH4RoSO 1MrRnrqF76+TyHq18ALbBFhsIC5TECU5sS8n/2oaSdZ9rtbcRiBGjcNYtWMxDRkA wGxIe2LtSurYUPaVoXNN3qWkxi0++b9bGJVM6MPt2Ob6iE02VzGRCKGmP2vakr81 0f9oOQjeViCsHixbGVcFtA9Hqz6yyCZY1bv6CJRjKaLwY5SjrLlrYqoQOLVVmnSz vivPZHG+b5D9xzXbiI6f084MlGqtdT8/0k0HG2ac0H4op/rkfmtNs74j/mi56lXu 4n8m/UnIpCHifD+wFKfghWOTwJqrARa26B1AZUjRqt0maryG+4efsolDplTyOr4u 8cgzfi7kfbj5bzLMUL3SFEykarcZZL1mwPEBXIH0IZeME7dP3lOX1/Hb1gUQImHs JgMVcIJSiy6CaAkGJ1dxWMbgCDTkJBScRVErR04Ijxoyj/fymic8HNSi+Cha8GJP Xo+yJWdDNro= =BXKb -----END PGP SIGNATURE----- --==_Exmh_1601467187_12263P-- --===============0004094293936810947== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============0004094293936810947==--