Skip to content

Commit 8ea6e34

Browse files
Li RongQingdavem330
authored andcommitted
net: filter: fix the comments
1. sk_run_filter has been renamed, sk_filter() is using SK_RUN_FILTER. 2. Remove wrong comments about storing intermediate value. 3. replace sk_run_filter with __bpf_prog_run for check_load_and_stores's comments Cc: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1a9525f commit 8ea6e34

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎net/core/filter.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
* @skb: buffer to filter
5252
*
5353
* Run the filter code and then cut skb->data to correct size returned by
54-
* sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
54+
* SK_RUN_FILTER. If pkt_len is 0 we toss packet. If skb->len is smaller
5555
* than pkt_len we keep whole skb->data. This is the socket level
56-
* wrapper to sk_run_filter. It returns 0 if the packet should
56+
* wrapper to SK_RUN_FILTER. It returns 0 if the packet should
5757
* be accepted or -EPERM if the packet should be tossed.
5858
*
5959
*/
@@ -565,12 +565,9 @@ int bpf_convert_filter(struct sock_filter *prog, int len,
565565
}
566566

567567
/* Security:
568-
*
569-
* A BPF program is able to use 16 cells of memory to store intermediate
570-
* values (check u32 mem[BPF_MEMWORDS] in sk_run_filter()).
571568
*
572569
* As we dont want to clear mem[] array for each packet going through
573-
* sk_run_filter(), we check that filter loaded by user never try to read
570+
* __bpf_prog_run(), we check that filter loaded by user never try to read
574571
* a cell if not previously written, and we check all branches to be sure
575572
* a malicious user doesn't try to abuse us.
576573
*/

0 commit comments

Comments
 (0)