[Resource Leak] Missing closing files in samples/bpf/hbm.c

2 messages, 2 authors, 2022-01-05 · open the first message on its own page

[Resource Leak] Missing closing files in samples/bpf/hbm.c

From: Ryan Cai <hidden>
Date: 2021-12-30 03:26:38

Dear Kernel maintainers,

          1. In run_bpf_prog, the file opened at Line 308 may not closed when going to Line 310.
          Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L302-L310

         2. In read_trace_pipe2, the file opened at Line 91 may not closed in the function.
         Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L91-L109

           Should it be a bug? I can send a patch for these.

Best,
Ryan

Re: [Resource Leak] Missing closing files in samples/bpf/hbm.c

From: Andrii Nakryiko <hidden>
Date: 2022-01-05 23:51:27

On Wed, Dec 29, 2021 at 7:26 PM Ryan Cai [off-list ref] wrote:
Dear Kernel maintainers,

          1. In run_bpf_prog, the file opened at Line 308 may not closed when going to Line 310.
          Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L302-L310

         2. In read_trace_pipe2, the file opened at Line 91 may not closed in the function.
         Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L91-L109

           Should it be a bug? I can send a patch for these.
seems so, please send patches
Best,
Ryan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help