Re: [PATCH bpf-next] bpf: Use sha1() instead of sha1_transform() in bpf_prog_calc_tag()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 11, 2025 at 05:57:58PM -0700, Song Liu wrote:
> On Mon, Aug 11, 2025 at 1:17 PM Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> >
> > Now that there's a proper SHA-1 library API, just use that instead of
> > the low-level SHA-1 compression function.  This eliminates the need for
> > bpf_prog_calc_tag() to implement the SHA-1 padding itself.  No
> > functional change; the computed tags remain the same.
> >
> > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> > ---
> >  include/linux/filter.h |  6 -----
> >  kernel/bpf/core.c      | 50 ++++++++----------------------------------
> >  2 files changed, 9 insertions(+), 47 deletions(-)
> 
> Nice clean up!
> 
> It appears this patch changes the sha1 of some programs, but not
> some other programs. For example, sha1 of program
> test_task_kfunc_flavor_relo_not_found from task_kfunc_success.bpf.o
> stays the same before and after the patch, while other programs from
> task_kfunc_success.bpf.o have different sha1 after the patch.
> 
> Is this expected?

I don't see how the behavior could have changed.  The previous code
calculated the SHA-1 value correctly, just in a hard-to-read way.  Is it
possible that those BPF programs changed between your two tests?  Did
you recompile them?

- Eric




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux