Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [stable] btrfs name length fixes
@ 2017-10-29 17:15 Ben Hutchings
  2017-10-29 23:59 ` Qu Wenruo
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2017-10-29 17:15 UTC (permalink / raw)
  To: Su Yue; +Cc: linux-btrfs, stable

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

You recently made a number of fixes to validation and use of name
lengths in btrfs:

286b92f43c0d btrfs: tree-log.c: Wrong printk information about namelen
19c6dcbfa746 btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond boundary
e79a33270d05 btrfs: Check name_len with boundary in verify dir_item
26a836cec2ea btrfs: Check name_len on add_inode_ref call path
8ee8c2d62d5f btrfs: Verify dir_item in replay_xattr_deletes
3c1d41844896 btrfs: Check name_len in btrfs_check_ref_name_override
59b0a7f2c7c1 btrfs: Check name_len before read in iterate_dir_item
488d7c456653 btrfs: Check name_len before reading btrfs_get_name
64c7b01446f4 btrfs: Check name_len before in btrfs_del_root_ref
fbc326159a01 btrfs: Verify dir_item in iterate_object_props

The bugs these are fixing probably should also be fixed on the affected
stable branches.  Do you agree?  Can you provide any guidance about how
far back these fixes would be needed?

Ben.

-- 
Ben Hutchings
I'm not a reverse psychological virus.  Please don't copy me into your
sig.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] btrfs name length fixes
  2017-10-29 17:15 [stable] btrfs name length fixes Ben Hutchings
@ 2017-10-29 23:59 ` Qu Wenruo
  2017-10-30  0:19   ` Ben Hutchings
  2017-10-30  1:55   ` Su Yue
  0 siblings, 2 replies; 6+ messages in thread
From: Qu Wenruo @ 2017-10-29 23:59 UTC (permalink / raw)
  To: Ben Hutchings, Su Yue; +Cc: linux-btrfs, stable


[-- Attachment #1.1: Type: text/plain, Size: 1156 bytes --]



On 2017年10月30日 01:15, Ben Hutchings wrote:
> You recently made a number of fixes to validation and use of name
> lengths in btrfs:
> 
> 286b92f43c0d btrfs: tree-log.c: Wrong printk information about namelen
> 19c6dcbfa746 btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond boundary
> e79a33270d05 btrfs: Check name_len with boundary in verify dir_item
> 26a836cec2ea btrfs: Check name_len on add_inode_ref call path
> 8ee8c2d62d5f btrfs: Verify dir_item in replay_xattr_deletes
> 3c1d41844896 btrfs: Check name_len in btrfs_check_ref_name_override
> 59b0a7f2c7c1 btrfs: Check name_len before read in iterate_dir_item
> 488d7c456653 btrfs: Check name_len before reading btrfs_get_name
> 64c7b01446f4 btrfs: Check name_len before in btrfs_del_root_ref
> fbc326159a01 btrfs: Verify dir_item in iterate_object_props
> 
> The bugs these are fixing probably should also be fixed on the affected
> stable branches.  Do you agree?  Can you provide any guidance about how
> far back these fixes would be needed?

These fixes will soon be replace by centralized tree-checker facilities.

Thanks,
Qu

> 
> Ben.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] btrfs name length fixes
  2017-10-29 23:59 ` Qu Wenruo
@ 2017-10-30  0:19   ` Ben Hutchings
  2017-10-30  0:45     ` Qu Wenruo
  2017-10-30  1:55   ` Su Yue
  1 sibling, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2017-10-30  0:19 UTC (permalink / raw)
  To: Qu Wenruo, Su Yue; +Cc: linux-btrfs, stable

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Mon, 2017-10-30 at 07:59 +0800, Qu Wenruo wrote:
> 
> On 2017年10月30日 01:15, Ben Hutchings wrote:
> > You recently made a number of fixes to validation and use of name
> > lengths in btrfs:
> > 
> > 286b92f43c0d btrfs: tree-log.c: Wrong printk information about namelen
> > 19c6dcbfa746 btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond boundary
> > e79a33270d05 btrfs: Check name_len with boundary in verify dir_item
> > 26a836cec2ea btrfs: Check name_len on add_inode_ref call path
> > 8ee8c2d62d5f btrfs: Verify dir_item in replay_xattr_deletes
> > 3c1d41844896 btrfs: Check name_len in btrfs_check_ref_name_override
> > 59b0a7f2c7c1 btrfs: Check name_len before read in iterate_dir_item
> > 488d7c456653 btrfs: Check name_len before reading btrfs_get_name
> > 64c7b01446f4 btrfs: Check name_len before in btrfs_del_root_ref
> > fbc326159a01 btrfs: Verify dir_item in iterate_object_props
> > 
> > The bugs these are fixing probably should also be fixed on the affected
> > stable branches.  Do you agree?  Can you provide any guidance about how
> > far back these fixes would be needed?
> 
> These fixes will soon be replace by centralized tree-checker facilities.

Is that likely to be a small enough change to be reasonably backport-
able?

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] btrfs name length fixes
  2017-10-30  0:19   ` Ben Hutchings
@ 2017-10-30  0:45     ` Qu Wenruo
  2017-10-30  1:46       ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Qu Wenruo @ 2017-10-30  0:45 UTC (permalink / raw)
  To: Ben Hutchings, Su Yue; +Cc: linux-btrfs, stable


[-- Attachment #1.1: Type: text/plain, Size: 2282 bytes --]



On 2017年10月30日 08:19, Ben Hutchings wrote:
> On Mon, 2017-10-30 at 07:59 +0800, Qu Wenruo wrote:
>>
>> On 2017年10月30日 01:15, Ben Hutchings wrote:
>>> You recently made a number of fixes to validation and use of name
>>> lengths in btrfs:
>>>
>>> 286b92f43c0d btrfs: tree-log.c: Wrong printk information about namelen
>>> 19c6dcbfa746 btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond boundary
>>> e79a33270d05 btrfs: Check name_len with boundary in verify dir_item
>>> 26a836cec2ea btrfs: Check name_len on add_inode_ref call path
>>> 8ee8c2d62d5f btrfs: Verify dir_item in replay_xattr_deletes
>>> 3c1d41844896 btrfs: Check name_len in btrfs_check_ref_name_override
>>> 59b0a7f2c7c1 btrfs: Check name_len before read in iterate_dir_item
>>> 488d7c456653 btrfs: Check name_len before reading btrfs_get_name
>>> 64c7b01446f4 btrfs: Check name_len before in btrfs_del_root_ref
>>> fbc326159a01 btrfs: Verify dir_item in iterate_object_props
>>>
>>> The bugs these are fixing probably should also be fixed on the affected
>>> stable branches.  Do you agree?  Can you provide any guidance about how
>>> far back these fixes would be needed?
>>
>> These fixes will soon be replace by centralized tree-checker facilities.
> 
> Is that likely to be a small enough change to be reasonably backport-
> able?

It depends.

Check the thread with the subject "[PATCH v3 0/5] Enhance tree block
validation checker"

----
 fs/btrfs/Makefile       |   2 +-
 fs/btrfs/ctree.h        |   4 +
 fs/btrfs/disk-io.c      | 284 +-------------------------------
 fs/btrfs/tree-checker.c | 429
++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 437 insertions(+), 282 deletions(-)
 create mode 100644 fs/btrfs/tree-checker.c
----

Since it's centralized, most of the modification will be in
tree-checker.c, and make the impact to existing code to minimal.

However that patchset is just the skeleton of the whole thing, name_len
related code is not moved to tree-checker yet.


On the other hand, the whole name_len patchset is just an enhanced
validation checker, I'm not pretty sure if such thing should be back
ported especially when it's just a whack-a-hole solution.

Thanks,
Qu

> 
> Ben.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] btrfs name length fixes
  2017-10-30  0:45     ` Qu Wenruo
@ 2017-10-30  1:46       ` Ben Hutchings
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2017-10-30  1:46 UTC (permalink / raw)
  To: Qu Wenruo, Su Yue; +Cc: linux-btrfs, stable

[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]

On Mon, 2017-10-30 at 08:45 +0800, Qu Wenruo wrote:
> 
> On 2017年10月30日 08:19, Ben Hutchings wrote:
> > On Mon, 2017-10-30 at 07:59 +0800, Qu Wenruo wrote:
[...]
> > > These fixes will soon be replace by centralized tree-checker facilities.
> > 
> > Is that likely to be a small enough change to be reasonably backport-
> > able?
> 
> It depends.
> 
> Check the thread with the subject "[PATCH v3 0/5] Enhance tree block
> validation checker"
> 
> ----
>  fs/btrfs/Makefile       |   2 +-
>  fs/btrfs/ctree.h        |   4 +
>  fs/btrfs/disk-io.c      | 284 +-------------------------------
>  fs/btrfs/tree-checker.c | 429
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 437 insertions(+), 282 deletions(-)
>  create mode 100644 fs/btrfs/tree-checker.c
> ----

That looks like it would be too big for stable.

> Since it's centralized, most of the modification will be in
> tree-checker.c, and make the impact to existing code to minimal.
> 
> However that patchset is just the skeleton of the whole thing, name_len
> related code is not moved to tree-checker yet.
> 
> 
> On the other hand, the whole name_len patchset is just an enhanced
> validation checker, I'm not pretty sure if such thing should be back
> ported especially when it's just a whack-a-hole solution.

I see.  Thanks for the information.

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] btrfs name length fixes
  2017-10-29 23:59 ` Qu Wenruo
  2017-10-30  0:19   ` Ben Hutchings
@ 2017-10-30  1:55   ` Su Yue
  1 sibling, 0 replies; 6+ messages in thread
From: Su Yue @ 2017-10-30  1:55 UTC (permalink / raw)
  To: Qu Wenruo, Ben Hutchings; +Cc: linux-btrfs, stable

Sorry for the late reply.

On 10/30/2017 07:59 AM, Qu Wenruo wrote:
> 
> 
> On 2017年10月30日 01:15, Ben Hutchings wrote:
>> You recently made a number of fixes to validation and use of name
>> lengths in btrfs:
>>
>> 286b92f43c0d btrfs: tree-log.c: Wrong printk information about namelen
>> 19c6dcbfa746 btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond boundary
>> e79a33270d05 btrfs: Check name_len with boundary in verify dir_item
>> 26a836cec2ea btrfs: Check name_len on add_inode_ref call path
>> 8ee8c2d62d5f btrfs: Verify dir_item in replay_xattr_deletes
>> 3c1d41844896 btrfs: Check name_len in btrfs_check_ref_name_override
>> 59b0a7f2c7c1 btrfs: Check name_len before read in iterate_dir_item
>> 488d7c456653 btrfs: Check name_len before reading btrfs_get_name
>> 64c7b01446f4 btrfs: Check name_len before in btrfs_del_root_ref
>> fbc326159a01 btrfs: Verify dir_item in iterate_object_props
>>
>> The bugs these are fixing probably should also be fixed on the affected
>> stable branches.  Do you agree?  Can you provide any guidance about how
>> far back these fixes would be needed?
> 
> These fixes will soon be replace by centralized tree-checker facilities.
> 

As Qu said, tree-checker facilities will verify name_len too and I think
it is indeed more proper than my patchset.

Thanks,
Su

> Thanks,
> Qu
> 
>>
>> Ben.
>>
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-30  1:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-29 17:15 [stable] btrfs name length fixes Ben Hutchings
2017-10-29 23:59 ` Qu Wenruo
2017-10-30  0:19   ` Ben Hutchings
2017-10-30  0:45     ` Qu Wenruo
2017-10-30  1:46       ` Ben Hutchings
2017-10-30  1:55   ` Su Yue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox