",
12 | "ado_fields": {
13 | "System.AreaPath": "OneFuzz-Ado-Integration",
14 | "System.Title": "{{report.task_id}}"
15 | },
16 | "ado_duplicate_fields": {
17 | "System.Reason": "My custom value that means a work item is a duplicate",
18 | "Custom.Work.Item.Field": "My custom value that means a work item is a duplicate"
19 | },
20 | "on_duplicate": {
21 | "increment": [],
22 | "comment": "DUP {{report.input_sha256}} Repro Command:
{{ repro_cmd }}
",
23 | "set_state": {
24 | "Resolved": "Active"
25 | },
26 | "ado_fields": {}
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | obj
3 | csx
4 | .vs
5 | edge
6 | Publish
7 |
8 | *.user
9 | *.suo
10 | *.cscfg
11 | *.Cache
12 | project.lock.json
13 |
14 | /packages
15 | /TestResults
16 |
17 | /tools/NuGet.exe
18 | /App_Data
19 | /secrets
20 | /data
21 | .secrets
22 | appsettings.json
23 | local.settings.json
24 |
25 | node_modules
26 | dist
27 |
28 | # Local python packages
29 | .python_packages/
30 |
31 | # Python Environments
32 | .env
33 | .venv
34 | env/
35 | venv/
36 | ENV/
37 | env.bak/
38 | venv.bak/
39 |
40 | # Byte-compiled / optimized / DLL files
41 | __pycache__/
42 | *.py[cod]
43 | *$py.class
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/example-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/contrib/webhook-teams-service/example-message.png
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "logging": {
4 | "applicationInsights": {
5 | "samplingSettings": {
6 | "isEnabled": true,
7 | "excludedTypes": "Request"
8 | }
9 | }
10 | },
11 | "extensionBundle": {
12 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
13 | "version": "[1.*, 2.0.0)"
14 | }
15 | }
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "FUNCTIONS_WORKER_RUNTIME": "python"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/mypy.ini:
--------------------------------------------------------------------------------
1 | [mypy]
2 | disallow_untyped_defs = True
3 | follow_imports = silent
4 | check_untyped_defs = True
5 | disallow_any_generics = True
6 | no_implicit_reexport = True
7 | strict_optional = True
8 | warn_redundant_casts = True
9 | warn_return_any = True
10 | warn_unused_configs = True
11 | warn_unused_ignores = True
12 |
13 | [mypy-azure.*]
14 | ignore_missing_imports = True
15 |
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/requirements.txt:
--------------------------------------------------------------------------------
1 | # Do not include azure-functions-worker as it may conflict with the Azure Functions platform
2 |
3 | azure-functions
4 | aiohttp
--------------------------------------------------------------------------------
/contrib/webhook-teams-service/webhook/function.json:
--------------------------------------------------------------------------------
1 | {
2 | "scriptFile": "__init__.py",
3 | "bindings": [
4 | {
5 | "authLevel": "function",
6 | "type": "httpTrigger",
7 | "direction": "in",
8 | "name": "req",
9 | "methods": [
10 | "post"
11 | ]
12 | },
13 | {
14 | "type": "http",
15 | "direction": "out",
16 | "name": "$return"
17 | }
18 | ]
19 | }
--------------------------------------------------------------------------------
/docs/FAQ.md:
--------------------------------------------------------------------------------
1 | # Frequently Asked Questions
2 |
3 | ## Results sometimes show up before tasks are "running"
4 |
5 | We use VM Scale Sets. Often, some of the VMs in the set provision faster than
6 | others. Rather than wait for the entire set to begin, the agent starts on each
7 | VM as soon as the VM is up.
8 |
9 | ## Debugging issues on scalesets
10 |
11 | You can use az vmss run-command to launch commands in your VMs. As an example,
12 | the following command in bash will recursively list c:\onefuzz for a given task:
13 |
14 | ```sh
15 | az vmss list-instances --subscription SUBSCRIPTION -n TASK_ID -g RESOURCE_GROUP \
16 | --query [].id --output tsv | az vmss run-command invoke --ids @- \
17 | --command-id RunPowerShellScript --scripts 'Get-ChildItem -Path c:\onefuzz -Recurse'
18 | ```
19 |
20 | On Linux VMs, use RunShellScript. On Windows VMs, use RunPowerShellScript. Note
21 | that you will only see the last 4096 bytes of output. See
22 | [here](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/run-command#restrictions)
23 | for all restrictions on run-command.
24 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # OneFuzz Documentation
2 |
3 | A brief index of the documentation follows:
4 |
5 | ## For Users
6 |
7 | First steps:
8 |
9 | * [Getting Started](getting-started.md)
10 | * [Frequently Asked Questions](FAQ.md)
11 | * [Known Issues](known-issues.md)
12 | * [Terminology](terminology.md) of OneFuzz
13 |
14 | Guides:
15 |
16 | * [Migrating Regions](migrating-regions.md)
17 |
18 | Integrations and customizations:
19 |
20 | * [Custom Analysis](custom-analysis.md)
21 | * [Custom Images](custom-images.md)
22 | * [Notifications](notifications.md)
23 | * [Webhooks](webhooks.md)
24 | * [Webhook Events](webhook_events.md)
25 |
26 | ## For Contributors
27 |
28 | Guides:
29 |
30 | * [Architecture Overview](overview.md)
31 | * [Comms Channels](comms-channels.md)
32 | * [Understanding Tasks](tasks.md)
33 |
34 | Policies:
35 |
36 | * [Supported Platforms](supported-platforms.md)
37 | * [Versioning](versioning.md)
38 |
--------------------------------------------------------------------------------
/docs/custom-analysis.md:
--------------------------------------------------------------------------------
1 | # Custom Analysis Tasks
2 |
3 | OneFuzz supports the ability to create user-defined analysis tasks, enabling
4 | custom triage of crashes.
5 |
6 | ## Example use case
7 |
8 | Users can automatically record the output of
9 | [!analyze](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/using-the--analyze-extension)
10 | for crash using a `generic_generator` task with analyzer_exe of `cdb`, and the
11 | `analyzer_options` of
12 |
13 | ```json
14 | [
15 | "-c", "!analyze;q", "-logo", "{output_dir}\\{input_file_name_no_ext}.report",
16 | "{target_exe}", "{target_options}"
17 | ]
18 | ```
19 |
20 | For a crash named `mycrash.txt`, this will create `mycrash.report` in the
21 | `analysis` container.
22 |
23 | This can be seen in the [radamsa](../src/cli/onefuzz/templates/radamsa.py)
24 | template for any Windows targets.
25 |
26 | See also:
27 |
28 | * [Command Replacements](command-replacements.md)
29 | * [Example to collect LLVM Source-Based Coverage using custom analysis](../src/cli/examples/llvm-source-coverage/README.md)
30 |
--------------------------------------------------------------------------------
/docs/how-to/remote-debugging-dotnet.md:
--------------------------------------------------------------------------------
1 | ## How to setup remote debugging of dotnet Azure Functions on new deployments
2 |
3 | 1) when running `deploy.py` use `--host_dotnet_on_windows` flag as part of the command line. This will deploy `dotnet` Azure Function on Windows Server Farm, which supports functinoality for remote debugging of `dotnet` code.
4 |
5 | 2) Follow instructions on how to connect Visual Studio 2022 to newly deployed Azure Function: [https://docs.microsoft.com/en-us/azure/azure-functions/functions-develop-vs?tabs=in-process#remote-debugging](https://docs.microsoft.com/en-us/azure/azure-functions/functions-develop-vs?tabs=in-process#remote-debugging)
--------------------------------------------------------------------------------
/docs/notifications/teams-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/docs/notifications/teams-message.png
--------------------------------------------------------------------------------
/docs/overview.md:
--------------------------------------------------------------------------------
1 | ## Architecture Overview
2 |
3 | ```mermaid
4 | flowchart TB
5 |
6 | subgraph clients[Clients]
7 | CLI
8 | script.py
9 | end
10 |
11 | subgraph service[Service]
12 | AzFunc("Azure\nFunctions\n⚡")
13 |
14 | pool-linux[/Linux queue/]
15 | pool-win[/Windows queue/]
16 |
17 | EventGrid{Event Grid}
18 | SystemData[(System Data)]
19 | end
20 |
21 | UserData[(User Data)]
22 |
23 | subgraph linux-compute[Linux VMs]
24 | vmss1
25 | vmss2
26 | end
27 |
28 | subgraph windows-compute[Windows VMs]
29 | vmss3
30 | vmss4
31 | end
32 |
33 | CLI--HTTP-->AzFunc
34 | script.py--HTTP-->AzFunc
35 |
36 | AzFunc--Timers-->AzFunc
37 | AzFunc --> pool-linux
38 | AzFunc --> pool-win
39 | AzFunc <--> UserData
40 | AzFunc -- ORM --> SystemData
41 | SystemData -- Trigger --> AzFunc
42 |
43 | SystemData --> EventGrid
44 | UserData --> EventGrid
45 | EventGrid -- Event --> AzFunc
46 |
47 | UserData <-- Container Sync --> linux-compute
48 | UserData <-- Container Sync --> windows-compute
49 |
50 | linux-compute -. poll .-> pool-linux
51 | windows-compute -. poll .-> pool-win
52 | ```
53 |
--------------------------------------------------------------------------------
/docs/screencasts/README.md:
--------------------------------------------------------------------------------
1 | # Screencasts of using OneFuzz
2 |
3 | ## Launching a Job
4 | 
5 |
6 |
7 | ## Live debugging a crash
8 | 
9 |
10 | Note: Launching the VM is sped up in this screencast. Launching VMs for crash
11 | reproduction currently takes approximiately 2 minutes for Linux and 7 minutes
12 | for Windows.
13 |
--------------------------------------------------------------------------------
/docs/screencasts/launching-job.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/docs/screencasts/launching-job.gif
--------------------------------------------------------------------------------
/docs/screencasts/live-debugging.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/docs/screencasts/live-debugging.gif
--------------------------------------------------------------------------------
/docs/ssh-config.md:
--------------------------------------------------------------------------------
1 | # SSH within OneFuzz
2 |
3 | OneFuzz enables automatically connecting to fuzzing & crash repro nodes via SSH.
4 | Each VM and VM scale set has its own SSH key pair.
5 |
6 | On Linux VMs, the public key is written to `~onefuzz/.ssh/authorized_keys`
7 |
8 | For Windows VMs, the public key is written to
9 | `\$env:ProgramData\ssh\administrators_authorized_keys` following
10 | [Windows OpenSSH server guides](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration).
11 |
12 | ## OneFuzz cli handling keys
13 |
14 | When using any of the SSH enabled components of the onefuzz CLI, the CLI will
15 | automatically fetch the key-pair for a VM as needed. The private key is written
16 | to a temporary directory and removed upon completion of the SSH command.
17 |
18 | NOTE: As VMs and VM scale sets are intended to be short-lived and ephemeral, the
19 | onefuzz CLI configures SSH to not write to the user's known host file and
20 | ignores host key checking.
21 |
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "7.0.100",
4 | "rollForward": "latestFeature"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/ApiService/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {}
5 | }
--------------------------------------------------------------------------------
/src/ApiService/ApiService/Auth/AuthenticationItems.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Azure.Functions.Worker;
2 |
3 | namespace Microsoft.OneFuzz.Service.Auth;
4 |
5 | public static class AuthenticationItems {
6 | private const string Key = "ONEFUZZ_USER_INFO";
7 |
8 | public static void SetUserAuthInfo(this FunctionContext context, UserAuthInfo info)
9 | => context.Items[Key] = info;
10 |
11 | public static UserAuthInfo GetUserAuthInfo(this FunctionContext context)
12 | => (UserAuthInfo)context.Items[Key];
13 |
14 | public static UserAuthInfo? TryGetUserAuthInfo(this FunctionContext context)
15 | => context.Items.TryGetValue(Key, out var result) ? (UserAuthInfo)result : null;
16 | }
17 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/Auth/AuthorizeAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.OneFuzz.Service.Auth;
2 |
3 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
4 | public sealed class AuthorizeAttribute : Attribute {
5 | public AuthorizeAttribute(Allow allow) {
6 | Allow = allow;
7 | }
8 |
9 | public Allow Allow { get; set; }
10 | }
11 |
12 | public enum Allow {
13 | Agent,
14 | User,
15 | Admin,
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/FeatureFlags.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.OneFuzz.Service;
2 |
3 | public static class FeatureFlagConstants {
4 | public const string RenderOnlyScribanTemplates = "RenderOnlyScribanTemplates";
5 | public const string EnableNodeDecommissionStrategy = "EnableNodeDecommissionStrategy";
6 | public const string SemanticNotificationConfigValidation = "SemanticNotificationConfigValidation";
7 | public const string EnableCustomMetricTelemetry = "EnableCustomMetricTelemetry";
8 | public const string EnableBlobRetentionPolicy = "EnableBlobRetentionPolicy";
9 | public const string EnableDryRunBlobRetention = "EnableDryRunBlobRetention";
10 | public const string EnableWorkItemCreation = "EnableWorkItemCreation";
11 | public const string EnableContainerRetentionPolicies = "EnableContainerRetentionPolicies";
12 | public const string EnableSlimEventSerialization = "EnableSlimEventSerialization";
13 | }
14 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/Functions/Negotiate.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Threading.Tasks;
3 | using Microsoft.Azure.Functions.Worker;
4 | using Microsoft.Azure.Functions.Worker.Http;
5 | using Microsoft.OneFuzz.Service.Auth;
6 |
7 | namespace Microsoft.OneFuzz.Service.Functions;
8 |
9 | public class Negotiate {
10 | [Function("Negotiate")]
11 | [Authorize(Allow.User)]
12 | public static async Task Run(
13 | [HttpTrigger(AuthorizationLevel.Anonymous, "POST")] HttpRequestData req,
14 | [SignalRConnectionInfoInput(HubName = "dashboard")] string info) {
15 |
16 | // This endpoint handles the signalr negotation
17 | // As we do not differentiate from clients at this time, we pass the Functions runtime
18 | // provided connection straight to the client
19 | //
20 | // For more info:
21 | // https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-concept-internals
22 |
23 | var resp = req.CreateResponse(HttpStatusCode.OK);
24 | resp.Headers.Add("Content-Type", "application/json");
25 | await resp.WriteStringAsync(info);
26 | return resp;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/Functions/QueueSignalREvents.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Azure.Functions.Worker;
2 | using Microsoft.Extensions.Logging;
3 | namespace Microsoft.OneFuzz.Service.Functions;
4 |
5 | public class QueueSignalREvents {
6 | private readonly ILogger _logger;
7 |
8 | public QueueSignalREvents(ILogger logger) {
9 | _logger = logger;
10 | }
11 |
12 | [Function("QueueSignalREvents")]
13 | [SignalROutput(HubName = "dashboard")]
14 | public static string Run(
15 | [QueueTrigger("signalr-events", Connection = "AzureWebJobsStorage")] string msg) {
16 | return msg;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/Functions/QueueWebhooks.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 | using Microsoft.Azure.Functions.Worker;
3 | using Microsoft.Extensions.Logging;
4 | using Microsoft.OneFuzz.Service.OneFuzzLib.Orm;
5 | namespace Microsoft.OneFuzz.Service.Functions;
6 |
7 | public class QueueWebhooks {
8 | private readonly ILogger _log;
9 | private readonly IWebhookMessageLogOperations _webhookMessageLog;
10 | public QueueWebhooks(ILogger log, IWebhookMessageLogOperations webhookMessageLog) {
11 | _log = log;
12 | _webhookMessageLog = webhookMessageLog;
13 | }
14 |
15 | [Function("QueueWebhooks")]
16 | public async Async.Task Run([QueueTrigger("webhooks", Connection = "AzureWebJobsStorage")] string msg) {
17 |
18 | _log.LogInformation("Webhook Message Queued: {msg}", msg);
19 |
20 | var obj = JsonSerializer.Deserialize(msg, EntityConverter.GetJsonSerializerOptions()).EnsureNotNull($"wrong data {msg}");
21 |
22 | await _webhookMessageLog.ProcessFromQueue(obj);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/LogExt.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using Microsoft.Extensions.Logging;
3 |
4 | namespace Microsoft.OneFuzz.Service;
5 | public static class LogExt {
6 | ///
7 | ///
8 | ///
9 | ///
10 | ///
11 | ///
12 | public static void LogOneFuzzError(this ILogger logger, Error err) {
13 | var errors = err.Errors ?? new List();
14 | logger.LogError("Error: Code = {Code}, Errors = {errorsString}", err.Code, string.Join(';', errors));
15 | }
16 |
17 |
18 | public static void AddHttpStatus(this ILogger logger, (HttpStatusCode Status, string Reason) result) {
19 | logger.AddTag("StatusCode", ((int)result.Status).ToString());
20 | logger.AddTag("ReasonPhrase", result.Reason);
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/az-local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
5 | "linux_fx_version": "DOTNET-ISOLATED|7.0"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "functionTimeout": "12:00:00",
4 | "logging": {
5 | "applicationInsights": {
6 | "samplingSettings": {
7 | "isEnabled": true,
8 | "excludedTypes": "Request"
9 | }
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/ApiService/ApiService/onefuzzlib/InstanceIds.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.OneFuzz.Service;
2 |
3 | public static class InstanceIds {
4 | // See: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-instance-ids#scale-set-vm-names
5 | // Machine Name here is {ScaleSet}_{InstanceId}
6 | public static string InstanceIdFromMachineName(string machineName)
7 | => machineName.Split("_").Last();
8 | }
9 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/onefuzzlib/Versions.cs:
--------------------------------------------------------------------------------
1 | using Semver;
2 |
3 | namespace Microsoft.OneFuzz.Service;
4 |
5 | public class Versions {
6 | public static bool IsMinimumVersion(string versionStr, string minimumStr) {
7 | var version = SemVersion.Parse(versionStr, SemVersionStyles.Any);
8 | var minimum = SemVersion.Parse(minimumStr, SemVersionStyles.Any);
9 |
10 | return version.ComparePrecedenceTo(minimum) >= 0;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/ApiService/ApiService/onefuzzlib/WellKnownContainers.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Microsoft.OneFuzz.Service;
3 |
4 | public static class WellKnownContainers {
5 | public static readonly Container BaseConfig = Container.Parse("base-config");
6 | public static readonly Container VmScripts = Container.Parse("vm-scripts");
7 | public static readonly Container InstanceSpecificSetup = Container.Parse("instance-specific-setup");
8 | public static readonly Container Tools = Container.Parse("tools");
9 | public static readonly Container ReproScripts = Container.Parse("repro-scripts");
10 | public static readonly Container TaskConfigs = Container.Parse("task-configs");
11 | public static readonly Container ProxyConfigs = Container.Parse("proxy-configs");
12 | public static readonly Container Events = Container.Parse("events");
13 | }
14 |
--------------------------------------------------------------------------------
/src/ApiService/CSharpExtensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "$comment1": "See https://github.com/cezarypiatek/CSharpExtensions ",
3 | "$comment2": "These types are all 'builders' and okay to ignore the result of",
4 | "CSE005": {
5 | "IgnoredReturnTypes": [
6 | "FluentAssertions.AndConstraint",
7 | "Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder",
8 | "Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationOptions",
9 | "Microsoft.Extensions.Configuration.IConfigurationBuilder",
10 | "Microsoft.Extensions.DependencyInjection.IServiceCollection",
11 | "NSubstitute.Core.ConfiguredCall",
12 | "System.Text.StringBuilder"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/ApiClient.cs:
--------------------------------------------------------------------------------
1 | namespace FunctionalTests {
2 | sealed class ApiClient {
3 | static Microsoft.Morse.AuthenticationConfig authConfig =
4 | new Microsoft.Morse.AuthenticationConfig(
5 | ClientId: System.Environment.GetEnvironmentVariable("ONEFUZZ_CLIENT_ID")!,
6 | TenantId: System.Environment.GetEnvironmentVariable("ONEFUZZ_TENANT_ID")!,
7 | Scopes: new[] { System.Environment.GetEnvironmentVariable("ONEFUZZ_SCOPES")! },
8 | Secret: System.Environment.GetEnvironmentVariable("ONEFUZZ_SECRET")!);
9 |
10 | static Microsoft.Morse.ServiceAuth auth = new Microsoft.Morse.ServiceAuth(authConfig);
11 | static Microsoft.OneFuzz.Service.Request request = new Microsoft.OneFuzz.Service.Request(new HttpClient(), () => auth.Token(new CancellationToken()));
12 |
13 | public static Microsoft.OneFuzz.Service.Request Request => request;
14 |
15 | public static Uri Endpoint { get; } = new(Environment.GetEnvironmentVariable("ONEFUZZ_ENDPOINT") ?? "http://localhost:7071");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/Authentication.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 |
3 | namespace FunctionalTests;
4 |
5 | public class Authentication : IFromJsonElement {
6 | readonly JsonElement _e;
7 |
8 | public Authentication(JsonElement e) => _e = e;
9 |
10 | public string Password => _e.GetStringProperty("password");
11 |
12 | public string PublicKey => _e.GetStringProperty("public_key");
13 | public string PrivateKey => _e.GetStringProperty("private_key");
14 |
15 | public static Authentication Convert(JsonElement e) => new(e);
16 | }
17 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/Download.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Web;
3 | using Xunit.Abstractions;
4 |
5 | namespace FunctionalTests {
6 | public class DownloadApi : ApiBase {
7 |
8 | public DownloadApi(Uri endpoint, Microsoft.OneFuzz.Service.Request request, ITestOutputHelper output) :
9 | base(endpoint, "/api/Download", request, output) {
10 | }
11 |
12 | public async Task> Get(string? container = null, string? filename = null) {
13 | var n = HttpUtility.ParseQueryString(string.Empty);
14 | if (container is not null)
15 | n.Add("container", container);
16 | if (filename is not null)
17 | n.Add("filename", filename);
18 | return await QueryGet(n.ToString());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/Negotiate.cs:
--------------------------------------------------------------------------------
1 | namespace FunctionalTests {
2 | public class NegotiateApi {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/NodeAddSshKey.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Nodes;
2 | using Xunit.Abstractions;
3 |
4 |
5 | namespace FunctionalTests {
6 | public class NodeAddSshKeyApi : ApiBase {
7 |
8 | public NodeAddSshKeyApi(Uri endpoint, Microsoft.OneFuzz.Service.Request request, ITestOutputHelper output) :
9 | base(endpoint, "/api/node_add_ssh_key", request, output) {
10 | }
11 |
12 | public async Task Post(Guid machineId, string publicSshKey) {
13 | var n = new JsonObject()
14 | .AddV("machine_id", machineId)
15 | .AddV("public_key", publicSshKey);
16 |
17 | var r = await Post(n);
18 | return Return(r);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/UserInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 |
3 | namespace FunctionalTests;
4 |
5 | public class UserInfo : IFromJsonElement {
6 |
7 | readonly JsonElement _e;
8 | public UserInfo(JsonElement e) => _e = e;
9 | public static UserInfo Convert(JsonElement e) => new(e);
10 |
11 | public Guid? ApplicationId => _e.GetNullableGuidProperty("application_id");
12 | public Guid? ObjectId => _e.GetNullableGuidProperty("object_id");
13 | public string? Upn => _e.GetNullableStringProperty("upn");
14 | }
15 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/WebhookLogs.cs:
--------------------------------------------------------------------------------
1 | namespace FunctionalTests {
2 | public class WebhookLogs {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/WebhookPing.cs:
--------------------------------------------------------------------------------
1 | namespace FunctionalTests {
2 | public class WebhookPing {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/1f-api/Webhooks.cs:
--------------------------------------------------------------------------------
1 | namespace FunctionalTests {
2 | public class Webhooks {
3 | }
4 | }
5 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "Test code")]
9 | [assembly: SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "Test code", Scope = "type", Target = "~T:FunctionalTests.Error")]
10 | [assembly: SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "Test code", Scope = "type", Target = "~T:FunctionalTests.Forward")]
11 | [assembly: SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "Test code", Scope = "type", Target = "~T:FunctionalTests.ProxyGetResult")]
12 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/Helpers.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace FunctionalTests {
4 | public class Helpers {
5 | public static async Task<(Pool, Scaleset)> CreatePoolAndScaleset(PoolApi poolApi, ScalesetApi scalesetApi, string os = "linux", string? region = null, int numNodes = 2) {
6 |
7 | var newPoolId = Guid.NewGuid().ToString();
8 | var newPoolName = PoolApi.TestPoolPrefix + newPoolId;
9 | var newPool = await poolApi.Create(newPoolName, os);
10 |
11 | Assert.True(newPool.IsOk, $"failed to create new pool: {newPool.ErrorV}");
12 | var newScalesetResult = await scalesetApi.Create(newPool.OkV!.Name, numNodes, region: region);
13 |
14 | Assert.True(newScalesetResult.IsOk, $"failed to crate new scaleset: {newScalesetResult.ErrorV}");
15 | var newScaleset = newScalesetResult.OkV!;
16 |
17 | return (newPool.OkV!, newScaleset);
18 |
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/TestInfo.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using Xunit;
3 | using Xunit.Abstractions;
4 |
5 |
6 | namespace FunctionalTests {
7 | [Trait("Category", "Live")]
8 | public class TestInfo {
9 | private readonly ITestOutputHelper _output;
10 | InfoApi _infoApi;
11 | public TestInfo(ITestOutputHelper output) {
12 | _output = output;
13 | _infoApi = new InfoApi(ApiClient.Endpoint, ApiClient.Request, output);
14 | }
15 |
16 | [Fact]
17 | async Task GetInfo() {
18 | var info = await _infoApi.Get();
19 | _ = info.IsOk.Should().BeTrue();
20 | _ = info.OkV!.Versions.ContainsKey("onefuzz").Should().BeTrue();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/ApiService/FunctionalTests/TestTasks.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using Xunit;
3 | using Xunit.Abstractions;
4 |
5 |
6 | namespace FunctionalTests {
7 | [Trait("Category", "Live")]
8 | public class TestTasks {
9 | TaskApi _taskApi;
10 |
11 | private readonly ITestOutputHelper _output;
12 |
13 | public TestTasks(ITestOutputHelper output) {
14 | this._output = output;
15 | _taskApi = new TaskApi(ApiClient.Endpoint, ApiClient.Request, output);
16 | }
17 |
18 | [Fact]
19 | public async Task GetNonExistentTask() {
20 | var t1 = await _taskApi.Get(Guid.NewGuid());
21 | _ = t1.IsOk.Should().BeTrue();
22 | _ = t1.OkV.Should().BeEmpty();
23 |
24 |
25 | var t2 = await _taskApi.Get(Guid.NewGuid(), Guid.NewGuid());
26 | _ = t2.IsOk.Should().BeFalse();
27 | _ = t2.ErrorV!.UnableToFindTask.Should().BeTrue();
28 | }
29 |
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/AgentCanScheduleTests.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.OneFuzz.Service;
2 | using Xunit;
3 | using Xunit.Abstractions;
4 |
5 | namespace IntegrationTests;
6 |
7 | [Trait("Category", "Live")]
8 | public class AzureStorageAgentCanScheduleTest : AgentCommandsTestsBase {
9 | public AzureStorageAgentCanScheduleTest(ITestOutputHelper output)
10 | : base(output, Integration.AzureStorage.FromEnvironment()) { }
11 | }
12 |
13 | public class AzuriteAgentCanScheduleTest : AgentEventsTestsBase {
14 | public AzuriteAgentCanScheduleTest(ITestOutputHelper output)
15 | : base(output, new Integration.AzuriteStorage()) { }
16 | }
17 |
18 | public abstract class AgentCanScheduleTestsBase : FunctionTestBase {
19 | public AgentCanScheduleTestsBase(ITestOutputHelper output, IStorage storage)
20 | : base(output, storage) { }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/AuthTests.cs:
--------------------------------------------------------------------------------
1 | using FluentAssertions;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.OneFuzz.Service;
4 | using Xunit;
5 | using Xunit.Abstractions;
6 |
7 | namespace Tests {
8 |
9 | public class AuthTests {
10 | protected ILogger Logger { get; }
11 | public AuthTests(ITestOutputHelper output) {
12 | var provider = new IntegrationTests.OneFuzzLoggerProvider(output);
13 | Logger = provider.CreateLogger("Auth");
14 | }
15 |
16 | [Fact]
17 | public async System.Threading.Tasks.Task TestAuth() {
18 | var auth = await AuthHelpers.BuildAuth(Logger);
19 |
20 | auth.Should().NotBeNull();
21 | auth.PrivateKey.StartsWith("-----BEGIN OPENSSH PRIVATE KEY-----").Should().BeTrue();
22 | auth.PrivateKey.EndsWith("-----END OPENSSH PRIVATE KEY-----\n").Should().BeTrue();
23 | auth.PublicKey.StartsWith("ssh-rsa").Should().BeTrue();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/Fakes/TestContainers.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Caching.Memory;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.OneFuzz.Service;
4 |
5 | // TestContainers class allows use of InstanceID without having to set it up in blob storage
6 | sealed class TestContainers : Containers {
7 | public TestContainers(ILogger log, IStorage storage, IServiceConfig config, IOnefuzzContext context, IMemoryCache cache)
8 | : base(log, storage, config, context, cache) { }
9 | }
10 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/Fakes/TestEvents.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.OneFuzz.Service;
4 | using Async = System.Threading.Tasks;
5 |
6 | namespace IntegrationTests.Fakes;
7 |
8 | public sealed class TestEvents : Events {
9 |
10 | public List Events { get; } = new();
11 | public List SignalREvents { get; } = new();
12 |
13 | public TestEvents(ILogger log, IOnefuzzContext context)
14 | : base(log, context) { }
15 |
16 | public override void LogEvent(BaseEvent anEvent) {
17 | Events.Add(anEvent);
18 | }
19 |
20 | public override Async.Task QueueSignalrEvent(DownloadableEventMessage message) {
21 | SignalREvents.Add(message);
22 | return Async.Task.CompletedTask;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/Fakes/TestMetrics.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.OneFuzz.Service;
4 | namespace IntegrationTests.Fakes;
5 |
6 | public sealed class TestMetrics : Metrics {
7 |
8 | public List Metrics { get; } = new();
9 | public List CustomMetrics { get; } = new();
10 | public TestMetrics(ILogger log, IOnefuzzContext context)
11 | : base(log, context) { }
12 | }
13 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/Fakes/TestWebhookMessageLogOperations.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.OneFuzz.Service;
4 | namespace IntegrationTests.Fakes;
5 |
6 | public sealed class TestWebhookMessageLogOperations : WebhookMessageLogOperations {
7 |
8 | public List Events { get; } = new();
9 | public List SignalREvents { get; } = new();
10 |
11 | public TestWebhookMessageLogOperations(ILogger log, IOnefuzzContext context)
12 | : base(log, context) { }
13 | }
14 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/Fakes/TestWebhookOperations.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Net.Http;
3 | using Microsoft.Extensions.Logging;
4 | using Microsoft.OneFuzz.Service;
5 | namespace IntegrationTests.Fakes;
6 |
7 | public sealed class TestWebhookOperations : WebhookOperations {
8 |
9 | public List Events { get; } = new();
10 | public List SignalREvents { get; } = new();
11 |
12 | public TestWebhookOperations(IHttpClientFactory httpClientFactory, ILogger log, IOnefuzzContext context)
13 | : base(httpClientFactory, log, context) { }
14 | }
15 |
--------------------------------------------------------------------------------
/src/ApiService/IntegrationTests/README.md:
--------------------------------------------------------------------------------
1 | # Integration Tests
2 |
3 | The integration tests in this project allow specific Functions to be run against
4 | Azure Storage. They can be run in two modes:
5 |
6 | - **Against the [Azurite](https://github.com/Azure/Azurite) storage emulator**:
7 | these tests are run by default. `azurite` must be started and running (e.g.
8 | with `azurite -s &`).
9 |
10 | - **Against a real Azure Storage account**: to use this, the environment
11 | variables `AZURE_ACCOUNT_NAME` and `AZURE_ACCOUNT_KEY` must be set.
12 |
13 | These tests can be excluded by running `dotnet test` with the arguments
14 | `--filter "Category!=Live"`.
15 |
16 | The same tests are used in each case. The way this is achieved in Xunit is by
17 | writing the tests in an (abstract) base class and then deriving two
18 | implementations from this base class, one for each “run configuration”.
19 |
--------------------------------------------------------------------------------
/src/ApiService/Tests/ErrorTests.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 | using Microsoft.OneFuzz.Service;
3 | using Xunit;
4 |
5 | namespace Tests;
6 |
7 | public class ErrorTests {
8 |
9 | [Fact]
10 | public void JsonHasErrorTitle() {
11 | var error = Error.Create(ErrorCode.INVALID_IMAGE);
12 | var json = JsonSerializer.Serialize(error);
13 | Assert.Equal(@"{""Code"":463,""Errors"":[],""Title"":""INVALID_IMAGE""}", json);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/ApiService/Tests/EventsTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.OneFuzz.Service;
3 | using Xunit;
4 |
5 | namespace Tests;
6 |
7 | public class EventTests {
8 |
9 | [Fact]
10 | public static void CheckAllEventClass() {
11 | // instantiate one event to force the static constructor to run
12 | // if it doesn't throw then this test passes
13 | _ = new EventPing(Guid.Empty);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/ApiService/Tests/ExponentialBackoffTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FluentAssertions;
3 | using Microsoft.OneFuzz.Service.Functions;
4 | using Xunit;
5 |
6 | namespace Tests;
7 |
8 | public class ExponentialBackoffTests {
9 | [Theory]
10 | [InlineData(1, 5)]
11 | [InlineData(2, 25)]
12 | [InlineData(3, 125)]
13 | [InlineData(4, 625)]
14 | public void ExpectedBackoffsWhenLessThanOneDay(int retryAttempt, int expectedBackoffMinutes) {
15 | var expectedBackoff = TimeSpan.FromMinutes(expectedBackoffMinutes);
16 |
17 | expectedBackoff.Should().Be(QueueFileChanges.CalculateExponentialBackoff(retryAttempt));
18 | }
19 |
20 | [Fact]
21 | public void BackoffIsCappedToRoughlyTwoDays() {
22 | QueueFileChanges.CalculateExponentialBackoff(5).Should()
23 | .BeLessThan(TimeSpan.FromDays(3));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/ApiService/Tests/InstanceIdTests.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.OneFuzz.Service;
2 | using Xunit;
3 |
4 | namespace Tests;
5 |
6 | public class InstanceIdTests {
7 | [Fact]
8 | public void CanExtractInstanceIdFromMachineName() {
9 | Assert.Equal("5", InstanceIds.InstanceIdFromMachineName("node_5"));
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/ApiService/Tests/RemoveUserInfoTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.Json;
3 | using Microsoft.OneFuzz.Service;
4 | using Xunit;
5 |
6 | namespace Tests {
7 | public class RemoveUserInfoTest {
8 |
9 | [Fact]
10 | public void TestSerialize() {
11 | var userInfo = new UserInfo(Guid.NewGuid(), Guid.NewGuid(), "test");
12 | var options = new JsonSerializerOptions();
13 | options.Converters.Add(new RemoveUserInfo());
14 | var serialized = JsonSerializer.Serialize(userInfo, options);
15 |
16 | Assert.Equal("{}", serialized);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/agent/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [target.x86_64-pc-windows-msvc]
2 | rustflags = [
3 | "-C",
4 | "target-feature=+crt-static",
5 | "-C",
6 | "control-flow-guard",
7 | "-C",
8 | "link-arg=/DYNAMICBASE",
9 | "-C",
10 | "link-arg=/CETCOMPAT",
11 | ]
12 |
--------------------------------------------------------------------------------
/src/agent/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .agent-run
--------------------------------------------------------------------------------
/src/agent/.rustfmt.toml:
--------------------------------------------------------------------------------
1 | edition = "2021"
2 | newline_style = "Native"
3 |
--------------------------------------------------------------------------------
/src/agent/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = [
3 | "atexit",
4 | "cobertura",
5 | "coverage",
6 | "debuggable-module",
7 | "debugger",
8 | "dynamic-library",
9 | "input-tester",
10 | "onefuzz",
11 | "onefuzz-task",
12 | "onefuzz-agent",
13 | "onefuzz-result",
14 | "onefuzz-file-format",
15 | "onefuzz-telemetry",
16 | "reqwest-retry",
17 | "storage-queue",
18 | "win-util",
19 | "libclusterfuzz",
20 | "stacktrace-parser",
21 | ]
22 |
23 | resolver = "2"
24 |
25 | [profile.release]
26 | lto = "thin"
27 | # Per https://fasterthanli.me/articles/why-is-my-rust-build-so-slow:
28 | # In Cargo.toml, debug = true actually means debug = 2, and it's usually overkill,
29 | # unless you're doing the sort of debugging where you need to be able to inspect
30 | # the value of local variables for example.
31 | # If all you're after is a stack trace, debug = 1 is good enough.
32 | debug = 1
33 |
--------------------------------------------------------------------------------
/src/agent/LibFuzzerDotnetLoader/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
--------------------------------------------------------------------------------
/src/agent/LibFuzzerDotnetLoader/LibFuzzerDotnetLoader.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | 11.0
6 | net7.0
7 | enable
8 | enable
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/agent/atexit/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "atexit"
3 | version = "0.1.0"
4 | license = "MIT"
5 | authors = ["fuzzing@microsoft.com"]
6 | edition = "2021"
7 |
8 | [dependencies]
9 | ctrlc = "3.4.0"
10 | lazy_static = "1.4"
11 | log = "0.4"
12 |
--------------------------------------------------------------------------------
/src/agent/cobertura/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "cobertura"
3 | version = "0.1.0"
4 | edition = "2021"
5 | license = "MIT"
6 |
7 | [dependencies]
8 | anyhow = "1.0"
9 | quick-xml = "0.30"
10 |
--------------------------------------------------------------------------------
/src/agent/coverage/fuzz/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | corpus
3 | artifacts
4 | coverage
5 |
--------------------------------------------------------------------------------
/src/agent/coverage/fuzz/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "coverage-fuzz"
3 | version = "0.0.0"
4 | publish = false
5 | edition = "2021"
6 |
7 | [package.metadata]
8 | cargo-fuzz = true
9 |
10 | [dependencies]
11 | libfuzzer-sys = "0.4"
12 | tempfile = "3.7"
13 | debuggable-module = { path = "../../debuggable-module" }
14 |
15 |
16 | [dependencies.coverage]
17 | path = ".."
18 |
19 | # Prevent this from interfering with workspaces
20 | [workspace]
21 | members = ["."]
22 |
23 | [profile.release]
24 | debug = 1
25 |
26 | [[bin]]
27 | name = "fuzz_target_record_coverage"
28 | path = "fuzz_targets/fuzz_target_record_coverage.rs"
29 | test = false
30 | doc = false
31 |
32 | [[bin]]
33 | name = "fuzz_target_allowlist_parse"
34 | path = "fuzz_targets/fuzz_target_allowlist_parse.rs"
35 | test = false
36 | doc = false
37 |
38 |
--------------------------------------------------------------------------------
/src/agent/coverage/fuzz/fuzz_targets/fuzz_target_allowlist_parse.rs:
--------------------------------------------------------------------------------
1 | #![no_main]
2 |
3 | use libfuzzer_sys::fuzz_target;
4 | use coverage::allowlist::AllowList;
5 |
6 | fuzz_target!(|data: &[u8]| {
7 | // fuzzed code goes here
8 | if let Ok(s) = std::str::from_utf8(data)
9 | {
10 | let _ = AllowList::parse(s);
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-all-glob-except-commented.txt:
--------------------------------------------------------------------------------
1 | a/*
2 | ! a/c
3 | # c
4 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-all-glob-except.txt:
--------------------------------------------------------------------------------
1 | a/*
2 | ! a/c
3 | c
4 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-all-glob-extension.txt:
--------------------------------------------------------------------------------
1 | a.*
2 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-all-glob.txt:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-all.txt:
--------------------------------------------------------------------------------
1 | a
2 | a/b
3 | b
4 | c
5 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/allow-some.txt:
--------------------------------------------------------------------------------
1 | a
2 | b
3 |
--------------------------------------------------------------------------------
/src/agent/coverage/src/allowlist/test-data/empty.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/src/agent/coverage/src/allowlist/test-data/empty.txt
--------------------------------------------------------------------------------
/src/agent/coverage/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | #[macro_use]
5 | extern crate log;
6 |
7 | pub mod allowlist;
8 | pub mod binary;
9 | pub mod cobertura;
10 | pub mod record;
11 | pub mod source;
12 | mod timer;
13 |
14 | #[doc(inline)]
15 | pub use allowlist::AllowList;
16 |
17 | #[doc(inline)]
18 | pub use record::{CoverageRecorder, Recorded};
19 |
--------------------------------------------------------------------------------
/src/agent/coverage/tests/snapshots/snapshot__windows_snapshot_tests.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: coverage/tests/snapshot.rs
3 | expression: result
4 | input_file: coverage/tests/windows/Inlinee.cpp
5 | ---
6 | [ ] #include
7 | [ ]
8 | [ ] __declspec(dllexport) void test();
9 | [ ]
10 | [ ] int main()
11 | [✔] {
12 | [✔] std::cout << "Before\n";
13 | [✔] test();
14 | [✔] std::cout << "After\n";
15 | [✔] }
16 | [ ]
17 | [ ] __declspec(dllexport) void test() {
18 | [✔] std::cout << "Hello World!\n";
19 | [ ] }
20 |
21 |
--------------------------------------------------------------------------------
/src/agent/coverage/tests/windows/Inlinee.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | __declspec(dllexport) void test();
4 |
5 | int main()
6 | {
7 | std::cout << "Before\n";
8 | test();
9 | std::cout << "After\n";
10 | }
11 |
12 | __declspec(dllexport) void test() {
13 | std::cout << "Hello World!\n";
14 | }
15 |
--------------------------------------------------------------------------------
/src/agent/data/licenses.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/src/agent/debuggable-module/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "debuggable-module"
3 | version = "0.1.0"
4 | edition = "2021"
5 | license = "MIT"
6 |
7 | [dependencies]
8 | anyhow = "1.0"
9 | elsa = "1.9.0"
10 | gimli = "0.28.0"
11 | goblin = "0.6"
12 | iced-x86 = "1.20"
13 | log = "0.4.17"
14 | pdb = "0.8.0"
15 | regex = "1.9"
16 | symbolic = { version = "12.3", features = [
17 | "debuginfo",
18 | "demangle",
19 | "symcache",
20 | ] }
21 | thiserror = "1.0"
22 |
23 | [dev-dependencies]
24 | clap = { version = "4.4", features = ["derive"] }
25 |
--------------------------------------------------------------------------------
/src/agent/debuggable-module/src/loader.rs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | use anyhow::Result;
5 |
6 | use crate::path::FilePath;
7 |
8 | #[derive(Default)]
9 | pub struct Loader {
10 | loaded: elsa::sync::FrozenMap>,
11 | }
12 |
13 | impl Loader {
14 | pub fn new() -> Self {
15 | Self::default()
16 | }
17 |
18 | pub fn load(&self, path: &FilePath) -> Result<&[u8]> {
19 | // Note: if we ever have this callable in parallel from
20 | // multiple threads, we should use some kind of
21 | // lock to prevent loading the same file multiple times.
22 |
23 | if let Some(data) = self.loaded.get(path) {
24 | return Ok(data);
25 | }
26 |
27 | let data: Box<[u8]> = std::fs::read(path)?.into();
28 | Ok(self.loaded.insert(path.clone(), data))
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/agent/debugger/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "debugger"
3 | version = "0.1.0"
4 | authors = ["fuzzing@microsoft.com"]
5 | edition = "2021"
6 | license = "MIT"
7 |
8 | [dependencies]
9 | anyhow = "1.0"
10 | fnv = "1.0"
11 | goblin = "0.6"
12 | iced-x86 = "1.20"
13 | log = "0.4"
14 | memmap2 = "0.7"
15 | rand = "0.8"
16 | serde = { version = "1.0", features = ["derive"] }
17 | win-util = { path = "../win-util" }
18 |
19 | [dependencies.windows]
20 | version = "0.48"
21 |
--------------------------------------------------------------------------------
/src/agent/debugger/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | #![cfg(windows)]
5 | // Allow safe functions that take `HANDLE` arguments.
6 | //
7 | // Though they type alias raw pointers, they are opaque. In the future, we will
8 | // wrap them in a newtype. This will witness that they were obtained via win32
9 | // API calls or documented pseudohandle construction.
10 | #![allow(clippy::not_unsafe_ptr_arg_deref)]
11 |
12 | mod breakpoint;
13 | pub mod dbghelp;
14 | mod debug_event;
15 | mod debugger;
16 | mod module;
17 | pub mod stack;
18 | mod target;
19 |
20 | pub use self::{
21 | debug_event::DebugEvent,
22 | debugger::{BreakpointId, BreakpointType, DebugEventHandler, Debugger, ModuleLoadInfo},
23 | };
24 |
--------------------------------------------------------------------------------
/src/agent/dynamic-library/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "dynamic-library"
3 | version = "0.1.0"
4 | edition = "2021"
5 | license = "MIT"
6 |
7 | [dependencies]
8 | anyhow = "1.0"
9 | clap = { version = "4.4.2", features = ["derive"] }
10 | lazy_static = "1.4"
11 | regex = "1.9"
12 | thiserror = "1.0"
13 |
14 | [target.'cfg(windows)'.dependencies]
15 | debugger = { path = "../debugger" }
16 | winreg = "0.51"
17 |
18 | [dependencies.windows]
19 | version = "0.48"
20 |
21 | [[bin]]
22 | name = "dynamic-library"
23 |
--------------------------------------------------------------------------------
/src/agent/dynamic-library/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | #[cfg(target_os = "linux")]
5 | pub mod linux;
6 |
7 | #[cfg(target_os = "windows")]
8 | pub mod windows;
9 |
--------------------------------------------------------------------------------
/src/agent/dynamic-library/src/linux/ldd_output_missing_0.txt:
--------------------------------------------------------------------------------
1 | linux-vdso.so.1 (0x00007ffd717b5000)
2 | libmycode.so => /my/project/libmycode.so.1 (0x00007ffd717b5000)
3 | libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1c2ac27000)
4 | libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c29e74000)
5 | /lib64/ld-linux-x86-64.so.2 (0x00007f1c2b1cf000)
6 |
--------------------------------------------------------------------------------
/src/agent/dynamic-library/src/linux/ldd_output_missing_1.txt:
--------------------------------------------------------------------------------
1 | linux-vdso.so.1 (0x00007ffd717b5000)
2 | libmycode.so => not found
3 | libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1c2ac27000)
4 | libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c29e74000)
5 | /lib64/ld-linux-x86-64.so.2 (0x00007f1c2b1cf000)
6 |
--------------------------------------------------------------------------------
/src/agent/dynamic-library/src/linux/ldd_output_missing_2.txt:
--------------------------------------------------------------------------------
1 | linux-vdso.so.1 (0x00007ffd717b5000)
2 | libmycode.so => not found
3 | libmyothercode.so => not found
4 | libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1c2ac27000)
5 | libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c29e74000)
6 | /lib64/ld-linux-x86-64.so.2 (0x00007f1c2b1cf000)
7 |
--------------------------------------------------------------------------------
/src/agent/input-tester/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "input-tester"
3 | version = "0.1.0"
4 | authors = ["fuzzing@microsoft.com"]
5 | edition = "2021"
6 | license = "MIT"
7 |
8 | [dependencies]
9 | anyhow = "1.0"
10 | atexit = { path = "../atexit" }
11 | debugger = { path = "../debugger" }
12 | fnv = "1.0"
13 | hex = "0.4"
14 | log = "0.4"
15 | num_cpus = "1.15"
16 | rayon = "1.8"
17 | sha2 = "0.10.2"
18 | win-util = { path = "../win-util" }
19 |
20 | [dependencies.windows]
21 | version = "0.48"
22 | features = [
23 | "Win32_System_SystemServices"
24 | ]
25 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "libclusterfuzz"
3 | version = "0.0.1"
4 | authors = ["fuzzing@microsoft.com>"]
5 | edition = "2021"
6 | license = "Apache-2.0"
7 | description = "Minimal porting of features from libclusterfuzz"
8 |
9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
10 |
11 | [dependencies]
12 | anyhow = "1.0"
13 | regex = "1.9.1"
14 | lazy_static = "1.4"
15 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/README.md:
--------------------------------------------------------------------------------
1 | Please note, this is crate contains rust code generated from parsing python
2 | code from [clusterfuzz](https://github.com/google/clusterfuzz). All of the
3 | code from this project is labeled with Google's original copyright
4 | statements.
5 |
6 | However, any errors may be the result of a mistake in the code generation
7 | process. As such, please file the issues with
8 | [onefuzz](https://github.com/microsoft/onefuzz) first.
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/cgmanifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/component-detection-manifest.json",
3 | "Registrations": [
4 | {
5 | "Component": {
6 | "Type": "git",
7 | "Git": {
8 | "RepositoryUrl": "https://github.com/google/clusterfuzz",
9 | "CommitHash": "d85aed776d120e6df26aa1cd0335fc7a53d76816"
10 | }
11 | }
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/parsed-traces/check_dir@golang_libfuzzer_panic.txt.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: stacktrace-parser/src/lib.rs
3 | expression: parsed
4 | input_file: libclusterfuzz/data/stack-traces/golang_libfuzzer_panic.txt
5 | ---
6 | {
7 | "text": "panic: parse //%B9%B9%B9%B9%B9%01%00%00%00%00%00%00%00%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9: invalid URL escape \"%01\"\n\ngoroutine 17 [running, locked to thread]:\ngithub.com/dvyukov/go-fuzz-corpus/url.Fuzz(0x6030001458a0, 0x20, 0x20, 0x10c0000c8ea0)\n /tmp/go-fuzz-build242808228/gopath/src/github.com/dvyukov/go-fuzz-corpus/url/main.go:24 +0x3d5\nmain.fuzzer_run(0x6030001458a0, 0x20, 0x20)\n /tmp/go-fuzz-build242808228/gopath/src/github.com/dvyukov/go-fuzz-corpus/url/go.fuzz.main/main.go:13 +0x41\nmain._cgoexpwrap_9bd49841752b_fuzzer_run(0x6030001458a0, 0x20, 0x20)\n _cgo_gotypes.go:45 +0x41\n==158476== ERROR: libFuzzer: deadly signal\n",
8 | "sanitizer": "libFuzzer",
9 | "summary": "libFuzzer: deadly signal",
10 | "fault_type": "deadly signal"
11 | }
12 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/parsed-traces/check_dir@sanitizer_signal_abrt.txt.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: stacktrace-parser/src/lib.rs
3 | expression: parsed
4 | input_file: libclusterfuzz/data/stack-traces/sanitizer_signal_abrt.txt
5 | ---
6 | {
7 | "text": "ASAN:SIGABRT\n==28640==ERROR: AddressSanitizer: ABRT (pc 0x7f8632666425 sp 0x7fff0cae8f08 bp 0x7fff0cae91d0 T0)\n #0 0x7f8632666424 (/lib/x86_64-linux-gnu/libc-2.15.so+0x36424)\n #1 0x7f8632669b8a (/lib/x86_64-linux-gnu/libc-2.15.so+0x39b8a)\n #2 0x42b11e (/tmp/coredump+0x42b11e)\n #3 0x7f863265176c (/lib/x86_64-linux-gnu/libc-2.15.so+0x2176c)\n #4 0x42ae7c (/tmp/coredump+0x42ae7c)\nAborted (core dumped)\n\n",
8 | "sanitizer": "AddressSanitizer",
9 | "summary": "AddressSanitizer: ABRT (pc 0x7f8632666425 sp 0x7fff0cae8f08 bp 0x7fff0cae91d0 T0)",
10 | "fault_type": "ABRT"
11 | }
12 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/parsed-traces/check_dir@unknown_module.txt.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: stacktrace-parser/src/lib.rs
3 | expression: parsed
4 | input_file: libclusterfuzz/data/stack-traces/unknown_module.txt
5 | ---
6 | {
7 | "text": "==3304==ERROR: AddressSanitizer: access-violation on unknown address 0x0ec3fdec (pc 0x0ec3fdec bp 0x00000000 sp 0x0ec3fde8 T16777215)\n[0624/081056:ERROR:client_util.cc(272)] Could not find exported function RelaunchChromeBrowserWithNewCommandLineIfNeeded\n #0 0xec3fdeb ()\n\nAddressSanitizer can not provide additional info.\nSUMMARY: AddressSanitizer: SEGV ()\n==3304==ABORTING\n",
8 | "sanitizer": "AddressSanitizer",
9 | "summary": "AddressSanitizer: SEGV ()",
10 | "fault_type": "SEGV"
11 | }
12 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/assert_failure_google.txt:
--------------------------------------------------------------------------------
1 | F0812 21:22:15.159294 61315 logging.cc:89] assert.h assertion failed at file/path.cc:380 in Foo: Blah.empty() && "Failure!"
2 | AddressSanitizer:DEADLYSIGNAL
3 | =================================================================
4 | ==61315==ERROR: AddressSanitizer: ABRT on unknown address 0x05390000ef83 (pc 0x7fd6607ef602 bp 0x7ffc9d927900 sp 0x7ffc9d9277d8 T0)
5 | SCARINESS: 10 (signal)
6 | #0 0x7fd6607ef601 in raise (/usr/grte/v4/lib64/libc.so.6+0xfffff)
7 | #1 0x7fd6607f131f in abort (/usr/grte/v4/lib64/libc.so.6+0xfffff)
8 | #12 0x561b33363be6 in Frame(int) file/path.cc:48:11
9 | #13 0x561b33360f41 in LLVMFuzzerTestOneInput file/path.cc:23:3
10 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/assert_in_drt_string.txt:
--------------------------------------------------------------------------------
1 | [30020:30020:0810/024340:317857911391:INFO:audio_manager_pulse.cc(258)] Failed to connect to the context. Error: Connection refused
2 | Xlib: extension "RANDR" missing on display ":1".
3 | #READY
4 | Xlib: extension "RANDR" missing on display ":1".
5 | Content-Type: text/plain
6 | ASSERT should not be triggered when type is changed in focus event.
7 | #EOF
8 | #EOF
9 | #EOF
10 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/cfi_invalid_vtable.txt:
--------------------------------------------------------------------------------
1 | test/cfi/simple-fail.cpp:103:4: runtime error: control flow integrity check for type 'B' failed during cast to unrelated type (vtable address 0x000000422710)
2 | 0x000000422710: note: invalid vtable
3 | ^
4 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/cfi_nodebug.txt:
--------------------------------------------------------------------------------
1 | Received signal 4 ILL_ILLOPN 7fdf1d27c590
2 | CFI: Most likely a control flow integrity violation; for more information see:
3 | https://www.chromium.org/developers/testing/control-flow-integrity
4 | #0 0x7fdf1ae337a8 in abc::def() /blah/blah.cc:111
5 | #1 0x7fdf14feb340 in foo() /blah/hello.cc:3
6 | #2 0xbeefbeefbeef in bar() /blah/hello.cc:5
7 | #3 133713371337ff in hack() /blah/hack.cc:55
8 | dx: 0000000000000529 ax: 0000000000001fe9 cx: 0000000000000017 sp: 00007fff77dd82d8
9 | ip: 00007fdf1d27c590 efl: 0000000000010202 cgf: ffff000000000033 erf: 0000000000000000
10 | [end of stack trace]
11 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/cfi_unrelated_vtable.txt:
--------------------------------------------------------------------------------
1 | test/cfi/simple-fail.cpp:103:4: runtime error: control flow integrity check for type 'B' failed during cast to unrelated type (vtable address 0x000000422710)
2 | 0x000000422710: note: vtable is of type 'A'
3 | 00 00 00 00 c0 c4 41 00 00 00 00 00 31 41 00 00 00 00 00 00 30 d0 ef 00 00 00 00 00 18 27 42 00
4 | ^
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/check_failure_chrome_android.txt:
--------------------------------------------------------------------------------
1 | ### ### ### ### ### ### ### ### ### ### ### ### ###
2 | Fatal signal 6 (SIGABRT), code -6 in tid 24061 (oid.apps.chrome)
3 | Detects a new minidump 10450b7b-4280-5e94-1777691c-05ff1236.dmp24061 send intent to MinidumpUploadService
4 | --------- DEBUG (22983):
5 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
6 | Build fingerprint: google/hammerhead/hammerhead:6.0/MRA59G/2457013:userdebug/dev-keys
7 | Revision: 0
8 | ABI: arm
9 | pid: 24061, tid: 24061, name: oid.apps.chrome >>> com.google.android.apps.chrome <<<
10 | signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
11 | Abort message: [FATAL:compositor_impl_android.cc(550)] Timed out waiting for GPU channel.
12 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/check_failure_chrome_android2.txt:
--------------------------------------------------------------------------------
1 | Fatal signal 6 (SIGABRT), code -6 in tid 21409 (CrRendererMain)
2 | --------- SELinux (198):
3 | SELinux: Loaded file_contexts contexts from /file_contexts.
4 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
5 | Build fingerprint: google/hammerhead/hammerhead:6.0/MRA59G/2457013:userdebug/dev-keys
6 | Revision: 0
7 | ABI: arm
8 | pid: 21395, tid: 21409, name: CrRendererMain >>> com.google.android.apps.chrome:sandboxed_process2 <<<
9 | signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10 | Abort message: [FATAL:FrameView.cpp(1838)] Check failed: lifecycle().state() < DocumentLifecycle::LayoutClean.
11 | #0 0xa26fcd8b in logging::LogMessage::~LogMessage() base/logging.cc:532:29
12 | #1 0xa3c30597 in blink::FrameView::checkLayoutInvalidationIsAllowed() const third_party/WebKit/Source/core/frame/FrameView.cpp:1838:5
13 | #2 0xa3d1ca0b in blink::FrameView::setNeedsLayout() third_party/WebKit/Source/core/frame/FrameView.cpp:1929:5
14 | #3 0xa8d680f1 in blink::LayoutPart::updateWidgetGeometry() third_party/WebKit/Source/core/layout/LayoutPart.cpp:309:20
15 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/check_failure_google.txt:
--------------------------------------------------------------------------------
1 | F0813 00:29:27.775753 384244 file.cc:130] Check failed: std::is_sorted(foo.begin(), foo.end())
2 | AddressSanitizer:DEADLYSIGNAL
3 | =================================================================
4 | ==384244==ERROR: AddressSanitizer: ABRT on unknown address 0x05390005dcf4 (pc 0x7f91eacc0602 bp 0x7ffeddeee0c0 sp 0x7ffeddeedf98 T0)
5 | SCARINESS: 10 (signal)
6 | #0 0x7f91eacc0601 in raise (/usr/grte/v4/lib64/libc.so.6+0xfffff)
7 | #1 0x7f91eacc231f in abort (/usr/grte/v4/lib64/libc.so.6+0xfffff)
8 | #6 0x560e73b80fe2 in Frame(int) file/path.cc:130:3
9 | #8 0x560e73b7d819 in LLVMFuzzerTestOneInput file/path.cc:10:1
10 | AddressSanitizer can not provide additional info.
11 | SUMMARY: AddressSanitizer: ABRT (/usr/grte/v4/lib64/libc.so.6+0xfffff) in raise
12 | ==384244==ABORTING
13 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/check_failure_with_comparison.txt:
--------------------------------------------------------------------------------
1 | [5:5:0100/000000:FATAL:zygote_linux.cc(449)] Check failed: len > 0 (-1 vs. 0)
2 | [1:1:0100/000000:FATAL:zygote_linux.cc(420)] Failed to synchronise with parent zygote process
3 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/check_failure_with_comparison2.txt:
--------------------------------------------------------------------------------
1 | [1:1:0412/075451.163515:FATAL:compositing_layer_property_updater.cc(57)] Check failed: layout_snapped_paint_offset == snapped_paint_offset ("9,134.016" vs. "9,134")"LayoutHTMLCanvas CANVAS id='htmlvar00020'"
2 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/gdb_sigtrap.txt:
--------------------------------------------------------------------------------
1 | 0x0000000000000ac8 in __aeabi_memcpy ()
2 |
3 | Program received signal SIGTRAP, Trace/breakpoint trap.
4 | 0x0000000000000ac8 in __aeabi_memcpy ()
5 | #0 0x0000000000000ac8 in __aeabi_memcpy ()
6 | #1 0x00000000000007d8 in memcpy ()
7 | #2 0x000000000000cdc0 in xymodem_trnasfer (target_addr=0x2022000, max_sz=, prot_type=1) at usbdev/protocol_xymodem.c:362
8 | #3 0x0000000000002060 in LoadImageFromUsb30 (uTargetAddr=, uSizeLimit=, req_type=3239010) at usbdev/usbdev_api.c:267
9 | #4 0x0000000000001fec in LoadBL1FromUsb30 () at usbdev/usbdev_api.c:225
10 | #5 0x0000000000004514 in Main () at boot/main.c:94
11 | #6 0x0000000000000044 in GPIO_SetPudBits (SFR_Address=, base=, mask=, value=) at gpio/gpio.c:38
12 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/generic_segv.txt:
--------------------------------------------------------------------------------
1 | Warning: unknown flag --harmony-templates.
2 | Try --help for options
3 | Received signal 11 SEGV_MAPERR 7f6b0c580000
4 | ==== C stack trace ===============================
5 | [0x7f6b13882bf1]
6 | [0x7f6b137dadb5]
7 | [0x7f6b0d5c2340]
8 | [0x7f69a09750a9]
9 | [end of stack trace]
10 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_generic_fatal_error_and_asan_abrt.txt:
--------------------------------------------------------------------------------
1 | fatal error: error message here
2 |
3 | goroutine 17 [running, locked to thread]:
4 | encoding/json.(*decodeState).unquoteBytes(0x10c000096420, 0x10c00001c568, 0x1, 0x8, 0x0, 0x0, 0x0, 0x0)
5 | /src/go/src/encoding/json/decode.go:1264 +0xb3b
6 | main.LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x9b1ad0)
7 | github.com/dvyukov/go-fuzz-corpus/json/go.fuzz.main/main.go:35 +0x66
8 | main._cgoexpwrap_e34c4d0cdb90_LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x2758b0)
9 | _cgo_gotypes.go:64 +0x37
10 | AddressSanitizer:DEADLYSIGNAL
11 | =================================================================
12 | ==1==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000001 (pc 0x0000005c1a81 bp 0x10c0000bd628 sp 0x10c0000bd610 T0)
13 | SCARINESS: 10 (signal)
14 | #0 0x5c1a80 in runtime.raise runtime/sys_linux_amd64.s:149
15 | AddressSanitizer can not provide additional info.
16 | SUMMARY: AddressSanitizer: ABRT (/mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds_golang_d17eb352b38c4d62fce2871b0afb04af926c5e25/revisions/fuzzer-json+0x5c1a80)
17 | ==1==ABORTING
18 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_generic_panic_and_asan_abrt.txt:
--------------------------------------------------------------------------------
1 | panic: error message here
2 |
3 | goroutine 17 [running, locked to thread]:
4 | encoding/json.(*decodeState).unquoteBytes(0x10c000096420, 0x10c00001c568, 0x1, 0x8, 0x0, 0x0, 0x0, 0x0)
5 | /src/go/src/encoding/json/decode.go:1264 +0xb3b
6 | main.LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x9b1ad0)
7 | github.com/dvyukov/go-fuzz-corpus/json/go.fuzz.main/main.go:35 +0x66
8 | main._cgoexpwrap_e34c4d0cdb90_LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x2758b0)
9 | _cgo_gotypes.go:64 +0x37
10 | AddressSanitizer:DEADLYSIGNAL
11 | =================================================================
12 | ==1==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000001 (pc 0x0000005c1a81 bp 0x10c0000bd628 sp 0x10c0000bd610 T0)
13 | SCARINESS: 10 (signal)
14 | #0 0x5c1a80 in runtime.raise runtime/sys_linux_amd64.s:149
15 | AddressSanitizer can not provide additional info.
16 | SUMMARY: AddressSanitizer: ABRT (/mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds_golang_d17eb352b38c4d62fce2871b0afb04af926c5e25/revisions/fuzzer-json+0x5c1a80)
17 | ==1==ABORTING
18 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_libfuzzer_panic.txt:
--------------------------------------------------------------------------------
1 | panic: parse //%B9%B9%B9%B9%B9%01%00%00%00%00%00%00%00%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9%B9: invalid URL escape "%01"
2 |
3 | goroutine 17 [running, locked to thread]:
4 | github.com/dvyukov/go-fuzz-corpus/url.Fuzz(0x6030001458a0, 0x20, 0x20, 0x10c0000c8ea0)
5 | /tmp/go-fuzz-build242808228/gopath/src/github.com/dvyukov/go-fuzz-corpus/url/main.go:24 +0x3d5
6 | main.fuzzer_run(0x6030001458a0, 0x20, 0x20)
7 | /tmp/go-fuzz-build242808228/gopath/src/github.com/dvyukov/go-fuzz-corpus/url/go.fuzz.main/main.go:13 +0x41
8 | main._cgoexpwrap_9bd49841752b_fuzzer_run(0x6030001458a0, 0x20, 0x20)
9 | _cgo_gotypes.go:45 +0x41
10 | ==158476== ERROR: libFuzzer: deadly signal
11 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_new_crash_type_and_asan_abrt.txt:
--------------------------------------------------------------------------------
1 | unknown error: error message here
2 |
3 | goroutine 17 [running, locked to thread]:
4 | encoding/json.(*decodeState).unquoteBytes(0x10c000096420, 0x10c00001c568, 0x1, 0x8, 0x0, 0x0, 0x0, 0x0)
5 | /src/go/src/encoding/json/decode.go:1264 +0xb3b
6 | main.LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x9b1ad0)
7 | github.com/dvyukov/go-fuzz-corpus/json/go.fuzz.main/main.go:35 +0x66
8 | main._cgoexpwrap_e34c4d0cdb90_LLVMFuzzerTestOneInput(0x6050000001d0, 0xa, 0x2758b0)
9 | _cgo_gotypes.go:64 +0x37
10 | AddressSanitizer:DEADLYSIGNAL
11 | =================================================================
12 | ==1==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000001 (pc 0x0000005c1a81 bp 0x10c0000bd628 sp 0x10c0000bd610 T0)
13 | SCARINESS: 10 (signal)
14 | #0 0x5c1a80 in runtime.raise runtime/sys_linux_amd64.s:149
15 | AddressSanitizer can not provide additional info.
16 | SUMMARY: AddressSanitizer: ABRT (/mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds_golang_d17eb352b38c4d62fce2871b0afb04af926c5e25/revisions/fuzzer-json+0x5c1a80)
17 | ==1==ABORTING
18 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_panic_runtime_error_integer_divide_by_zero.txt:
--------------------------------------------------------------------------------
1 | panic: runtime error: integer divide by zero
2 |
3 | goroutine 40 [running]:
4 | github.com/d2r2/go-bsbmp.(*SensorBMP180).ReadPressureMult10Pa(0x2502020, 0x2500080, 0x3, 0x4087becc, 0xc0000000, 0x4087becc)
5 | /home/pi/go/src/github.com/d2r2/go-bsbmp/bmp180.go:340 +0xfa4
6 | github.com/d2r2/go-bsbmp.(*BMP).ReadAltitude(0x2500090, 0x3, 0x4087becc, 0x1, 0x4b2038)
7 | /home/pi/go/src/github.com/d2r2/go-bsbmp/bmp.go:213 +0x38
8 | main.main.func3(0x2500090)
9 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_panic_runtime_error_makeslice_len_out_of_range.txt:
--------------------------------------------------------------------------------
1 | panic: runtime error: makeslice: len out of range
2 |
3 | goroutine 1 [running]:
4 | panic(0x85d9e0, 0xc849858ed0)
5 | /usr/lib/go/src/runtime/panic.go:464 +0x3e6
6 | cmd/compile/internal/gc.newliveness(0xc82082ee10, 0xc82b6e4240, 0xc8505aa000, 0x35a64, 0x3a000, 0xc8497de000, 0xd398, 0xf000, 0x4130239190186200)
7 | /usr/lib/go/src/cmd/compile/internal/gc/plive.go:687 +0x161
8 | cmd/compile/internal/gc.liveness(0xc82082ee10, 0xc82b6e4240, 0xc82d2c3e80, 0xc82d2c3f00)
9 | /usr/lib/go/src/cmd/compile/internal/gc/plive.go:1782 +0x2cf
10 | cmd/compile/internal/gc.compile(0xc82082ee10)
11 | /usr/lib/go/src/cmd/compile/internal/gc/pgen.go:541 +0xdf2
12 | cmd/compile/internal/gc.funccompile(0xc82082ee10)
13 | /usr/lib/go/src/cmd/compile/internal/gc/dcl.go:1450 +0x1c0
14 | cmd/compile/internal/gc.Main()
15 | /usr/lib/go/src/cmd/compile/internal/gc/lex.go:476 +0x2205
16 | cmd/compile/internal/amd64.Main()
17 | /usr/lib/go/src/cmd/compile/internal/amd64/galign.go:127 +0x58d
18 | main.main()
19 | /usr/lib/go/src/cmd/compile/main.go:33 +0x395
20 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/golang_sigsegv_panic.txt:
--------------------------------------------------------------------------------
1 | root@943ca8071e8b:/out# ./fuzzer-bzip2
2 | panic: runtime error: invalid memory address or nil pointer dereference
3 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5da137]
4 |
5 | goroutine 1 [running]:
6 | math.glob..func1(0x5da117)
7 | /src/go/src/math/exp_asm.go:11 +0x7
8 | math.init.ializers()
9 | /src/go/src/math/exp_asm.go:11 +0x3f
10 | Aborted
11 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/hwasan_tag_mismatch.txt:
--------------------------------------------------------------------------------
1 | ==872==ERROR: HWAddressSanitizer: tag-mismatch on address 0x0040e1287be0 at pc 0x007618899e7c
2 | READ of size 8 at 0x0040e1287be0 tags: 0f/47 (ptr/mem) in thread T31
3 | #0 0x7618899e78 frame1
4 | #1 0x761889ddb8 frame2
5 | #2 0x7618896a00 frame3
6 |
7 | [0x0040e1287b80,0x0040e1287c00) is a small unallocated heap chunk; size: 128 offset: 96
8 | 0x0040e1287be0 is located 96 bytes inside of 112-byte region [0x0040e1287b80,0x0040e1287bf0)
9 | freed by thread T0 here:
10 | #0 0x761a68a9dc frame4
11 | #1 0x7618897814 frame5
12 | #2 0x7618899150 frame6
13 |
14 | previously allocated here:
15 | #0 0x761a68a7ac frame7
16 | #1 0x7618898aec frame8
17 | #2 0x7618898770 frame9
18 | #3 0x76188917a0 frame10
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/ignore_asan_warning.txt:
--------------------------------------------------------------------------------
1 | E: clusterfuzz: Failed to lock chroot: /var/lib/schroot/session/clusterfuzz: Failed to write session file: File exists
2 | ==16763==WARNING: AddressSanitizer failed to allocate 0xffffffff bytes
3 | /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/fuzz-00919.js:4: RangeError: Invalid array buffer length
4 | var __v_4 = new ArrayBuffer(byteLength);
5 | ^
6 |
7 |
8 | #
9 | # Fatal error in ../../src/objects-inl.h, line 3061
10 | # Check failed: !v8::internal::FLAG_enable_slow_asserts || (object->IsAccessCheckInfo()).
11 | #
12 |
13 | ==== C stack trace ===============================
14 |
15 | 1: 0xb2b5b14
16 | 2: 0xb2b6142
17 | 3: 0x9543acd
18 | 4: 0x9545ce5
19 | 5: 0x977a2fb
20 | 6: 0x98973ef
21 | 7: 0x9f9bca2
22 | 8: 0x82cccf8
23 | 9: 0x82ce064
24 | 10: 0x812fab0
25 | 11: 0x815df3d
26 | 12: 0x8195d8d
27 | 13: 0xb2cd849
28 | 14: 0x810d1b4
29 | 15: 0x80e3b8b
30 | 16: 0xf7246d78
31 | 17: clone
32 | E: Child terminated by signal ‘Illegal instruction’
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/log_fatal_google.txt:
--------------------------------------------------------------------------------
1 | F0812 20:32:32.874783 47273 file.h:195] Log fatal.
2 | AddressSanitizer:DEADLYSIGNAL
3 | =================================================================
4 | ==47273==ERROR: AddressSanitizer: ABRT on unknown address 0x05390000b8a9 (pc 0x7fb149fee602 bp 0x7ffe9a107800 sp 0x7ffe9a1076d8 T0)
5 | SCARINESS: 10 (signal)
6 | #0 0x7fd6607ef601 in raise (/usr/grte/v4/lib64/libc.so.6+0xfffff)
7 | #1 0x7fd6607f131f in abort (/usr/grte/v4/lib64/libc.so.6+0xfffff)
8 | #10 0x5585f338030f in Frame(int) file/path.cc:87:9
9 | #11 0x5585f33815b2 in LLVMFuzzerTestOneInput file/path.cc:98:1
10 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/lsan_single_frame_stacks.txt:
--------------------------------------------------------------------------------
1 | -----------------------------------------------------
2 | Suppressions used:
3 | count bytes template
4 | 581 16883 libfontconfig
5 | -----------------------------------------------------
6 |
7 | =================================================================
8 | ==31049==ERROR: LeakSanitizer: detected memory leaks
9 | Direct leak of 1 byte(s) in 1 object(s) allocated from:
10 | #0 0x7f1d1174876b in f(unsigned long) /usr/include/blah.h:88
11 |
12 | Direct leak of 1 byte(s) in 1 object(s) allocated from:
13 | #0 0x7f1d1174876c in g(unsigned long) /usr/include/blah.h:89
14 |
15 | SUMMARY: AddressSanitizer: 2 byte(s) leaked in 2 allocation(s).
16 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/missing_library_android.txt:
--------------------------------------------------------------------------------
1 | CANNOT LINK EXECUTABLE "/build/vts_proto_fuzzer": library "libvts_codecoverage.so" not found
2 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/missing_library_linux.txt:
--------------------------------------------------------------------------------
1 | ./test: error while loading shared libraries: libtest.so.1: cannot open shared object file: No such file or directory
2 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/sanitizer_signal_abrt.txt:
--------------------------------------------------------------------------------
1 | ASAN:SIGABRT
2 | ==28640==ERROR: AddressSanitizer: ABRT (pc 0x7f8632666425 sp 0x7fff0cae8f08 bp 0x7fff0cae91d0 T0)
3 | #0 0x7f8632666424 (/lib/x86_64-linux-gnu/libc-2.15.so+0x36424)
4 | #1 0x7f8632669b8a (/lib/x86_64-linux-gnu/libc-2.15.so+0x39b8a)
5 | #2 0x42b11e (/tmp/coredump+0x42b11e)
6 | #3 0x7f863265176c (/lib/x86_64-linux-gnu/libc-2.15.so+0x2176c)
7 | #4 0x42ae7c (/tmp/coredump+0x42ae7c)
8 | Aborted (core dumped)
9 |
10 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/sanitizer_signal_abrt_unknown.txt:
--------------------------------------------------------------------------------
1 | ERROR: AddressSanitizer: ABRT on unknown address 0x000000000001 (pc 0x7f24b70be418 bp 0x0000005b6a80 sp 0x7ffe58419768 T0)
2 | SCARINESS: 10 (signal)
3 | #0 0x7f24b70be417 in gsignal
4 | #1 0x7f24b70c0019 in abort
5 | #2 0x7f24b70b6bd6 in libc.so.6
6 | #3 0x7f24b70b6c81 in __assert_fail
7 | #4 0x512b27 in LLVMFuzzerTestOneInput
8 | /src/json/test/src/fuzzer-parse_msgpack.cpp:45:13
9 | #5 0x5122e3 in main /src/libfuzzer/afl/afl_driver.cpp:287:7
10 | #6 0x7f24b70a982f in __libc_start_main
11 | #7 0x41b588 in _start
12 |
13 | AddressSanitizer can not provide additional info.
14 | SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x35417)
15 | ==1==ABORTING
16 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/ubsan_unknown_logs_error.txt:
--------------------------------------------------------------------------------
1 | Running: /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash-1ecd3fd5c9ee4c8545301c3dd5ddc333dbe7360c
2 | ../../third_party/freetype/src/src/cff/cffload.c:2060:51: runtime error: unsupported ubsan error that needs a new signature
3 | #0 0x564ca63e03d4 in a ../../file:1234:1
4 | #1 0x564ca63de001 in b ../../file:1234:1
5 | #2 0x564ca63d2426 in c ../../file:1234:1
6 | SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../file:1234:1
7 | Executed /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash-1ecd3fd5c9ee4c8545301c3dd5ddc333dbe7360c in 1 ms
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/unknown_module.txt:
--------------------------------------------------------------------------------
1 | ==3304==ERROR: AddressSanitizer: access-violation on unknown address 0x0ec3fdec (pc 0x0ec3fdec bp 0x00000000 sp 0x0ec3fde8 T16777215)
2 | [0624/081056:ERROR:client_util.cc(272)] Could not find exported function RelaunchChromeBrowserWithNewCommandLineIfNeeded
3 | #0 0xec3fdeb ()
4 |
5 | AddressSanitizer can not provide additional info.
6 | SUMMARY: AddressSanitizer: SEGV ()
7 | ==3304==ABORTING
8 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_check.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../src/heap/mark-compact.h, line 54
3 | # Check failed: !IsImpossible(mark_bit).
4 | #
5 |
6 | ==== C stack trace ===============================
7 |
8 | 1: 0xb29b0f4
9 | 2: 0xb29b722
10 | 3: 0x8efa09d
11 | 4: 0x8e6592c
12 | 5: 0x87d84a9
13 | 6: 0x8835c19
14 | 7: 0x9f048dc
15 | 8: 0xa70a1bc
16 | 9: 0xa6ffa2c
17 | 10: 0xa7279c8
18 | 11: 0xa727de0
19 | 12: 0xa729b5f
20 | 13: 0x8abff10
21 | 14: 0x8ab8e14
22 | 15: 0x81c0f08
23 | 16: 0x8226891
24 | 17: 0x812f610
25 | 18: 0x81580df
26 | 19: 0x81627fe
27 | 20: 0x8164309
28 | 21: __libc_start_main
29 | 22: 0x806081a
30 | E: Child terminated by signal ‘Illegal instruction’
31 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_check_eq.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../v8/src/compiler/verifier.cc, line 394
3 | # Check failed: a == b (2 vs. 3).
4 | #
5 |
6 | ==== C stack trace ===============================
7 |
8 | 1: 0x7f4843814746
9 | 2: 0x7f4843814d6b
10 | 3: 0x7f4841e7fb22
11 | 4: 0x7f4841e84a9c
12 | 5: 0x7f4841cfa3c9
13 | 6: 0x7f4841cfbc1f
14 | 7: 0x7f4841ea52dd
15 | 8: 0x7f4841eb26d7
16 | 9: 0x7f4841eb4bd2
17 | 10: 0x7f4841eb089b
18 | 11: 0x7f4842f25943
19 | 12: 0x7f46d0409afb
20 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_check_windows.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ..\..\v8\src\objects-debug.cc, line 1234
3 | # Check failed: !field_type->NowStable().
4 | #
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_correctness_failure.txt:
--------------------------------------------------------------------------------
1 | #
2 | # V8 correctness failure
3 | # V8 correctness configs: x64,fullcode:x64,ignition_staging
4 | # V8 correctness sources: deadbeef,beefdead,abcd1234
5 | # V8 correctness suppression: crbug.com/123456
6 |
7 |
8 | More text
9 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_fatal_error_no_check.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in v8::HandleScope::CreateHandle()
3 | # Cannot create a handle without a HandleScope
4 | #
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_fatal_error_partial.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../src/objects-inl.h, line 2244
3 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_oom.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in CALL_AND_RETRY_LAST
3 | # Allocation failed - JavaScript heap out of memory
4 | #
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_representation_changer_error.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../v8/src/compiler/representation-change.cc, line 517
3 | # RepresentationChangerError: node #81:Int64Constant of kRepWord64 (Internal) cannot be changed to kRepTagged
4 | #
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_runtime_error.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Runtime error in ../../src/runtime/runtime-test.cc, line 87
3 | #
4 | # args[0]->IsJSFunction()
5 |
6 | ==== C stack trace ===============================
7 |
8 | 1: 0x34cdfb0
9 | 2: 0x34ce63d
10 | 3: 0x332661a
11 | 4: 0x3325b71
12 | 5: 0x7f7256306187
13 | Caught: illegal access
14 | Caught: ReferenceError: debug is not defined
15 | Caught: ReferenceError: foo is not defined
16 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_unimplemented_code.txt:
--------------------------------------------------------------------------------
1 | Caught: ReferenceError: debug is not defined
2 | Caught: ReferenceError: Debug is not defined
3 |
4 |
5 | #
6 | # Fatal error in ../../src/arm/simulator-arm.cc, line 3715
7 | # unimplemented code
8 | #
9 |
10 | ==== C stack trace ===============================
11 |
12 | 1: 0xb27abe4
13 | 2: 0xb27b212
14 | 3: 0xa706089
15 | 4: 0xa6ed7c3
16 | 5: 0xa7157b8
17 | 6: 0xa715bd0
18 | 7: 0xa71794f
19 | 8: 0x8ac1900
20 | 9: 0x8aba804
21 | 10: 0x81c1fc8
22 | 11: 0x8226821
23 | 12: 0x812f5a0
24 | 13: 0x815780f
25 | 14: 0x816227e
26 | 15: 0x816463f
27 | 16: __libc_start_main
28 | 17: 0x80607aa
29 | E: Child terminated by signal ‘Illegal instruction’
30 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_unknown_fatal_error.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../src/arm/simulator-arm.cc, line 3715
3 | # something that isn't supported yet
4 | #
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/data/stack-traces/v8_unreachable_code.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Fatal error in ../../v8/src/compiler/typer.cc, line 1626
3 | # unreachable code
4 | #
5 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/third-party/crash_analysis/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onefuzz/82fffbe8adc047f055cb4fddcae17e9e1244423e/src/agent/libclusterfuzz/third-party/crash_analysis/__init__.py
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/third-party/crash_analysis/stack_parsing.py:
--------------------------------------------------------------------------------
1 | # this is a stubbed out class to enable us to load `constants.py` during code
2 | # generation.
3 |
4 | class stack_parser:
5 | def StackFrameSpec(*args, **kwargs):
6 | pass
7 |
--------------------------------------------------------------------------------
/src/agent/libclusterfuzz/third-party/update.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (c) Microsoft Corporation.
4 | # Licensed under the MIT License.
5 | #
6 |
7 | set -ex
8 |
9 |
10 | cd $(dirname "$(readlink -f "$0")")
11 | git clone --depth 1 https://github.com/google/clusterfuzz clusterfuzz-src
12 | mv clusterfuzz-src/src/python/lib/clusterfuzz/stacktraces/constants.py .
13 | mkdir -p ../data/stack-traces
14 | cp clusterfuzz-src/src/python/tests/core/crash_analysis/stack_parsing/stack_analyzer_data/*.txt ../data/stack-traces/
15 | chmod -x ../data/stack-traces/*.txt
16 | python build.py
17 | rm -rf constants.py __pycache__ */__pycache__ clusterfuzz-src
18 | (cd ../; cargo fmt)
19 |
--------------------------------------------------------------------------------
/src/agent/onefuzz-agent/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | Cargo.lock
3 |
--------------------------------------------------------------------------------
/src/agent/onefuzz-agent/src/coordinator/double.rs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | use super::*;
5 |
6 | #[derive(Debug, Default)]
7 | pub struct CoordinatorDouble {
8 | pub commands: Arc>>,
9 | pub events: Arc>>,
10 | }
11 |
12 | #[async_trait]
13 | impl ICoordinator for CoordinatorDouble {
14 | async fn poll_commands(&mut self) -> Result