You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Zoltan Martonka (Code Review)" <ge...@cloudera.org> on 2026/10/21 14:56:09 UTC

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Zoltan Martonka has uploaded this change for review. ( http://gerrit.cloudera.org:8080/25171


Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................

[tserver] Fix OOB write with wrong key columns.

The newly added WriteWithForgedKeyColumnsDoesNotCrash reliably triggers an ASAN
warning without the fix. We should check the keys in the client schema to
prevent potential OOB write.

Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
---
M src/kudu/common/row_operations-test.cc
M src/kudu/common/row_operations.cc
M src/kudu/tserver/tablet_server-test.cc
3 files changed, 132 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/25171/1
-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 1:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3136/


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Oct 2026 14:56:15 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3144/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 22 Oct 2026 23:28:40 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Zoltan Martonka has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2:

Unrelated tsan failures


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Mon, 26 Oct 2026 09:29:22 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Zoltan Martonka has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Mon, 26 Oct 2026 09:29:05 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Gabriella Lotz (Code Review)" <ge...@cloudera.org>.
Gabriella Lotz has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2: Code-Review+1


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Mon, 26 Oct 2026 13:06:03 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/25171

to look at the new patch set (#2).

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................

[tserver] Fix OOB write with wrong key columns.

The newly added WriteWithForgedKeyColumnsDoesNotCrash reliably triggers an ASAN
warning without the fix. We should check the keys in the client schema to
prevent potential OOB write.

Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
---
M src/kudu/common/row_operations-test.cc
M src/kudu/common/row_operations.cc
M src/kudu/tserver/tablet_server-test.cc
3 files changed, 116 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/25171/2
-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc
File src/kudu/common/row_operations-test.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1202
PS1, Line 1202: namespace {
Is it possible to move all this stuff inside the corresponding TEST_F scenario?  It's not used anywhere else.

Or you are planning to add more test scenarios on top of this?


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1211
PS1, Line 1211:   const auto cols = []() {
              :     return vector<ColumnSchema>{ ColumnSchema("key1", INT32),
              :                                  ColumnSchema("key2", INT32),
              :                                  ColumnSchema("int_val", INT32)};
              :   };
Why to have this as a functor when it's possible to keep the schema as a constant and supply it to Schema() constructor?


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1217
PS1, Line 1217:   out.push_back({"all columns as keys", Schema(cols(), 3), "key columns"});
              : 
              :   out.push_back({"zero key columns", Schema(cols(), 0), "key columns"});
              : 
              :   out.push_back({"keys in different order",
              :       Schema({ ColumnSchema("key2", INT32), ColumnSchema("key1", INT32),
              :                ColumnSchema("int_val", INT32)}, 2),
              :       "does not match the tablet key column"});
              : 
              :   out.push_back({"key column renamed",
              :       Schema({ ColumnSchema("key1_renamed", INT32), ColumnSchema("key2", INT32),
              :                ColumnSchema("int_val", INT32)}, 2),
              :       "not present in tablet"});
Turn this into initializer's list and get rid of 'push_back'?


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations.cc
File src/kudu/common/row_operations.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations.cc@838
PS1, Line 838: if 
Change this to 'if constexpr' since 'mode' is a compile-time parameter?


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/tserver/tablet_server-test.cc@1887
PS1, Line 1887: CHECK_OK
nit: change this to ASSERT_OK, otherwise SCOPED_TRACE() at line 1884 above doesn't make much sense?



-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Oct 2026 17:05:55 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Zoltan Martonka has removed a vote on this change.

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3144/


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 22 Oct 2026 22:28:02 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Zoltan Martonka has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc
File src/kudu/common/row_operations-test.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1202
PS1, Line 1202: }
> Is it possible to move all this stuff inside the corresponding TEST_F scena
Done


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1211
PS1, Line 1211:   for (size_t i = 0; i < columns.size(); i++) {
              :     ASSERT_OK(builder.AddColumn(columns[i], /*is_key=*/ i < kKeyColumnNum));
              :   }
              :   Schema tablet_schema = builder.Build();
              : 
> Why to have this as a functor when it's possible to keep the schema as a co
Done


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations-test.cc@1217
PS1, Line 1217:                                 const Schema& client_schema,
              :                                 const string_view& expected_error) {
              :     SCOPED_TRACE(description);
              : 
              :     KuduPartialRow row(&client_schema);
              :     // Values are irrelevant: the schema-level checks fire before per-op decode.
              :     for (int i = 0; i < client_schema.num_key_columns(); i++) {
              :       ASSERT_OK(row.SetInt32(i, 0));
              :     }
              :     RowOperationsPB pb;
              :     RowOperationsPBEncoder(&pb).Add(RowOperationsPB::DELETE, row);
              : 
              :     arena_.Reset();
> Turn this into initializer's list and get rid of 'push_back'?
Done


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations.cc
File src/kudu/common/row_operations.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/common/row_operations.cc@838
PS1, Line 838: if 
> Change this to 'if constexpr' since 'mode' is a compile-time parameter?
Done


http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

http://gerrit.cloudera.org:8080/#/c/25171/1/src/kudu/tserver/tablet_server-test.cc@1887
PS1, Line 1887: ASSERT_O
> nit: change this to ASSERT_OK, otherwise SCOPED_TRACE() at line 1884 above 
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 22 Oct 2026 22:30:00 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Zoltan Martonka (Code Review)" <ge...@cloudera.org>.
Zoltan Martonka has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................

[tserver] Fix OOB write with wrong key columns.

The newly added WriteWithForgedKeyColumnsDoesNotCrash reliably triggers an ASAN
warning without the fix. We should check the keys in the client schema to
prevent potential OOB write.

Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Reviewed-on: http://gerrit.cloudera.org:8080/25171
Reviewed-by: Alexey Serbin <al...@apache.org>
Tested-by: Zoltan Martonka <zm...@cloudera.com>
Reviewed-by: Gabriella Lotz <lo...@gmail.com>
---
M src/kudu/common/row_operations-test.cc
M src/kudu/common/row_operations.cc
M src/kudu/tserver/tablet_server-test.cc
3 files changed, 116 insertions(+), 0 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Zoltan Martonka: Verified
  Gabriella Lotz: Looks good to me, but someone else must approve

-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 1: Verified+1

Build Successful 

http://jenkins.kudu.apache.org/job/pre_commit/3136/ : SUCCESS


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Oct 2026 15:42:10 +0000
Gerrit-HasComments: No

[kudu-CR] [tserver] Fix OOB write with wrong key columns.

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/25171 )

Change subject: [tserver] Fix OOB write with wrong key columns.
......................................................................


Patch Set 2: Code-Review+2

LGTM!

pre-commit test failures in TSAN seem to be related to known flaky tests.  Please double-check that, and if that's so, override Jenkin's -1 for 'Verified' and this changelist should be ready to go.


-- 
To view, visit http://gerrit.cloudera.org:8080/25171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaaddeae1b1a9541f0046a9d64cf239f82aadb395
Gerrit-Change-Number: 25171
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Fri, 23 Oct 2026 20:48:48 +0000
Gerrit-HasComments: No