Monday, May 28, 2018

Digest for comp.lang.c++@googlegroups.com - 4 updates in 2 topics

scott@slp53.sl.home (Scott Lurndal): May 28 01:23PM


>> flushing the cache is a side effect of the exception, thus a covert
>> channel - useful to determine valid kernel addresses, for example.
 
>You get an exception when you access a page that you're not allowed to.
 
Which, of course, takes longer than an access that doesn't get
an exception. Covert channel #1.
 
 
>System flushes the cache.
 
Which, of course, changes the timing of the code that executes following
the flush. Covert channel #2.
 
 
>There is no way to determine whether this is an illegal address, or a
>forbidden address - unless of course the system chooses to tell you.
 
Doesn't matter. It's information that can be used.
 
 
>What will you do with the list of valid kernel addresses anyway? It's
>their contents that are interesting.
 
What the list of valid kernel addresses provides is information. Useful
information to those attempting to subvert the kernel; and certainly
key to the exploits enabled by Spectre/Meltdown. Amongst other things,
it allows the attacker to subvert KASLR.
Robert Wessel <robertwessel2@yahoo.com>: May 28 11:36AM -0500

On Sun, 27 May 2018 21:26:15 +0100, Vir Campestris
 
>Without C, yes. Or Fortran, Cobol, Algol... maybe APL would like a
>properly parallel machine, but I can't think of another language of that
>vintage that isn't essentially single threaded.
 
 
IBM's PL/1 supporting threading (with a fork/join sort of mechanism on
subroutine calls) in 1966 (and still does), although that was not a
feature that made it into the standard.
Juha Nieminen <nospam@thanks.invalid>: May 28 09:29AM

This compiles ok:
 
//------------------------------------------------------------
struct Test
{
template<typename T>
friend Test friendFunc(T);
 
private:
int value;
};
 
template<typename T>
Test friendFunc(T value)
{
Test test;
test.value = value;
return test;
}
 
int main() { friendFunc(10); }
//------------------------------------------------------------
 
However, this does not:
 
//------------------------------------------------------------
template<typename R>
struct Test
{
template<typename T>
friend Test<R> friendFunc(T);
 
private:
int value;
};
 
template<typename T>
Test<T> friendFunc(T value)
{
Test<T> test;
test.value = value;
return test;
}
 
int main() { friendFunc(10); }
//------------------------------------------------------------
 
It complains that the member variable is private.
 
How to make the second example compile as well?
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: May 28 11:07AM +0100

On Mon, 28 May 2018 09:29:04 -0000 (UTC)
> //------------------------------------------------------------
 
> It complains that the member variable is private.
 
> How to make the second example compile as well?
 
If you change the friendship declaration of friendFunc in Test to:
 
template<typename T> friend Test<T> friendFunc(T);
 
so that it matches the definition, it will compile. The templatizing
of Test on R is pointless and presumably you really want the 'value'
member to be of type R?
 
Chris
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: