* [PATCH] tty/vt: don't set font mappings on vc not supporting this
@ 2014-10-02 13:34 Imre Deak
0 siblings, 0 replies; 4+ messages in thread
From: Imre Deak @ 2014-10-02 13:34 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-kernel
We can call this function for a dummy console that doesn't support
setting the font mapping, which will result in a null ptr BUG. So check
for this case and return error for consoles w/o font mapping support.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=59321
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/tty/vt/consolemap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 610b720..59b25e0 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -539,6 +539,12 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
/* Save original vc_unipagdir_loc in case we allocate a new one */
p = *vc->vc_uni_pagedir_loc;
+
+ if (!p) {
+ err = -EINVAL;
+
+ goto out_unlock;
+ }
if (p->refcount > 1) {
int j, k;
@@ -623,6 +629,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
set_inverse_transl(vc, p, i); /* Update inverse translations */
set_inverse_trans_unicode(vc, p);
+out_unlock:
console_unlock();
return err;
}
--
1.8.4
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 3.14 00/18] 3.14.52-stable review
@ 2015-09-12 15:55 Greg Kroah-Hartman
2015-09-13 6:03 ` [PATCH] tty/vt: don't set font mappings on vc not supporting this Sudip Mukherjee
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-09-12 15:55 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: linux-kernel, torvalds, akpm, linux, shuah.kh, stable
On Sat, Sep 12, 2015 at 04:37:51PM +0530, Sudip Mukherjee wrote:
> On Fri, Sep 11, 2015 at 03:49:18PM -0700, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 3.14.52 release.
> > There are 18 patches in this series, all will be posted as a response
> > to this one. If anyone has any issues with these being applied, please
> > let me know.
> >
> > Responses should be made by Sun Sep 13 22:46:12 UTC 2015.
> > Anything received after that time might be too late.
>
> Compiled and booted on x86_32. dmesg showd:
> kmemleak: 47 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
>
> /sys/kernel/debug/kmemleak showed lots of:
> unreferenced object 0xf3204fb0 (size 1024):
> comm "setfont", pid 326, jiffies 4294897405 (age 2079.568s)
> hex dump (first 32 bytes):
> a3 00 a0 25 92 25 b1 00 a2 00 a5 00 a9 00 ae 00 ...%.%..........
> c6 00 dd 00 e6 00 52 01 53 01 78 01 14 20 20 20 ......R.S.x..
> backtrace:
> [<c1637adc>] kmemleak_alloc+0x3c/0xa0
> [<c116845f>] kmem_cache_alloc_trace+0x9f/0x140
> [<c13d3caa>] set_inverse_trans_unicode.isra.0+0x10a/0x120
> [<c13d4672>] con_set_unimap+0x1b2/0x230
> [<c13cee27>] vt_ioctl+0x857/0x1020
> [<c13c40e3>] tty_ioctl+0x233/0xa40
> [<c1188e82>] do_vfs_ioctl+0x2e2/0x540
> [<c1189140>] SyS_ioctl+0x60/0x90
> [<c164f086>] sysenter_after_call+0x0/0x21
> [<ffffffff>] 0xffffffff
>
> 9e326f78713a ("tty/vt: don't set font mappings on vc not supporting this")
> solved the error for me. 9e326f78713a is marked for stable also and it
> will not apply cleanly.
So this isn't a new thing at all, can you provide a backport that worked
for you so I can queue it up for the next round?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] tty/vt: don't set font mappings on vc not supporting this
2015-09-12 15:55 [PATCH 3.14 00/18] 3.14.52-stable review Greg Kroah-Hartman
@ 2015-09-13 6:03 ` Sudip Mukherjee
2015-09-21 1:40 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-09-13 6:03 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Sudip Mukherjee, stable
commit 9e326f78713a4421fe11afc2ddeac07698fac131 upstream
We can call this function for a dummy console that doesn't support
setting the font mapping, which will result in a null ptr BUG. So check
for this case and return error for consoles w/o font mapping support.
Cc: <stable@vger.kernel.org> # 3.14.x
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
backporting for the first time so not exactly sure if the format is ok.
drivers/tty/vt/consolemap.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 2978ca5..08d36e4 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -540,6 +540,11 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
/* Save original vc_unipagdir_loc in case we allocate a new one */
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
+
+ if (!p) {
+ err = -EINVAL;
+ goto out_unlock;
+ }
if (p->readonly) {
console_unlock();
return -EIO;
@@ -633,6 +638,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
set_inverse_transl(vc, p, i); /* Update inverse translations */
set_inverse_trans_unicode(vc, p);
+out_unlock:
console_unlock();
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] tty/vt: don't set font mappings on vc not supporting this
2015-09-13 6:03 ` [PATCH] tty/vt: don't set font mappings on vc not supporting this Sudip Mukherjee
@ 2015-09-21 1:40 ` Greg Kroah-Hartman
2015-09-21 4:58 ` Sudip Mukherjee
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-09-21 1:40 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: linux-kernel, stable
On Sun, Sep 13, 2015 at 11:33:51AM +0530, Sudip Mukherjee wrote:
> commit 9e326f78713a4421fe11afc2ddeac07698fac131 upstream
>
> We can call this function for a dummy console that doesn't support
> setting the font mapping, which will result in a null ptr BUG. So check
> for this case and return error for consoles w/o font mapping support.
>
> Cc: <stable@vger.kernel.org> # 3.14.x
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> backporting for the first time so not exactly sure if the format is ok.
You need to keep the original authorship of the patch around, as well as
their signed-off-by information. Also, you didn't backport it
identically:
>
> drivers/tty/vt/consolemap.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
> index 2978ca5..08d36e4 100644
> --- a/drivers/tty/vt/consolemap.c
> +++ b/drivers/tty/vt/consolemap.c
> @@ -540,6 +540,11 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
>
> /* Save original vc_unipagdir_loc in case we allocate a new one */
> p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
> +
> + if (!p) {
> + err = -EINVAL;
> + goto out_unlock;
The original has a blank line between these two lines, why not keep it?
I'll fix it up, but be a bit more careful next time please.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] tty/vt: don't set font mappings on vc not supporting this
2015-09-21 1:40 ` Greg Kroah-Hartman
@ 2015-09-21 4:58 ` Sudip Mukherjee
0 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2015-09-21 4:58 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable
On Sun, Sep 20, 2015 at 06:40:15PM -0700, Greg Kroah-Hartman wrote:
> On Sun, Sep 13, 2015 at 11:33:51AM +0530, Sudip Mukherjee wrote:
> > commit 9e326f78713a4421fe11afc2ddeac07698fac131 upstream
<snip>
> > Cc: <stable@vger.kernel.org> # 3.14.x
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> >
> > backporting for the first time so not exactly sure if the format is ok.
>
> You need to keep the original authorship of the patch around, as well as
> their signed-off-by information. Also, you didn't backport it
> identically:
>
<snip>
> > +
> > + if (!p) {
> > + err = -EINVAL;
> > + goto out_unlock;
>
> The original has a blank line between these two lines, why not keep it?
>
> I'll fix it up, but be a bit more careful next time please.
Sure, next time you will have no complaints about this.
regards
sudip
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-21 4:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 13:34 [PATCH] tty/vt: don't set font mappings on vc not supporting this Imre Deak
2015-09-12 15:55 [PATCH 3.14 00/18] 3.14.52-stable review Greg Kroah-Hartman
2015-09-13 6:03 ` [PATCH] tty/vt: don't set font mappings on vc not supporting this Sudip Mukherjee
2015-09-21 1:40 ` Greg Kroah-Hartman
2015-09-21 4:58 ` Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®