mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [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] 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

* 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

* [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

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®