* [PATCH] vgaarb: fix typo deference when copying from userspace @ 2010-01-12 17:58 Tiago Vignatti 2010-01-12 17:58 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Tiago Vignatti 2010-01-12 18:56 ` [PATCH] vgaarb: fix typo deference when copying from userspace Helge Deller 0 siblings, 2 replies; 6+ messages in thread From: Tiago Vignatti @ 2010-01-12 17:58 UTC (permalink / raw) To: Dave Airlie Cc: Jesse Barnes, Benjamin Herrenschmidt, Paulo R. Zanoni, Henry Zhao, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org, Tiago Vignatti From: Brad Spengler <spender@grsecurity.net> libpciaccess is not triggering such code though. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> --- Andy Getzendanner tried to fix this, but he seems did a wrong approach: http://marc.info/?l=linux-kernel&m=126112173704466 Andy: please test (and put your tag review!) this one instead. Thanks. drivers/gpu/vga/vgaarb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 1ac0c93..2f6cf69 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -961,7 +961,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, remaining -= 7; pr_devel("client 0x%p called 'target'\n", priv); /* if target is default */ - if (!strncmp(buf, "default", 7)) + if (!strncmp(curr_pos, "default", 7)) pdev = pci_dev_get(vga_default_device()); else { if (!vga_pci_str_to_vars(curr_pos, remaining, -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value 2010-01-12 17:58 [PATCH] vgaarb: fix typo deference when copying from userspace Tiago Vignatti @ 2010-01-12 17:58 ` Tiago Vignatti 2010-01-12 17:58 ` [PATCH-again] vgaarb: use MIT license Tiago Vignatti 2010-01-13 4:05 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Henry Zhao 2010-01-12 18:56 ` [PATCH] vgaarb: fix typo deference when copying from userspace Helge Deller 1 sibling, 2 replies; 6+ messages in thread From: Tiago Vignatti @ 2010-01-12 17:58 UTC (permalink / raw) To: Dave Airlie Cc: Jesse Barnes, Benjamin Herrenschmidt, Paulo R. Zanoni, Henry Zhao, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org, Tiago Vignatti From: Henry Zhao <Henry.Zhao@Sun.COM> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> --- Henry, can you Signed-off-by there? drivers/gpu/vga/vgaarb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 2f6cf69..0f5f64d 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -935,7 +935,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, goto done; } - if (vga_tryget(pdev, io_state)) { + if (!vga_tryget(pdev, io_state)) { /* Update the client's locks lists... */ for (i = 0; i < MAX_USER_CARDS; i++) { if (priv->cards[i].pdev == pdev) { -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH-again] vgaarb: use MIT license 2010-01-12 17:58 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Tiago Vignatti @ 2010-01-12 17:58 ` Tiago Vignatti 2010-01-14 15:07 ` Paulo Zanoni 2010-01-13 4:05 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Henry Zhao 1 sibling, 1 reply; 6+ messages in thread From: Tiago Vignatti @ 2010-01-12 17:58 UTC (permalink / raw) To: Dave Airlie Cc: Jesse Barnes, Benjamin Herrenschmidt, Paulo R. Zanoni, Henry Zhao, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org, Tiago Vignatti Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> --- Hi. All authors already decided about such change. So I'd please ask (again) that you put the s-o-b tag here. Thanks. drivers/gpu/vga/vgaarb.c | 26 +++++++++++++++++++++++--- include/linux/vgaarb.h | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 0f5f64d..53dd628 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -1,12 +1,32 @@ /* - * vgaarb.c + * vgaarb.c: Implements the VGA arbitration. For details refer to + * Documentation/vgaarbiter.txt + * * * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> * - * Implements the VGA arbitration. For details refer to - * Documentation/vgaarbiter.txt + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS + * IN THE SOFTWARE. + * */ #include <linux/module.h> diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index 2dfaa29..c9a9759 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h @@ -5,6 +5,27 @@ * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS + * IN THE SOFTWARE. + * */ #ifndef LINUX_VGA_H -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH-again] vgaarb: use MIT license 2010-01-12 17:58 ` [PATCH-again] vgaarb: use MIT license Tiago Vignatti @ 2010-01-14 15:07 ` Paulo Zanoni 0 siblings, 0 replies; 6+ messages in thread From: Paulo Zanoni @ 2010-01-14 15:07 UTC (permalink / raw) To: Tiago Vignatti Cc: Dave Airlie, Jesse Barnes, Benjamin Herrenschmidt, Henry Zhao, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org On Tue, Jan 12, 2010 at 3:58 PM, Tiago Vignatti <tiago.vignatti@nokia.com> wrote: > Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Paulo R. Zanoni <przanoni@gmail.com> > --- > Hi. All authors already decided about such change. So I'd please ask (again) > that you put the s-o-b tag here. Thanks. > > drivers/gpu/vga/vgaarb.c | 26 +++++++++++++++++++++++--- > include/linux/vgaarb.h | 21 +++++++++++++++++++++ > 2 files changed, 44 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c > index 0f5f64d..53dd628 100644 > --- a/drivers/gpu/vga/vgaarb.c > +++ b/drivers/gpu/vga/vgaarb.c > @@ -1,12 +1,32 @@ > /* > - * vgaarb.c > + * vgaarb.c: Implements the VGA arbitration. For details refer to > + * Documentation/vgaarbiter.txt > + * > * > * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> > * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> > * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> > * > - * Implements the VGA arbitration. For details refer to > - * Documentation/vgaarbiter.txt > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > + * DEALINGS > + * IN THE SOFTWARE. > + * > */ > > #include <linux/module.h> > diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h > index 2dfaa29..c9a9759 100644 > --- a/include/linux/vgaarb.h > +++ b/include/linux/vgaarb.h > @@ -5,6 +5,27 @@ > * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> > * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> > * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > + * DEALINGS > + * IN THE SOFTWARE. > + * > */ > > #ifndef LINUX_VGA_H > -- > 1.6.0.4 > > -- Paulo R. Zanoni ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value 2010-01-12 17:58 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Tiago Vignatti 2010-01-12 17:58 ` [PATCH-again] vgaarb: use MIT license Tiago Vignatti @ 2010-01-13 4:05 ` Henry Zhao 1 sibling, 0 replies; 6+ messages in thread From: Henry Zhao @ 2010-01-13 4:05 UTC (permalink / raw) To: Tiago Vignatti Cc: Dave Airlie, Jesse Barnes, Benjamin Herrenschmidt, Paulo R. Zanoni, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org Signed-off-by: Henry Zhao <Henry.Zhao@Sun.COM> Tiago Vignatti wrote: > From: Henry Zhao <Henry.Zhao@Sun.COM> > > Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> > --- > Henry, can you Signed-off-by there? > > drivers/gpu/vga/vgaarb.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c > index 2f6cf69..0f5f64d 100644 > --- a/drivers/gpu/vga/vgaarb.c > +++ b/drivers/gpu/vga/vgaarb.c > @@ -935,7 +935,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, > goto done; > } > > - if (vga_tryget(pdev, io_state)) { > + if (!vga_tryget(pdev, io_state)) { > /* Update the client's locks lists... */ > for (i = 0; i < MAX_USER_CARDS; i++) { > if (priv->cards[i].pdev == pdev) { > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] vgaarb: fix typo deference when copying from userspace 2010-01-12 17:58 [PATCH] vgaarb: fix typo deference when copying from userspace Tiago Vignatti 2010-01-12 17:58 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Tiago Vignatti @ 2010-01-12 18:56 ` Helge Deller 1 sibling, 0 replies; 6+ messages in thread From: Helge Deller @ 2010-01-12 18:56 UTC (permalink / raw) To: Tiago Vignatti Cc: Dave Airlie, Jesse Barnes, Benjamin Herrenschmidt, Paulo R. Zanoni, Henry Zhao, Andy Getzendanner, Brad Spengler, dri-devel@lists.sf.net, linux-kernel@vger.kernel.org, linux-parisc On 01/12/2010 06:58 PM, Tiago Vignatti wrote: > From: Brad Spengler<spender@grsecurity.net> > > libpciaccess is not triggering such code though. > > Signed-off-by: Tiago Vignatti<tiago.vignatti@nokia.com> I can confirm, that this patch is needed to prevent a kernel segfault with 2.6.33-rc3 on the parisc/hppa architecture. Tested-by: Helge Deller <deller@gmx.de> > --- > Andy Getzendanner tried to fix this, but he seems did a wrong approach: > http://marc.info/?l=linux-kernel&m=126112173704466 > > Andy: please test (and put your tag review!) this one instead. Thanks. > > drivers/gpu/vga/vgaarb.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c > index 1ac0c93..2f6cf69 100644 > --- a/drivers/gpu/vga/vgaarb.c > +++ b/drivers/gpu/vga/vgaarb.c > @@ -961,7 +961,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, > remaining -= 7; > pr_devel("client 0x%p called 'target'\n", priv); > /* if target is default */ > - if (!strncmp(buf, "default", 7)) > + if (!strncmp(curr_pos, "default", 7)) > pdev = pci_dev_get(vga_default_device()); > else { > if (!vga_pci_str_to_vars(curr_pos, remaining, ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-14 15:07 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-01-12 17:58 [PATCH] vgaarb: fix typo deference when copying from userspace Tiago Vignatti 2010-01-12 17:58 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Tiago Vignatti 2010-01-12 17:58 ` [PATCH-again] vgaarb: use MIT license Tiago Vignatti 2010-01-14 15:07 ` Paulo Zanoni 2010-01-13 4:05 ` [PATCH] vgaarb: fix trylock behaviour accordingly vga_tryget return value Henry Zhao 2010-01-12 18:56 ` [PATCH] vgaarb: fix typo deference when copying from userspace Helge Deller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox