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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 8353BC43387 for ; Fri, 21 Dec 2018 14:03:03 +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 36ADA21920 for ; Fri, 21 Dec 2018 14:03:03 +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="fIgoN3tc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fg0J4TY+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36ADA21920 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=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1gaLOH-0002Bi-WE for kernelnewbies@archiver.kernel.org; Fri, 21 Dec 2018 09:03:02 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gaLMK-0008P0-JV for kernelnewbies@kernelnewbies.org; Fri, 21 Dec 2018 09:01:01 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 63F651464; Fri, 21 Dec 2018 09:00:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 21 Dec 2018 09:00:58 -0500 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=fm2; bh=LM0dfeBjSrNFIwWzEil9C8xhbZO yB+oDIv5l7eQ8WXk=; b=fIgoN3tcmwVv2bTlRWBjeg2BGiehIcwRgtduY4x6S0q Zd1cacA6rEAczkXpHvRDmtj9ZvDc1vrU172cUrcQ+3ik67Czx3pLLnMwGF0dCYgH LPWNccJ+RMsJkyqv2332FD3LnhS9tB+i/TS4eBxqwm8MUtIAsK7gro9KOUgWduFI HX5jO2wtsbtoCvQRgBuzyCRWSR5ADS81eXt/72zMZ0HgyWTh+MVl5BltHidQklmE eDh1qU3/RHPh2J71QlUcAMdQh45A73i2xoCi9ngJU7BbiX2Zz1pMnUwqhb19yDzc /u4IibmO1seULpCewjXYYGMGt7On23B0gGHMw7m9czA== 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=fm1; bh=LM0dfe BjSrNFIwWzEil9C8xhbZOyB+oDIv5l7eQ8WXk=; b=fg0J4TY+a3g6y5DXTdKcR9 d0yU8ITgXjJYoa3TgYbHc9OEimihzK6MOoHqjc5KgiHWcLQHfcwQZYKZv2yI/jE2 MpFyNMFW/TZO9Jbe+9qUpxQhFy5ondDOxtuZTDLmEdf1Kz6azOJFN7TrDVNeVkje gvpNWVrDPL7ac/B4WIKx5pATHN8sJkHSaI2aqxN5EWwRs4rEm6INNr6IuhOZkqd3 9N/uBLVKcfVkQ0EBpB5nCK6g7WkuAP7HqfD4rbZc97YuqsJxsShC4RtrGPot+7Os 5ZGWXuVK94fbtVeDRiEdybM0lkuCbNjzCG2cjvlljDGt0LXcIh+KZAudVTh16+EQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudejhedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecuogfuphgrmhfkphculdeftddtmdenucfjughrpeffhffvuffkfhggtggujggfse httdertddtredvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgt ohhmqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id C9380E4445; Fri, 21 Dec 2018 09:00:56 -0500 (EST) Date: Fri, 21 Dec 2018 15:00:55 +0100 From: Greg KH To: Lev Olshvang Subject: Re: In a process context kernel_read returns -EINTR, how to proceed? Message-ID: <20181221140055.GA8889@kroah.com> References: <92921545301989@sas2-9bd6ba081e5d.qloud-c.yandex.net> <9348.1545324048@turing-police.cc.vt.edu> <764811545400289@myt2-dc4bba9bb23c.qloud-c.yandex.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <764811545400289@myt2-dc4bba9bb23c.qloud-c.yandex.net> User-Agent: Mutt/1.11.1 (2018-12-01) Cc: "valdis.kletnieks@vt.edu" , kernelnewbies 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=archiver.kernel.org@kernelnewbies.org On Fri, Dec 21, 2018 at 04:51:29PM +0300, Lev Olshvang wrote: > Hi Valdis, > > I need to read file inside LSM hook and I can not do it in user space > I forgot o mention that same error occurried both in 4.4 and 4.13 kernels > What alternative you can recommend to read file in kernel and avoid -EINTR? > Is vfs_read() different from kernel_read() ? You should never try to read a file from within the kernel. That way lies madness and lots and lots and lots of problems. You really are on your own if you want to do that, you should step back and reconsider exactly what you are trying to do and redesign your system to not try to ever do this. good luck! greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies