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:   Thu, 13 Oct 2022 14:26:49 +0800
From:   Jason Yan <yanaijie@...wei.com>
To:     Li kunyu <kunyu@...china.com>, <damien.lemoal@...nsource.wdc.com>
CC:     <jejb@...ux.vnet.ibm.com>, <linux-kernel@...r.kernel.org>,
        <linux-scsi@...r.kernel.org>, <martin.petersen@...cle.com>
Subject: Re: [PATCH 4.19] scsi: sd: Fix 'sdkp' in sd_first_printk


On 2022/10/13 12:49, Li kunyu wrote:
> 
> This is defined in the 4.19 kernel:
> 
> #define sd_printk(prefix, sdsk, fmt, a...)                              \
>          (sdsk)->disk ?                                                  \
>                sdev_prefix_printk(prefix, (sdsk)->device,                \
>                                   (sdsk)->disk->disk_name, fmt, ##a) :   \
>                sdev_printk(prefix, (sdsk)->device, fmt, ##a)
> 
> #define sd_first_printk(prefix, sdsk, fmt, a...)                        \
>          do {                                                            \
>                  if ((sdkp)->first_scan)                                 \
>                          sd_printk(prefix, sdsk, fmt, ##a);              \
>          } while (0)
> 
> 
> 
> Most of the sdsk used in the macro definition has only one sdkp.
> 
> 
> This is defined in the v6.0-rc7 kernel:
> 
> #define sd_printk(prefix, sdsk, fmt, a...)                              \
>          (sdsk)->disk ?                                                  \
>                sdev_prefix_printk(prefix, (sdsk)->device,                \
>                                   (sdsk)->disk->disk_name, fmt, ##a) :   \
>                sdev_printk(prefix, (sdsk)->device, fmt, ##a)
> 
> #define sd_first_printk(prefix, sdsk, fmt, a...)                        \
>          do {                                                            \
>                  if ((sdsk)->first_scan)                                 \
>                          sd_printk(prefix, sdsk, fmt, ##a);              \
>          } while (0)
> 
> Use sdsk in macro definition.
> 
> 
> I did report an error when compiling sd. o in the 4.19 kernel. It was modified to say that no more errors were reported in sdsk. Can I continue the 6.0-rc7 writing method here.
> 

You should backport the mainline patch to 4.19, not create a new one.

commit df46cac3f71c57e0b23f6865651629aaa54f8ca9
Author: Dietmar Hahn <dietmar.hahn@...fujitsu.com>
Date:   Tue Feb 5 11:10:48 2019 +0100

     scsi: sd: Fix typo in sd_first_printk()

     Commit b2bff6ceb61a9 ("[SCSI] sd: Quiesce mode sense error messages")
     added the macro sd_first_printk(). The macro takes "sdsk" as argument
     but dereferences "sdkp". This hasn't caused any real issues since all
     callers of sd_first_printk() have an sdkp. But fix the typo.

     [mkp: Turned this into a real patch and tweaked commit description]

     Signed-off-by: Dietmar Hahn <dietmar.hahn@...fujitsu.com>
     Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>

diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 1080c85d97f8..5796ace76225 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -132,7 +132,7 @@ static inline struct scsi_disk *scsi_disk(struct 
gendisk *disk)

  #define sd_first_printk(prefix, sdsk, fmt, a...)                       \
         do {                                                            \
-               if ((sdkp)->first_scan)                                 \
+               if ((sdsk)->first_scan)                                 \
                         sd_printk(prefix, sdsk, fmt, ##a);              \
         } while (0)



> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ