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]
Date:   Fri, 25 Aug 2023 13:29:08 +0200
From:   Daniel Wagner <dwagner@...e.de>
To:     Shinichiro Kawasaki <shinichiro.kawasaki@....com>
Cc:     Bart Van Assche <bvanassche@....org>,
        "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        Chaitanya Kulkarni <kch@...dia.com>,
        Hannes Reinecke <hare@...e.de>,
        Sagi Grimberg <sagi@...mberg.me>,
        Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH blktests v3 3/3] nvme: introduce
 nvmet_target_{setup/cleanup} common code

On Fri, Aug 25, 2023 at 07:34:21AM +0000, Shinichiro Kawasaki wrote:
> IMO, SC2119 is not broken. SC2119 (and its companion SC2120) assumes that bash
> functions do not have optional arguments. If any functions which refer arguments
> are called without arguments, it complains. With the assumption, SC2119 is
> useful to detect missing arguments of function calls. (I guess Bart thinks this
> is useful.)

I wanted to say that the implementation of SC2119 is broken, not the
SC2119/SC2120 itself. Sorry for the confusion.

> However, when we implement argument parsers in bash functions so that the
> arguments can be optional, the assumption for the SC2119 is wrong. Then SC2119
> reports are useless. Until recently, blktests had few functions with such
> optional arguments, such as _init_null_blk or _init_scsi_debug. But most of
> calls to those functions had some arguments, and it was rare to call them
> without any argument. So SC2119 reports were easy to suppress and not a pain.
>
>     I doubt Shellcheck can be improved and detect if functions have the optional
>     argument parsers...

No idea. But we are not alone with this problem:

https://github.com/koalaman/shellcheck/issues/2511

> Recently, you actively cleans up tests/nvme/* (which is great!), and introduced
> argument parsers in test/nvme/rc. The first one is _nvme_connect_subsys, and the
> second one is this _nvme_target_setup. It looks for me this is a bash coding
> style change in blktests, from "don't use optional arguments often" to "use
> optional arguments aggressively".

Yes, it's a bit excessive to hand in all possible arguments all the
time. Especially it makes it even hard to review if only value changes
but 6 default values are passed to the setup function.

> If we apply this change, we should suppress
> SC2119. If we keep the old coding style, we should keep on enabling SC2119. What
> I see here is the style difference between you and Bart.
>
> Now I'm tempted to disable SC2119, and to go with the new coding style...
> 
> If I have any misunderstanding, or if anyone has more comments on this, please
> let me know.

All good from my side.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ