erofs: Replace HTTP links with HTTPS ones
authorAlexander A. Klimov <grandmaster@al2klimov.de>
Mon, 13 Jul 2020 13:09:44 +0000 (15:09 +0200)
committerGao Xiang <hsiangkao@redhat.com>
Mon, 3 Aug 2020 13:04:29 +0000 (21:04 +0800)
commit592e7cd00bb9d48742ff402b74b79244e4a765dd
tree5b6ec3c892925b71ea2f9cae2ccae70494f31b89
parent92ed301919932f777713b9172e525674157e983d
erofs: Replace HTTP links with HTTPS ones

Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Link: https://lore.kernel.org/r/20200713130944.34419-1-grandmaster@al2klimov.de
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
16 files changed:
fs/erofs/compress.h
fs/erofs/data.c
fs/erofs/decompressor.c
fs/erofs/dir.c
fs/erofs/erofs_fs.h
fs/erofs/inode.c
fs/erofs/internal.h
fs/erofs/namei.c
fs/erofs/super.c
fs/erofs/utils.c
fs/erofs/xattr.c
fs/erofs/xattr.h
fs/erofs/zdata.c
fs/erofs/zdata.h
fs/erofs/zmap.c
fs/erofs/zpvec.h