Commit Graph

2509 Commits

Author SHA1 Message Date
David Anderson 04e1396360 Merge pull request #1635 from BOINC/suspicious_results
Validator: implement "suspicious" results
2017-01-31 01:18:30 -08:00
David Anderson 1274dbe2cb start script: create lock and pid files non-world-writeable 2017-01-27 12:12:49 -08:00
David Anderson ebfc5dc2ce remove compile warnings. Should have done this long ago! 2017-01-20 00:01:25 -08:00
David Anderson fc4fb299a6 file upload handler: unrecognized XML is not critical 2016-12-14 13:08:02 -08:00
David Anderson 081c64ec79 sample substr validator: allow multiple strings 2016-11-23 18:10:45 -08:00
Christian Beer fa6c27805d Merge pull request #1618 from BOINC/validator_enhancement
The validator handler can now pass unknown arguments to the project specific handler.
Projects that have their own validator need to implement the validate_handler_init() function and handle project specific arguments there. They also need to supply a validate_handler_usage() function that printf()'s a description of the custom options. For examples see sample_substr_validator.cpp or script_validator.cpp
The validator test harness was also adopted to use these new functions.

This brings the implementation of the validator framework on the same level as the assimilator framework where similar changes where made in 0038d27 and dd00440.
2016-11-23 13:40:32 +01:00
Christian Beer 85068e92d7 Scheduler: fix global preference parsing
The xp.element_contents() functions strips the linebreak before the closing tag. But the closing tag needs to be on it's own line because of the limitations of BOINC XML parsing.
2016-10-14 13:38:51 +02:00
Christian Beer 7f327d213f Validator: fix path and filename when in standalone mode
When in standalone mode (test framework) the name is actually the path supplied by the user. This will extract the filename from the given path and fill in the correct values of the OUTPUT_FILE_INFO object.
This is important so that the test framework is consistent with the actual behaviour and projects don't need to put in extra code to distinguish between test mode and normal mode.
2016-09-21 11:38:55 +02:00
Christian Beer 2999fc10cd Validator: fix usage info 2016-09-06 10:44:14 +02:00
Christian Beer 998a927956 Validator: log suspicious results 2016-09-01 11:46:37 +02:00
Bernd Machenschalk e82d9d87a9 Validator: implement "suspicious" results
A validator now has the possibility to mark a single result as "suspicious" by making init_result() return VAL_RESULT_SUSPICIOUS. If this is the single quorum result of an adaptive replication, this will trigger another task to be generated for validation.
2016-09-01 10:47:45 +02:00
David Anderson 1d82913b80 Scheduler: fix bug in parsing project prefs. 2016-08-20 15:01:44 -07:00
Christian Beer 2c36e7246d Daemons: enhance validator framework
The validator handler can now pass unknown arguments to the project specific handler.
Projects that have there own validator need to implement the validate_handler_init() function and handle project specific arguments there. They also need to supply a validate_handler_usage() function that printf()'s a description of the custom options. For examples see sample_substr_validator.cpp or script_validator.cpp
The validator test harness was also adopted to use this new functions.

This brings the implementation of the validator framework on the same level as the assimilator framework where similar changes where made in 0038d275c and dd004404a.
2016-08-16 11:14:42 +02:00
David Anderson 94c18fc671 (Oops - these notes apply to previous commit) Add support for new project prefs.
- max_cpus: cap effective_ncpus at this value.
- max_jobs: at most this # of jobs in progress on host
2016-07-30 00:10:31 -07:00
David Anderson 09d67f794a scheduler (HR): detect "ARM" in p_model as well as p_vendor.
Some Android devices report p_vendor as blank, but p_model contains "ARM".
2016-07-30 00:07:33 -07:00
David Anderson c5de0b56e0 scheduler: add HR classes for Android and ARM
The HR (homogeneous redundancy) code was way out of date.
There were no classes, coarse or fine, for Android or ARM.
I added these.

I also changed/fixed the "coarse" classification to be (OS type + CPU type)
where OS type is Win/Mac/Linux/FreeBSD/Android,
and CPU type is Intel-compatible/PPC/ARM.
Previously all Linux hosts were considered equivalent.

Note: the fine classification of CPUs is based on models c. 2008.
This should be updated based on a study of FP discrepancies.
2016-07-29 13:26:23 -07:00
David Anderson 89dc25bc6c Condor interface: compile fix 2016-07-27 23:18:30 -07:00
David Anderson 671446ced1 code cleanup: in scheduler, factor project prefs into their own struct 2016-07-27 15:15:08 -07:00
Rom Walton eac15d6982 sched: Remove CERN Theory hard-coded values from the sched_customize.cpp file. Theory now uses a container approach with each container pulling a job from the CERN job scheduler, which makes this code obsolete. 2016-07-27 10:38:19 -07:00
David Anderson 4a6c20e043 scheduler: reflect min_ncpus in multithread mem calculation (from WWU) 2016-07-13 13:20:51 -07:00
David Anderson 30f4a07f5d plan class XML spec: change memory size specs from bytes to MB
Append "_mb" to mem_usage_base and mem_usage_per_cpu; these are now in MB
2016-07-01 12:05:23 -07:00
David Anderson 995fdc38d5 plan class mechanism: allow mem usage to depend on #CPUs
Add optional <mem_usage_base> and <mem_usage_per_cpu> elements
for MT plan classes.
These let you make the estimated memory usage depend on the # of CPUs used,
for example, for VM apps that run multiple jobs within the VM.
The mem usage is base + NCPUS*per_cpu.
This is used for:
1) to limit the # of CPUs, based on client's available memory
2) to determine workunit.rsc_memory_bound
    (the value in the input template is overridden)
2016-06-29 13:06:10 -07:00
David Anderson 6121ce1b58 scheduler: add flags to host description for Vbox extensions present, enabled 2016-06-28 12:19:02 -07:00
David Anderson 986baf1437 sample_assimilator: add --outdir cmdline arg 2016-06-28 11:25:52 -07:00
David Anderson 7878d24f95 Add header comments to sched/*.cpp 2016-06-24 15:42:11 -07:00
Rom Walton 4d605b6dc9 sched: Adjust default rule set so that 64-bit VM jobs are not sent to hosts without hardware acceleration or it is disabled. 2016-06-17 21:30:51 -07:00
Christian Beer 0cf3c556d8 Server: use MAXPATHLEN for char arrays when they contain filenames
This prevents out-of-bounds access by functions that already use MAXPATHLEN.

Fixes CID 120041, 120042, 120043, 120044, 120045 reported by Coverity
2016-04-25 09:33:26 +02:00
funkydude 71831ee639 Expand usage of HTTPS and fix a few URLs 2016-03-08 20:04:28 +00:00
Rom Walton 56da6b11fb client: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 21:53:07 -05:00
David Anderson be50103751 file upoad handler: if file is already there, don't upload again
Notes:
1) We still need to read all the data from socket (copy_socket_to_null());
otherwise the client will block on the send, and never get the success reply.
The previous approach (read-only file) didn't do this.
All we're saving is disk I/O on server.

2) The client reports a result only after it know that
all its output files have successfully been uploaded.
It won't re-upload anything if that's the case.
2016-02-02 11:51:45 -08:00
David Anderson d5f5918111 Replace strncpy() with strlcpy() various places.
Except for very specific cases, strncpy() should never be used.
It can result in a non-terminated string.

Also replace strncat() with strlcat(); the latter is simpler
because you don't have to calculate remaining buffer space.
2016-02-01 20:23:18 -08:00
David Anderson ab5526ea6f file upload handler: undo the change where we make uploaded files readonly
This broke other things (e.g. get_file_size on that file).
We would accomplish the same thing a cleaner way,
i.e. notice the file is already there and of the right size.
2016-02-01 20:21:27 -08:00
David Anderson 9daab7acb1 Scheduler: when matching host by CPID, make sure basic system params match
In handling a request without host ID, if we match a host record by CPID,
make sure the computers are not obviously different.
2016-01-15 15:48:12 -08:00
David Anderson cb6259ecf1 fix comment about output filename random part 2015-11-20 13:58:28 -08:00
David Anderson 4e55dbf0e0 fix typo 2015-11-19 19:29:30 -08:00
David Anderson f4c72320a3 file upload handler: improve check for filename validity
The file upload handler checked for ".." in the filename.
Also check for control chars and for starting with /.
Put this into a separate function, is_valid_filename().
2015-11-18 16:08:47 -08:00
David Anderson 6b81b0e63b server: provide access to output file names without random part
- add random substring as "_r123123"
- add function remove_random_from_filename() that removes
  the random substring from an output filename
2015-11-18 13:42:06 -08:00
David Anderson aa11256909 file upload handler: don't include full path in error msgs sent to client 2015-11-16 20:42:45 -08:00
David Anderson 153f6600d0 Server (assimilator): add random string to result file names
Otherwise, result file names can be inferred from result names.
An attacker with task A could find the name of the "wingman" task B,
upload fake files as B's output files,
upload the same files as A's output files,
report A as completed, and get unearned credit.
2015-11-16 19:28:30 -08:00
Rom Walton 56737cc002 Merge branch 'master' of https://github.com/BOINC/boinc 2015-11-16 15:39:46 -05:00
Rom Walton 914d9f0873 sched: Remove commit ecea18f.
We parse the stuff from xml_doc_in instead of xml_doc_out.  xml_doc_in cannot be modified by anything the BOINC client returns.
2015-11-16 15:39:30 -05:00
Christian Beer 3fc2d41f9a Server: fix sched/start to work with older python version
An issue with unicode strings in python 2.4 and 2.6 (and possibly 2.5) prevents shlex to split the command which leads to the daemon or task not starting. The unicode issue seems to be fixed in python 2.7. The exact error message is: "TypeError: execv() argument 1 must be (encoded string without NULL bytes), not str".

See: https://github.com/vinodc/gitlab-webhook-branch-deployer/issues/1
2015-11-16 13:27:15 +01:00
Rom Walton 8e11f75195 sched: Do not create a temp string object just to append a character to a string object. 2015-11-15 11:54:27 -05:00
Rom Walton 90f4e92e3e sched: fix compiler warnings 2015-11-14 12:29:42 -05:00
Rom Walton eec9f10460 sched: fix compiler warnings 2015-11-14 12:26:28 -05:00
Rom Walton ecea18f473 sched: Do not trust that the result name embedded within the result output file name is correctly reported by the client.
This opens the validator up to a result name spoofing attack where a bogus client can claim it processed the result reported by a different client for the same workunit.
2015-11-14 12:18:39 -05:00
Christian Beer 454bd634d9 File upload handler: return the lseek() error
If the printf() or close() calls change errno, the original lseek() error is lost. The logged error would differ from the message send to the client. This amends 005957a.
Suggested by Juha Sointusalo
2015-11-12 13:32:58 +01:00
Christian Beer 475fbbeb15 Merge pull request #1427 from BOINC/sched_start_shell
Server: fix behaviour of start script
2015-11-11 08:39:09 +01:00
Christian Beer 69c04cca8c Server: enhance shell encapsulation of daemons and tasks
- if a daemon or task should run in a shell, add <use_shell>1</use_shell> to the task entry in config.xml
  this will spawn a "sh -c cmd" process that propagates signals to the child process (see 881863d)
- if a daemon or task has to use a shell (pipe or redirection present in cmd) and <use_shell> is not enabled:
  don't execute the cmd and print an error message (other daemons and tasks are still started)
2015-11-10 10:16:30 +01:00
Christian Beer 4eec734bc4 Feeder: more efficient solution to memory leak fix
The for loop copies newly created objects into the vector and destroys the original objects. The resize() instantiates the objects directly in the vector. Suggested by Nicolás Alvarez.
2015-11-10 08:29:19 +01:00