CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Romain Perier <[email protected]>
TO: Kees Cook <[email protected]>
TO: [email protected]
TO: "Martin K. Petersen" <[email protected]>
CC: Romain Perier <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]

Hi Romain,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on s390/features]
[also build test WARNING on cryptodev/master crypto/master 
driver-core/driver-core-testing linus/master balbi-usb/testing/next v5.11 
next-20210222]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Romain-Perier/Manual-replacement-of-all-strlcpy-in-favor-of-strscpy/20210222-232701
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
compiler: nds32le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/target/target_core_configfs.c:1293:15: warning: Possible null 
>> pointer dereference: buf [nullPointer]
    len = strlen(buf);
                 ^
   drivers/target/target_core_configfs.c:1327:19: note: Assignment 
'stripped=NULL', assigned value is 0
    char *stripped = NULL;
                     ^
   drivers/target/target_core_configfs.c:1339:34: note: Calling function 
'target_check_inquiry_data', 1st argument 'stripped' value is 0
    ret = target_check_inquiry_data(stripped);
                                    ^
   drivers/target/target_core_configfs.c:1293:15: note: Null pointer dereference
    len = strlen(buf);
                 ^

vim +1293 drivers/target/target_core_configfs.c

c66ac9db8d4ad9 Nicholas Bellinger 2010-12-17  1287  
0322913cab79e4 Alan Adamson       2019-03-01  1288  static ssize_t 
target_check_inquiry_data(char *buf)
0322913cab79e4 Alan Adamson       2019-03-01  1289  {
0322913cab79e4 Alan Adamson       2019-03-01  1290      size_t len;
0322913cab79e4 Alan Adamson       2019-03-01  1291      int i;
0322913cab79e4 Alan Adamson       2019-03-01  1292  
0322913cab79e4 Alan Adamson       2019-03-01 @1293      len = strlen(buf);
0322913cab79e4 Alan Adamson       2019-03-01  1294  
0322913cab79e4 Alan Adamson       2019-03-01  1295      /*
0322913cab79e4 Alan Adamson       2019-03-01  1296       * SPC 4.3.1:
0322913cab79e4 Alan Adamson       2019-03-01  1297       * ASCII data fields 
shall contain only ASCII printable characters
0322913cab79e4 Alan Adamson       2019-03-01  1298       * (i.e., code values 
20h to 7Eh) and may be terminated with one or
0322913cab79e4 Alan Adamson       2019-03-01  1299       * more ASCII null 
(00h) characters.
0322913cab79e4 Alan Adamson       2019-03-01  1300       */
0322913cab79e4 Alan Adamson       2019-03-01  1301      for (i = 0; i < len; 
i++) {
0322913cab79e4 Alan Adamson       2019-03-01  1302              if (buf[i] < 
0x20 || buf[i] > 0x7E) {
0322913cab79e4 Alan Adamson       2019-03-01  1303                      
pr_err("Emulated T10 Inquiry Data contains non-ASCII-printable characters\n");
0322913cab79e4 Alan Adamson       2019-03-01  1304                      return 
-EINVAL;
0322913cab79e4 Alan Adamson       2019-03-01  1305              }
0322913cab79e4 Alan Adamson       2019-03-01  1306      }
0322913cab79e4 Alan Adamson       2019-03-01  1307  
0322913cab79e4 Alan Adamson       2019-03-01  1308      return len;
0322913cab79e4 Alan Adamson       2019-03-01  1309  }
0322913cab79e4 Alan Adamson       2019-03-01  1310  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to