Skip to content

Commit

Permalink
Merge pull request #1049 from andyzhangx/CVE-2023-39325-1.22
Browse files Browse the repository at this point in the history
[release-1.22] fix: CVE-2023-39325
  • Loading branch information
andyzhangx authored Oct 15, 2023
2 parents c5d8f58 + e2db027 commit 7b919c9
Show file tree
Hide file tree
Showing 164 changed files with 22,596 additions and 6,632 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ CSI_IMAGE_TAG ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION)
CSI_IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGE_NAME):latest
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS ?= "-X ${PKG}/pkg/blob.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/blob.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/blob.buildDate=${BUILD_DATE} -s -w -extldflags '-static'"
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test"
ifdef ENABLE_BLOBFUSE_PROXY
override E2E_HELM_OPTIONS := $(E2E_HELM_OPTIONS) --set controller.logLevel=6 --set node.logLevel=6 --set node.enableBlobfuseProxy=true
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set controller.logLevel=6 --set node.logLevel=6 --set node.enableBlobfuseProxy=true
else
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test"
endif
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
GO111MODULE = on
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/pborman/uuid v1.2.0
github.com/pelletier/go-toml v1.9.4
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.10.0
golang.org/x/net v0.17.0
google.golang.org/grpc v1.51.0
google.golang.org/protobuf v1.30.0
k8s.io/api v0.27.3
Expand Down Expand Up @@ -126,12 +126,12 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.9.3 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -544,8 +544,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -617,13 +617,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28=
golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -633,8 +633,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
3 changes: 0 additions & 3 deletions hack/verify-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ EXAMPLES=(\
deploy/example/deployment.yaml \
deploy/example/statefulset.yaml \
deploy/example/statefulset-nonroot.yaml \
deploy/example/deployment-nfs.yaml \
deploy/example/statefulset-nfs.yaml \
deploy/example/statefulset-nonroot-nfs.yaml \
)

for EXAMPLE in "${EXAMPLES[@]}"; do
Expand Down
5 changes: 1 addition & 4 deletions pkg/blobfuse-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ import (
csicommon "sigs.k8s.io/blob-csi-driver/pkg/csi-common"
)

func init() {
_ = flag.Set("logtostderr", "true")
}

var (
blobfuseProxyEndpoint = flag.String("blobfuse-proxy-endpoint", "unix://tmp/blobfuse-proxy.sock", "blobfuse-proxy endpoint")
)

func main() {
klog.InitFlags(nil)
_ = flag.Set("logtostderr", "true")
flag.Parse()
proto, addr, err := csicommon.ParseEndpoint(*blobfuseProxyEndpoint)
if err != nil {
Expand Down
5 changes: 1 addition & 4 deletions pkg/blobplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import (
"k8s.io/klog/v2"
)

func init() {
_ = flag.Set("logtostderr", "true")
}

var (
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
blobfuseProxyEndpoint = flag.String("blobfuse-proxy-endpoint", "unix://tmp/blobfuse-proxy.sock", "blobfuse-proxy endpoint")
Expand Down Expand Up @@ -64,6 +60,7 @@ var (

func main() {
klog.InitFlags(nil)
_ = flag.Set("logtostderr", "true")
flag.Parse()
if *version {
info, err := blob.GetVersionYAML(*driverName)
Expand Down
21 changes: 13 additions & 8 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ var blobDriver *blob.Driver
var projectRoot string

type testCmd struct {
command string
args []string
startLog string
endLog string
command string
args []string
startLog string
endLog string
ignoreError bool
}

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -160,10 +161,11 @@ var _ = ginkgo.SynchronizedBeforeSuite(func(ctx ginkgo.SpecContext) []byte {
var _ = ginkgo.SynchronizedAfterSuite(func(ctx ginkgo.SpecContext) {},
func(ctx ginkgo.SpecContext) {
blobLog := testCmd{
command: "bash",
args: []string{"test/utils/blob_log.sh"},
startLog: "==============start blob log(after suite)===================",
endLog: "==============end blob log(after suite)===================",
command: "bash",
args: []string{"test/utils/blob_log.sh"},
startLog: "==============start blob log(after suite)===================",
endLog: "==============end blob log(after suite)===================",
ignoreError: true,
}
e2eTeardown := testCmd{
command: "make",
Expand Down Expand Up @@ -206,6 +208,9 @@ func execTestCmd(cmds []testCmd) {
err := cmdSh.Run()
if err != nil {
log.Printf("Failed to run command: %s %s, Error: %s\n", cmd.command, strings.Join(cmd.args, " "), err.Error())
if !cmd.ignoreError {
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}
}
gomega.Expect(err).NotTo(gomega.HaveOccurred())
log.Println(cmd.endLog)
Expand Down
2 changes: 1 addition & 1 deletion test/external-e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -xe

PROJECT_ROOT=$(git rev-parse --show-toplevel)
DRIVER="test"
DRIVER="blob"

setup_e2e_binaries() {
# download k8s external e2e binary
Expand Down
2 changes: 1 addition & 1 deletion test/external-e2e/testdriver-blobfuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ShortName: blobfuse
StorageClass:
FromFile: /tmp/csi/storageclass.yaml
DriverInfo:
Name: test.csi.azure.com
Name: blob.csi.azure.com
Capabilities:
persistence: true
exec: true
Expand Down
2 changes: 1 addition & 1 deletion test/external-e2e/testdriver-nfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ShortName: blobfuse
StorageClass:
FromFile: /tmp/csi/storageclass.yaml
DriverInfo:
Name: test.csi.azure.com
Name: blob.csi.azure.com
Capabilities:
persistence: true
exec: true
Expand Down
17 changes: 11 additions & 6 deletions test/utils/blob_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
# set -e

NS=kube-system
CONTAINER=blob
Expand Down Expand Up @@ -49,11 +49,6 @@ kubectl get pods -n${NS} -l${LABEL} \
| awk 'NR>1 {print $1}' \
| xargs -I {} kubectl logs {} --prefix -c${CONTAINER} -n${NS}

echo "print out cloudprovider_azure metrics ..."
echo "======================================================================================"
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
curl http://$ip:29634/metrics

if [ -n "$ENABLE_BLOBFUSE_PROXY" ]; then
echo "print out install-blobfuse-proxy logs ..."
echo "======================================================================================"
Expand All @@ -64,4 +59,14 @@ if [ -n "$ENABLE_BLOBFUSE_PROXY" ]; then
| xargs -I {} kubectl logs {} --prefix -c${PROXY} -n${NS}
fi

echo "======================================================================================"
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
if echo "$ip" | grep -q "\."; then
echo "print out cloudprovider_azure metrics ..."
curl http://$ip:29634/metrics
else
echo "csi-$DRIVER-controller service ip is empty"
kubectl get svc csi-$DRIVER-controller -n kube-system
fi


4 changes: 2 additions & 2 deletions vendor/golang.org/x/crypto/chacha20/chacha_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/golang.org/x/crypto/chacha20/chacha_arm64.s

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/golang.org/x/crypto/chacha20/chacha_noasm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/golang.org/x/crypto/cryptobyte/builder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vendor/golang.org/x/crypto/cryptobyte/string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 0 additions & 71 deletions vendor/golang.org/x/crypto/ed25519/ed25519.go

This file was deleted.

Loading

0 comments on commit 7b919c9

Please sign in to comment.