lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201808281147.bOuMfCfN%fengguang.wu@intel.com>
Date:   Tue, 28 Aug 2018 12:43:49 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Aristeu Rozanski <aris@...hat.com>
Cc:     kbuild-all@...org, linux-kernel@...r.kernel.org,
        "Luis R. Rodriguez" <mcgrof@...nel.org>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] sysctl: do not allow a 64bit value write in a 32bit knob

Hi Aristeu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc1 next-20180827]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aristeu-Rozanski/sysctl-do-not-allow-a-64bit-value-write-in-a-32bit-knob/20180828-043801
config: microblaze-mmu_defconfig (attached as .config)
compiler: microblaze-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=microblaze 

All warnings (new ones prefixed by >>):

   kernel/sysctl.c: In function 'do_proc_dointvec_minmax_conv':
>> kernel/sysctl.c:2558:14: warning: right shift count >= width of type [-Wshift-count-overflow]
          *lvalp >> (sizeof(int) * 8))
                 ^~

vim +2558 kernel/sysctl.c

  2548	
  2549	static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
  2550						int *valp,
  2551						int write, void *data)
  2552	{
  2553		struct do_proc_dointvec_minmax_conv_param *param = data;
  2554		if (write) {
  2555			int val = *negp ? -*lvalp : *lvalp;
  2556			if ((param->min && *param->min > val) ||
  2557			    (param->max && *param->max < val) ||
> 2558			    *lvalp >> (sizeof(int) * 8))
  2559				return -EINVAL;
  2560			*valp = val;
  2561		} else {
  2562			int val = *valp;
  2563			if (val < 0) {
  2564				*negp = true;
  2565				*lvalp = -(unsigned long)val;
  2566			} else {
  2567				*negp = false;
  2568				*lvalp = (unsigned long)val;
  2569			}
  2570		}
  2571		return 0;
  2572	}
  2573	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (12811 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ