* [PATCH 1/1 v2] fanotify.7: BUGS, error handling in fanotify_read [not found] ` <5373ADF9.4020505-fPG8STNUNVg@public.gmane.org> @ 2014-05-14 18:10 ` Heinrich Schuchardt [not found] ` <1400091016-17670-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Heinrich Schuchardt @ 2014-05-14 18:10 UTC (permalink / raw) To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Heinrich Schuchardt The patch in http://www.spinics.net/lists/linux-man/msg05589.html was not accepted. Michael Kerrisk suggested in a private mail to add a comment in the BUGS section. Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> --- man7/fanotify.7 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/man7/fanotify.7 b/man7/fanotify.7 index 2a92908..c6cec7c 100644 --- a/man7/fanotify.7 +++ b/man7/fanotify.7 @@ -164,7 +164,7 @@ so that multiple events can be retrieved by a single The return value of .BR read (2) is the number of bytes placed in the buffer, -or \-1 in case of an error. +or \-1 in case of an error (but see BUGS). The fields of the .I fanotify_event_metadata @@ -468,7 +468,7 @@ The event queue can overflow. In this case, events are lost. .SH BUGS As of Linux 3.15, -the following bug exists: +the following bugs exists: .IP * 3 .\" FIXME: A patch was proposed. When an event is generated, @@ -478,6 +478,16 @@ before passing a file descriptor for that file. This poses a security risk, when the .B CAP_SYS_ADMIN capability is set for programs executed by unprivileged users. +.IP * +If a call to +.BR read( 2 ) +processes multiple events from the fanotify queue and an error occurs, the +return value will be the cumulated length of the events successfully copied to +the user space buffer before the error occured. +The return value will not be \-1. +.I errno +will not be set. +Thus, the user program has no way to detect the error. .SH EXAMPLE The following program demonstrates the usage of the fanotify API. It marks the mount point passed as a command-line argument -- 2.0.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1400091016-17670-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>]
* Re: [PATCH 1/1 v2] fanotify.7: BUGS, error handling in fanotify_read [not found] ` <1400091016-17670-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org> @ 2014-05-14 18:52 ` Michael Kerrisk (man-pages) [not found] ` <CAKgNAki6E91d+GJnev5UWc4KPuXSTCnPnXE56fsDtoRerUS3jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2014-05-15 3:32 ` Michael Kerrisk (man-pages) 1 sibling, 1 reply; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2014-05-14 18:52 UTC (permalink / raw) To: Heinrich Schuchardt; +Cc: linux-man, Jan Kara, Eric Paris [Expanded CC] Jan, Eric, Do you have any comments/additions for this man-pages patch? Cheers, Michael On Wed, May 14, 2014 at 8:10 PM, Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> wrote: > The patch in > http://www.spinics.net/lists/linux-man/msg05589.html > was not accepted. > > Michael Kerrisk suggested in a private mail to add a comment > in the BUGS section. > > Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> > --- > man7/fanotify.7 | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/man7/fanotify.7 b/man7/fanotify.7 > index 2a92908..c6cec7c 100644 > --- a/man7/fanotify.7 > +++ b/man7/fanotify.7 > @@ -164,7 +164,7 @@ so that multiple events can be retrieved by a single > The return value of > .BR read (2) > is the number of bytes placed in the buffer, > -or \-1 in case of an error. > +or \-1 in case of an error (but see BUGS). > > The fields of the > .I fanotify_event_metadata > @@ -468,7 +468,7 @@ The event queue can overflow. > In this case, events are lost. > .SH BUGS > As of Linux 3.15, > -the following bug exists: > +the following bugs exists: > .IP * 3 > .\" FIXME: A patch was proposed. > When an event is generated, > @@ -478,6 +478,16 @@ before passing a file descriptor for that file. > This poses a security risk, when the > .B CAP_SYS_ADMIN > capability is set for programs executed by unprivileged users. > +.IP * > +If a call to > +.BR read( 2 ) > +processes multiple events from the fanotify queue and an error occurs, the > +return value will be the cumulated length of the events successfully copied to > +the user space buffer before the error occured. > +The return value will not be \-1. > +.I errno > +will not be set. > +Thus, the user program has no way to detect the error. > .SH EXAMPLE > The following program demonstrates the usage of the fanotify API. > It marks the mount point passed as a command-line argument > -- > 2.0.0.rc0 > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAKgNAki6E91d+GJnev5UWc4KPuXSTCnPnXE56fsDtoRerUS3jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 1/1 v2] fanotify.7: BUGS, error handling in fanotify_read [not found] ` <CAKgNAki6E91d+GJnev5UWc4KPuXSTCnPnXE56fsDtoRerUS3jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-05-14 20:54 ` Jan Kara 0 siblings, 0 replies; 4+ messages in thread From: Jan Kara @ 2014-05-14 20:54 UTC (permalink / raw) To: Michael Kerrisk (man-pages) Cc: Heinrich Schuchardt, linux-man, Jan Kara, Eric Paris Hello, On Wed 14-05-14 20:52:12, Michael Kerrisk (man-pages) wrote: > Do you have any comments/additions for this man-pages patch? No, it looks good to me. Honza > On Wed, May 14, 2014 at 8:10 PM, Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> wrote: > > The patch in > > http://www.spinics.net/lists/linux-man/msg05589.html > > was not accepted. > > > > Michael Kerrisk suggested in a private mail to add a comment > > in the BUGS section. > > > > Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> > > --- > > man7/fanotify.7 | 14 ++++++++++++-- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/man7/fanotify.7 b/man7/fanotify.7 > > index 2a92908..c6cec7c 100644 > > --- a/man7/fanotify.7 > > +++ b/man7/fanotify.7 > > @@ -164,7 +164,7 @@ so that multiple events can be retrieved by a single > > The return value of > > .BR read (2) > > is the number of bytes placed in the buffer, > > -or \-1 in case of an error. > > +or \-1 in case of an error (but see BUGS). > > > > The fields of the > > .I fanotify_event_metadata > > @@ -468,7 +468,7 @@ The event queue can overflow. > > In this case, events are lost. > > .SH BUGS > > As of Linux 3.15, > > -the following bug exists: > > +the following bugs exists: > > .IP * 3 > > .\" FIXME: A patch was proposed. > > When an event is generated, > > @@ -478,6 +478,16 @@ before passing a file descriptor for that file. > > This poses a security risk, when the > > .B CAP_SYS_ADMIN > > capability is set for programs executed by unprivileged users. > > +.IP * > > +If a call to > > +.BR read( 2 ) > > +processes multiple events from the fanotify queue and an error occurs, the > > +return value will be the cumulated length of the events successfully copied to > > +the user space buffer before the error occured. > > +The return value will not be \-1. > > +.I errno > > +will not be set. > > +Thus, the user program has no way to detect the error. > > .SH EXAMPLE > > The following program demonstrates the usage of the fanotify API. > > It marks the mount point passed as a command-line argument > > -- > > 2.0.0.rc0 > > > > > > -- > Michael Kerrisk > Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ > Linux/UNIX System Programming Training: http://man7.org/training/ -- Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1 v2] fanotify.7: BUGS, error handling in fanotify_read [not found] ` <1400091016-17670-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org> 2014-05-14 18:52 ` Michael Kerrisk (man-pages) @ 2014-05-15 3:32 ` Michael Kerrisk (man-pages) 1 sibling, 0 replies; 4+ messages in thread From: Michael Kerrisk (man-pages) @ 2014-05-15 3:32 UTC (permalink / raw) To: Heinrich Schuchardt Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA, Jan Kara, Eric Paris On 05/14/2014 08:10 PM, Heinrich Schuchardt wrote: > The patch in > http://www.spinics.net/lists/linux-man/msg05589.html > was not accepted. > > Michael Kerrisk suggested in a private mail to add a comment > in the BUGS section. Hi Heinrich, Thanks! I've applied this patch (and fixed a few typos) and added Reviewed-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org> Cheers, Michael > Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> > --- > man7/fanotify.7 | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/man7/fanotify.7 b/man7/fanotify.7 > index 2a92908..c6cec7c 100644 > --- a/man7/fanotify.7 > +++ b/man7/fanotify.7 > @@ -164,7 +164,7 @@ so that multiple events can be retrieved by a single > The return value of > .BR read (2) > is the number of bytes placed in the buffer, > -or \-1 in case of an error. > +or \-1 in case of an error (but see BUGS). > > The fields of the > .I fanotify_event_metadata > @@ -468,7 +468,7 @@ The event queue can overflow. > In this case, events are lost. > .SH BUGS > As of Linux 3.15, > -the following bug exists: > +the following bugs exists: > .IP * 3 > .\" FIXME: A patch was proposed. > When an event is generated, > @@ -478,6 +478,16 @@ before passing a file descriptor for that file. > This poses a security risk, when the > .B CAP_SYS_ADMIN > capability is set for programs executed by unprivileged users. > +.IP * > +If a call to > +.BR read( 2 ) > +processes multiple events from the fanotify queue and an error occurs, the > +return value will be the cumulated length of the events successfully copied to > +the user space buffer before the error occured. > +The return value will not be \-1. > +.I errno > +will not be set. > +Thus, the user program has no way to detect the error. > .SH EXAMPLE > The following program demonstrates the usage of the fanotify API. > It marks the mount point passed as a command-line argument > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-15 3:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <5373ADF9.4020505@bfs.de>
[not found] ` <5373ADF9.4020505-fPG8STNUNVg@public.gmane.org>
2014-05-14 18:10 ` [PATCH 1/1 v2] fanotify.7: BUGS, error handling in fanotify_read Heinrich Schuchardt
[not found] ` <1400091016-17670-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-05-14 18:52 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAki6E91d+GJnev5UWc4KPuXSTCnPnXE56fsDtoRerUS3jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-14 20:54 ` Jan Kara
2014-05-15 3:32 ` Michael Kerrisk (man-pages)
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).