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] [day] [month] [year] [list]
Date:   Mon, 14 May 2018 22:04:21 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Atul Gupta <atul.gupta@...lsio.com>
Cc:     kbuild-all@...org, herbert@...dor.apana.org.au,
        linux-crypto@...r.kernel.org, gustavo@...eddedor.com,
        dan.carpenter@...cle.com, netdev@...r.kernel.org,
        davem@...emloft.net, atul.gupta@...lsio.com
Subject: Re: [PATCH 2/5] crypto: chtls: wait for memory sendmsg, sendpage

Hi Atul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on cryptodev/master]
[also build test WARNING on v4.17-rc5 next-20180514]
[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/Atul-Gupta/build-warnings-cleanup/20180514-213306
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-randconfig-x009-201819 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/crypto/chelsio/chtls/chtls_io.c: In function 'csk_wait_memory':
>> drivers/crypto/chelsio/chtls/chtls_io.c:946:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       if (noblock)
       ^~
   drivers/crypto/chelsio/chtls/chtls_io.c:948:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
        goto do_nonblock;
        ^~~~

vim +/if +946 drivers/crypto/chelsio/chtls/chtls_io.c

   921	
   922	static int csk_wait_memory(struct chtls_dev *cdev,
   923				   struct sock *sk, long *timeo_p)
   924	{
   925		DEFINE_WAIT_FUNC(wait, woken_wake_function);
   926		int sndbuf, err = 0;
   927		long current_timeo;
   928		long vm_wait = 0;
   929		bool noblock;
   930	
   931		current_timeo = *timeo_p;
   932		noblock = (*timeo_p ? false : true);
   933		sndbuf = cdev->max_host_sndbuf;
   934		if (sndbuf > sk->sk_wmem_queued) {
   935			current_timeo = (prandom_u32() % (HZ / 5)) + 2;
   936			vm_wait = (prandom_u32() % (HZ / 5)) + 2;
   937		}
   938	
   939		add_wait_queue(sk_sleep(sk), &wait);
   940		while (1) {
   941			sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
   942	
   943			if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
   944				goto do_error;
   945			if (!*timeo_p) {
 > 946				if (noblock)
   947					set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
   948					goto do_nonblock;
   949			}
   950			if (signal_pending(current))
   951				goto do_interrupted;
   952			sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
   953			if (sndbuf > sk->sk_wmem_queued && !vm_wait)
   954				break;
   955	
   956			set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
   957			sk->sk_write_pending++;
   958			sk_wait_event(sk, &current_timeo, sk->sk_err ||
   959				      (sk->sk_shutdown & SEND_SHUTDOWN) ||
   960				      (sndbuf > sk->sk_wmem_queued && !vm_wait), &wait);
   961			sk->sk_write_pending--;
   962	
   963			if (vm_wait) {
   964				vm_wait -= current_timeo;
   965				current_timeo = *timeo_p;
   966				if (current_timeo != MAX_SCHEDULE_TIMEOUT) {
   967					current_timeo -= vm_wait;
   968					if (current_timeo < 0)
   969						current_timeo = 0;
   970				}
   971				vm_wait = 0;
   972			}
   973			*timeo_p = current_timeo;
   974		}
   975	out:
   976		remove_wait_queue(sk_sleep(sk), &wait);
   977		return err;
   978	do_error:
   979		err = -EPIPE;
   980		goto out;
   981	do_nonblock:
   982		err = -EAGAIN;
   983		goto out;
   984	do_interrupted:
   985		err = sock_intr_errno(*timeo_p);
   986		goto out;
   987	}
   988	

---
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" (37181 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ