Thread (1 message) 1 message, 1 author, 2023-01-17

Re: Question: Patch:("net: sched: cbq: dont intepret cls results when asked to drop") may be not bug for branch LTS 5.10

From: shaozhengchao <hidden>
Date: 2023-01-17 01:03:40

+cc netdev@vger.kernel.org yuehaibing

On 2023/1/16 16:27, shaozhengchao wrote:
When I analyzed the following LTS 5.10 patch, I had a small question:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b2c917e510e5ddbc7896329c87d20036c8b82952

As described in this patch, res is obtained through the tcf_classify()
interface. If result is TC_ACT_SHOT, res may be an abnormal value.
Accessing class in res will cause abnormal access.

For LTS version 5.10, if tcf_classify() is to return a positive value,
the classify hook function to the filter must be called, and the hook 
function returns a positive number. Observe the classify function of 
each filter. Generally, res is initialized in four scenarios.
1. res is assigned a value by res in the private member of each filter.
Generally, kzalloc is used to assign initial values to res of various
filters. Therefore, class in res is initialized to 0. Then use the
tcf_bind_filter() interface to assign values to members in res.
Therefore, value of class is assigned. For example, cls_basic.
2. The classify function of the filter directly assigns a value to the
class of res, for example, cls_cgroup.
3. The filter classify function references tp and assigns a value to
res, for example, cls_u32.
4. The change function of the filter references fh and assigns a value
to class in res, for example, cls_rsvp.

This Mainline problem is caused by commit:3aa260559455 (" net/sched:
store the last executed chain also for clsact egress") and
commit:9410c9409d3e ("net: sched: Introduce ingress classification
function"). I don't know if my analysis is correct, please help correct, 
thank you very much.

Zhengchao Shao
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help