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: <20090512094544.GE32292@elte.hu>
Date:	Tue, 12 May 2009 11:45:44 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	"Cihula, Joseph" <joseph.cihula@...el.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"andi@...stfloor.org" <andi@...stfloor.org>,
	"chrisw@...s-sol.org" <chrisw@...s-sol.org>,
	"jmorris@...ei.org" <jmorris@...ei.org>,
	"jbeulich@...ell.com" <jbeulich@...ell.com>,
	"peterm@...hat.com" <peterm@...hat.com>,
	"Wei, Gang" <gang.wei@...el.com>,
	"Wang, Shane" <shane.wang@...el.com>
Subject: Re: [RFC v3][PATCH 2/2] intel_txt: Intel(R) TXT and tboot kernel
	support


* Cihula, Joseph <joseph.cihula@...el.com> wrote:

> > From: Ingo Molnar [mailto:mingo@...e.hu]
> > Sent: Friday, May 08, 2009 2:58 AM
> >
> > * Joseph Cihula <joseph.cihula@...el.com> wrote:
> >
> > > +   /* if we're being called before the 1:1 mapping is set up then just
> > > +      return and let the normal shutdown happen; this should only be
> > > +      due to very early panic() */
> > > +   if (!tboot_pg_dir)
> > > +           return;
> >
> > Please use the customary comment style:
> >
> >   /*
> >    * Comment .....
> >    * ...... goes here:
> >    */
> >
> > specified in Documentation/CodingStyle. Please fix this in all other
> > multi-line comments in your patch as well.
> 
> Will do.
> 
> > > +   if (shutdown_type == TB_SHUTDOWN_S3) {
> > > +           tboot_shared->num_mac_regions = 3;
> > > +           /* S3 resume code */
> > > +           tboot_shared->mac_regions[0].start =
> > > +                   PFN_PHYS(PFN_DOWN(acpi_wakeup_address));
> > > +           tboot_shared->mac_regions[0].size =
> > > +                   PFN_UP(WAKEUP_SIZE) << PAGE_SHIFT;
> > > +           /* AP trampoline code */
> > > +           tboot_shared->mac_regions[1].start =
> > > +                   PFN_PHYS(PFN_DOWN(virt_to_phys(trampoline_base)));
> > > +           tboot_shared->mac_regions[1].size =
> > > +                   PFN_UP(TRAMPOLINE_SIZE) << PAGE_SHIFT;
> > > +           /* kernel code + data + bss */
> > > +           tboot_shared->mac_regions[2].start =
> > > +                   PFN_PHYS(PFN_DOWN(virt_to_phys(&_text)));
> > > +           tboot_shared->mac_regions[2].size =
> > > +                   PFN_PHYS(PFN_UP(virt_to_phys(&_end))) -
> > > +                   PFN_PHYS(PFN_DOWN(virt_to_phys(&_text)));
> > > +   }
> > > +
> > > +   tboot_shared->shutdown_type = shutdown_type;
> > > +
> > > +   switch_to_tboot_pt();
> > > +
> > > +   ((void(*)(void))(unsigned long)tboot_shared->shutdown_entry)();
> >
> > shutdown_entry should probably have a proper function pointer 
> > type, to avoid this ugliness.
> 
> Since pointer types are different lengths depending on whether it 
> is a 32b or 64b build environment, that would not allow a 
> separately-compiled tboot to be used with both 32b and 64b 
> kernels.

then the sign extension is done slightly wrong/unclean i guess. 
Wouldnt:

> > > +   ((void(*)(void))(long)tboot_shared->shutdown_entry)();

be better? Or is shutdown_entry always mapped into [0..2GB) on 
64-bit? Even then, not sign-extending RIP addresses is wrong and 
invites bugs/restrictions.

	Ingo
--
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