All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-sctp@vger.kernel.org
Subject: question about "acpi, nfit: validate ars_status output buffer size"
Date: Mon, 09 Jan 2017 13:30:07 +0000	[thread overview]
Message-ID: <20170109133007.GA952@elgon.mountain> (raw)

Hi Dan,

It's really hard to understand commit 82aa37cf0986 ("acpi, nfit:
validate ars_status output buffer size") from Dec 6, 2016.

drivers/acpi/nfit/core.c
   139                  /* No ARS performed for the current boot */
   140                  if (status = NFIT_ARS_STATUS_NONE)
   141                          return -EAGAIN;
   142  
   143                  /*
   144                   * ARS interrupted, either we overflowed or some other
   145                   * agent wants the scan to stop.  If we didn't overflow
   146                   * then just continue with the returned results.
   147                   */
   148                  if (status = NFIT_ARS_STATUS_INTR) {
   149                          if (ars_status->out_length >= 40 && (ars_status->flags
   150                                                  & NFIT_ARS_F_OVERFLOW))

When I read the commit message, it implies that we're being more strict
about what we process but actually this is && instead of || so we're
being less strict.

The commit message doesn't really describe the user visible effects of
this bug.  I'm not an expert on ACPI and I have grepped the source but
can't figure it out.

Also this isn't aligned the normal way.  It should be:

				if (ars_status->out_length >= 40 &&
				    (ars_status->flags & NFIT_ARS_F_OVERFLOW))

   151                                  return -ENOSPC;
   152                          return 0;
   153                  }

regards,
dan carpenter

             reply	other threads:[~2017-01-09 13:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 13:30 Dan Carpenter [this message]
2017-01-09 13:33 ` question about "acpi, nfit: validate ars_status output buffer size" Dan Carpenter
2017-01-09 13:38 ` Marcelo Ricardo Leitner
2017-01-09 13:44 ` Dan Carpenter

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=20170109133007.GA952@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-sctp@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 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.