lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1422.172.50.1.13.1185460753.squirrel@172.19.0.2>
Date:	Thu, 26 Jul 2007 23:39:13 +0900 (JST)
From:	fernando@....ntt.co.jp
To:	"Dmitry Torokhov" <dmitry.torokhov@...il.com>
Cc:	Fernando Luis Vázquez Cao 
	<fernando@....ntt.co.jp>, linux-kernel@...r.kernel.org,
	vojtech@...e.cz, akpm@...ux-foundation.org
Subject: Re: [PATCH] fix return value of i8042_aux_test_irq

On Thu, July 26, 2007 10:54 pm, Dmitry Torokhov wrote:
> Hi,
>
> On 7/26/07, Fernando Luis Vázquez Cao <fernando@....ntt.co.jp> wrote:
>> I made an interesting finding while testing the two patches below.
>>
>> http://lkml.org/lkml/2007/7/19/685
>> http://lkml.org/lkml/2007/7/19/687
>>
>> These patches modify the traditional CONFIG_DEBUG_KERNEL in such a way
>> that the request_irq prints a warning if after calling the handler it
>> returned IRQ_HANDLED .
>>
>> The code looks like this:
>>
>> int request_irq(unsigned int irq, irq_handler_t handler,
>>                unsigned long irqflags, const char *devname, void
>> *dev_id)
>> .....
>>        if (irqflags & IRQF_DISABLED) {
>>                unsigned long flags;
>>
>>                local_irq_save(flags);
>>                retval = handler(irq, dev_id);
>>                local_irq_restore(flags);
>>        } else
>>                retval = handler(irq, dev_id);
>>        if (retval == IRQ_HANDLED) {
>>                printk(KERN_WARNING
>>                       "%s (IRQ %d) handled a spurious interrupt\n",
>>                       devname, irq);
>>        }
>> .....
>>
>> I discovered that i8042_aux_test_irq handles the "fake" interrupt,
>> which, in principle, is not correct because it obviously isn't a real
>> interrupt and it could have been a spurious interrupt as well.
>>
>> The problem is that the interrupt handler unconditionally returns IRQ
>> handled, which does not seem correct. Anyway I am not very familiar with
>> this code so I may be missing the whole point. I would appreciate your
>> comments on this.
>>
>
> The handler does handle the interrupt - both status and data registers
> are read so from the keyboard controller point of view the interrupt
> has been handled even if we happen to discard the data. As far as I
> know IRQ12 is never shared by BIOS... Vojtech, do you remember why we
> request IRQ12 with IRQF_SHARED?
Hi Dmitry,

Thank you for the feedback.

Isn't there a way to tell whether the interrupt came from a different
source? If it is not possible the IRQF_SHARED flag does not seem
appropriate to me. If we return IRQ_HANDLED unconditionally we may end up
preventing the right interrupt handler from executing. Am I missing
something?

Fernando

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ