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=-0.3 required=3.0 tests=DEAR_SOMETHING,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 AE8DBC432C1 for ; Tue, 24 Sep 2019 07:36:07 +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 6C7F32053B for ; Tue, 24 Sep 2019 07:36:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="J31kBfNl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pMkPmZiO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C7F32053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.2) (envelope-from ) id 1iCfMQ-00057q-1H; Tue, 24 Sep 2019 03:35:46 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iCfMN-00057k-0N for kernelnewbies@kernelnewbies.org; Tue, 24 Sep 2019 03:35:43 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 759D421C57; Tue, 24 Sep 2019 03:35:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 24 Sep 2019 03:35:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=fzHWiy9TKvzwvyT8NGbw4P8xLlA qIz9Wtejzuh5fYmQ=; b=J31kBfNlleL0XMcTD9yK59nIf4n53g+d/cYC3ZgVEIA BEU8iifiTL6QjdZlP2M8xcy/E6UipWLZlLTHVF9mHBAzeCcss7Jk2zfzgOxoCJNK cWBoR3oq16T54edXgnkHtn4vb20PuCeydfmnZJr/exY/QXh8fP6VmSBSh278fQ/q cOdypzfMgKcIq99P6EgPxd5+/shB0QRsZbWf9zEHg0+RuyrpUMJMZ6cIhYpUxiqZ Yh78FoAVh3qONYNUV4ytQ5tsT+xtRGdPR4ZhhEU1AkKBJA6a/LEa6jPm4Dvc0NHh BCLQ+i3+LOnwOvu6ufeQM/KCQjYbKjl4QFZ83Co43vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=fzHWiy 9TKvzwvyT8NGbw4P8xLlAqIz9Wtejzuh5fYmQ=; b=pMkPmZiO4bX7ANl2CHNr5g i3j25J0AU15Hhv8E1L2104VTguyChtGsxymNf2uBrNmZK4r5iGaeEJQpTGNafrQV X8SN5EBc1YCLbKezOVecP1PZp6VEd4nvOVxOpioa2RjlLtfG6v9HBeO+c4euBvqz JbOW+dzxhoc0HbZCXFnUDvifNOSGYg6lW0J1DhJH+mpJdvmK+QKXfa03WUylMhTz H9ppIAhJpW9GKd+tCuYsmEKtQyAZzOdYjCF5ij+GUIEe8EG3fBX1fRO61mHILaBk H+gIHeFwTcN5H2w58MUj8F6gH0uuZ3hoWXisv+Lutvoe7ZMtsGfYUN0dHgBvPQxw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdelgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjfgesthdtredttdervdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuffhomhgrihhnpehsthgrtghkoh hvvghrfhhlohifrdgtohhmnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghm pehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuih iivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id BAB30D6005D; Tue, 24 Sep 2019 03:35:38 -0400 (EDT) Date: Tue, 24 Sep 2019 09:35:35 +0200 From: Greg KH To: Sahibzada Irfanullah Subject: Re: Fwd: Need Help regarding Reading and Writting to a file from kernel function file Message-ID: <20190924073535.GA489411@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Sep 24, 2019 at 04:10:07PM +0900, Sahibzada Irfanullah wrote: > Dear Sir, > Hope you are doing well. Actually, I have one problem metioned in the > subject line. The problem is: I am trying to write/read page faulted > physical addresses to a file in a kernel (v5.3-1) function, i.e., > handle_ept_violation() which is present in vmx.c. I have followed this > , > it's working as a standalone kernel module when I load/unload this kernel > module, but when I try to use this code in the handle_ept_violation() > function, I can't able to open the file and get the error codes, i.e., -2, > -3, or -13. It's compiled successfully but generate the error at runtime. I > searched for error codes online but I didn't find any help. > Can anyone please provide me with any good guidlines, or links where I can > start and solve this problem in a fast way. Please do not try to read or write a file from within the kernel, that way almost always lies madness and major problems. Step back and try to describe the problem you are attempting to solve here first. Odds are it can be done in a much better way. Also, do you have a pointer to your code anywhere? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies