mirror of
https://github.com/systemd/systemd
synced 2026-04-12 01:55:10 +02:00
Compare commits
11 Commits
bb18c742c8
...
ff97eb4aac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff97eb4aac | ||
|
|
7847b54814 | ||
|
|
5377ad4ea4 | ||
|
|
f097f4ab89 | ||
|
|
ba5b19ef4d | ||
|
|
cc1746bbed | ||
|
|
1a37237e2f | ||
|
|
1341f25b9b | ||
|
|
5df66d7d68 | ||
|
|
951280ce99 | ||
|
|
637ccd2fa4 |
@ -12,7 +12,7 @@
|
|||||||
# Total Phase
|
# Total Phase
|
||||||
###########################################################
|
###########################################################
|
||||||
# Aarvark I2C/SPI Host Adapter
|
# Aarvark I2C/SPI Host Adapter
|
||||||
usb:v0403pe0d0*
|
usb:v0403pE0D0*
|
||||||
ID_SIGNAL_ANALYZER=1
|
ID_SIGNAL_ANALYZER=1
|
||||||
|
|
||||||
# Beagle Protocol Analyzers
|
# Beagle Protocol Analyzers
|
||||||
@ -29,5 +29,16 @@ usb:v1679p3001*
|
|||||||
|
|
||||||
# Power Delivery Analyzers
|
# Power Delivery Analyzers
|
||||||
usb:v1679p6003*
|
usb:v1679p6003*
|
||||||
usb:v0483pdf11*
|
usb:v0483pDF11*
|
||||||
|
ID_SIGNAL_ANALYZER=1
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
# XGecu
|
||||||
|
###########################################################
|
||||||
|
# TL866A/CS
|
||||||
|
usb:v04D8pE11C*
|
||||||
|
ID_SIGNAL_ANALYZER=1
|
||||||
|
|
||||||
|
# TL866II+
|
||||||
|
usb:vA466p0A53*
|
||||||
ID_SIGNAL_ANALYZER=1
|
ID_SIGNAL_ANALYZER=1
|
||||||
|
|||||||
@ -212,21 +212,23 @@ def check_matches(groups):
|
|||||||
|
|
||||||
# This is a partial check. The other cases could be also done, but those
|
# This is a partial check. The other cases could be also done, but those
|
||||||
# two are most commonly wrong.
|
# two are most commonly wrong.
|
||||||
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)),
|
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4) + Optional(':')) + '*',
|
||||||
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8)),
|
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8) + Optional(':')) + '*',
|
||||||
}
|
}
|
||||||
|
|
||||||
for match in matches:
|
for match in matches:
|
||||||
prefix, rest = match.split(':', maxsplit=1)
|
prefix, rest = match.split(':', maxsplit=1)
|
||||||
gr = grammars.get(prefix)
|
gr = grammars.get(prefix)
|
||||||
if gr:
|
if gr:
|
||||||
|
# we check this first to provide an easy error message
|
||||||
|
if rest[-1] not in '*:':
|
||||||
|
error('pattern {} does not end with "*" or ":"', match)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gr.parseString(rest)
|
gr.parseString(rest)
|
||||||
except ParseBaseException as e:
|
except ParseBaseException as e:
|
||||||
error('Pattern {!r} is invalid: {}', rest, e)
|
error('Pattern {!r} is invalid: {}', rest, e)
|
||||||
continue
|
continue
|
||||||
if rest[-1] not in '*:':
|
|
||||||
error('pattern {} does not end with "*" or ":"', match)
|
|
||||||
|
|
||||||
matches.sort()
|
matches.sort()
|
||||||
prev = None
|
prev = None
|
||||||
|
|||||||
@ -12,7 +12,6 @@ SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
|
|||||||
|
|
||||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
|
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
|
||||||
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
|
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
|
||||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="hwdb 'usb:v$attr{idVendor}p$attr{idProduct}'"
|
|
||||||
|
|
||||||
ACTION!="add", GOTO="default_end"
|
ACTION!="add", GOTO="default_end"
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
assert_se(p);
|
assert_se(p);
|
||||||
|
|
||||||
char16_t *title = get_bcd_title(p, size);
|
char16_t *title = get_bcd_title(p, size);
|
||||||
assert_se(!title || char16_strlen(title) >= 0);
|
if (title)
|
||||||
|
(void) char16_strlen(title);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "conf-parser.h"
|
#include "conf-parser.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "install.h"
|
#include "install.h"
|
||||||
#include "load-fragment.h"
|
#include "load-fragment.h"
|
||||||
@ -22,10 +21,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
const char *name;
|
const char *name;
|
||||||
long offset;
|
long offset;
|
||||||
|
|
||||||
if (size == 0)
|
f = data_to_file(data, size);
|
||||||
return 0;
|
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
if (read_line(f, LINE_MAX, &p) < 0)
|
if (read_line(f, LINE_MAX, &p) < 0)
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "env-file.h"
|
#include "env-file.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "strv.h"
|
#include "strv.h"
|
||||||
@ -13,10 +12,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
_cleanup_strv_free_ char **rl = NULL, **rlp = NULL;
|
_cleanup_strv_free_ char **rl = NULL, **rlp = NULL;
|
||||||
|
|
||||||
if (size == 0 || size > 65535)
|
if (size > 65535)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
f = data_to_file(data, size);
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
/* We don't want to fill the logs with messages about parse errors.
|
/* We don't want to fill the logs with messages about parse errors.
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "hostname-setup.h"
|
#include "hostname-setup.h"
|
||||||
|
|
||||||
@ -10,10 +9,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
_cleanup_free_ char *ret = NULL;
|
_cleanup_free_ char *ret = NULL;
|
||||||
|
|
||||||
if (size == 0)
|
f = data_to_file(data, size);
|
||||||
return 0;
|
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
/* We don't want to fill the logs with messages about parse errors.
|
/* We don't want to fill the logs with messages about parse errors.
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
@ -12,10 +11,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
_cleanup_fclose_ FILE *f = NULL, *g = NULL;
|
_cleanup_fclose_ FILE *f = NULL, *g = NULL;
|
||||||
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
||||||
|
|
||||||
if (size == 0)
|
f = data_to_file(data, size);
|
||||||
return 0;
|
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0)
|
if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0)
|
||||||
|
|||||||
@ -4,5 +4,14 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "fileio.h"
|
||||||
|
|
||||||
/* The entry point into the fuzzer */
|
/* The entry point into the fuzzer */
|
||||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
|
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
|
||||||
|
|
||||||
|
static inline FILE* data_to_file(const uint8_t *data, size_t size) {
|
||||||
|
if (size == 0)
|
||||||
|
return fopen("/dev/null", "re");
|
||||||
|
else
|
||||||
|
return fmemopen_unlocked((char*) data, size, "re");
|
||||||
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "nspawn-oci.h"
|
#include "nspawn-oci.h"
|
||||||
|
|
||||||
@ -10,10 +9,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
_cleanup_(settings_freep) Settings *s = NULL;
|
_cleanup_(settings_freep) Settings *s = NULL;
|
||||||
|
|
||||||
if (size == 0)
|
f = data_to_file(data, size);
|
||||||
return 0;
|
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
/* We don't want to fill the logs with messages about parse errors.
|
/* We don't want to fill the logs with messages about parse errors.
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
|
||||||
#include "fuzz.h"
|
#include "fuzz.h"
|
||||||
#include "nspawn-settings.h"
|
#include "nspawn-settings.h"
|
||||||
|
|
||||||
@ -10,10 +9,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
_cleanup_(settings_freep) Settings *s = NULL;
|
_cleanup_(settings_freep) Settings *s = NULL;
|
||||||
|
|
||||||
if (size == 0)
|
f = data_to_file(data, size);
|
||||||
return 0;
|
|
||||||
|
|
||||||
f = fmemopen_unlocked((char*) data, size, "re");
|
|
||||||
assert_se(f);
|
assert_se(f);
|
||||||
|
|
||||||
/* We don't want to fill the logs with messages about parse errors.
|
/* We don't want to fill the logs with messages about parse errors.
|
||||||
|
|||||||
@ -608,14 +608,14 @@ tests += [
|
|||||||
'src/test/nss-test-util.h'],
|
'src/test/nss-test-util.h'],
|
||||||
[],
|
[],
|
||||||
[libdl],
|
[libdl],
|
||||||
[], 'ENABLE_NSS', 'manual'],
|
[], 'ENABLE_NSS'],
|
||||||
|
|
||||||
[['src/test/test-nss-users.c',
|
[['src/test/test-nss-users.c',
|
||||||
'src/test/nss-test-util.c',
|
'src/test/nss-test-util.c',
|
||||||
'src/test/nss-test-util.h'],
|
'src/test/nss-test-util.h'],
|
||||||
[],
|
[],
|
||||||
[libdl],
|
[libdl],
|
||||||
[], 'ENABLE_NSS', 'manual'],
|
[], 'ENABLE_NSS'],
|
||||||
|
|
||||||
[['src/test/test-bus-util.c']],
|
[['src/test/test-bus-util.c']],
|
||||||
|
|
||||||
|
|||||||
@ -420,7 +420,7 @@ static int parse_argv(int argc, char **argv,
|
|||||||
#if ENABLE_NSS_MYMACHINES
|
#if ENABLE_NSS_MYMACHINES
|
||||||
"mymachines",
|
"mymachines",
|
||||||
#endif
|
#endif
|
||||||
"dns");
|
NULL);
|
||||||
assert_se(modules);
|
assert_se(modules);
|
||||||
|
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
|
|||||||
@ -214,7 +214,7 @@ static int parse_argv(int argc, char **argv,
|
|||||||
#if ENABLE_NSS_MYMACHINES
|
#if ENABLE_NSS_MYMACHINES
|
||||||
"mymachines",
|
"mymachines",
|
||||||
#endif
|
#endif
|
||||||
"files");
|
NULL);
|
||||||
assert_se(modules);
|
assert_se(modules);
|
||||||
|
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
|
|||||||
@ -7,7 +7,10 @@ sanitize_address_undefined = custom_target(
|
|||||||
project_source_root,
|
project_source_root,
|
||||||
'@OUTPUT@',
|
'@OUTPUT@',
|
||||||
'fuzzers',
|
'fuzzers',
|
||||||
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@'.format(get_option('optimization')),
|
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@'.format(
|
||||||
|
get_option('optimization'),
|
||||||
|
get_option('werror') ? '--werror' : ''
|
||||||
|
),
|
||||||
' '.join(cc.cmd_array()),
|
' '.join(cc.cmd_array()),
|
||||||
cxx_cmd])
|
cxx_cmd])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user