Open Source Continuous File Synchronization
  • Go 84.6%
  • HTML 7.1%
  • JavaScript 5.7%
  • Shell 1.8%
  • CSS 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andrew Gunnerson a0171e3a9b
build: allow inotify on Android amd64 (ref #8710) (#10783)
ad0044fec8 previously disabled it due to
seccomp crashes. This was caused by `golang.org/x/sys`'s
`unix.EpollWait` function using the `epoll_wait` syscall instead of the
`epoll_pwait` syscall. bionic libc implements the `epoll_wait` C wrapper
function in terms of the `epoll_pwait` syscall, so this never affected C
code.

`golang.org/x/sys` switched to the `epoll_pwait` syscall in 2016, but
only for arm64. As of v0.47.0, it now uses `epoll_pwait` for all
architectures.

Upstream bug: https://github.com/golang/go/issues/80080
Upstream fix: https://go-review.googlesource.com/c/sys/+/792700
Upstream arm64 fix from 2016:
https://go-review.googlesource.com/c/sys/+/21971

---

With this change, Syncthing no longer crashes when inotify is allowed
and enabled in the Android emulator when run inside an app context. (The
seccomp policies do not affect execution under `adb shell`.)

This is the crash that occurs if inotify is enabled without the v0.47.0
update:
```
2026-07-08 10:59:36.711202 -0400 F/DEBUG   (16538): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2026-07-08 10:59:36.711219 -0400 F/DEBUG   (16538): Build fingerprint: 'google/sdk_gphone16k_x86_64/emu64xa16k:17/CE2A.260420.019/15611780:userdebug/dev-keys'
2026-07-08 10:59:36.711224 -0400 F/DEBUG   (16538): Kernel Release: '6.12.58-android16-6-gccafb60de224-ab14828483'
2026-07-08 10:59:36.711226 -0400 F/DEBUG   (16538): Revision: '0'
2026-07-08 10:59:36.711228 -0400 F/DEBUG   (16538): ABI: 'x86_64'
2026-07-08 10:59:36.711230 -0400 F/DEBUG   (16538): Timestamp: 2026-07-08 10:59:36.617348693-0400
2026-07-08 10:59:36.711232 -0400 F/DEBUG   (16538): Process uptime: 2s
2026-07-08 10:59:36.711234 -0400 F/DEBUG   (16538): Page size: 16384 bytes
2026-07-08 10:59:36.711236 -0400 F/DEBUG   (16538): Executable: /system/bin/app_process64
2026-07-08 10:59:36.711239 -0400 F/DEBUG   (16538): Cmdline: com.chiller3.basicsync.debug
2026-07-08 10:59:36.711241 -0400 F/DEBUG   (16538): pid: 16502, ppid: 436, tid: 16531, name: Thread-6  >>> com.chiller3.basicsync.debug <<<
2026-07-08 10:59:36.711243 -0400 F/DEBUG   (16538): uid: 10231
2026-07-08 10:59:36.711886 -0400 F/DEBUG   (16538): signal 31 (SIGSYS), code 1 (SYS_SECCOMP), fault addr --------
2026-07-08 10:59:36.711899 -0400 F/DEBUG   (16538): Cause: seccomp prevented call to disallowed x86_64 system call 232
2026-07-08 10:59:36.711908 -0400 F/DEBUG   (16538):     rax 00000000000000e8  rbx 0000000000000078  rcx 00007372d956826e  rdx 0000000000000001
2026-07-08 10:59:36.711912 -0400 F/DEBUG   (16538):     r8  0000000000000000  r9  0000000000000000  r10 ffffffffffffffff  r11 0000000000000206
2026-07-08 10:59:36.712123 -0400 F/DEBUG   (16538):     r12 0000737291cc5d00  r13 000025897adcad20  r14 000025897abc7c20  r15 ffffffffffffffff
2026-07-08 10:59:36.712134 -0400 F/DEBUG   (16538):     rdi 0000000000000078  rsi 000025897af9ef7c
2026-07-08 10:59:36.712137 -0400 F/DEBUG   (16538):     rbp 000025897af9ee28  rsp 000025897af9ede8  rip 00007372d956826e  err 0000000000000000
2026-07-08 10:59:36.712139 -0400 F/DEBUG   (16538): 1 total frames
2026-07-08 10:59:36.712141 -0400 F/DEBUG   (16538): backtrace:
2026-07-08 10:59:36.712145 -0400 F/DEBUG   (16538):       #00 pc 0000000000d2826e  /data/app/~~s99umF1bl81-VDLSDwy30g==/com.chiller3.basicsync.debug-5Lq8YsTwbMz_SXt-F_uHaQ==/base.apk (offset 0x2e4c000)
2026-07-08 10:59:36.712431 -0400 F/DEBUG   (16538): Note: To display stack pointer information, use the pbtombstone tool:
2026-07-08 10:59:36.712443 -0400 F/DEBUG   (16538):         pbtombstone --display-sp tombstone_XX.pb
```

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2026-07-16 16:08:55 +00:00
.github build: use Go 1.26 for Windows as well (#10744) 2026-06-13 14:01:46 +02:00
assets fix: on Windows don't allocate console if not opened inside one (#10726) 2026-06-02 14:00:38 +02:00
cmd fix(strelaypoolsrv): locking correctness (#10801) 2026-07-16 16:01:47 +00:00
etc fix(systemd): add back chown allowed syscalls (#10605) 2026-03-13 12:53:36 +01:00
gui chore(gui, man, authors): update docs, translations, and contributors 2026-07-13 04:53:32 +00:00
internal fix(sqlite): update last migration to set schema version, counts (#10768) 2026-06-26 07:22:40 +02:00
lib build: allow inotify on Android amd64 (ref #8710) (#10783) 2026-07-16 16:08:55 +00:00
man chore(gui, man, authors): update docs, translations, and contributors 2026-07-13 04:53:32 +00:00
meta Merge branch 'main' into v2 2025-05-21 08:35:12 +02:00
proto chore: remove tracking inode change time (#10579) 2026-03-22 20:24:03 -07:00
relnotes docs: release notes for 2.1 2026-04-26 12:23:35 +02:00
script fix: let umask do the thing (#10723) 2026-06-03 10:54:04 +02:00
test chore: systematic syncthing_build_info metric 2026-04-06 09:44:49 +02:00
.codecov.yml build: Add test coverage info (#7502) 2021-04-05 10:25:39 +02:00
.deepsource.toml build: Fix deepsource test & exclude patterns (#7969) 2021-09-26 12:08:59 +02:00
.gitattributes lib/protocol: Revert protobuf encoder changes in v0.14.17 (fixes #3855) 2017-01-01 17:19:00 +00:00
.gitignore chore: remove abandoned next-gen-gui experiment (#10004) 2025-03-29 13:20:35 +01:00
.golangci.yml chore(model): slightly improve handling of pulling empty blocks (#10679) 2026-05-09 12:15:18 +02:00
.policy.yml policy: pushing invalidates PR approval 2026-04-08 17:48:27 +02:00
.yamlfmt build: Add more GitHub Actions 2023-02-22 10:56:55 +01:00
AUTHORS chore(gui, man, authors): update docs, translations, and contributors 2026-06-22 05:29:45 +00:00
buf.gen.yaml refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
buf.yaml refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
build.go fix: let umask do the thing (#10723) 2026-06-03 10:54:04 +02:00
build.ps1 build: Clean up build.sh, add build.ps1 (#6689) 2020-05-28 12:42:15 +02:00
build.sh chore(gui): update dependency copyrights, add script for periodic maintenance (#10067) 2025-04-23 12:41:05 +07:00
compat.yaml chore: build with Go 1.26; use Go 1.25 features (#10570) 2026-02-11 10:41:38 +00:00
CONDUCT.md conduct: Upgrade to Contributor Covenant 2018-06-20 23:53:06 +02:00
CONTRIBUTING.md docs: minor formatting fixup of previous 2025-09-02 09:19:43 +02:00
Dockerfile build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.builder build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.stcrashreceiver build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.stdiscosrv build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.strelaypoolsrv lib/geoip, cmd/relaypoolsrv, cmd/ursrv: Automatically manage GeoIP updates (#9342) 2024-05-18 20:31:49 +03:00
Dockerfile.strelaysrv build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.stupgrades build: Fixup Docker changes from previous (#9223) 2023-11-14 08:17:34 +01:00
Dockerfile.ursrv build: Ursrv image for infrastructure 2023-11-15 08:48:00 +01:00
go.mod build: allow inotify on Android amd64 (ref #8710) (#10783) 2026-07-16 16:08:55 +00:00
go.sum build: allow inotify on Android amd64 (ref #8710) (#10783) 2026-07-16 16:08:55 +00:00
GOALS.md readme: Style fixes, add security note (#9136) 2023-09-28 11:55:48 +02:00
LICENSE all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
README-Docker.md docs(docker): make host network mode the default (#10416) 2025-09-29 15:20:44 -04:00
README.md docs: update section on code signing 2024-12-16 11:42:34 +01:00

Syncthing


MPLv2 License CII Best Practices Go Report Card

Goals

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers. We strive to fulfill the goals below. The goals are listed in order of importance, the most important ones first. This is the summary version of the goal list - for more commentary, see the full Goals document.

Syncthing should be:

  1. Safe From Data Loss

    Protecting the user's data is paramount. We take every reasonable precaution to avoid corrupting the user's files.

  2. Secure Against Attackers

    Again, protecting the user's data is paramount. Regardless of our other goals, we must never allow the user's data to be susceptible to eavesdropping or modification by unauthorized parties.

  3. Easy to Use

    Syncthing should be approachable, understandable, and inclusive.

  4. Automatic

    User interaction should be required only when absolutely necessary.

  5. Universally Available

    Syncthing should run on every common computer. We are mindful that the latest technology is not always available to every individual.

  6. For Individuals

    Syncthing is primarily about empowering the individual user with safe, secure, and easy to use file synchronization.

  7. Everything Else

    There are many things we care about that don't make it on to the list. It is fine to optimize for these values, as long as they are not in conflict with the stated goals above.

Getting Started

Take a look at the getting started guide.

There are a few examples for keeping Syncthing running in the background on your system in the etc directory. There are also several GUI implementations for Windows, Mac, and Linux.

Docker

To run Syncthing in Docker, see the Docker README.

Getting in Touch

The first and best point of contact is the Forum. If you've found something that is clearly a bug, feel free to report it in the GitHub issue tracker.

If you believe that youve found a Syncthing-related security vulnerability, please report it by emailing security@syncthing.net. Do not report it in the Forum or issue tracker.

Building

Building Syncthing from source is easy. After extracting the source bundle from a release or checking out git, you just need to run go run build.go and the binaries are created in ./bin. There's a guide with more details on the build process.

Signed Releases

Release binaries are GPG signed with the key available from https://syncthing.net/security/. There is also a built-in automatic upgrade mechanism (disabled in some distribution channels) which uses a compiled in ECDSA signature. macOS and Windows binaries are also code-signed.

Documentation

Please see the Syncthing documentation site [source].

All code is licensed under the MPLv2 License.