All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Saheed Olayemi Bolarinwa <refactormyself@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, helgaas@kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH 2/13] misc: rtsx: Check the return value of pcie_capability_read_*()
Date: Wed, 8 Jul 2020 08:53:30 +0200	[thread overview]
Message-ID: <20200708065330.GA348669@kroah.com> (raw)
In-Reply-To: <20200707220324.8425-3-refactormyself@gmail.com>

On Wed, Jul 08, 2020 at 12:03:13AM +0200, Saheed Olayemi Bolarinwa wrote:
> From: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>
> 
> On failure pcie_capability_read_dword() sets it's last parameter, val
> to 0. In which case (val & PCI_EXP_DEVCTL2_LTR_EN) evaluates to 0.
> However, with Patch 13/13, it is possible that val is set to ~0 on
> failure. This would introduce a bug because (x & x) == (~0 & x).
> 
> This bug can be avoided without changing the function's behaviour if the
> return value of pcie_capability_read_word is checked to confirm success.
> 
> Check the return value of pcie_capability_read_word() to ensure success.
> 
> Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
> Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Saheed Olayemi Bolarinwa <refactormyself@gmail.com>
Cc: helgaas@kernel.org, Arnd Bergmann <arnd@arndb.de>,
	bjorn@helgaas.com, skhan@linuxfoundation.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/13] misc: rtsx: Check the return value of pcie_capability_read_*()
Date: Wed, 8 Jul 2020 08:53:30 +0200	[thread overview]
Message-ID: <20200708065330.GA348669@kroah.com> (raw)
In-Reply-To: <20200707220324.8425-3-refactormyself@gmail.com>

On Wed, Jul 08, 2020 at 12:03:13AM +0200, Saheed Olayemi Bolarinwa wrote:
> From: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>
> 
> On failure pcie_capability_read_dword() sets it's last parameter, val
> to 0. In which case (val & PCI_EXP_DEVCTL2_LTR_EN) evaluates to 0.
> However, with Patch 13/13, it is possible that val is set to ~0 on
> failure. This would introduce a bug because (x & x) == (~0 & x).
> 
> This bug can be avoided without changing the function's behaviour if the
> return value of pcie_capability_read_word is checked to confirm success.
> 
> Check the return value of pcie_capability_read_word() to ensure success.
> 
> Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
> Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

  reply	other threads:[~2020-07-08  6:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 22:03 [PATCH 0/13] PCI: Remove '*val = 0' from pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] " Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 2/13] misc: rtsx: Check the return value of pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-08  6:53   ` Greg Kroah-Hartman [this message]
2020-07-08  6:53     ` Greg Kroah-Hartman
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 5/13] PCI: pciehp: " Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 6/13] PCI: pciehp: Make "Power On" the default Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 8/13] PCI: pciehp: Check return value of pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 9/13] PCI: " Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 10/13] PCI/PM: " Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [Linux-kernel-mentees] [PATCH 12/13] PCI/ASPM: Check the " Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03 ` [PATCH 13/13] PCI: Remove '*val = 0' from pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` Saheed Olayemi Bolarinwa
2020-07-07 22:03   ` [Linux-kernel-mentees] " Saheed Olayemi Bolarinwa

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=20200708065330.GA348669@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=refactormyself@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 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.