Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Guo Zhi <qtxuning1999@sjtu.edu.cn>
Cc: <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] drivers/ata: Fix kernel pointer leak
Date: Thu, 30 Sep 2021 11:54:37 +0300	[thread overview]
Message-ID: <baee2cee-3401-e8e4-efb3-432d48bb9589@omp.ru> (raw)
In-Reply-To: <265805eb-162e-4d2d-1e56-39aa16c87934@opensource.wdc.com>

On 30.09.2021 5:35, Damien Le Moal wrote:
> On 2021/09/29 21:16, Guo Zhi wrote:
>> Pointers should be printed with %p or %px rather than cast to
>> 'unsigned long' and pinted with %lx
> 
> s/pinted/printed
> 
>> Change %lx to %p to print the secured pointer.
>>
>> Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
>> ---
>>   drivers/ata/pata_atp867x.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
>> index 2bc5fc81efe3..c32b95f48e50 100644
>> --- a/drivers/ata/pata_atp867x.c
>> +++ b/drivers/ata/pata_atp867x.c
>> @@ -447,11 +447,11 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
>>   #ifdef	ATP867X_DEBUG
>>   		atp867x_check_ports(ap, i);
>>   #endif
>> -		ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
>> -			(unsigned long)ioaddr->cmd_addr,
>> -			(unsigned long)ioaddr->ctl_addr);
>> -		ata_port_desc(ap, "bmdma 0x%lx",
>> -			(unsigned long)ioaddr->bmdma_addr);
>> +		ata_port_desc(ap, "cmd 0x%p ctl 0x%p",
>> +			ioaddr->cmd_addr,
>> +			ioaddr->ctl_addr);
>> +		ata_port_desc(ap, "bmdma 0x%p",
>> +			ioaddr->bmdma_addr);
>>   
>>   		mask |= 1 << i;
>>   	}
>>
> 
> Looks OK to me. But please fix the commit title to:
> 
> "ata: atp867x: Fix pointer value print"
> 
> "pointer leak" is too scary for what is only a simple printk problem.

    It's not a simple printk() problem, it's an kernel info leak that he's 
fixing. But, as I said, this driver doesn't use MMIO, so "leaks" only I/O port 
addresses.

MBR, Sergey

  parent reply	other threads:[~2021-09-30  8:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 12:16 [PATCH] drivers/ata: Fix kernel pointer leak Guo Zhi
2021-09-29 14:40 ` Sergey Shtylyov
2021-09-30  2:35 ` Damien Le Moal
2021-09-30  2:44   ` Guo Zhi
2021-09-30  2:48     ` Damien Le Moal
2021-09-30  8:54   ` Sergey Shtylyov [this message]
2021-10-01  1:18     ` Damien Le Moal
2021-10-01 20:18       ` Sergey Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baee2cee-3401-e8e4-efb3-432d48bb9589@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=qtxuning1999@sjtu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox