Netdev List
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Matthias Rosenfelder <mrosenfelder.lkml@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net, davejwatson@fb.com
Subject: Re: [RFC] tls: length check correct in do_tls_getsockopt_tx()?
Date: Wed, 5 Jul 2017 13:07:40 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1707051306320.3050@hadrien> (raw)
In-Reply-To: <20170705101748.abfquxq73ey6lhme@mwanda>



On Wed, 5 Jul 2017, Dan Carpenter wrote:

> On Wed, Jul 05, 2017 at 03:10:53AM -0400, Matthias Rosenfelder wrote:
> > Hi,
> >
> > In do_tls_getsockopt_tx():
> >
> > if (len == sizeof(crypto_info)) {
> >
> > should be
> >
> > if (len == sizeof(*crypto_info)) {
> >
> > as crypto_info is of pointer type. Or am I missing something?
>
> No, you're right.  It should be "sizeof(*crypto_info)".
>
> It's hard for Smatch to catch these sorts of bugs because Sparse
> sometimes just gives Smatch a number literal instead of a sizeof()
> expression.  I think Coccinelle can catch these kinds of bugs?

Currently, I think the Coccinelle rules are only looking for things like x
= f(...,sizeof(x),...)

julia

      reply	other threads:[~2017-07-05 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  7:10 [RFC] tls: length check correct in do_tls_getsockopt_tx()? Matthias Rosenfelder
2017-07-05 10:17 ` Dan Carpenter
2017-07-05 11:07   ` Julia Lawall [this message]

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.1707051306320.3050@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=mrosenfelder.lkml@gmail.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox