04 Jul, 2020

1 commit

  • To allow for restarts 61fbf5933d42 ("net: bpfilter: restart
    bpfilter_umh when error occurred") moved the blob holding the
    userspace binary out of the init sections.

    Now that loading the blob into a filesystem is separate from executing
    the blob the blob no longer needs to live .rodata to allow for restarting.
    So move the blob back to .init.rodata.

    v1: https://lkml.kernel.org/r/87sgeidlvq.fsf_-_@x220.int.ebiederm.org
    v2: https://lkml.kernel.org/r/87ftad4ozc.fsf_-_@x220.int.ebiederm.org
    Link: https://lkml.kernel.org/r/20200702164140.4468-11-ebiederm@xmission.com
    Reviewed-by: Greg Kroah-Hartman
    Acked-by: Alexei Starovoitov
    Tested-by: Alexei Starovoitov
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

17 Jan, 2019

1 commit

  • The section of bpfilter UMH blob is the ".bpfilter_umh". but this is not
    an explicit section. so linking warning occurred at compile time for the
    powerpc.
    So, this patch makes use of the ".rodata" instead of the ".bpfilter_umh".

    Config condition:

    CONFIG_BPFILTER=y
    CONFIG_BPFILTER_UMH=y

    Result:

    ld: warning: orphan section `.bpfilter_umh' from
    `net/bpfilter/bpfilter_umh_blob.o' being placed in section `.bpfilter_umh'

    Fixes: 61fbf5933d42 ("net: bpfilter: restart bpfilter_umh when error occurred")
    Reported-by: Stephen Rothwell
    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     

12 Jan, 2019

1 commit

  • The bpfilter_umh will be stopped via __stop_umh() when the bpfilter
    error occurred.
    The bpfilter_umh() couldn't start again because there is no restart
    routine.

    The section of the bpfilter_umh_{start/end} is no longer .init.rodata
    because these area should be reused in the restart routine. hence
    the section name is changed to .bpfilter_umh.

    The bpfilter_ops->start() is restart callback. it will be called when
    bpfilter_umh is stopped.
    The stop bit means bpfilter_umh is stopped. this bit is set by both
    start and stop routine.

    Before this patch,
    Test commands:
    $ iptables -vnL
    $ kill -9
    $ iptables -vnL
    [ 480.045136] bpfilter: write fail -32
    $ iptables -vnL

    All iptables commands will fail.

    After this patch,
    Test commands:
    $ iptables -vnL
    $ kill -9
    $ iptables -vnL
    $ iptables -vnL

    Now, all iptables commands will work.

    Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
    Signed-off-by: Taehee Yoo
    Signed-off-by: David S. Miller

    Taehee Yoo
     

28 Jun, 2018

1 commit