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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9996e46f-e493-e3b3-c23a-31415668db7d@i-love.sakura.ne.jp>
Date:   Sat, 31 Oct 2020 23:02:56 +0900
From:   Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To:     Jari Ruusu <jariruusu@...rs.sourceforge.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Sasha Levin <sashal@...nel.org>
Subject: Re: Linux 4.19.154

On 2020/10/31 22:14, Jari Ruusu wrote:
> Greg Kroah-Hartman wrote:
>> --- a/block/blk-core.c
>> +++ b/block/blk-core.c
>> @@ -2127,11 +2127,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector)
>>  {
>>         char b[BDEVNAME_SIZE];
>>
>> -       printk(KERN_INFO "attempt to access beyond end of device\n");
>> -       printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",
>> -                       bio_devname(bio, b), bio->bi_opf,
>> -                       (unsigned long long)bio_end_sector(bio),
>> -                       (long long)maxsector);
>> +       pr_info_ratelimited("attempt to access beyond end of device\n"
>> +                           "%s: rw=%d, want=%llu, limit=%llu\n",
>> +                           bio_devname(bio, b), bio->bi_opf,
>> +                           bio_end_sector(bio), maxsector);
>>  }
>>
>>  #ifdef CONFIG_FAIL_MAKE_REQUEST
> 
> Above change "block: ratelimit handle_bad_sector() message"
> upstream commit f4ac712e4fe009635344b9af5d890fe25fcc8c0d
> in 4.19.154 kernel is not completely OK.
> 
> Removing casts from arguments 4 and 5 produces these compile warnings:
> 
(...snipped...)
> For 64 bit systems it is only compile time cosmetic warning. For 32 bit
> system + CONFIG_LBDAF=n it introduces bugs: output formats are "%llu" and
> passed parameters are 32 bits. That is not OK.
> 
> Upstream kernels have hardcoded 64 bit sector_t. In older stable trees
> sector_t can be either 64 or 32 bit. In other words, backport of above patch
> needs to keep those original casts.

Indeed, commit f4ac712e4fe00963 ("block: ratelimit handle_bad_sector() message")
depends on commit 72deb455b5ec619f ("block: remove CONFIG_LBDAF") which was merged
into 5.2 kernel.

-------- Forwarded Message --------
Date: Thu, 8 Oct 2020 07:40:49 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org
Subject: Re: [PATCH] block: ratelimit handle_bad_sector() message
Message-ID: <20201008064049.GA29599@...radead.org>
References: <20201008002344.6759-1-penguin-kernel@...ove.SAKURA.ne.jp>
In-Reply-To: <20201008002344.6759-1-penguin-kernel@...ove.SAKURA.ne.jp>

On Thu, Oct 08, 2020 at 09:23:44AM +0900, Tetsuo Handa wrote:
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -803,8 +803,8 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector)
>  {
>  	char b[BDEVNAME_SIZE];
>  
> -	printk(KERN_INFO "attempt to access beyond end of device\n");
> -	printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",
> +	printk_ratelimited(KERN_INFO "attempt to access beyond end of device\n");
> +	printk_ratelimited(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",
>  			bio_devname(bio, b), bio->bi_opf,
>  			(unsigned long long)bio_end_sector(bio),
>  			(long long)maxsector);

Please use pr_info_ratelimited, and also remove the casts now that
sector_t is guranteed to be an unsigned long long.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ