linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Pengfei Wang <wpengfeinudt@gmail.com>
Cc: Vaishali Thakkar <vaishali.thakkar@oracle.com>,
	Kees Cook <keescook@chromium.org>,
	Vaishali Thakkar <vthakkar1994@gmail.com>,
	linux-kernel@vger.kernel.org, Michal Marek <mmarek@suse.com>,
	cocci@systeme.lip6.fr
Subject: Re: [Cocci] [PATCH] coccicheck: add a test for repeat copy_from_user
Date: Wed, 11 Jan 2017 07:12:53 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1701110708030.2396@hadrien> (raw)
In-Reply-To: <76D088EA-3C7E-4766-A237-3FA1F0767C1A@gmail.com>

I looked at the get_user part of the original script.  It looks like most
of the complexity is to deal with the possibility of the src location
being expressed in two different ways between the two calls.  Even if this
happens in practice only for get_user, it would seem that it could happen
for copy_from_user as well.  So I think we could just throw both get_user
and copy_from_user into the same rule?

I'm also not sure to understand why there are cases for things like

get_user(exp1, src->f1)
...
get_user(exp2,src)

Can this happen?  The types seem wrong.

Likewise, I see the need to take into account a second argument of src++,
but not the need to take into account a second argument of src+4.  Either
there is src+4 in both calls or the addresses involved are just different.

Perhaps I'm missing something, though.

julia

  parent reply	other threads:[~2017-01-11  6:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 22:24 [PATCH] coccicheck: add a test for repeat copy_from_user Kees Cook
2016-04-26 22:30 ` Kees Cook
2016-12-27 18:21 ` Julia Lawall
2017-01-09 17:05   ` [Cocci] " Vaishali Thakkar
2017-01-09 19:08     ` Julia Lawall
2017-01-09 20:56       ` Kees Cook
2017-01-09 22:02         ` Kees Cook
     [not found]     ` <05AE3A59-EF48-4FFF-A028-0204B2E56DEB@gmail.com>
2017-01-10  8:40       ` Vaishali Thakkar
     [not found]         ` <19545870-5238-4BEB-AF1E-741BA97A6AA2@gmail.com>
2017-01-10 17:46           ` Vaishali Thakkar
     [not found]             ` <76D088EA-3C7E-4766-A237-3FA1F0767C1A@gmail.com>
2017-01-11  6:12               ` Julia Lawall [this message]
2017-01-11 13:44                 ` Pengfei Wang
2017-01-10 19:16         ` Kees Cook
2017-01-10 19:15       ` Kees Cook

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=alpine.DEB.2.20.1701110708030.2396@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=vaishali.thakkar@oracle.com \
    --cc=vthakkar1994@gmail.com \
    --cc=wpengfeinudt@gmail.com \
    /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).