diff mbox series

fsl_pci: Correct fsl_pci_mcheck_exception

Message ID 20170905115943.19919-1-joakim.tjernlund@infinera.com (mailing list archive)
State Accepted
Delegated to: Scott Wood
Headers show
Series fsl_pci: Correct fsl_pci_mcheck_exception | expand

Commit Message

Joakim Tjernlund Sept. 5, 2017, 11:59 a.m. UTC
get_user() had it args reversed causing NIP to be NULL:ed instead
of fixing up the PCI access.

Note: This still hangs my P1020 Freescale CPU hard, but at least
I get a NIP now.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
 arch/powerpc/sysdev/fsl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

York Sun Sept. 6, 2017, 3:34 p.m. UTC | #1
On 09/05/2017 04:59 AM, Joakim Tjernlund wrote:
> get_user() had it args reversed causing NIP to be NULL:ed instead
> of fixing up the PCI access.
> 
> Note: This still hangs my P1020 Freescale CPU hard, but at least
> I get a NIP now.
> 
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> ---
>   arch/powerpc/sysdev/fsl_pci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index 7c8b779c329a..9e64c12dff6a 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -996,7 +996,7 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
>   	if (is_in_pci_mem_space(addr)) {
>   		if (user_mode(regs)) {
>   			pagefault_disable();
> -			ret = get_user(regs->nip, &inst);
> +			ret = get_user(inst, (__u32 __user *)regs->nip);
>   			pagefault_enable();
>   		} else {
>   			ret = probe_kernel_address(regs->nip, inst);
> 

Leo,

Can you take a look, or assign it to someone who is familiar with this code?

York
Leo Li Sept. 6, 2017, 7:19 p.m. UTC | #2
> -----Original Message-----
> From: York Sun
> Sent: Wednesday, September 06, 2017 10:34 AM
> To: Leo Li <leoyang.li@nxp.com>
> Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>; linuxppc-dev linuxppc-
> dev <linuxppc-dev@lists.ozlabs.org>
> Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> 
> On 09/05/2017 04:59 AM, Joakim Tjernlund wrote:
> > get_user() had it args reversed causing NIP to be NULL:ed instead of
> > fixing up the PCI access.
> >
> > Note: This still hangs my P1020 Freescale CPU hard, but at least I get
> > a NIP now.
> >
> > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > ---
> >   arch/powerpc/sysdev/fsl_pci.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/sysdev/fsl_pci.c
> > b/arch/powerpc/sysdev/fsl_pci.c index 7c8b779c329a..9e64c12dff6a
> > 100644
> > --- a/arch/powerpc/sysdev/fsl_pci.c
> > +++ b/arch/powerpc/sysdev/fsl_pci.c
> > @@ -996,7 +996,7 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
> >   	if (is_in_pci_mem_space(addr)) {
> >   		if (user_mode(regs)) {
> >   			pagefault_disable();
> > -			ret = get_user(regs->nip, &inst);
> > +			ret = get_user(inst, (__u32 __user *)regs->nip);
> >   			pagefault_enable();
> >   		} else {
> >   			ret = probe_kernel_address(regs->nip, inst);
> >
> 
> Leo,
> 
> Can you take a look, or assign it to someone who is familiar with this code?

Acked-by: Li Yang <leoyang.li@nxp.com>

Regards,
Leo
Joakim Tjernlund Nov. 21, 2017, 5:17 p.m. UTC | #3
On Wed, 2017-09-06 at 19:19 +0000, Leo Li wrote:
> > -----Original Message-----
> > From: York Sun
> > Sent: Wednesday, September 06, 2017 10:34 AM
> > To: Leo Li <leoyang.li@nxp.com>
> > Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>; linuxppc-dev linuxppc-
> > dev <linuxppc-dev@lists.ozlabs.org>
> > Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> > 
> > On 09/05/2017 04:59 AM, Joakim Tjernlund wrote:
> > > get_user() had it args reversed causing NIP to be NULL:ed instead of
> > > fixing up the PCI access.
> > > 
> > > Note: This still hangs my P1020 Freescale CPU hard, but at least I get
> > > a NIP now.
> > > 
> > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > ---
> > >   arch/powerpc/sysdev/fsl_pci.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/powerpc/sysdev/fsl_pci.c
> > > b/arch/powerpc/sysdev/fsl_pci.c index 7c8b779c329a..9e64c12dff6a
> > > 100644
> > > --- a/arch/powerpc/sysdev/fsl_pci.c
> > > +++ b/arch/powerpc/sysdev/fsl_pci.c
> > > @@ -996,7 +996,7 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
> > >   	if (is_in_pci_mem_space(addr)) {
> > >   		if (user_mode(regs)) {
> > >   			pagefault_disable();
> > > -			ret = get_user(regs->nip, &inst);
> > > +			ret = get_user(inst, (__u32 __user *)regs->nip);
> > >   			pagefault_enable();
> > >   		} else {
> > >   			ret = probe_kernel_address(regs->nip, inst);
> > > 
> > 
> > Leo,
> > 
> > Can you take a look, or assign it to someone who is familiar with this code?
> 
> Acked-by: Li Yang <leoyang.li@nxp.com>
> 
> Regards,
> Leo

I think this is forgotten, cannot se it in Linus tree.
Leo Li Dec. 5, 2017, 3:16 p.m. UTC | #4
> -----Original Message-----
> From: Joakim Tjernlund [mailto:Joakim.Tjernlund@infinera.com]
> Sent: Tuesday, November 21, 2017 11:17 AM
> To: Leo Li <leoyang.li@nxp.com>; York Sun <york.sun@nxp.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> 
> On Wed, 2017-09-06 at 19:19 +0000, Leo Li wrote:
> > > -----Original Message-----
> > > From: York Sun
> > > Sent: Wednesday, September 06, 2017 10:34 AM
> > > To: Leo Li <leoyang.li@nxp.com>
> > > Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>; linuxppc-dev
> > > linuxppc- dev <linuxppc-dev@lists.ozlabs.org>
> > > Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> > >
> > > On 09/05/2017 04:59 AM, Joakim Tjernlund wrote:
> > > > get_user() had it args reversed causing NIP to be NULL:ed instead
> > > > of fixing up the PCI access.
> > > >
> > > > Note: This still hangs my P1020 Freescale CPU hard, but at least I
> > > > get a NIP now.
> > > >
> > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > ---
> > > >   arch/powerpc/sysdev/fsl_pci.c | 2 +-
> > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/powerpc/sysdev/fsl_pci.c
> > > > b/arch/powerpc/sysdev/fsl_pci.c index 7c8b779c329a..9e64c12dff6a
> > > > 100644
> > > > --- a/arch/powerpc/sysdev/fsl_pci.c
> > > > +++ b/arch/powerpc/sysdev/fsl_pci.c
> > > > @@ -996,7 +996,7 @@ int fsl_pci_mcheck_exception(struct pt_regs
> *regs)
> > > >   	if (is_in_pci_mem_space(addr)) {
> > > >   		if (user_mode(regs)) {
> > > >   			pagefault_disable();
> > > > -			ret = get_user(regs->nip, &inst);
> > > > +			ret = get_user(inst, (__u32 __user *)regs->nip);
> > > >   			pagefault_enable();
> > > >   		} else {
> > > >   			ret = probe_kernel_address(regs->nip, inst);
> > > >
> > >
> > > Leo,
> > >
> > > Can you take a look, or assign it to someone who is familiar with this
> code?
> >
> > Acked-by: Li Yang <leoyang.li@nxp.com>
> >
> > Regards,
> > Leo
> 
> I think this is forgotten, cannot se it in Linus tree.

Hi Scott,

Could you help to review this patch and pick it up?  Thanks.

Regards,
Leo
Crystal Wood Dec. 5, 2017, 8:10 p.m. UTC | #5
On Tue, 2017-12-05 at 15:16 +0000, Leo Li wrote:
> > -----Original Message-----
> > From: Joakim Tjernlund [mailto:Joakim.Tjernlund@infinera.com]
> > Sent: Tuesday, November 21, 2017 11:17 AM
> > To: Leo Li <leoyang.li@nxp.com>; York Sun <york.sun@nxp.com>
> > Cc: linuxppc-dev@lists.ozlabs.org
> > Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> > 
> > On Wed, 2017-09-06 at 19:19 +0000, Leo Li wrote:
> > > > -----Original Message-----
> > > > From: York Sun
> > > > Sent: Wednesday, September 06, 2017 10:34 AM
> > > > To: Leo Li <leoyang.li@nxp.com>
> > > > Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>; linuxppc-dev
> > > > linuxppc- dev <linuxppc-dev@lists.ozlabs.org>
> > > > Subject: Re: [PATCH] fsl_pci: Correct fsl_pci_mcheck_exception
> > > > 
> > > > On 09/05/2017 04:59 AM, Joakim Tjernlund wrote:
> > > > > get_user() had it args reversed causing NIP to be NULL:ed instead
> > > > > of fixing up the PCI access.
> > > > > 
> > > > > Note: This still hangs my P1020 Freescale CPU hard, but at least I
> > > > > get a NIP now.
> > > > > 
> > > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > > ---
> > > > >   arch/powerpc/sysdev/fsl_pci.c | 2 +-
> > > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/arch/powerpc/sysdev/fsl_pci.c
> > > > > b/arch/powerpc/sysdev/fsl_pci.c index 7c8b779c329a..9e64c12dff6a
> > > > > 100644
> > > > > --- a/arch/powerpc/sysdev/fsl_pci.c
> > > > > +++ b/arch/powerpc/sysdev/fsl_pci.c
> > > > > @@ -996,7 +996,7 @@ int fsl_pci_mcheck_exception(struct pt_regs
> > 
> > *regs)
> > > > >   	if (is_in_pci_mem_space(addr)) {
> > > > >   		if (user_mode(regs)) {
> > > > >   			pagefault_disable();
> > > > > -			ret = get_user(regs->nip, &inst);
> > > > > +			ret = get_user(inst, (__u32 __user *)regs-
> > > > > >nip);
> > > > >   			pagefault_enable();
> > > > >   		} else {
> > > > >   			ret = probe_kernel_address(regs->nip,
> > > > > inst);
> > > > > 
> > > > 
> > > > Leo,
> > > > 
> > > > Can you take a look, or assign it to someone who is familiar with this
> > 
> > code?
> > > 
> > > Acked-by: Li Yang <leoyang.li@nxp.com>
> > > 
> > > Regards,
> > > Leo
> > 
> > I think this is forgotten, cannot se it in Linus tree.
> 
> Hi Scott,
> 
> Could you help to review this patch and pick it up?  Thanks.

Sure... In the future please CC me on patches you want me to pick up.

-Scott
diff mbox series

Patch

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 7c8b779c329a..9e64c12dff6a 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -996,7 +996,7 @@  int fsl_pci_mcheck_exception(struct pt_regs *regs)
 	if (is_in_pci_mem_space(addr)) {
 		if (user_mode(regs)) {
 			pagefault_disable();
-			ret = get_user(regs->nip, &inst);
+			ret = get_user(inst, (__u32 __user *)regs->nip);
 			pagefault_enable();
 		} else {
 			ret = probe_kernel_address(regs->nip, inst);