Alexey Makhalov cebcb9f864 Fix range check in do_tunable_update_val
Current implementation of tunables does not set arena_max and arena_test
values. Any value provided by glibc.malloc.arena_max and
glibc.malloc.arena_test parameters is ignored.

These tunables have minval value set to 1 (see elf/dl-tunables.list file)
and undefined maxval value. In that case default value (which is 0. see
scripts/gen-tunables.awk) is being used to set maxval.

For instance, generated tunable_list[] entry for arena_max is:
(gdb) p *cur
$1 = {name = 0x7ffff7df6217 "glibc.malloc.arena_max",
 type = {type_code = TUNABLE_TYPE_SIZE_T, min = 1, max = 0},
  val = {numval = 0, strval = 0x0}, initialized = false,
   security_level = TUNABLE_SECLEVEL_SXID_IGNORE,
    env_alias = 0x7ffff7df622e "MALLOC_ARENA_MAX"}

As a result, any value of glibc.malloc.arena_max is ignored by
TUNABLE_SET_VAL_IF_VALID_RANGE macro
  __type min = (__cur)->type.min;                    <- initialized to 1
  __type max = (__cur)->type.max;                    <- initialized to 0!
  if (min == max)                                    <- false
    {
      min = __default_min;
      max = __default_max;
    }
  if ((__type) (__val) >= min && (__type) (val) <= max)  <- false
    {
      (__cur)->val.numval = val;
      (__cur)->initialized = true;
    }

Assigning correct min/max values at a build time fixes a problem.
Plus, a bit of optimization: Setting of default min/max values for the
given type at a run time might be eliminated.

	* elf/dl-tunables.c (do_tunable_update_val): Range checking fix.
	* scripts/gen-tunables.awk: Set unspecified minval and/or maxval
	values to correct default value for given type.
2017-09-27 02:44:09 +05:30
..
2002-07-17 00:34:35 +00:00
2002-06-30 07:17:02 +00:00
2002-07-17 00:34:35 +00:00
2002-07-17 00:34:35 +00:00
2002-07-17 00:34:35 +00:00
2002-06-30 07:17:02 +00:00
2001-01-21 17:15:50 +00:00
2000-12-17 17:50:56 +00:00
2001-09-06 01:03:05 +00:00
2001-09-06 01:03:05 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2017-08-18 08:50:42 -07:00
2000-12-17 17:50:56 +00:00
2000-08-19 07:17:09 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2001-02-06 10:38:10 +00:00
1999-05-03 21:59:35 +00:00
2001-03-21 07:21:34 +00:00
2001-04-06 15:23:41 +00:00
2009-06-03 16:21:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2013-06-05 20:44:03 +00:00
2009-06-22 15:07:40 -07:00
2013-06-05 20:44:03 +00:00
2009-10-30 00:48:54 -07:00
2009-06-03 16:21:40 -07:00
2009-10-30 00:48:54 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-06-22 15:07:40 -07:00
2009-10-30 00:48:54 -07:00
2009-06-22 15:07:40 -07:00
2001-02-02 06:54:15 +00:00
2004-04-21 18:58:31 +00:00
2017-08-16 15:59:55 +02:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2000-12-15 16:03:57 +00:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-31 06:09:08 +00:00
2000-12-31 06:09:08 +00:00
2012-01-07 23:57:22 -05:00
2006-03-01 06:18:49 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2003-01-12 10:11:16 +00:00
2000-08-25 19:33:19 +00:00
2000-08-25 19:33:19 +00:00
2000-12-17 17:50:56 +00:00
2000-08-25 19:33:19 +00:00
2002-02-10 22:40:17 +00:00
2000-07-21 04:42:21 +00:00
2002-03-03 19:43:30 +00:00
2000-07-21 04:42:21 +00:00
2000-11-26 06:18:02 +00:00
2000-11-26 06:18:02 +00:00
2000-12-17 17:50:56 +00:00
2000-12-15 16:03:57 +00:00
2001-09-08 17:45:32 +00:00
2013-08-21 19:48:48 +02:00
2001-09-22 15:44:07 +00:00
2001-05-22 23:55:23 +00:00
2001-06-22 13:50:51 +00:00
2001-05-22 23:55:23 +00:00
2001-06-22 13:50:51 +00:00
2001-09-22 15:44:35 +00:00
2003-01-12 10:11:16 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2001-10-01 00:14:14 +00:00
2002-04-15 17:10:22 +00:00
2002-04-15 17:10:22 +00:00
2002-04-15 17:10:22 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2002-12-30 20:25:40 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2003-01-12 10:11:16 +00:00
2013-08-21 19:48:48 +02:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
1999-08-02 19:56:07 +00:00
2000-11-26 06:18:02 +00:00
2001-05-22 22:30:18 +00:00
2017-09-10 17:39:39 +02:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2000-12-15 16:03:57 +00:00
2013-06-05 20:44:03 +00:00
2003-01-27 21:03:22 +00:00
2003-01-27 21:03:22 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2005-07-07 23:00:02 +00:00
2004-09-23 07:45:38 +00:00
2004-09-23 07:45:38 +00:00
2004-09-23 07:45:38 +00:00
2004-10-27 20:27:40 +00:00
2004-07-16 17:56:45 +00:00
2013-10-18 19:45:36 +05:30
2011-09-10 14:34:15 -04:00
2011-09-10 14:34:15 -04:00
2011-09-10 14:34:15 -04:00
2003-04-17 19:19:29 +00:00
2003-07-24 20:07:00 +00:00
2005-03-20 22:25:59 +00:00
2006-03-01 06:18:49 +00:00
2000-12-17 17:50:56 +00:00
2000-12-17 17:50:56 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-03 08:28:23 +00:00
2005-03-18 10:54:53 +00:00
2005-03-18 10:54:53 +00:00
2005-04-27 01:39:11 +00:00
2011-08-24 09:32:13 +02:00
2006-03-01 06:18:49 +00:00
2000-08-26 23:41:19 +00:00
2017-08-10 16:54:57 +02:00
2003-03-29 03:46:03 +00:00