diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..9f65e2f88e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,35 @@ +# Security Policy + +LAMMPS is designed as a user-level application to conduct computer +simulations for research using classical mechanics. As such LAMMPS +depends to some degrees on users providing correctly formatted input and +LAMMPS needs to read and write files based on uncontrolled user input. +As a parallel application for use in high-performance computing +environments, performance critical steps are also done without checking +data. + +LAMMPS also is interfaced to a number of external libraries, including +libraries with experimental research software, that are not validated +and tested by the LAMMPS developers, so it is easy to import bad +behavior from calling functions in one of those libraries. + +Thus is is quite easy to crash LAMMPS through malicious input and do all +kinds of filesystem manipulations. And because of that LAMMPS should +**NEVER** be compiled or **run** as superuser, either from a "root" or +"administrator" account directly or indirectly via "sudo" or "su". + +Therefore what could be seen as a security vulnerability is usually +either a user mistake or a bug in the code. Bugs can be reported in +the LAMMPS project +[issue tracker on GitHub](https://github.com/lammps/lammps/issues). + + +# Version Updates + +LAMMPS follows continuous release development model. We aim to keep all +release versions (stable or patch) fully functional and employ a variety +of automatic testing procedures to detect failures of existing +functionality from adding new features before releases are made. Thus +bugfixes and updates are only integrated into the current development +branch and thus the next (patch) release and users are recommended to +update regularly. diff --git a/doc/src/fix_grem.rst b/doc/src/fix_grem.rst index e57f1889e1..85702b909f 100644 --- a/doc/src/fix_grem.rst +++ b/doc/src/fix_grem.rst @@ -92,6 +92,11 @@ The :doc:`thermo_modify ` *press* option is supported by this fix to add the rescaled kinetic pressure as part of :doc:`thermodynamic output `. +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the effective +temperature :math:`T_{eff}`. The scalar value calculated by this +fix is "intensive". + Restrictions """""""""""" diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.cpp b/src/USER-BROWNIAN/fix_brownian_asphere.cpp index e7b6eb2728..f7d39c4792 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_asphere.cpp @@ -38,8 +38,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : - FixBrownianBase(lmp, narg, arg) +FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) + : FixBrownianBase(lmp, narg, arg), avec(nullptr) { if (!gamma_t_eigen_flag || !gamma_r_eigen_flag) { error->all(FLERR, "Illegal fix brownian command."); diff --git a/src/USER-BROWNIAN/fix_brownian_base.cpp b/src/USER-BROWNIAN/fix_brownian_base.cpp index 93990681bd..2e6a3dff46 100644 --- a/src/USER-BROWNIAN/fix_brownian_base.cpp +++ b/src/USER-BROWNIAN/fix_brownian_base.cpp @@ -46,6 +46,7 @@ FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n gamma_t_flag = gamma_r_flag = 0; gamma_t_eigen_flag = gamma_r_eigen_flag = 0; dipole_flag = 0; + g2 = 0.0; if (narg < 5) error->all(FLERR, "Illegal fix brownian command."); @@ -201,7 +202,7 @@ void FixBrownianBase::init() g1 = force->ftm2v; if (noise_flag == 0) { - g2 = 0; + g2 = 0.0; } else if (gaussian_noise_flag == 1) { g2 = sqrt(2 * force->boltz * temp / dt / force->mvv2e); } else { diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp index 9adb49d039..f7cc0bc2be 100644 --- a/src/USER-BROWNIAN/fix_propel_self.cpp +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -42,7 +42,8 @@ enum { DIPOLE, VELOCITY, QUAT }; /* ---------------------------------------------------------------------- */ -FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) + : Fix(lmp, narg, arg), avec(nullptr) { virial_global_flag = virial_peratom_flag = 1; diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 14191cb10d..fc6c8cce23 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -2212,6 +2212,7 @@ double FixBondReact::rxnfunction(std::string rxnfunc, std::string varid, if (rxnfunc == "rxnsum") return sumvvec; if (rxnfunc == "rxnave") return sumvvec/nsum; + return 0.0; } /* ---------------------------------------------------------------------- diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 2d04243a11..77ff784e64 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -39,6 +39,7 @@ using namespace FixConst; enum{NOBIAS,BIAS}; enum{CONSTANT,EQUAL}; +static constexpr int PRNGSIZE = 98+2+3; /* ---------------------------------------------------------------------- */ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : @@ -330,7 +331,6 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { - const int PRNGSIZE = 98+2+3; int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy double *list = nullptr; if (comm->me == 0) { @@ -363,7 +363,7 @@ void FixTempCSVR::restart(char *buf) if (nprocs != comm->nprocs) { if (comm->me == 0) error->warning(FLERR,"Different number of procs. Cannot restore RNG state."); - } else random->set_state(list+2+comm->me*103); + } else random->set_state(list+2+comm->me*PRNGSIZE); } /* ---------------------------------------------------------------------- diff --git a/src/utils.h b/src/utils.h index d60ba0a4f6..355d98fd3a 100644 --- a/src/utils.h +++ b/src/utils.h @@ -379,7 +379,6 @@ namespace LAMMPS_NS { :cpp:class:`Tokenizer`, :cpp:class:`ValueTokenizer` \endverbatim - * * \param text string that should be split * \return STL vector with the words */