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] [day] [month] [year] [list]
Message-ID: <54882C7F.4010901@arm.com>
Date:	Wed, 10 Dec 2014 11:20:31 +0000
From:	Marc Zyngier <marc.zyngier@....com>
To:	"Yun Wu (Abel)" <wuyun.wu@...wei.com>
CC:	Thomas Gleixner <tglx@...utronix.de>,
	Jason Cooper <jason@...edaemon.net>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Yingjoe Chen <yingjoe.chen@...iatek.com>,
	Will Deacon <Will.Deacon@....com>,
	Catalin Marinas <Catalin.Marinas@....com>,
	Mark Rutland <Mark.Rutland@....com>,
	"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
	Robert Richter <robert.richter@...iumnetworks.com>
Subject: Re: [PATCH v3 04/13] irqchip: GICv3: ITS command queue

On 10/12/14 03:03, Yun Wu (Abel) wrote:
> On 2014/11/24 22:35, Marc Zyngier wrote:
> 
> [...]
> 
>> +static struct its_collection *its_build_mapd_cmd(struct its_cmd_block *cmd,
>> +                                              struct its_cmd_desc *desc)
>> +{
>> +     unsigned long itt_addr;
>> +     u8 size = order_base_2(desc->its_mapd_cmd.dev->nr_ites);
> 
> If @nr_ites is 1, then @size becomes 0, and... (see below)
> 
>> +
>> +     itt_addr = virt_to_phys(desc->its_mapd_cmd.dev->itt);
>> +     itt_addr = ALIGN(itt_addr, ITS_ITT_ALIGN);
>> +
>> +     its_encode_cmd(cmd, GITS_CMD_MAPD);
>> +     its_encode_devid(cmd, desc->its_mapd_cmd.dev->device_id);
>> +     its_encode_size(cmd, size - 1);
> 
> here (size - 1) becomes the value of ~0, which will exceed the maximum
> supported bits of identifier.

Well, the problem is that nr_ites should never be 1, as it effectively
means "don't use any bit to index the ITE". And it also means we cannot
have an ITT that's not a strict power of two.

So while this is indeed a bug, the root of the problem is elsewhere.

I'll cook a fix, thanks for the report.

	M.
-- 
Jazz is not dead. It just smells funny...
--
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