From: Christopher Yeoh <cyeoh-8fk3Idey6ehBDgjK7y7TUQ@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] process_vm_{read,write}v(3): initial man pages
Date: Wed, 21 Mar 2012 13:55:10 +1030 [thread overview]
Message-ID: <20120321135510.29380c06@Gantu> (raw)
In-Reply-To: <CAKgNAkg=3KokH5zFwThOsHt4gaM4fqcauFdmtihCgcFEV8_z1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, 20 Mar 2012 19:27:31 +1300
"Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, Mar 20, 2012 at 1:50 PM, Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> wrote:
> > On Monday 19 March 2012 16:45:41 Michael Kerrisk (man-pages) wrote:
> >> A quick question about one piece:
> >> > +The count values might be individually capped according to
> >> > \fIUIO_MAXIOV\fP. +If the Linux kernel is capped at smaller
> >> > values, the C library will take care +of emulating the limit it
> >> > exposes (if it is bigger) so the user only needs to +care about
> >> > that (what the C library defines).
> >>
> >> I don't see anything in glibc that does this. Have I missed
> >> something?
> >
> > i think you're correct. the code in glibc atm is merely a
> > syscall(). i think the idea was to have the C library guarantee
> > that and if moving forward the kernel changes, the C library would
> > update by adding a wrapper. maybe just drop this sentence until
> > that day comes ?
>
> So, does the kernel currently impose a limit on the size of the iovec?
> It wasn't immediately clear to me from a quick scan of the source.
>
>
The code calls rw_copy_check_uvector which does check that the iovecs
are smaller than UIO_MAXIOV.
Note that the following bit is not strictly true:
"So if the counts are too big, or the vectors invalid, or the
addresses refer to regions that are inaccessible, none of the
previous vectors will be processed and an +error will be returned
immediately."
Whilst the code does check that memory regions in the process calling
the system calls are accessible before any work is done, it does not
check the memory regions in the remote process until just before doing
the read/write. So in that case you can end up with a partial
read/write if one of the iovec elements for the remote process points
to an invalid memory region. No further read/writes will be attempted
after this point though.
Regards,
Chris
--
cyeoh-hXjcm30GF6XQT0dZR+AlfA@public.gmane.org
--
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
next prev parent reply other threads:[~2012-03-21 3:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-10 5:42 [PATCH] process_vm_{read,write}v(3): initial man pages Mike Frysinger
[not found] ` <1331358148-17235-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-03-19 20:45 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkjhzh+zZ+GhOcbKsZpkeAgn6ua5K=zS=0_AUsUQ3GsQ_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-20 0:50 ` Mike Frysinger
[not found] ` <201203192050.48882.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-03-20 6:27 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkg=3KokH5zFwThOsHt4gaM4fqcauFdmtihCgcFEV8_z1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-21 3:25 ` Christopher Yeoh [this message]
2012-03-21 4:05 ` Mike Frysinger
2012-03-21 3:57 ` Mike Frysinger
2012-03-20 6:30 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkj-bss8Tuq3jcPMRpsKCfKgHGSemq5emS48eBXi2JXA_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-21 4:09 ` Mike Frysinger
2012-03-21 4:13 ` Christopher Yeoh
2012-03-21 15:43 ` Mike Frysinger
[not found] ` <201203211143.37042.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-03-21 18:29 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkiNiG42ZtjYszYWBQWsvsk+c-mHhucER6Umt3esUvRCKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-29 18:42 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkiEF6yTN-S-7-7L3Bu+QQyBepgocQM5S=CAOZ+npBQmEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-02 2:03 ` Christopher Yeoh
2012-04-14 1:08 ` Michael Kerrisk (man-pages)
2012-03-29 19:17 ` Mike Frysinger
[not found] ` <201203291517.46815.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-04-14 1:07 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkiKL64_H2QT6v0hsP-=cM3w=wGJbjaph+JMq6R+Knhysg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-14 1:10 ` Michael Kerrisk (man-pages)
2012-04-14 4:36 ` Mike Frysinger
[not found] ` <201204140036.28834.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-04-14 21:22 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkjh46Bpar7qkJBn_r4D1qtFkbK_QLVfE3ESgEuaYMGp5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-22 18:56 ` Michael Kerrisk (man-pages)
2012-04-24 4:24 ` Mike Frysinger
[not found] ` <201204240024.56967.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-04-24 9:07 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAki+hiCAdGe9ExFsY2MwsLE=yvHib+nb5WQbXqtBXCqHMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-24 9:11 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkg2ag9cR217km4vLM0kZYANfayNt=4mvfiObnL4LY3ztQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-24 17:49 ` Mike Frysinger
[not found] ` <201204241349.31377.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-04-25 2:16 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkj2hUUZCpG7F-1VpnAeNuM0aHtSqvoK26UbSj3bxnrsog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 19:01 ` Mike Frysinger
[not found] ` <201211191401.10726.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-03-03 4:05 ` Mike Frysinger
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=20120321135510.29380c06@Gantu \
--to=cyeoh-8fk3idey6ehbdgjk7y7tuq@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.