Page MenuHomePhabricator

C CodeProject
ActivePublic

Members (1)

Watchers

  • This project does not have any watchers.

Details

Description

C programming language

Recent Activity

Apr 5 2019

Patrick added a comment to T543: TCP ISNs and Temperature induced clock skews.

@Patrick What is the status of integration?

Apr 5 2019, 10:20 PM · C Code, security, Whonix
HulaHoop added a comment to T543: TCP ISNs and Temperature induced clock skews.

@Patrick What is the status of integration? Since we have kloak this is also a great defense to have. There is a script on there for packing as a deb:

Apr 5 2019, 8:55 PM · C Code, security, Whonix

Aug 7 2018

HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

In theory, we could make sdwdate provide a local (default) (or optional opt-in server) NTP compatible time provider. Could be useful anyhow. -> sdwdate-server No idea how hard that would be.
And then configure NTP to connect only to that local NTP server.

Aug 7 2018, 8:37 AM · Whonix, C Code, sclockadj, sdwdate
HulaHoop closed T814: find out what the most popular time synchronization daemon is / find out debian's default time synchronization daemon, a subtask of T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock, as Resolved.
Aug 7 2018, 8:16 AM · Whonix, C Code, sclockadj, sdwdate

Aug 6 2018

Patrick added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

/usr/sbin/ntpdate as far as I know doesn't accept a command line command to take an offset (or anything). It connects to remote servers in its default design.

Aug 6 2018, 8:59 PM · Whonix, C Code, sclockadj, sdwdate
Patrick added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

Yes, not readily accessible from command line.

Aug 6 2018, 8:48 PM · Whonix, C Code, sclockadj, sdwdate
HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

The easy way: calculating the offset between local time and the onion average in timesync then using ntpdate's slew option if the offset is less than 0.5s. Otherwise you tell it to step up the time immediately so that you are accurately mimicking the default behavior. However you can force slewing all the time with -B. This way you won't need to touch kernel syscalls as ntpdate should be able to do the operation for you.

Aug 6 2018, 8:28 PM · Whonix, C Code, sclockadj, sdwdate
HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

From what I understand, this code path is only relevant when timesyncd is talking directly with NTP servers and reacting to replies about deltas between local and remote times. There is no way you can call that function from the command line when using timedatectl standalone AFAICT.

Aug 6 2018, 5:46 PM · Whonix, C Code, sclockadj, sdwdate

Aug 5 2018

Patrick updated the task description for T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.
Aug 5 2018, 3:58 PM · Whonix, C Code, sclockadj, sdwdate
Patrick added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

It doesn't seem that timedatectl supports gradual time adjustment.

Aug 5 2018, 3:52 PM · Whonix, C Code, sclockadj, sdwdate

Jul 27 2018

HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

Since we are interested in ntpd's default behavior (for blending in purposes) it turns out that it performs instant clock jumps once the delta difference is excessively large otherwise its slewing algorithm would take forever to adjust the time.

Jul 27 2018, 7:33 PM · Whonix, C Code, sclockadj, sdwdate
HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

It doesn't seem that timedatectl supports gradual time adjustment. Our next best option is ntpd which can do so but cannot coexist with timedatectl - we can only run either but not both. According to popcon, ntpd is the mos widely used time daemon so its the natural choice.

Jul 27 2018, 6:22 PM · Whonix, C Code, sclockadj, sdwdate
Patrick added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

Currently time is set using gnu date (clock jump) (initial run after current boot) or sclockadj (consecutive run) (slow clock adjustment).

Jul 27 2018, 9:35 AM · Whonix, C Code, sclockadj, sdwdate

Jul 25 2018

HulaHoop added a comment to T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock.

the time could be set with timedatectl by feeding it the time with this command:

Jul 25 2018, 9:20 PM · Whonix, C Code, sclockadj, sdwdate
Patrick added a subtask for T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock: T814: find out what the most popular time synchronization daemon is / find out debian's default time synchronization daemon.
Jul 25 2018, 9:41 AM · Whonix, C Code, sclockadj, sdwdate
Patrick triaged T815: sclockadj fingerprinting defense - set time using sclockadj the same way NTP / sntp / chrony / systemd-timesyncd is changing the clock as Normal priority.
Jul 25 2018, 9:22 AM · Whonix, C Code, sclockadj, sdwdate
Patrick closed T50: systemd spams journal due to time changed by sclockadj, rewrite of sclockadj, sclockadj2 as Resolved.

sclockadj3 is done -> T686.

Jul 25 2018, 8:35 AM · C Code, python, bug, Whonix, sdwdate, sclockadj

Jul 3 2017

s.sh added a comment to T599: bindp libindp.so C code fixes.

A miracle has happened. All of https://github.com/yongboy/bindp/pull/6 was merged by upstream.

Very well. So finally they applied our patch.

Jul 3 2017, 8:55 PM · bindp, security, Whonix 14, Whonix, C Code
Patrick added a comment to T599: bindp libindp.so C code fixes.
In T599#12631, @Patrick wrote:

Notified upstream. Let's see if he replies.
bindp pull request - security fixes, debian packaging, and more:
https://github.com/yongboy/bindp/pull/6

Jul 3 2017, 1:52 PM · bindp, security, Whonix 14, Whonix, C Code

Jun 16 2017

s.sh added a comment to T599: bindp libindp.so C code fixes.

What about...?

Jun 16 2017, 8:21 PM · bindp, security, Whonix 14, Whonix, C Code
Patrick added a comment to T599: bindp libindp.so C code fixes.

What about...?

Jun 16 2017, 8:16 PM · bindp, security, Whonix 14, Whonix, C Code
s.sh added a comment to T599: bindp libindp.so C code fixes.
In T599#13705, @Patrick wrote:

Now pushed.

Jun 16 2017, 7:47 PM · bindp, security, Whonix 14, Whonix, C Code
Patrick added a comment to T599: bindp libindp.so C code fixes.

Now pushed.

Jun 16 2017, 7:01 PM · bindp, security, Whonix 14, Whonix, C Code
s.sh added a comment to T599: bindp libindp.so C code fixes.

@Patrick In the master branch the only difference in comparison to the original version that I can see is the main function at the bottom of the file. Did you not apply the changes? This code is still the previous one.

Jun 16 2017, 6:15 PM · bindp, security, Whonix 14, Whonix, C Code
Patrick closed T599: bindp libindp.so C code fixes as Resolved.

Merged into master.

Jun 16 2017, 5:41 PM · bindp, security, Whonix 14, Whonix, C Code

Jun 15 2017

JasonJAyalaP closed T650: review 30 lines of sclockadj inline C code as Resolved.
Jun 15 2017, 10:42 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 14 2017

Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

Please create a new ticket for porting to some better C function.

Jun 14 2017, 12:18 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

adjtimex, as far as I can tell, is for tuning the clock to stay accurate. It's not directly for setting a new time. I assume it's used by ntp to speed up and slow down the clock, with more code that checks on it and stops it when it reaches the right time. Reimplementing this is beyond my skill.

Jun 14 2017, 3:14 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 8 2017

JasonJAyalaP claimed T650: review 30 lines of sclockadj inline C code.
Jun 8 2017, 7:10 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

OK. It might strain my limited C knowledge, but I'll give it shot.

Jun 8 2017, 7:09 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
marmarek added a comment to T650: review 30 lines of sclockadj inline C code.

Looks like at least NTP and chrony use ntp_adjtime/adjtimex

Jun 8 2017, 1:30 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

Where is adjtime being used in existing time sync applications? NTP?
chrony? systemd-timesyncd?

Jun 8 2017, 1:22 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

Using adjtime would be a simple matter (of programming), but only has microsecond precision.

Jun 8 2017, 12:02 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 7 2017

Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

A popular existing linux tool.

Jun 7 2017, 11:25 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

Do we need precise control? The only requirement (other than working) is that it imitate an existing linux tool.

Jun 7 2017, 11:24 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
marmarek added a comment to T650: review 30 lines of sclockadj inline C code.

adjtimex/ntp_adjtime looks quite complex, but also allow precise control on how time should be adjusted. From those two, according to manual page ntp_adjtime is preferred.

Jun 7 2017, 12:42 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 6 2017

Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

It would avoid trashing logs with Time has been changed every single second, and possibly other side effects.

Jun 6 2017, 1:32 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 5 2017

marmarek added a comment to T650: review 30 lines of sclockadj inline C code.

I've left you some minor comments here: https://github.com/JasonJAyalaP/sclockadj/commit/e9bf84e3a400f7a8ef01e5f00dcefc013d0a9efe

Jun 5 2017, 10:54 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
marmarek added a comment to T650: review 30 lines of sclockadj inline C code.

What about using adjtime() syscall instead of all this? It would avoid trashing logs with Time has been changed every single second, and possibly other side effects.

Jun 5 2017, 10:44 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP assigned T650: review 30 lines of sclockadj inline C code to marmarek.
Jun 5 2017, 8:42 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Jun 3 2017

JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

@marmarek Would you be willing to review the C? It's under 75 total lines.

Jun 3 2017, 8:00 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
JasonJAyalaP added a comment to T650: review 30 lines of sclockadj inline C code.

I've rewritten the whole thing in C. It was a simple matter since we no longer need the random interval algorithm. Patrick prefers that it imitates ntpd instead of trying to hide.

Jun 3 2017, 12:43 AM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Mar 26 2017

Patrick reopened T599: bindp libindp.so C code fixes as "Open".
Mar 26 2017, 1:53 PM · bindp, security, Whonix 14, Whonix, C Code
Patrick closed T599: bindp libindp.so C code fixes as Resolved.
Mar 26 2017, 12:56 PM · bindp, security, Whonix 14, Whonix, C Code

Mar 17 2017

Patrick added a project to T650: review 30 lines of sclockadj inline C code: Whonix 14.
Mar 17 2017, 1:49 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
Patrick updated subscribers of T650: review 30 lines of sclockadj inline C code.
Mar 17 2017, 1:48 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

Yes, sclockadj runs as root. Usually sclockadj is functional.

Mar 17 2017, 1:48 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code

Mar 16 2017

s.sh added a comment to T650: review 30 lines of sclockadj inline C code.

the clock_gettime and clock_settime functions are passing zero as their first parameters and that means CLOCK_REALTIME. Firstly the process needs root privilege to touch real time clock, secondly you need to somehow run it by strace like:

Mar 16 2017, 7:37 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
Patrick added a comment to T650: review 30 lines of sclockadj inline C code.

TZ is unset since it's started as a systemd unit file.

Mar 16 2017, 7:31 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code
s.sh added a comment to T650: review 30 lines of sclockadj inline C code.

The C code itself doesn't have any CPU intensive instruction, if the problem is really what is written as inline C, I suspect the issue is either with

clock_gettime(0, &tps)

or

Mar 16 2017, 6:29 PM · Whonix 14, Whonix, sclockadj, sdwdate, C Code