Skip to content

Commit 9d56532

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 97bf472 + 2f62370 commit 9d56532

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

fusil/process/prepare.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ def prepareProcess(process):
3535
except Exception as e:
3636
print(e)
3737
# Change the user and group
38-
changeUserGroup(config, options)
38+
try:
39+
changeUserGroup(config, options)
40+
except Exception as e:
41+
print(e)
3942

4043
try:
4144
chdir(directory)
@@ -55,7 +58,8 @@ def prepareProcess(process):
5558

5659
# Make sure that the program is executable by the current user
5760
program = process.current_arguments[0]
58-
if not access(program, X_OK):
61+
# if not access(program, X_OK):
62+
if 0:
5963
user = getuid()
6064
user = getpwuid(user).pw_name
6165
message = "The user %s is not allowed to execute the file %s" % (user, program)
@@ -66,7 +70,8 @@ def prepareProcess(process):
6670
raise ChildError(message)
6771

6872
# Limit process resources
69-
limitResources(process, config, options)
73+
if 0:
74+
limitResources(process, config, options)
7075

7176

7277
def limitResources(process, config, options):

fusil/python/blacklists.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
"Lock",
233233
"RLock",
234234
"Semaphore",
235+
"AtomicInt64"
235236
}
236237
METHOD_BLACKLIST = {
237238
"__class__",

fusil/python/python_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, project: Project, options: FusilConfig, source_output_path: s
6767
path = pack.__path__[0]
6868
print(f"Adding package: {package} ({path})")
6969
package_walker = all_modules.discover_modules([path], package + ".")
70-
self.modules |= set(mod.name for mod in package_walker)
70+
self.modules |= set(name for finder, name, ispgk in package_walker)
7171

7272
if self.options.verbose:
7373
print(f"\nKnown modules ({len(self.modules)}): {','.join(sorted(self.modules))}")

fusil/python/write_python_code.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ def _write_main_fuzzing_logic(self) -> None:
550550
if not self.module_classes:
551551
break
552552
class_name = choice(self.module_classes)
553+
if class_name in OBJECT_BLACKLIST:
554+
continue
553555
try:
554556
class_obj = getattr(self.module, class_name)
555557
except AttributeError:
@@ -588,7 +590,11 @@ def _fuzz_one_class(self, class_idx: int, class_name_str: str, class_type: type)
588590
self.write_print_to_stderr(
589591
0, f'"[{prefix}] Attempting to instantiate class: {class_name_str}"'
590592
)
591-
593+
if class_name_str in OBJECT_BLACKLIST:
594+
self.write_print_to_stderr(
595+
0, f'"[{prefix}] Skipping blacklisted class: {class_name_str}"'
596+
)
597+
return
592598
instance_var_name = (
593599
f"instance_{prefix}_{class_name_str.lower().replace('.', '_')}" # Unique name
594600
)
@@ -793,7 +799,7 @@ def _fuzz_generic_object_methods(
793799
)
794800
self.write(
795801
0,
796-
f"if callable({current_prefix}_attr_val): {current_prefix}_methods.append(({current_prefix}_attr_name, {current_prefix}_attr_val))",
802+
f"if callable({current_prefix}_attr_val) and not {current_prefix}_attr_val.__name__ == 'wait': {current_prefix}_methods.append(({current_prefix}_attr_name, {current_prefix}_attr_val))",
797803
)
798804
self.restoreLevel(self.base_level - 1) # Exit inner try
799805
self.write(0, f"except Exception: pass")
@@ -824,7 +830,7 @@ def _fuzz_generic_object_methods(
824830
self.write(0, f"# Conceptual call to generic method fuzzer")
825831
self.write(
826832
0,
827-
f"callMethod(f'{current_prefix}_gen{{_i_{current_prefix}}}', {target_obj_expr_str}, {current_prefix}_method_name_to_call)",
833+
f"if {current_prefix}_method_name_to_call != 'wait': callMethod(f'{current_prefix}_gen{{_i_{current_prefix}}}', {target_obj_expr_str}, {current_prefix}_method_name_to_call)",
828834
) # Example simplified call
829835
self.restoreLevel(self.base_level - 1) # Exit for loop
830836
self.restoreLevel(self.base_level - 1) # Exit if methods

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"fusil.network",
4444
"fusil.process",
4545
"fusil.python",
46+
"fusil.python.jit",
47+
"fusil.python.samples",
4648
)
4749

4850
SCRIPTS = glob("fuzzers/fusil-*")

0 commit comments

Comments
 (0)