kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Lev Olshvang <levonshe@yandex.com>
Cc: "valdis.kletnieks@vt.edu" <valdis.kletnieks@vt.edu>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: In a process context kernel_read returns -EINTR, how to proceed?
Date: Fri, 21 Dec 2018 15:00:55 +0100	[thread overview]
Message-ID: <20181221140055.GA8889@kroah.com> (raw)
In-Reply-To: <764811545400289@myt2-dc4bba9bb23c.qloud-c.yandex.net>

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

  reply	other threads:[~2018-12-21 14:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 10:33 In a process context kernel_read returns -EINTR, how to proceed? Lev Olshvang
2018-12-20 16:40 ` valdis.kletnieks
2018-12-21 13:51   ` Lev Olshvang
2018-12-21 14:00     ` Greg KH [this message]
2018-12-21 16:15     ` valdis.kletnieks
2018-12-23  8:41       ` Lev Olshvang
2018-12-23  8:53         ` valdis.kletnieks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181221140055.GA8889@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=levonshe@yandex.com \
    --cc=valdis.kletnieks@vt.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).