All of lore.kernel.org
 help / color / mirror / Atom feed
* user-space unaligned accesses
@ 2003-10-08 14:42 Bjorn Helgaas
  2003-10-08 21:46 ` Grant Grundler
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2003-10-08 14:42 UTC (permalink / raw)
  To: linux-ia64

I got this from somebody at Red Hat.  Anybody want to comment on it?


-------------------------------------------------------
...
The ia64 architecture does a tty_write
on a userspace unaligned access. Not only is this extremenly annoying,
it's also very broken since the tty may well be suspended etc etc.
Doing a printk on such an access by default is very broken already,
lets not make it worse



--- linux/arch/ia64/kernel/unaligned.c~	2003-09-30 11:04:08.000000000 +0200
+++ linux/arch/ia64/kernel/unaligned.c	2003-09-30 11:04:08.000000000 +0200
@@ -1340,12 +1340,6 @@
 			len = sprintf(buf, "%s(%d): unaligned access to 0x%016lx, "
 				      "ip=0x%016lx\n\r", current->comm, current->pid,
 				      ifa, regs->cr_iip + ipsr->ri);
-			/*
-			 * Don't call tty_write_message() if we're in the kernel; we might
-			 * be holding locks...
-			 */
-			if (user_mode(regs))
-				tty_write_message(current->tty, buf);
 			buf[len-1] = '\0';	/* drop '\r' */
 			printk(KERN_WARNING "%s", buf);	/* watch for command names containing %s */
 		}





-------------------------------------------------------


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
@ 2003-10-08 21:46 ` Grant Grundler
  2003-10-08 22:54 ` Bjorn Helgaas
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Grant Grundler @ 2003-10-08 21:46 UTC (permalink / raw)
  To: linux-ia64

On Wed, Oct 08, 2003 at 08:42:00AM -0600, Bjorn Helgaas wrote:
> ...
> The ia64 architecture does a tty_write
> on a userspace unaligned access. Not only is this extremenly annoying,
> it's also very broken since the tty may well be suspended etc etc.
> Doing a printk on such an access by default is very broken already,
> lets not make it worse

This was beat to death on linux-ia64 already where davidm and davem
decided to disagree on the utility of printing unaligned accesses
to the tty.

davidm wrote:
| At the moment, there are two ways to control the unaligned message printing:
| 
|  - use the dmesg command to lower the printing threshold below KERN_WARNING
|     ("dmesg -n4", IIRC)
| 
|  - use prctl --unalign=silent to turn off unaligned printing for a
|    particular task and its children

Running prctl on relevant gettys at boot time would have the same effect.

grant

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
  2003-10-08 21:46 ` Grant Grundler
@ 2003-10-08 22:54 ` Bjorn Helgaas
  2003-10-08 23:36 ` David Mosberger
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2003-10-08 22:54 UTC (permalink / raw)
  To: linux-ia64

On Wednesday 08 October 2003 3:46 pm, Grant Grundler wrote:
> On Wed, Oct 08, 2003 at 08:42:00AM -0600, Bjorn Helgaas wrote:
> > ...
> > The ia64 architecture does a tty_write
> > on a userspace unaligned access. Not only is this extremenly annoying,
> > it's also very broken since the tty may well be suspended etc etc.
> > Doing a printk on such an access by default is very broken already,
> > lets not make it worse
> 
> This was beat to death on linux-ia64 already where davidm and davem
> decided to disagree on the utility of printing unaligned accesses
> to the tty.

I thought that discussion was mainly about messages printed by the
kernel using printk.  The Red Hat concern was specifically about
writing to the user tty.

> davidm wrote:
> | At the moment, there are two ways to control the unaligned message printing:
> | 
> |  - use the dmesg command to lower the printing threshold below KERN_WARNING
> |     ("dmesg -n4", IIRC)
> | 
> |  - use prctl --unalign=silent to turn off unaligned printing for a
> |    particular task and its children
> 
> Running prctl on relevant gettys at boot time would have the same effect.
> 
> grant


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
  2003-10-08 21:46 ` Grant Grundler
  2003-10-08 22:54 ` Bjorn Helgaas
@ 2003-10-08 23:36 ` David Mosberger
  2003-10-09 13:53 ` Bjorn Helgaas
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2003-10-08 23:36 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Wed, 8 Oct 2003 16:54:07 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:

  Bjorn> On Wednesday 08 October 2003 3:46 pm, Grant Grundler wrote:
  >> On Wed, Oct 08, 2003 at 08:42:00AM -0600, Bjorn Helgaas wrote:
  >> > ...
  >> > The ia64 architecture does a tty_write
  >> > on a userspace unaligned access. Not only is this extremenly annoying,
  >> > it's also very broken since the tty may well be suspended etc etc.
  >> > Doing a printk on such an access by default is very broken already,
  >> > lets not make it worse

  >> This was beat to death on linux-ia64 already where davidm and davem
  >> decided to disagree on the utility of printing unaligned accesses
  >> to the tty.

  Bjorn> I thought that discussion was mainly about messages printed by the
  Bjorn> kernel using printk.

Correct.

  Bjorn> The Red Hat concern was specifically about writing to the
  Bjorn> user tty.

There are users (other than me ;-) that find the messages helpful.  If
there is something wrong about the current printing code, I'd rather
fix that instead (and as Grant pointed out, if someone doesn't like
the message, prctl can be used to turn it off).  The mail you
forwarded was unclear on whether there was a real security/correctness
bug.  If there is, please ask for/provide details.

	--david

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
                   ` (2 preceding siblings ...)
  2003-10-08 23:36 ` David Mosberger
@ 2003-10-09 13:53 ` Bjorn Helgaas
  2003-10-11 23:22 ` Micah Parrish
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2003-10-09 13:53 UTC (permalink / raw)
  To: linux-ia64

On Wednesday 08 October 2003 5:36 pm, David Mosberger wrote:
>   Bjorn> The Red Hat concern was specifically about writing to the
>   Bjorn> user tty.
> 
> There are users (other than me ;-) that find the messages helpful.  If
> there is something wrong about the current printing code, I'd rather
> fix that instead (and as Grant pointed out, if someone doesn't like
> the message, prctl can be used to turn it off).  The mail you
> forwarded was unclear on whether there was a real security/correctness
> bug.  If there is, please ask for/provide details.

I did ask Red Hat to post the patch themselves.  I just posted it to
make sure it didn't get completely dropped when I cleaned out my inbox.
Perhaps this will provide an opening for them to give more details :-)

Bjorn


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
                   ` (3 preceding siblings ...)
  2003-10-09 13:53 ` Bjorn Helgaas
@ 2003-10-11 23:22 ` Micah Parrish
  2003-10-13 23:56 ` David Mosberger
  2003-10-13 23:59 ` Duraid Madina
  6 siblings, 0 replies; 8+ messages in thread
From: Micah Parrish @ 2003-10-11 23:22 UTC (permalink / raw)
  To: linux-ia64

>The ia64 architecture does a tty_write
>on a userspace unaligned access. Not only is this extremenly annoying,
>it's also very broken since the tty may well be suspended etc etc.
>Doing a printk on such an access by default is very broken already,
>lets not make it worse


I too see no reason to do a tty_write here.  Most other error messages
of the same level (KERN_WARNING) do not do a tty_write, and syslogd can
be configured to write KERN_WARNING messages to the console or anywhere
else if you care.  Smells like old debug code, and looks messy to the
end user.

-micah.parrish@hp.com


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
                   ` (4 preceding siblings ...)
  2003-10-11 23:22 ` Micah Parrish
@ 2003-10-13 23:56 ` David Mosberger
  2003-10-13 23:59 ` Duraid Madina
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2003-10-13 23:56 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sat, 11 Oct 2003 17:22:48 -0600, Micah Parrish <micah.parrish@hp.com> said:

  Micah> Smells like old debug code,

Not at all.

  Micah> and looks messy to the end user.

Distributors have the choice to turn it off with prctl.

	--david

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: user-space unaligned accesses
  2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
                   ` (5 preceding siblings ...)
  2003-10-13 23:56 ` David Mosberger
@ 2003-10-13 23:59 ` Duraid Madina
  6 siblings, 0 replies; 8+ messages in thread
From: Duraid Madina @ 2003-10-13 23:59 UTC (permalink / raw)
  To: linux-ia64

David Mosberger wrote:
> 
>   Micah> and looks messy to the end user.
> 
> Distributors have the choice to turn it off with prctl.

It is pretty useless though. What we need is unaligned/FPSWA-per-second 
gkrellm plugin. 8)

	Duraid

(just kidding)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-13 23:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-08 14:42 user-space unaligned accesses Bjorn Helgaas
2003-10-08 21:46 ` Grant Grundler
2003-10-08 22:54 ` Bjorn Helgaas
2003-10-08 23:36 ` David Mosberger
2003-10-09 13:53 ` Bjorn Helgaas
2003-10-11 23:22 ` Micah Parrish
2003-10-13 23:56 ` David Mosberger
2003-10-13 23:59 ` Duraid Madina

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.